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);
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)
165 mergePosition_(
false),
181 firstHEQuadPhiRing_(999),
182 firstHFQuadPhiRing_(40),
192 HBSize_(kHBSizePreLS1),
193 HESize_(kHESizePreLS1),
196 HTSize_(kHTSizePreLS1),
197 CALIBSize_(kCALIBSizePreLS1),
225 edm::LogWarning(
"HCalGeom") <<
"This is an incomplete constructor of HcalTopology - be warned that many " 226 <<
"functionalities will not be there - revert from this - get from EventSetup";
259 if ((
id.
iphi() % 4) != 1)
264 }
else if (
id.
version() == 1) {
287 unsigned int iphi =
static_cast<unsigned int>(tid.
iphi());
314 unsigned int iphi =
static_cast<unsigned int>(tid.
iphi());
320 unsigned int iphi =
static_cast<unsigned int>(tid.
iphi());
325 unsigned int iphi =
static_cast<unsigned int>(tid.
iphi());
356 switch (
id.subdet()) {
408 std::vector<DetId> vNeighborsDetId;
411 if (neighbors[
i].oldFormat())
412 neighbors[
i].changeForm();
413 vNeighborsDetId.emplace_back(
DetId(neighbors[
i].
rawId()));
415 return vNeighborsDetId;
419 std::vector<DetId> vNeighborsDetId;
422 if (neighbors[
i].oldFormat())
423 neighbors[
i].changeForm();
424 vNeighborsDetId.emplace_back(
DetId(neighbors[
i].
rawId()));
426 return vNeighborsDetId;
430 std::vector<DetId> vNeighborsDetId;
435 vNeighborsDetId.emplace_back(
DetId(neighbor.
rawId()));
437 return vNeighborsDetId;
441 std::vector<DetId> vNeighborsDetId;
446 vNeighborsDetId.emplace_back(
DetId(neighbor.
rawId()));
448 return vNeighborsDetId;
453 std::vector<DetId> vNeighborsDetId;
457 vNeighborsDetId.emplace_back(neighbor);
459 return vNeighborsDetId;
464 std::vector<DetId> vNeighborsDetId;
468 vNeighborsDetId.emplace_back(neighbor);
470 return vNeighborsDetId;
497 int iphi_l =
std::min(iphi1, iphi2);
498 int iphi_h =
std::max(iphi1, iphi2);
499 int depth_l =
std::min(depth1, depth2);
500 int depth_h =
std::max(depth1, depth2);
544 const int ip(
id.
iphi());
547 return ((ip >= 1) && (ip <=
IPHI_MAX) && (
dp >= 1) && (ie >= 1) &&
548 (((sd ==
HcalBarrel) && (((ie <= 14) && (
dp == 1)) || (((ie == 15) || (ie == 16)) && (
dp <= 2)))) ||
551 ((ie >= 18) && (ie <= 20) && (
dp <= 2)) || ((ie >= 21) && (ie <= 26) && (
dp <= 2) && (ip % 2 == 1)) ||
552 ((ie >= 27) && (ie <= 28) && (
dp <= 3) && (ip % 2 == 1)) || ((ie == 29) && (
dp <= 2) && (ip % 2 == 1)))) ||
562 int ieta =
id.ieta();
563 int aieta =
id.ietaAbs();
564 int depth =
id.depth();
565 int iphi =
id.iphi();
566 int zside =
id.zside();
577 (depth < hcons_->getMinDepth(0, aieta,
iphi,
zside)))
591 if (aieta ==
i.ieta) {
611 (((aieta >= 17 && aieta < firstHETripleDepthRing()) || aieta == lastHERing()) && depth > 2) ||
636 switch (
id.subdet()) {
688 switch (
id.subdet()) {
753 int aieta =
id.ietaAbs();
770 if (!
valid(neighbors[0]))
778 int aieta =
id.ietaAbs();
798 }
else if (aieta == 1) {
807 if (!
valid(neighbors[0]) &&
n == 2) {
808 if (!
valid(neighbors[1]))
812 neighbors[0] = neighbors[1];
815 if (
n == 2 && !
valid(neighbors[1]))
817 if (
n == 1 && !
valid(neighbors[0]))
885 int nDepthBins(0), startingBin(0);
890 if (
depth >= (startingBin + nDepthBins)) {
929 int nDepthBins, startingBin;
946 }
else if (
depth <= 0) {
954 depth =
i.depthStart +
i.layer.size() - 1;
988 if (phiTableVal != 0.0)
989 lastPhiBin =
static_cast<int>((2._pi / phiTableVal) + 0.001);
1021 for (
unsigned int k = 0;
k <
etaTable.size() - 1; ++
k) {
1055 else if (
phi > 2._pi)
1057 int phibin(1),
unit(1);
1071 iphi = (phibin - 1) * 2 + 1;
1073 iphi = (phibin - 1) * 4 + 3;
1080 SegmentationMap::const_iterator
pos;
1084 throw cms::Exception(
"HcalTopology") <<
"No depth segmentation found for ring" <<
ring;
1089 throw cms::Exception(
"HcalTopology") <<
"No depth segmentation found for ring" <<
ring;
1094 readoutDepths =
pos->second;
1106 std::vector<int> readoutDepths;
1109 int d2 =
std::upper_bound(readoutDepths.begin(), readoutDepths.end(),
depth) - readoutDepths.begin();
1110 return std::pair<int, int>(
d1, d2);
1138 int ieta = (keta > 0) ? keta : -keta;
1150 return std::pair<double, double>(0, 0);
1156 const int ip(hid.
iphi());
1159 const int zn(hid.
zside() < 0 ? 1 : 0);
1160 unsigned int retval =
1162 ? (ip - 1) * 18 +
dp - 1 + ie - (ie < 16 ? 1 : 0) + zn *
kHBhalf 1164 ? 2 *
kHBhalf + (ip - 1) * 8 + (ip / 2) * 20 +
1165 ((ie == 16 || ie == 17)
1167 : ((ie >= 18 && ie <= 20)
1168 ? 2 + 2 * (ie - 18) +
dp - 1
1169 : ((ie >= 21 && ie <= 26)
1170 ? 8 + 2 * (ie - 21) +
dp - 1
1171 : ((ie >= 27 && ie <= 28) ? 20 + 3 * (ie - 27) +
dp - 1
1172 : 26 + 2 * (ie - 29) +
dp - 1)))) +
1177 ((ip - 1) / 2) * 22 + 2 * (ie - 29) + (
dp - 1) + zn *
kHFhalf 1184 const int ip(hid.
iphi());
1187 const int zn(hid.
zside() < 0 ? 1 : 0);
1188 unsigned int retval = 0xFFFFFFFFu;
1190 retval = (ip - 1) * 18 +
dp - 1 + ie - (ie < 16 ? 1 : 0) + zn *
kHBhalf;
1203 const int ip(hid.
iphi());
1206 const int zn(hid.
zside() < 0 ? 1 : 0);
1207 unsigned int retval = 0xFFFFFFFFu;
1209 retval = (ip - 1) * 8 + (ip / 2) * 20 +
1210 ((ie == 16 || ie == 17)
1212 : ((ie >= 18 && ie <= 20)
1213 ? 2 + 2 * (ie - 18) +
dp - 1
1214 : ((ie >= 21 && ie <= 26) ? 8 + 2 * (ie - 21) +
dp - 1
1215 : ((ie >= 27 && ie <= 28) ? 20 + 3 * (ie - 27) +
dp - 1
1216 : 26 + 2 * (ie - 29) +
dp - 1)))) +
1230 const int ip(hid.
iphi());
1232 const int zn(hid.
zside() < 0 ? 1 : 0);
1234 unsigned int retval = 0xFFFFFFFFu;
1236 retval = (ip - 1) * 15 + (ie - 1) + zn *
kHOhalf;
1248 const int ip(hid.
iphi());
1251 const int zn(hid.
zside() < 0 ? 1 : 0);
1253 unsigned int retval = 0xFFFFFFFFu;
1255 retval = ((ip - 1) / 4) * 4 + ((ip - 1) / 2) * 22 + 2 * (ie - 29) + (
dp - 1) + zn *
kHFhalf;
1257 retval =
dp - 1 + 2 * (ip - 1);
1271 unsigned int ivers = tid.
version();
1275 if ((
iphi - 1) % 4 == 0)
1297 unsigned int index = 0xFFFFFFFFu;
1304 edm::LogVerbatim(
"HCalGeom") <<
"CALIB_HB: dphi = 4 (18 phi values), 3 channel types (0,1,2), eta = -1 or 1\n " 1305 " total of 18*3*2=108 channels";
1316 edm::LogVerbatim(
"HCalGeom") <<
"CALIB_HE: dphi = 4 (18 phi values), 7 channel types (0,1,2,3,4,5,6), eta = " 1317 "-1/+1\n total of 18*7*2=252 channels if (channel > 2) channel -= 1";
1333 <<
"CALIB_HF: dphi = 18 (4 phi values), 3 channel types (0,1,8), eta = -1 or +1\n or iphi = 1; " 1334 "channel = 9, eta = -1 or +1 total channels 4*3*2=24 + 2";
1365 }
else if (
ieta > 0) {
1377 edm::LogVerbatim(
"HCalGeom") <<
"HX: for YB0/HO0 phi is grouped in 6 groups of 6 with dphi=2 but the transitions " 1378 "are 1 or 3 in such a way that the %36 operation yeilds unique values for every " 1379 "iphi\n ieta = 0 for HO2M/HO1M ieta=2 for HO1P/HO2P; /ieta = 1 YB0/HO0";
1406 unsigned int hid0(hid);
1409 int ieta(0),
iphi(0), ichan(0), ctype(0);
1411 int id0 =
static_cast<int>(hid0);
1421 int id0 =
static_cast<int>(hid0);
1431 int id0 =
static_cast<int>(hid0);
1441 int id0 =
static_cast<int>(hid0);
1486 << ctype <<
" " <<
id;
1492 iphi =
static_cast<int>(hid0) + 1;
1504 iphi =
static_cast<int>(hid0) + 1;
1536 unsigned int retval(0);
1568 retval = 0xFFFFFFFu;
1594 ip += 1 + (
in > 21 ? 2 : 0);
1606 ie = 1 + (
in - 15 * (ip - 1));
1617 ie = 15 + (
in < 2 ? 1 +
in : 2 + (
in < 20 ? 1 + (
in - 2) / 2 : 9 + (
in < 26 ? 1 + (
in - 20) / 3 : 3)));
1620 : (
in < 2 ? 1 : (
in < 20 ? 1 + (
in - 2) % 2 : (
in < 26 ? 1 + (
in - 20) % 3 : (1 + (
in - 26) % 2)))));
1637 if (denseid <
ncells()) {
1665 }
else if (denseid >= (
HBSize_)) {
static constexpr int minMaxDepth_
int getMinDepth(const int &itype, const int &ieta, const int &iphi, const int &zside) const
static constexpr int chanCalibHF2_
Log< level::Info, true > LogVerbatim
bool validHT(const HcalTrigTowerDetId &id) const
int cboxChannel() const
get the calibration box channel (if relevant)
std::vector< int > unitPhiHF
static constexpr unsigned int kchanCalibHE1_
static constexpr int etaCalibHE_[nEtaCalibHE_]
std::pair< int, int > getEtaRange(const int &i) const
static constexpr unsigned int kchanCalibHF1_
static constexpr unsigned int kPhiCalibHBX_
constexpr bool oldFormat() const
const std::vector< double > & getPhiOffs() const
static constexpr int etaCalibHBX_
static constexpr unsigned int kOffCalibHFX_
unsigned int numberOfShapes_
unsigned int detId2denseIdPreLS1(const DetId &id) const
std::vector< double > dPhiTableHF
void excludeSubdetector(HcalSubdetector subdet)
bool decrementDepth(HcalDetId &id) const
int getDepthEta16(const int &det, const int &iphi, const int &zside) const
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHB_
constexpr int zside() const
get the z-side of the cell (1/-1)
int topoVersion() const override
return a version which identifies the given topology
void getDepthSegmentation(const unsigned ring, std::vector< int > &readoutDepths, const bool flag=false) const
std::vector< int > unitPhi
static constexpr unsigned int kchanCalibHE2_
constexpr int ietaAbs() const
get the absolute value of the cell ieta
int getNPhi(const int &type) const
bool valid(const DetId &id) const override
std::vector< DetId > south(const DetId &id) const override
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
void exclude(const HcalDetId &id)
HcalTopologyMode::TriggerMode triggerMode_
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
static constexpr unsigned int kchanCalibHF2_
std::pair< int, int > segmentBoundaries(const unsigned ring, const unsigned depth, const bool flag=false) const
static constexpr unsigned int kOffCalibHE1_
unsigned int detId2denseId(const DetId &id) const override
return a linear packed id
int decAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
static constexpr unsigned int nEtaCalibHO_
int incIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
static constexpr int kHFSizePreLS1
static constexpr int kHBhalf
static constexpr unsigned int kPhiCalibHO0_
bool incIPhi(const HcalDetId &id, HcalDetId &neighbor) const
static constexpr int phiCalibHO_[nEtaCalibHO_]
static constexpr int etaCalibHO_[nEtaCalibHO_]
HcalCalibDetId denseId2detIdCALIB(const unsigned int &id) const
return a Calib DetId from linear packed id
static constexpr unsigned int nEtaCalibHF_
static constexpr int kHTSizePreLS1
static constexpr unsigned int nchanCalibHO_
static constexpr int etaCalibHB_[nEtaCalibHB_]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int getTriggerMode() const
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHE_
static constexpr unsigned int nPhiCalibHOX_[nEtaCalibHOX_]
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
int firstHETripleDepthRing() const
HcalSubdetector hcalSubdet() const
get the HcalSubdetector (if relevant)
static constexpr int kCALIBSizePreLS1
static constexpr int kHThalf
static constexpr int chanCalibHE2_
static constexpr unsigned int nEtaCalibHB_
int iphi() const
get the tower iphi
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
static constexpr int phiCalibHOX3_
static constexpr unsigned int kPhiCalibHB_
static constexpr unsigned int nEtaCalibHE_
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
U second(std::pair< T, U > const &p)
static constexpr unsigned int maxPhi_
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ietaAbs(uint32_t id)
std::vector< DetId > up(const DetId &id) const override
constexpr HcalSubdetector subdet() const
get the subdetector
static constexpr int phiCalibHOX2_
constexpr void changeForm()
int decIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
static constexpr unsigned int nchanCalibHB_
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
static constexpr int phiCalibHOX1_
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
bool decIPhi(const HcalDetId &id, HcalDetId &neighbor) const
int firstHFQuadPhiRing() const
static constexpr unsigned int kOffCalibHEX_
constexpr int ieta() const
get the cell ieta
int iphi() const
get the low-edge iphi (if relevant)
HcalTopologyMode::Mode mode_
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)
static constexpr unsigned int mPhiCalibHEX_
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
static constexpr int kHOhalf
static constexpr int chanCalibHE1_[nchanCalibHE1_]
Abs< T >::type abs(const T &t)
const std::vector< double > & getEtaTable() const
static constexpr int kHESizePreLS1
static constexpr int kHBSizePreLS1
DetId denseId2detId(unsigned int) const override
return a linear packed id
static constexpr int etaCalibHEX_[nEtaCalibHEX_]
static constexpr int kHOSizePreLS1
static constexpr int kHEhalf
static constexpr unsigned int kPhiCalibHO2_
std::vector< double > etaTableHF
SegmentationMap depthSegmentation_
static constexpr unsigned int kPhiCalibHO1_
SegmentationMap depthSegmentationOne_
bool validRaw(const HcalDetId &id) const
static constexpr unsigned int mPhiCalibHE_
bool validDetIdPreLS1(const HcalDetId &id) const
int getMaxDepth(const int &type) const
int zside() const
get the sign of ieta (+/-1)
std::vector< DetId > east(const DetId &id) const override
std::vector< double > etaTable
int incAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
static constexpr unsigned int kOffCalibHB_
Basic3DVector unit() const
static constexpr unsigned int nchanCalibHF1_
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
static constexpr int kHTSizePhase1
std::vector< DetId > down(const DetId &id) const override
const std::vector< double > & getEtaTableHF() const
static constexpr int chanCalibHO_[nchanCalibHO_]
static constexpr unsigned int nchanCalibHE1_
static constexpr unsigned int mPhiCalibHO1_
static constexpr unsigned int kOffCalibHOX_
static constexpr unsigned int kPhiCalibHF1_
int firstHEQuadPhiRing() const
bool isPlan1ToBeMergedId(const HcalDetId &id) const
bool validCalib(const HcalCalibDetId &id) const
static constexpr int etaCalibHOX_[nEtaCalibHOX_]
std::vector< double > phioff
static constexpr int chanCalibHOs_
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
static constexpr unsigned int kOffCalibHF1_
static constexpr unsigned int nEtaCalibHOX_
static constexpr int chanCalibHF1_[nchanCalibHF1_]
static constexpr int kHFhalf
constexpr uint32_t rawId() const
get the raw id
static constexpr unsigned int kOffCalibHE2_
int firstHEDoublePhiRing() const
int maxHFDepth(int ieta, int iphi) const
static constexpr unsigned int kOffCalibHBX_
static constexpr int chanCalibHB_[nchanCalibHB_]
CalibDetType calibFlavor() const
get the flavor of this calibration detid
int ietaAbs() const
get the absolute value of the tower ieta
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
std::vector< DetId > north(const DetId &id) const override
bool validHcal(const HcalDetId &id) const
static constexpr unsigned int mPhiCalibHO0_
std::vector< double > dPhiTable
static constexpr unsigned int kOffCalibHO2_
TString units(TString variable, Char_t axis)
int getNoff(const int &i) const
static constexpr unsigned int minPhi_
int firstHETripleDepthRing_
static constexpr int kSizeForDenseIndexingPreLS1
bool isPlan1MergedId(const HcalDetId &id) const
static constexpr int etaCalibHF_[nEtaCalibHF_]
int zside() const
get the z-side of the tower (1/-1)
std::vector< HcalDetId > exclusionList_
const std::vector< double > & getPhiTable() const
bool incrementDepth(HcalDetId &id) const
static constexpr unsigned int kPhiCalibHE_
static constexpr unsigned int mPhiCalibHB_
const std::vector< double > & getPhiTableHF() const
static constexpr unsigned int kchanCalibHB_
int phiBin(HcalSubdetector subdet, int etaRing, double phi) const
std::vector< DetId > west(const DetId &id) const override
void setDepthSegmentation(const unsigned ring, const std::vector< int > &readoutDepths, const bool flag)
Log< level::Warning, false > LogWarning
static constexpr int phiCalibHF2_
int version() const
get the version code for the trigger tower
static constexpr unsigned int kOffCalibHO1_
static constexpr unsigned int nEtaCalibHEX_
static constexpr float d1
static constexpr unsigned int kPhiCalibHEX_
int getDepthEta29(const int &iphi, const int &zside, const int &type) const
std::vector< int > getDepth(const int &det, const int &phi, const int &zside, const unsigned int &eta) const
double etaMax(HcalSubdetector subdet) const
constexpr int iphi() const
get the cell iphi
static constexpr unsigned int mPhiCalibHF1_
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT
int nPhiBins(int etaRing) const
how many phi segments in this ring
int firstHEDoublePhiRing_
const HcalDDDRecConstants * hcons_
static const int IPHI_MAX
static constexpr unsigned int kOffCalibHF2_
bool isExcluded(const HcalDetId &id) const
constexpr int depth() const
get the tower depth