CMS 3D CMS Logo

GflashNameSpace.cc
Go to the documentation of this file.
2 
3 namespace Gflash {
4 
5  // beginning of the Gflash name space
6 
8  // return the calorimeter number of sensitive detectors (coarse)
9 
11  double eta = position.getEta();
12 
13  // central
14  if (std::fabs(eta) < EtaMax[kESPM]) {
15  double rho = position.getRho();
16  double rhoBack = rhoBackEB(position);
17  if (rho > Gflash::Rmin[kESPM] && rho < rhoBack) {
18  index = kESPM;
19  } else if (rho > Rmin[kHB] && rho < Rmax[kHB]) {
20  index = kHB;
21  }
22  }
23  // forward
24  else if (std::fabs(eta) < EtaMax[kENCA]) {
25  double z = std::fabs(position.getZ());
26  double zBack = zBackEE(position);
27  if (z > Gflash::Zmin[kENCA] && z < zBack) {
28  index = kENCA;
29  } else if (z > Zmin[kHE] && z < Zmax[kHE]) {
30  index = kHE;
31  }
32  // HF is not in the standard Gflash implementation yet
33  // if( z > Zmin[kHF] && z < Zmax[kHF] ) {
34  // index = kHF;
35  // }
36  }
37 
38  return index;
39  }
40 
42  // type of hadron showers subject to the shower starting point (ssp)
43  // showerType = -1 : default (invalid)
44  // showerType = 0 : ssp before EBRY (barrel crystal)
45  // showerType = 1 : ssp inside EBRY
46  // showerType = 2 : ssp after EBRY before HB
47  // showerType = 3 : ssp inside HB
48  // showerType = 4 : ssp before EFRY (endcap crystal)
49  // showerType = 5 : ssp inside EFRY
50  // showerType = 6 : ssp after EFRY before HE
51  // showerType = 7 : ssp inside HE
52 
53  int showerType = -1;
54 
55  // central
56  double eta = position.getEta();
57  if (std::fabs(eta) < EtaMax[kESPM]) {
58  double rho = position.getRho();
59  double rhoBack = rhoBackEB(position);
60  if (rho < Gflash::RFrontCrystalEB)
61  showerType = 0;
62  else if (rho < rhoBack)
63  showerType = 1;
64  else if (rho < Rmin[kHB])
65  showerType = 2;
66  else
67  showerType = 3;
68  }
69  // forward
70  else if (std::fabs(eta) < EtaMax[Gflash::kENCA]) {
71  double z = std::fabs(position.getZ());
72  double zBack = zBackEE(position);
74  showerType = 4;
75  else if (z < zBack)
76  showerType = 5;
77  else if (z < Zmin[kHE])
78  showerType = 6;
79  else
80  showerType = 7;
81  }
82 
83  return showerType;
84  }
85 
86  double rhoBackEB(const Gflash3Vector &position) {
87  // return (Gflash::RFrontCrystalEB +
88  // Gflash::LengthCrystalEB*std::sin(position.getTheta()));
90  }
91 
92  double zBackEE(const Gflash3Vector &position) {
93  // return (Gflash::ZFrontCrystalEE +
94  // Gflash::LengthCrystalEE*std::fabs(std::cos(position.getTheta())));
96  }
97 
98  // end of the Gflash name space
99 } // namespace Gflash
const double ZFrontCrystalEE
const double Zmax[kNumberCalorimeter]
double zBackEE(const Gflash3Vector &position)
const double EtaMax[kNumberCalorimeter]
CalorimeterNumber getCalorimeterNumber(const Gflash3Vector &position)
const double LengthCrystalEE
const double LengthCrystalEB
double rhoBackEB(const Gflash3Vector &position)
int findShowerType(const Gflash3Vector &position)
const double RFrontCrystalEB
const double Zmin[kNumberCalorimeter]
CLHEP::Hep3Vector Gflash3Vector
Definition: Gflash3Vector.h:6
static int position[264][3]
Definition: ReadPGInfo.cc:289
const double Rmax[kNumberCalorimeter]
const double Rmin[kNumberCalorimeter]