15 using namespace geant_units;
16 using namespace geant_units::operators;
20 edm::LogInfo(
"HCalGeom") <<
"Creating HcalNumberingFromDDD\n";
26 edm::LogInfo(
"HCalGeom") <<
"Deleting HcalNumberingFromDDD\n";
34 double hx = point.x();
35 double hy = point.y();
36 double hz = point.z();
37 double hR =
sqrt(hx * hx + hy * hy + hz * hz);
38 double htheta = (hR == 0. ? 0. : acos(
std::max(
std::min(hz / hR, 1.0), -1.0)));
39 double hsintheta =
sin(htheta);
40 double hphi = (hR * hsintheta == 0. ? 0. : atan2(hy, hx));
41 double heta = (fabs(hsintheta) == 1. ? 0. : -
log(fabs(
tan(htheta / 2.))));
49 hR =
sqrt(hx * hx + hy * hy);
50 etaR = (heta >= 0. ? hR : -hR);
62 edm::LogVerbatim(
"HCalGeom") <<
"HcalNumberingFromDDD: point = " << point <<
" det " << det <<
":" << hsubdet
63 <<
" eta/R " << etaR <<
" phi " << hphi <<
" depth " << depth <<
" layer " << lay;
65 return unitID(hsubdet, etaR, hphi, depth, lay);
70 return unitID(detEta.first, detEta.second, fi, depth, lay);
74 double hetaR = fabs(etaR);
78 int nphi = int((2._pi + 0.1 * ficons.second) / ficons.second);
79 int zside = etaR > 0 ? 1 : 0;
80 double hphi = phi + ficons.first;
83 int iphi = int(hphi / ficons.second) + 1;
88 edm::LogVerbatim(
"HCalGeom") <<
"HcalNumberingFromDDD: etaR = " << etaR <<
" : " << zside <<
"/" << ieta <<
" phi "
89 << hphi <<
" : " << iphi << std::endl;
91 return unitID(det, zside, depth, ieta, iphi, lay);
95 int det,
int zside,
int depth,
int etaR,
int phi,
int lay)
const {
96 if (det == static_cast<int>(
HcalBarrel) && lay > 17)
105 edm::LogVerbatim(
"HCalGeom") <<
"HcalNumberingFromDDD: phi units= " << units <<
" iphi_skip= " << iphi_skip;
111 <<
" depth = " << tmp.
depth <<
" eta/R = " << tmp.
etaR <<
" phi = " << tmp.
phi
112 <<
" layer = " << tmp.
lay;
Log< level::Info, true > LogVerbatim
static std::vector< std::string > checklist log
Sin< T >::type sin(const T &t)
std::pair< int, double > getDetEta(const double &eta, const int &depth) const
int phiNumber(const int &phi, const int &unit) const
HcalNumberingFromDDD(const HcalDDDSimConstants *hcons)
double getEtaHO(const double &etaR, const double &x, const double &y, const double &z) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
int unitPhi(const int &det, const int &etaR) const
Tan< T >::type tan(const T &t)
HcalID unitID(int det, const math::XYZVectorD &pos, int depth, int lay=-1) const
Log< level::Info, false > LogInfo
const HcalDDDSimConstants * hcalConstants
int getEta(const int &det, const int &lay, const double &hetaR) const
TString units(TString variable, Char_t axis)
std::pair< int, int > getEtaDepth(const int &det, int etaR, const int &phi, const int &zside, int depth, const int &lay) 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