11 using namespace geant_units::operators;
14 etaTable_ = conf.
getParameter<std::vector<double> >(
"EtaTable");
15 phibin_ = conf.
getParameter<std::vector<double> >(
"PhiBin");
16 phioff_ = conf.
getParameter<std::vector<double> >(
"PhiOffset");
20 depthHBHE_ = conf.
getParameter<std::vector<int> >(
"DepthHBHE");
24 const double deg =
M_PI / 180.0;
25 for (
auto& phi : phibin_)
27 for (
auto& phi : phioff_)
30 edm::LogVerbatim(
"HcalSim") <<
"HcalNumberingFromPS:: EtaTable with " << etaTable_.size() <<
" elements";
31 for (
unsigned k = 0;
k < etaTable_.size(); ++
k)
33 edm::LogVerbatim(
"HcalSim") <<
"HcalNumberingFromPS:: PhiBin with " << phibin_.size() <<
" elements";
34 for (
unsigned k = 0;
k < phibin_.size(); ++
k)
36 edm::LogVerbatim(
"HcalSim") <<
"HcalNumberingFromPS:: PhiOff with " << phioff_.size() <<
" elements";
37 for (
unsigned k = 0;
k < phioff_.size(); ++
k)
39 edm::LogVerbatim(
"HcalSim") <<
"HcalNumberingFromPS:: EtaMin/EtaMax with " << etaMin_.size() <<
":" << etaMax_.size()
41 for (
unsigned k = 0;
k < etaMin_.size(); ++
k)
42 edm::LogVerbatim(
"HcalSim") <<
"EtaMin[" <<
k <<
"] = " << etaMin_[
k] <<
" EtaMax[" <<
k <<
"] = " << etaMax_[
k];
43 edm::LogVerbatim(
"HcalSim") <<
"HcalNumberingFromPS:: EtaHBHE " << etaHBHE_ <<
" DepthHBHE " << depthHBHE_[0] <<
":"
44 << depthHBHE_[1] <<
" RMinHO " << rMinHO_ <<
" zHO with " << zHO_.size() <<
" elements";
45 for (
unsigned k = 0;
k < zHO_.size(); ++
k)
49 segmentation_.resize(nEtas_);
52 snprintf(name, 10,
"Eta%d",
ring + 1);
61 for (
unsigned int k = 0;
k < segmentation_[
ring].size(); ++
k)
73 std::pair<int, int> iphi =
getPhi(deteta.first, deteta.second, pos.Phi());
75 int zside = ((pos.z() > 0) ? 1 : 0);
76 if (deteta.first == static_cast<int>(
HcalBarrel)) {
77 newDepth = segmentation_[deteta.second - 1][layer - 1];
78 if ((deteta.second == etaHBHE_) && (newDepth > depthHBHE_[0]))
79 newDepth = depthHBHE_[0];
80 }
else if (deteta.first == static_cast<int>(
HcalEndcap)) {
81 newDepth = segmentation_[deteta.second - 1][layer - 1];
82 if ((deteta.second == etaHBHE_) && (newDepth < depthHBHE_[1]))
83 newDepth = depthHBHE_[1];
84 if ((deteta.second ==
etaMax_[1]) && (newDepth > depth29Mx_))
86 }
else if (deteta.first == static_cast<int>(
HcalOuter)) {
90 edm::LogVerbatim(
"HcalSim") <<
"HcalNumberingFromPS:: det " << det <<
":" << subdet <<
":" << deteta.first
91 <<
"\t Eta " << pos.Eta() <<
":" << deteta.second <<
"\t Phi " << pos.Phi() <<
":"
92 << iphi.first <<
":" << iphi.second <<
"\t Layer|Depth " << layer <<
":" << depth <<
":"
102 if (pos.Rho() > rMinHO_) {
106 if (eta <= etaTable_[10])
107 eta = etaTable_[10] + 0.001;
108 }
else if (z > zHO_[1]) {
109 if (eta <= etaTable_[4])
110 eta = etaTable_[4] + 0.001;
113 for (
unsigned int i = 1;
i < etaTable_.size();
i++) {
114 if (eta < etaTable_[
i]) {
123 }
else if (det == static_cast<int>(
HcalEndcap)) {
127 return std::make_pair(subdet, ieta);
131 double fioff = ((det ==
static_cast<int>(
HcalEndcap)) ? phioff_[1] : phioff_[0]);
132 double fibin = phibin_[ieta - 1];
133 int nphi = int((2._pi + 0.1 * fibin) / fibin);
134 double hphi = phi + fioff;
137 int iphi = int(hphi / fibin) + 1;
140 const double fiveDegInRad = 5._deg;
141 int units = int(fibin / fiveDegInRad + 0.5);
144 int iphi_skip = iphi;
146 iphi_skip = (iphi - 1) * 2 + 1;
148 iphi_skip = (iphi - 1) * 4 - 1;
151 return std::make_pair(iphi, iphi_skip);
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
HcalNumberingFromDDD::HcalID unitID(int det, int layer, int depth, const math::XYZVectorD &pos) const
etaMax_(conf.getParameter< double >("etaMax"))
float getEta(float r, float z)
std::pair< int, int > getPhi(const int &det, const int &ieta, const double &phi) const
constexpr std::array< uint8_t, layerIndexSize > layer
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Abs< T >::type abs(const T &t)
double deteta(const Fourvec &v, double zvert)
NOT USED ANYMORE: Get the detector (D0-specific), requires z-vertex.
HcalNumberingFromPS(const edm::ParameterSet &)
std::pair< int, int > getEta(const int &det, const math::XYZVectorD &pos) const
T getParameter(std::string const &) const
float getPhi(float x, float y)
TString units(TString variable, Char_t axis)
etaMin_(conf.getParameter< double >("etaMin"))