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