19 #include "G4SystemOfUnits.hh" 41 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
42 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
43 float hx = hitPoint.x();
44 float hy = hitPoint.y();
45 float hz = hitPoint.z();
50 if ((hr > 3. *
m) && (hr < 3.830 *
m))
57 float hR = hitPoint.mag();
58 float htheta = (hR == 0. ? 0. : acos(
std::max(
std::min(hz / hR,
float(1.)),
float(-1.))));
59 float hsintheta =
sin(htheta);
60 float hphi = (hR * hsintheta == 0. ? 0. : acos(
std::max(
std::min(hx / (hR * hsintheta),
float(1.)),
float(-1.))));
61 float heta = (fabs(hsintheta) == 1. ? 0. : -
log(fabs(
tan(htheta / 2.))));
62 int eta =
int(heta / 0.087);
63 int phi =
int(hphi / (5. * degree));
65 G4VPhysicalVolume* thePV = preStepPoint->GetPhysicalVolume();
66 int ilayer = ((thePV->GetCopyNo()) / 10) % 100;
67 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: Layer " << thePV->GetName() <<
" found at phi = " 68 << phi <<
" eta = " << eta <<
" lay = " << thePV->GetCopyNo() <<
" " << ilayer;
80 if ((layerID != 17) && (layerID != 18))
83 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID <<
" layer = " << layerID;
93 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID <<
" phi = " << phiID;
97 phiID =
abs(phiID - 3);
107 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID <<
" eta = " << etaID;
Sin< T >::type sin(const T &t)
int getphiID(int sID) const
HcalTB02HcalNumberingScheme()
int getlayerID(int sID) const
~HcalTB02HcalNumberingScheme() override
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
int getUnitID(const G4Step *aStep) const override
int getetaID(int sID) const
Power< A, B >::type pow(const A &a, const B &b)