CMS 3D CMS Logo

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