14 etaTable_ = conf.
getParameter<std::vector<double> >(
"EtaTable");
15 phibin_ = conf.
getParameter<std::vector<double> >(
"PhiBin");
16 phioff_ = conf.
getParameter<std::vector<double> >(
"PhiOffset");
17 etaMin_ = conf.
getParameter<std::vector<int> >(
"EtaMin");
18 etaMax_ = conf.
getParameter<std::vector<int> >(
"EtaMax");
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)
72 std::pair<int, int>
deteta = getEta(subdet,
pos);
77 newDepth = segmentation_[
deteta.second - 1][
layer - 1];
78 if ((
deteta.second == etaHBHE_) && (newDepth > depthHBHE_[0]))
79 newDepth = depthHBHE_[0];
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_))
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]) {
121 if (
ieta > etaMax_[0])
123 }
else if (det == static_cast<int>(
HcalEndcap)) {
124 if (
ieta <= etaMin_[1])
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);