19 #include "G4SystemOfUnits.hh" 29 edm::LogInfo(
"HcalTBSim") <<
"Creating HcalTB02HcalNumberingScheme";
33 edm::LogInfo(
"HcalTBSim") <<
"Deleting HcalTB02HcalNumberingScheme";
44 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
45 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
46 float hx = hitPoint.x();
47 float hy = hitPoint.y();
48 float hz = hitPoint.z();
53 if ( (hr > 3.*
m) && (hr < 3.830*
m) )
return scintID=17;
54 if (hr > 3.830*
m)
return scintID=18;
58 float hR = hitPoint.mag();
59 float htheta = (hR == 0. ? 0. : acos(
max(
min(hz/hR,
float(1.)),
float(-1.))));
60 float hsintheta =
sin(htheta);
61 float hphi = (hR*hsintheta == 0. ? 0. :acos(
max(
min(hx/(hR*hsintheta),
float(1.)),
float(-1.)) ) );
62 float heta = ( fabs(hsintheta) == 1.? 0. : -
log(fabs(
tan(htheta/2.))) );
64 int phi =
int(hphi/(5.*degree));
66 G4VPhysicalVolume* thePV = preStepPoint->GetPhysicalVolume();
67 int ilayer = ((thePV->GetCopyNo())/10)%100;
68 LogDebug(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: Layer " 69 << thePV->GetName() <<
" found at phi = " << phi
70 <<
" eta = " << eta <<
" lay = " << thePV->GetCopyNo()
74 if (hy<0.) scintID = -scintID;
83 if ( (layerID != 17) && (layerID != 18) )
86 LogDebug(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID
87 <<
" layer = " << layerID;
94 if (sID<0) IDsign = -1;
97 LogDebug(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID
98 <<
" phi = " << phiID;
102 phiID =
abs(phiID-3);
113 LogDebug(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID
114 <<
" 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)