28 edm::LogInfo(
"HcalTBSim") <<
"Creating HcalTB02HcalNumberingScheme";
32 edm::LogInfo(
"HcalTBSim") <<
"Deleting HcalTB02HcalNumberingScheme";
43 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
44 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) )
return scintID=17;
53 if (hr > 3.830*
m)
return scintID=18;
57 float hR = hitPoint.mag();
58 float htheta = (hR == 0. ? 0. : acos(
max(
min(hz/hR,
float(1.)),
float(-1.))));
59 float hsintheta =
sin(htheta);
60 float hphi = (hR*hsintheta == 0. ? 0. :acos(
max(
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 LogDebug(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: Layer "
68 << thePV->GetName() <<
" found at phi = " << phi
69 <<
" eta = " << eta <<
" lay = " << thePV->GetCopyNo()
73 if (hy<0.) scintID = -scintID;
82 if ( (layerID != 17) && (layerID != 18) )
85 LogDebug(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID
86 <<
" layer = " << layerID;
93 if (sID<0) IDsign = -1;
95 int phiID = int(
float(sID)/
float(
phiScale));
96 LogDebug(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID
97 <<
" phi = " << phiID;
101 phiID =
abs(phiID-3);
110 int etaID = int(
float(aux)/
float(
etaScale));
112 LogDebug(
"HcalTBSim") <<
"HcalTB02HcalNumberingScheme:: scintID " << sID
113 <<
" eta = " << etaID;
Sin< T >::type sin(const T &t)
virtual int getUnitID(const G4Step *aStep) const
int getphiID(int sID) const
HcalTB02HcalNumberingScheme()
virtual ~HcalTB02HcalNumberingScheme()
const T & max(const T &a, const T &b)
int getlayerID(int sID) const
Tan< T >::type tan(const T &t)
int getetaID(int sID) const
Power< A, B >::type pow(const A &a, const B &b)