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;
Sin< T >::type sin(const T &t)
int phiNumber(const int &phi, const int &unit) const
double getEtaHO(const double &etaR, const double &x, const double &y, const double &z) const
HcalDDDSimConstants * hcalConstants
int unitPhi(const int &det, const int &etaR) const
Tan< T >::type tan(const T &t)
std::pair< int, int > getEtaDepth(const int &det, int etaR, const int &phi, const int &zside, int depth, const int &lay)
std::pair< int, double > getDetEta(const double &eta, const int &depth)
std::vector< std::vector< double > > tmp
TString units(TString variable, Char_t axis)
int getEta(const int &det, const int &lay, const double &hetaR)
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
std::pair< double, double > getPhiCons(const int &det, const int &ieta) 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)