Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:35

0001 #include "SimGeneral/GFlash/interface/GflashNameSpace.h"
0002 
0003 namespace Gflash {
0004 
0005   // beginning of the Gflash name space
0006 
0007   CalorimeterNumber getCalorimeterNumber(const Gflash3Vector &position) {
0008     // return the calorimeter number of sensitive detectors (coarse)
0009 
0010     CalorimeterNumber index = kNULL;
0011     double eta = position.getEta();
0012 
0013     // central
0014     if (std::fabs(eta) < EtaMax[kESPM]) {
0015       double rho = position.getRho();
0016       double rhoBack = rhoBackEB(position);
0017       if (rho > Gflash::Rmin[kESPM] && rho < rhoBack) {
0018         index = kESPM;
0019       } else if (rho > Rmin[kHB] && rho < Rmax[kHB]) {
0020         index = kHB;
0021       }
0022     }
0023     // forward
0024     else if (std::fabs(eta) < EtaMax[kENCA]) {
0025       double z = std::fabs(position.getZ());
0026       double zBack = zBackEE(position);
0027       if (z > Gflash::Zmin[kENCA] && z < zBack) {
0028         index = kENCA;
0029       } else if (z > Zmin[kHE] && z < Zmax[kHE]) {
0030         index = kHE;
0031       }
0032       // HF is not in the standard Gflash implementation yet
0033       //      if( z > Zmin[kHF] && z < Zmax[kHF] ) {
0034       //    index = kHF;
0035       //      }
0036     }
0037 
0038     return index;
0039   }
0040 
0041   int findShowerType(const Gflash3Vector &position) {
0042     // type of hadron showers subject to the shower starting point (ssp)
0043     // showerType = -1 : default (invalid)
0044     // showerType =  0 : ssp before EBRY (barrel crystal)
0045     // showerType =  1 : ssp inside EBRY
0046     // showerType =  2 : ssp after  EBRY before HB
0047     // showerType =  3 : ssp inside HB
0048     // showerType =  4 : ssp before EFRY (endcap crystal)
0049     // showerType =  5 : ssp inside EFRY
0050     // showerType =  6 : ssp after  EFRY before HE
0051     // showerType =  7 : ssp inside HE
0052 
0053     int showerType = -1;
0054 
0055     // central
0056     double eta = position.getEta();
0057     if (std::fabs(eta) < EtaMax[kESPM]) {
0058       double rho = position.getRho();
0059       double rhoBack = rhoBackEB(position);
0060       if (rho < Gflash::RFrontCrystalEB)
0061         showerType = 0;
0062       else if (rho < rhoBack)
0063         showerType = 1;
0064       else if (rho < Rmin[kHB])
0065         showerType = 2;
0066       else
0067         showerType = 3;
0068     }
0069     // forward
0070     else if (std::fabs(eta) < EtaMax[Gflash::kENCA]) {
0071       double z = std::fabs(position.getZ());
0072       double zBack = zBackEE(position);
0073       if (z < Gflash::ZFrontCrystalEE)
0074         showerType = 4;
0075       else if (z < zBack)
0076         showerType = 5;
0077       else if (z < Zmin[kHE])
0078         showerType = 6;
0079       else
0080         showerType = 7;
0081     }
0082 
0083     return showerType;
0084   }
0085 
0086   double rhoBackEB(const Gflash3Vector &position) {
0087     // return (Gflash::RFrontCrystalEB +
0088     // Gflash::LengthCrystalEB*std::sin(position.getTheta()));
0089     return (Gflash::RFrontCrystalEB + Gflash::LengthCrystalEB);
0090   }
0091 
0092   double zBackEE(const Gflash3Vector &position) {
0093     // return (Gflash::ZFrontCrystalEE +
0094     // Gflash::LengthCrystalEE*std::fabs(std::cos(position.getTheta())));
0095     return (Gflash::ZFrontCrystalEE + Gflash::LengthCrystalEE);
0096   }
0097 
0098   // end of the Gflash name space
0099 }  // namespace Gflash