File indexing completed on 2024-04-06 12:30:35
0001 #include "SimGeneral/GFlash/interface/GflashNameSpace.h"
0002
0003 namespace Gflash {
0004
0005
0006
0007 CalorimeterNumber getCalorimeterNumber(const Gflash3Vector &position) {
0008
0009
0010 CalorimeterNumber index = kNULL;
0011 double eta = position.getEta();
0012
0013
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
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
0033
0034
0035
0036 }
0037
0038 return index;
0039 }
0040
0041 int findShowerType(const Gflash3Vector &position) {
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 int showerType = -1;
0054
0055
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
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
0088
0089 return (Gflash::RFrontCrystalEB + Gflash::LengthCrystalEB);
0090 }
0091
0092 double zBackEE(const Gflash3Vector &position) {
0093
0094
0095 return (Gflash::ZFrontCrystalEE + Gflash::LengthCrystalEE);
0096 }
0097
0098
0099 }