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
Gflash::zBackEE
double zBackEE(const Gflash3Vector &position)
Definition: GflashNameSpace.cc:92
Gflash::LengthCrystalEE
const double LengthCrystalEE
Definition: GflashNameSpace.h:41
Gflash::ZFrontCrystalEE
const double ZFrontCrystalEE
Definition: GflashNameSpace.h:37
GflashNameSpace.h
Gflash::Rmax
const double Rmax[kNumberCalorimeter]
Definition: GflashNameSpace.h:31
Gflash::EtaMax
const double EtaMax[kNumberCalorimeter]
Definition: GflashNameSpace.h:34
Gflash::findShowerType
int findShowerType(const Gflash3Vector &position)
Definition: GflashNameSpace.cc:41
Gflash::rhoBackEB
double rhoBackEB(const Gflash3Vector &position)
Definition: GflashNameSpace.cc:86
Gflash::kHB
Definition: GflashNameSpace.h:13
Gflash::kHE
Definition: GflashNameSpace.h:15
Gflash::kENCA
Definition: GflashNameSpace.h:14
Gflash::kNULL
Definition: GflashNameSpace.h:11
Gflash::Zmax
const double Zmax[kNumberCalorimeter]
Definition: GflashNameSpace.h:29
PVValHelper::eta
Definition: PVValidationHelpers.h:69
Gflash::getCalorimeterNumber
CalorimeterNumber getCalorimeterNumber(const Gflash3Vector &position)
Definition: GflashNameSpace.cc:7
Gflash::LengthCrystalEB
const double LengthCrystalEB
Definition: GflashNameSpace.h:40
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
Gflash::CalorimeterNumber
CalorimeterNumber
Definition: GflashNameSpace.h:10
Gflash::Zmin
const double Zmin[kNumberCalorimeter]
Definition: GflashNameSpace.h:28
Gflash3Vector
CLHEP::Hep3Vector Gflash3Vector
Definition: Gflash3Vector.h:6
Gflash::RFrontCrystalEB
const double RFrontCrystalEB
Definition: GflashNameSpace.h:36
Gflash
Definition: GflashNameSpace.h:6
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
Gflash::Rmin
const double Rmin[kNumberCalorimeter]
Definition: GflashNameSpace.h:30
Gflash::kESPM
Definition: GflashNameSpace.h:12