11 #include "CLHEP/Units/GlobalPhysicalConstants.h" 12 #include "CLHEP/Units/GlobalSystemOfUnits.h" 18 hcalConstants(hcons) {
20 edm::LogInfo(
"HCalGeom") <<
"Creating HcalNumberingFromDDD\n";
26 edm::LogInfo(
"HCalGeom") <<
"Deleting HcalNumberingFromDDD\n";
31 const CLHEP::Hep3Vector&
point,
36 double hx = point.x();
37 double hy = point.y();
38 double hz = point.z();
39 double hR =
sqrt(hx*hx+hy*hy+hz*hz);
41 double hsintheta =
sin(htheta);
42 double hphi = (hR*hsintheta == 0. ? 0. :atan2(hy,hx));
43 double heta = (fabs(hsintheta) == 1.? 0. : -
log(fabs(
tan(htheta/2.))) );
51 hR =
sqrt(hx*hx+hy*hy);
52 etaR = (heta >= 0. ? hR : -hR);
64 std::cout <<
"HcalNumberingFromDDD: point = " << point
65 <<
" det " << det <<
":" << hsubdet <<
" eta/R " 66 << etaR <<
" phi " << hphi <<
" depth " << depth
67 <<
" layer " << lay << std::endl;
69 return unitID(hsubdet,etaR,hphi,depth,lay);
76 return unitID(detEta.first,detEta.second,fi,depth,lay);
86 double hetaR = fabs(etaR);
90 int nphi =
int((CLHEP::twopi+0.1*ficons.second)/ficons.second);
91 int zside = etaR>0 ? 1: 0;
92 double hphi = phi+ficons.first;
93 if (hphi < 0) hphi += CLHEP::twopi;
94 int iphi =
int(hphi/ficons.second) + 1;
95 if (iphi > nphi) iphi = 1;
98 std::cout <<
"HcalNumberingFromDDD: etaR = " << etaR <<
" : " 99 << zside <<
"/" << ieta <<
" phi " << hphi <<
" : " 100 << iphi << std::endl;
102 return unitID(det,zside,depth,ieta,iphi,lay);
111 if (det == static_cast<int>(
HcalBarrel) && lay > 17)
120 std::cout <<
"HcalNumberingFromDDD: phi units= " << units
121 <<
" iphi_skip= " << iphi_skip << std::endl;
126 std::cout <<
"HcalNumberingFromDDD: det = " << det <<
" " 128 <<
" depth = " << tmp.
depth <<
" eta/R = " 129 << tmp.
etaR <<
" phi = " << tmp.
phi <<
" layer = " 130 << tmp.
lay << std::endl;
std::pair< int, int > getEtaDepth(const int det, int etaR, int phi, int zside, int depth, int lay)
std::pair< double, double > getPhiCons(const int det, const int ieta) const
Sin< T >::type sin(const T &t)
double getEtaHO(double &etaR, double &x, double &y, double &z) const
std::pair< int, double > getDetEta(const double eta, const int depth)
HcalDDDSimConstants * hcalConstants
Tan< T >::type tan(const T &t)
int getEta(const int det, const int lay, const double hetaR)
std::vector< std::vector< double > > tmp
int phiNumber(const int phi, const int unit) const
TString units(TString variable, Char_t axis)
int unitPhi(const int det, const int etaR) 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)