19 mergePosition_(mergePosition),
31 firstHEDoublePhiRing_(999),
32 firstHEQuadPhiRing_(999),
33 firstHFQuadPhiRing_(40),
34 firstHETripleDepthRing_(999),
54 int unit =
static_cast<int>((
i.dphi / 5.0_deg) + 0.01);
105 if (etaBinsHE_.size() > 1) {
106 double eta = etaBinsHE_[etaBinsHE_.size() - 1].etaMax;
114 for (
auto&
i : etaBinsHE_) {
115 if (eta <
i.etaMax) {
121 const double fiveDegInRad = 5.0_deg;
123 int units = (
int)(
k / fiveDegInRad + 0.5);
127 int units = (
int)(
k / fiveDegInRad + 0.5);
135 edm::LogVerbatim(
"HCalGeom") <<
"Set segmentation for ring " <<
ring <<
" with " << segmentation.size()
137 for (
unsigned int k = 0;
k < segmentation.size(); ++
k)
143 edm::LogVerbatim(
"HCalGeom") <<
"Set Plan-1 segmentation for ring " <<
ring <<
" with " << segmentation.size()
145 for (
unsigned int k = 0;
k < segmentation.size(); ++
k)
221 edm::LogWarning(
"HCalGeom") <<
"This is an incomplete constructor of HcalTopology - be warned that many " 222 <<
"functionalities will not be there - revert from this - get from EventSetup";
249 if (
id.ietaAbs() > 28) {
254 if ((
id.
iphi() % 4) != 1)
256 if (
id.ietaAbs() > 32)
259 }
else if (
id.
version() == 1) {
262 if (
id.ietaAbs() < 30 ||
id.ietaAbs() > 41)
264 if (
id.ietaAbs() > 29 && ((
id.
iphi() % 2) == 0))
266 if (
id.ietaAbs() > 39 && ((
id.
iphi() % 4) != 3))
282 unsigned int iphi =
static_cast<unsigned int>(tid.
iphi());
309 unsigned int iphi =
static_cast<unsigned int>(tid.
iphi());
315 unsigned int iphi =
static_cast<unsigned int>(tid.
iphi());
320 unsigned int iphi =
static_cast<unsigned int>(tid.
iphi());
351 switch (
id.subdet()) {
403 std::vector<DetId> vNeighborsDetId;
406 if (neighbors[
i].oldFormat())
407 neighbors[
i].changeForm();
408 vNeighborsDetId.emplace_back(
DetId(neighbors[
i].rawId()));
410 return vNeighborsDetId;
414 std::vector<DetId> vNeighborsDetId;
417 if (neighbors[
i].oldFormat())
418 neighbors[
i].changeForm();
419 vNeighborsDetId.emplace_back(
DetId(neighbors[
i].rawId()));
421 return vNeighborsDetId;
425 std::vector<DetId> vNeighborsDetId;
430 vNeighborsDetId.emplace_back(
DetId(neighbor.
rawId()));
432 return vNeighborsDetId;
436 std::vector<DetId> vNeighborsDetId;
441 vNeighborsDetId.emplace_back(
DetId(neighbor.
rawId()));
443 return vNeighborsDetId;
448 std::vector<DetId> vNeighborsDetId;
452 vNeighborsDetId.emplace_back(neighbor);
454 return vNeighborsDetId;
459 std::vector<DetId> vNeighborsDetId;
463 vNeighborsDetId.emplace_back(neighbor);
465 return vNeighborsDetId;
490 int ieta_l =
std::min(ieta1, ieta2);
491 int ieta_h =
std::max(ieta1, ieta2);
492 int iphi_l =
std::min(iphi1, iphi2);
493 int iphi_h =
std::max(iphi1, iphi2);
494 int depth_l =
std::min(depth1, depth2);
495 int depth_h =
std::max(depth1, depth2);
538 const int ie(
id.ietaAbs());
539 const int ip(
id.
iphi());
542 return ((ip >= 1) && (ip <=
IPHI_MAX) && (dp >= 1) && (ie >= 1) &&
543 (((sd ==
HcalBarrel) && (((ie <= 14) && (dp == 1)) || (((ie == 15) || (ie == 16)) && (dp <= 2)))) ||
545 (((ie ==
firstHERing()) && (dp == 3)) || ((ie == 17) && (dp == 1)) ||
546 ((ie >= 18) && (ie <= 20) && (dp <= 2)) || ((ie >= 21) && (ie <= 26) && (dp <= 2) && (ip % 2 == 1)) ||
547 ((ie >= 27) && (ie <= 28) && (dp <= 3) && (ip % 2 == 1)) || ((ie == 29) && (dp <= 2) && (ip % 2 == 1)))) ||
548 ((sd ==
HcalOuter) && (ie <= 15) && (dp == 4)) ||
557 int ieta =
id.ieta();
558 int aieta =
id.ietaAbs();
559 int depth =
id.depth();
560 int iphi =
id.iphi();
561 int zside =
id.zside();
564 if ((ieta == 0 || iphi <= 0 || iphi > maxPhi) || aieta >
maxEta_)
571 (depth < hcons_->getMinDepth(0, aieta, iphi, zside)))
574 if (aieta >
lastHBRing() || depth > 2 || (aieta <= 14 && depth > 1))
580 (depth < hcons_->getMinDepth(1, aieta, iphi, zside)) || (aieta <
firstHERing()) || (aieta >
lastHERing())) {
584 if (aieta ==
i.ieta) {
593 if (depth <
i.depthStart)
604 (((aieta >= 17 && aieta < firstHETripleDepthRing()) || aieta == lastHERing()) && depth > 2) ||
629 switch (
id.subdet()) {
681 switch (
id.subdet()) {
746 int aieta =
id.ietaAbs();
763 if (!
valid(neighbors[0]))
771 int aieta =
id.ietaAbs();
791 }
else if (aieta == 1) {
800 if (!
valid(neighbors[0]) && n == 2) {
801 if (!
valid(neighbors[1]))
805 neighbors[0] = neighbors[1];
808 if (n == 2 && !
valid(neighbors[1]))
810 if (n == 1 && !
valid(neighbors[0]))
847 }
else if (etaRing == 17) {
876 int nDepthBins(0), startingBin(0);
881 if (depth >= (startingBin + nDepthBins)) {
895 (ieta > 0) ? ++ieta : --ieta;
899 (ieta > 0) ? --ieta : ++ieta;
906 detId =
HcalDetId(subdet, ieta, iphi, depth);
917 int nDepthBins, startingBin;
932 (ieta > 0) ? --ieta : ++ieta;
933 }
else if (depth <= 0) {
938 ieta = (ieta > 0) ? etaRing : -etaRing;
940 if (etaRing ==
i.ieta) {
941 depth =
i.depthStart +
i.layer.size() - 1;
975 if (phiTableVal != 0.0)
976 lastPhiBin =
static_cast<int>((2._pi / phiTableVal) + 0.001);
1008 for (
unsigned int k = 0;
k <
etaTable.size() - 1; ++
k) {
1031 if (index < static_cast<int>(
dPhiTableHF.size())) {
1042 else if (phi > 2._pi)
1044 int phibin(1),
unit(1);
1058 iphi = (phibin - 1) * 2 + 1;
1060 iphi = (phibin - 1) * 4 + 3;
1067 SegmentationMap::const_iterator
pos;
1071 throw cms::Exception(
"HcalTopology") <<
"No depth segmentation found for ring" <<
ring;
1076 throw cms::Exception(
"HcalTopology") <<
"No depth segmentation found for ring" <<
ring;
1081 readoutDepths = pos->second;
1093 std::vector<int> readoutDepths;
1095 int d1 = std::lower_bound(readoutDepths.begin(), readoutDepths.end(),
depth) - readoutDepths.begin();
1096 int d2 = std::upper_bound(readoutDepths.begin(), readoutDepths.end(),
depth) - readoutDepths.begin();
1097 return std::pair<int, int>(d1, d2);
1125 int ieta = (keta > 0) ? keta : -keta;
1134 if ((ietal < (
int)(
etaTable.size())) && (ieta > 0))
1135 return std::pair<double, double>(
etaTable[ieta - 1], etaTable[ietal]);
1137 return std::pair<double, double>(0, 0);
1143 const int ip(hid.
iphi());
1146 const int zn(hid.
zside() < 0 ? 1 : 0);
1147 unsigned int retval =
1149 ? (ip - 1) * 18 +
dp - 1 + ie - (ie < 16 ? 1 : 0) + zn *
kHBhalf 1151 ? 2 *
kHBhalf + (ip - 1) * 8 + (ip / 2) * 20 +
1152 ((ie == 16 || ie == 17)
1154 : ((ie >= 18 && ie <= 20)
1155 ? 2 + 2 * (ie - 18) +
dp - 1
1156 : ((ie >= 21 && ie <= 26)
1157 ? 8 + 2 * (ie - 21) +
dp - 1
1158 : ((ie >= 27 && ie <= 28) ? 20 + 3 * (ie - 27) +
dp - 1
1159 : 26 + 2 * (ie - 29) +
dp - 1)))) +
1164 ((ip - 1) / 2) * 22 + 2 * (ie - 29) + (
dp - 1) + zn *
kHFhalf 1171 const int ip(hid.
iphi());
1174 const int zn(hid.
zside() < 0 ? 1 : 0);
1175 unsigned int retval = 0xFFFFFFFFu;
1177 retval = (ip - 1) * 18 +
dp - 1 + ie - (ie < 16 ? 1 : 0) + zn *
kHBhalf;
1190 const int ip(hid.
iphi());
1193 const int zn(hid.
zside() < 0 ? 1 : 0);
1194 unsigned int retval = 0xFFFFFFFFu;
1196 retval = (ip - 1) * 8 + (ip / 2) * 20 +
1197 ((ie == 16 || ie == 17)
1199 : ((ie >= 18 && ie <= 20)
1200 ? 2 + 2 * (ie - 18) +
dp - 1
1201 : ((ie >= 21 && ie <= 26) ? 8 + 2 * (ie - 21) +
dp - 1
1202 : ((ie >= 27 && ie <= 28) ? 20 + 3 * (ie - 27) +
dp - 1
1203 : 26 + 2 * (ie - 29) +
dp - 1)))) +
1217 const int ip(hid.
iphi());
1219 const int zn(hid.
zside() < 0 ? 1 : 0);
1221 unsigned int retval = 0xFFFFFFFFu;
1223 retval = (ip - 1) * 15 + (ie - 1) + zn *
kHOhalf;
1235 const int ip(hid.
iphi());
1238 const int zn(hid.
zside() < 0 ? 1 : 0);
1240 unsigned int retval = 0xFFFFFFFFu;
1242 retval = ((ip - 1) / 4) * 4 + ((ip - 1) / 2) * 22 + 2 * (ie - 29) + (
dp - 1) + zn *
kHFhalf;
1244 retval =
dp - 1 + 2 * (ip - 1);
1256 unsigned int ietaAbs = tid.
ietaAbs();
1258 unsigned int ivers = tid.
version();
1262 if ((iphi - 1) % 4 == 0)
1263 index = (iphi - 1) * 32 + (ietaAbs - 1) - (12 * ((iphi - 1) / 4));
1265 index = (iphi - 1) * 28 + (ietaAbs - 1) + (4 * (((iphi - 1) / 4) + 1));
1272 index += (36 * (ietaAbs - 30) + ((iphi - 1) / 2));
1284 unsigned int index = 0xFFFFFFFFu;
1348 }
else if (ieta > 0) {
1364 int kphi = ((
std::abs(ieta) ==
etaCalibHOX_[0]) ? ((iphi % 2 == 0) ? (iphi / 2 - 1) : (iphi - 1) / 2) : (iphi - 1));
1387 unsigned int hid0(hid);
1390 int id0, keta,
ieta,
iphi, ichan, ctype;
1392 id0 =
static_cast<int>(hid0);
1402 id0 =
static_cast<int>(hid0);
1412 id0 =
static_cast<int>(hid0);
1422 id0 =
static_cast<int>(hid0);
1450 id0 =
static_cast<int>(hid0);
1459 id0 =
static_cast<int>(hid0);
1468 edm::LogVerbatim(
"HCalGeom") <<
"CalibrationBox: " << hid <<
" o/p " << ieta <<
":" << iphi <<
":" << ichan <<
":" 1469 << ctype <<
" " <<
id;
1475 iphi =
static_cast<int>(hid0) + 1;
1487 iphi =
static_cast<int>(hid0) + 1;
1492 edm::LogVerbatim(
"HCalGeom") <<
"HOCrossTalk: " << hid <<
":" << hid0 <<
" o/p " << ieta <<
":" << iphi <<
" " 1501 edm::LogVerbatim(
"HCalGeom") <<
"HBX: " << hid <<
":" << hid0 <<
" o/p " << ieta <<
":" << iphi <<
" " <<
id;
1512 edm::LogVerbatim(
"HCalGeom") <<
"HEX: " << hid <<
":" << hid0 <<
" o/p " << ieta <<
":" << iphi <<
" " <<
id;
1519 unsigned int retval(0);
1551 retval = 0xFFFFFFFu;
1577 ip += 1 + (in > 21 ? 2 : 0);
1589 ie = 1 + (in - 15 * (ip - 1));
1590 }
else if (in > 2 *
kHBhalf - 1) {
1600 ie = 15 + (in < 2 ? 1 + in : 2 + (in < 20 ? 1 + (in - 2) / 2 : 9 + (in < 26 ? 1 + (in - 20) / 3 : 3)));
1603 : (in < 2 ? 1 : (in < 20 ? 1 + (in - 2) % 2 : (in < 26 ? 1 + (in - 20) % 3 : (1 + (in - 26) % 2)))));
1620 if (denseid <
ncells()) {
1648 }
else if (denseid >= (
HBSize_)) {
1678 HcalDetId hid(sd, iz *
int(ie), ip, dp);
DetId denseId2detId(unsigned int) const override
return a linear packed id
std::vector< int > getDepth(const int &det, const int &phi, const int &zside, const unsigned int &eta) const
std::vector< int > unitPhiHF
int zside() const
get the z-side of the tower (1/-1)
static int etaCalibHE_[nEtaCalibHE_]
void getDepthSegmentation(const unsigned ring, std::vector< int > &readoutDepths, const bool flag=false) const
int topoVersion() const override
return a version which identifies the given topology
int decIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
static unsigned int kOffCalibHO1_
bool validCalib(const HcalCalibDetId &id) const
unsigned int numberOfShapes_
unsigned int detId2denseIdPreLS1(const DetId &id) const
static unsigned int kPhiCalibHB_
std::vector< double > dPhiTableHF
void excludeSubdetector(HcalSubdetector subdet)
HcalSubdetector subdet() const
get the subdetector
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHB_
int phiBin(HcalSubdetector subdet, int etaRing, double phi) const
std::vector< int > unitPhi
bool valid(const DetId &id) const override
CalibDetType calibFlavor() const
get the flavor of this calibration detid
std::vector< DetId > up(const DetId &id) const override
unsigned int detId2denseId(const DetId &id) const override
return a linear packed id
static unsigned int kOffCalibHF2_
static unsigned int nEtaCalibHE_
int zside() const
get the z-side of the cell (1/-1)
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
static unsigned int kchanCalibHE2_
static unsigned int nPhiCalibHOX_[nEtaCalibHOX_]
static unsigned int kOffCalibHEX_
void exclude(const HcalDetId &id)
const std::vector< double > & getEtaTableHF() const
HcalTopologyMode::TriggerMode triggerMode_
static unsigned int nEtaCalibHF_
static int chanCalibHF1_[nchanCalibHF1_]
constexpr uint32_t rawId() const
get the raw id
int nPhiBins(int etaRing) const
how many phi segments in this ring
int incIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
bool decrementDepth(HcalDetId &id) const
static unsigned int kPhiCalibHO1_
static unsigned int nchanCalibHF1_
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
bool decIPhi(const HcalDetId &id, HcalDetId &neighbor) const
static unsigned int kPhiCalibHF1_
bool validHcal(const HcalDetId &id) const
static int chanCalibHE1_[nchanCalibHE1_]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static int etaCalibHF_[nEtaCalibHF_]
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHE_
static int chanCalibHO_[nchanCalibHO_]
HcalCalibDetId denseId2detIdCALIB(const unsigned int &id) const
return a Calib DetId from linear packed id
const std::vector< double > & getPhiOffs() const
static unsigned int mPhiCalibHO0_
HcalTopologyMode::Mode mode() const
int getTriggerMode() const
static unsigned int kOffCalibHB_
U second(std::pair< T, U > const &p)
bool isExcluded(const HcalDetId &id) const
void depthBinInformation(HcalSubdetector subdet, int etaRing, int iphi, int zside, int &nDepthBins, int &startingBin) const
finds the number of depth bins and which is the number to start with
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
static int etaCalibHO_[nEtaCalibHO_]
int depth() const
get the tower depth
std::pair< int, int > segmentBoundaries(const unsigned ring, const unsigned depth, const bool flag=false) const
bool incIPhi(const HcalDetId &id, HcalDetId &neighbor) const
bool isPlan1MergedId(const HcalDetId &id) const
static unsigned int minPhi_
bool validRaw(const HcalDetId &id) const
std::vector< DetId > south(const DetId &id) const override
static unsigned int kPhiCalibHE_
int decAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
static unsigned int maxPhi_
int getMinDepth(const int &itype, const int &ieta, const int &iphi, const int &zside) const
HcalTopologyMode::Mode mode_
static unsigned int kPhiCalibHBX_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
HcalTopology(const HcalDDDRecConstants *hcons, const bool mergePosition=false)
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
int firstHETripleDepthRing() const
int ieta() const
get the cell ieta
int getDepthEta16(const int &det, const int &iphi, const int &zside) const
Abs< T >::type abs(const T &t)
static unsigned int kOffCalibHOX_
int getDepthEta29(const int &iphi, const int &zside, const int &type) const
static unsigned int nEtaCalibHB_
static unsigned int mPhiCalibHEX_
static unsigned int nchanCalibHB_
std::vector< double > etaTableHF
int firstHEDoublePhiRing() const
SegmentationMap depthSegmentation_
SegmentationMap depthSegmentationOne_
std::vector< double > etaTable
static unsigned int kchanCalibHE1_
static unsigned int kOffCalibHF1_
static unsigned int nEtaCalibHOX_
static unsigned int mPhiCalibHO1_
int ietaAbs() const
get the absolute value of the cell ieta
int iphi() const
get the low-edge iphi (if relevant)
bool validDetIdPreLS1(const HcalDetId &id) const
int iphi() const
get the cell iphi
bool incrementDepth(HcalDetId &id) const
int zside() const
get the sign of ieta (+/-1)
std::vector< double > phioff
const std::vector< double > & getPhiTable() const
int getNoff(const int &i) const
static unsigned int kOffCalibHE1_
int version() const
get the version code for the trigger tower
int getMaxDepth(const int &type) const
static int chanCalibHB_[nchanCalibHB_]
static unsigned int kPhiCalibHEX_
const std::vector< double > & getEtaTable() const
static unsigned int kchanCalibHF2_
int firstHFQuadPhiRing() const
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
static unsigned int kPhiCalibHO0_
static unsigned int kOffCalibHFX_
static unsigned int mPhiCalibHF1_
static unsigned int nEtaCalibHO_
static int etaCalibHEX_[nEtaCalibHEX_]
static unsigned int nchanCalibHE1_
static unsigned int mPhiCalibHB_
std::vector< double > dPhiTable
std::vector< DetId > west(const DetId &id) const override
static unsigned int kOffCalibHO2_
int cboxChannel() const
get the calibration box channel (if relevant)
std::vector< DetId > north(const DetId &id) const override
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
TString units(TString variable, Char_t axis)
static unsigned int nchanCalibHO_
const std::vector< double > & getPhiTableHF() const
std::vector< DetId > down(const DetId &id) const override
static unsigned int kchanCalibHF1_
int firstHETripleDepthRing_
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
std::vector< HcalDetId > exclusionList_
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
bool isPlan1ToBeMergedId(const HcalDetId &id) const
static unsigned int kPhiCalibHO2_
static int etaCalibHOX_[nEtaCalibHOX_]
int firstHEQuadPhiRing() const
HcalSubdetector hcalSubdet() const
get the HcalSubdetector (if relevant)
void setDepthSegmentation(const unsigned ring, const std::vector< int > &readoutDepths, const bool flag)
std::pair< int, int > getEtaRange(const int &i) const
int maxHFDepth(int ieta, int iphi) const
static unsigned int kchanCalibHB_
static unsigned int nEtaCalibHEX_
int incAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
static unsigned int kOffCalibHBX_
int ietaAbs() const
get the absolute value of the tower ieta
static int etaCalibHB_[nEtaCalibHB_]
int iphi() const
get the tower iphi
static int phiCalibHO_[nEtaCalibHO_]
std::vector< DetId > east(const DetId &id) const override
double etaMax(HcalSubdetector subdet) const
int firstHEDoublePhiRing_
const HcalDDDRecConstants * hcons_
static const int IPHI_MAX
static unsigned int kOffCalibHE2_
Basic3DVector unit() const
int getNPhi(const int &type) const
static unsigned int mPhiCalibHE_
bool validHT(const HcalTrigTowerDetId &id) const