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