19 #include <CLHEP/Units/SystemOfUnits.h> 44 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
45 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
46 float hx = hitPoint.x();
47 float hy = hitPoint.y();
52 if ((hr > 3. *
m) && (hr < 3.830 *
m))
59 float hz = hitPoint.z();
60 float hR = hitPoint.mag();
61 float htheta = (hR == 0. ? 0. : acos(
std::max(
std::min(hz / hR,
float(1.)),
float(-1.))));
62 float hsintheta =
sin(htheta);
63 float hphi = (hR * hsintheta == 0. ? 0. : acos(
std::max(
std::min(hx / (hR * hsintheta),
float(1.)),
float(-1.))));
64 float heta = (std::fabs(hsintheta) == 1. ? 0. : -
std::log(std::fabs(
tan(htheta / 2.))));
65 int eta =
int(heta / 0.087);
66 int phi =
int(hphi / (5. * degree));
68 G4VPhysicalVolume* thePV = preStepPoint->GetPhysicalVolume();
69 int ilayer = ((thePV->GetCopyNo()) / 10) % 100;
71 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: Layer " << thePV->GetName()
72 <<
" found at phi = " <<
phi <<
" eta = " <<
eta <<
" lay = " << thePV->GetCopyNo()
85 if ((layerID != 17) && (layerID != 18))
89 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID <<
" layer = " << layerID;
101 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID <<
" phi = " << phiID;
117 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)