11 #include "CLHEP/Units/GlobalPhysicalConstants.h"
12 #include "CLHEP/Units/GlobalSystemOfUnits.h"
18 hcalConstants(hcons) {
19 edm::LogInfo(
"HCalGeom") <<
"Creating HcalNumberingFromDDD";
23 edm::LogInfo(
"HCalGeom") <<
"Deleting HcalNumberingFromDDD";
27 const CLHEP::Hep3Vector&
point,
32 double hx = point.x();
33 double hy = point.y();
34 double hz = point.z();
35 double hR =
sqrt(hx*hx+hy*hy+hz*hz);
37 double hsintheta =
sin(htheta);
38 double hphi = (hR*hsintheta == 0. ? 0. :atan2(hy,hx));
39 double heta = (fabs(hsintheta) == 1.? 0. : -
log(fabs(
tan(htheta/2.))) );
47 hR =
sqrt(hx*hx+hy*hy);
48 etaR = (heta >= 0. ? hR : -hR);
60 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: point = " << point <<
" det "
61 << det <<
":" << hsubdet <<
" eta/R " << etaR <<
" phi "
64 return unitID(hsubdet,etaR,hphi,depth,lay);
71 return unitID(detEta.first,detEta.second,fi,depth,lay);
81 double hetaR = fabs(etaR);
85 int nphi = int((CLHEP::twopi+0.1*ficons.second)/ficons.second);
86 int zside = etaR>0 ? 1: 0;
87 double hphi = phi+ficons.first;
88 if (hphi < 0) hphi += CLHEP::twopi;
89 int iphi = int(hphi/ficons.second) + 1;
90 if (iphi > nphi) iphi = 1;
93 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: etaR = " << etaR <<
" : "
94 << zside <<
"/" << ieta <<
" phi " << hphi <<
" : "
97 return unitID(det,zside,depth,ieta,iphi,lay);
107 if (det == static_cast<int>(
HcalBarrel) && etaDepth.second == 4) {
115 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: phi units= " << units
116 <<
" iphi_skip= " << iphi_skip;
121 LogDebug(
"HCalGeom") <<
"HcalNumberingFromDDD: det = " << det <<
" "
122 << tmp.
subdet <<
" zside = " << tmp.
zside <<
" depth = "
123 << tmp.
depth <<
" eta/R = " << tmp.
etaR <<
" phi = "
124 << tmp.
phi <<
" layer = " << tmp.
lay;
std::pair< int, int > getEtaDepth(int det, int etaR, int phi, int depth, int lay)
int unitPhi(int det, int etaR) const
int getEta(int det, int lay, double hetaR)
Sin< T >::type sin(const T &t)
double getEtaHO(double &etaR, double &x, double &y, double &z) const
HcalDDDSimConstants * hcalConstants
Tan< T >::type tan(const T &t)
std::pair< int, double > getDetEta(double eta, int depth)
std::pair< double, double > getPhiCons(int det, int ieta)
Geom::Phi< T > phi() const
std::vector< std::vector< double > > tmp
TString units(TString variable, Char_t axis)
int phiNumber(int phi, int unit) const
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
HcalNumberingFromDDD(HcalDDDSimConstants *hcons)