CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions
HcalDetId Class Reference

#include <HcalDetId.h>

Inheritance diagram for HcalDetId:
DetId

Public Member Functions

constexpr HcalDetId baseDetId () const
 
constexpr void changeForm ()
 
constexpr int crystal_ieta_high () const
 get the largest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only) More...
 
constexpr int crystal_ieta_low () const
 get the smallest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only) More...
 
constexpr int crystal_iphi_high () const
 get the largest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) More...
 
constexpr int crystal_iphi_low () const
 get the smallest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) More...
 
constexpr int depth () const
 get the tower depth More...
 
constexpr HcalDetId ()
 
constexpr HcalDetId (uint32_t rawid)
 
constexpr HcalDetId (HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth)
 
constexpr HcalDetId (const DetId &gen)
 
constexpr int hfdepth () const
 get full depth information for HF More...
 
constexpr int ieta () const
 get the cell ieta More...
 
constexpr int ietaAbs () const
 get the absolute value of the cell ieta More...
 
constexpr int iphi () const
 get the cell iphi More...
 
constexpr uint32_t maskDepth () const
 get the tower depth More...
 
constexpr uint32_t newForm () const
 
constexpr bool oldFormat () const
 
constexpr bool operator!= (DetId gen) const
 
constexpr bool operator< (DetId gen) const
 
constexpr HcalDetIdoperator= (const DetId &gen)
 
constexpr bool operator== (DetId gen) const
 
constexpr uint32_t otherForm () const
 change format More...
 
constexpr bool sameBaseDetId (const DetId &gen) const
 base detId for HF dual channels More...
 
constexpr HcalDetId secondAnodeId () const
 second PMT anode detId for HF dual channels More...
 
constexpr HcalSubdetector subdet () const
 get the subdetector More...
 
constexpr int zside () const
 get the z-side of the cell (1/-1) More...
 
- Public Member Functions inherited from DetId
constexpr Detector det () const
 get the detector field from this detid More...
 
constexpr DetId ()
 Create an empty or null id (also for persistence) More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. More...
 
constexpr DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr bool null () const
 is this a null id ? More...
 
constexpr operator uint32_t () const
 
constexpr bool operator!= (DetId id) const
 inequality More...
 
constexpr uint32_t operator() () const
 
constexpr bool operator< (DetId id) const
 comparison More...
 
constexpr bool operator== (DetId id) const
 equality More...
 
constexpr uint32_t rawId () const
 get the raw id More...
 
constexpr int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Member Functions

static constexpr int32_t newForm (const uint32_t &inpid)
 

Static Public Attributes

static constexpr uint32_t kHcalDepthMask1 = 0x1F
 
static constexpr uint32_t kHcalDepthMask2 = 0xF
 
static constexpr uint32_t kHcalDepthOffset1 = 14
 
static constexpr uint32_t kHcalDepthOffset2 = 20
 
static constexpr uint32_t kHcalDepthSet1 = 0x1C000
 
static constexpr uint32_t kHcalDepthSet2 = 0xF00000
 
static constexpr uint32_t kHcalEtaMask1 = 0x3F
 
static constexpr uint32_t kHcalEtaMask2 = 0x1FF
 
static constexpr uint32_t kHcalEtaOffset1 = 7
 
static constexpr uint32_t kHcalEtaOffset2 = 10
 
static constexpr uint32_t kHcalIdFormat2 = 0x1000000
 
static constexpr uint32_t kHcalIdMask = 0xFE000000
 
static constexpr uint32_t kHcalPhiMask1 = 0x7F
 
static constexpr uint32_t kHcalPhiMask2 = 0x3FF
 
static constexpr uint32_t kHcalZsideMask1 = 0x2000
 
static constexpr uint32_t kHcalZsideMask2 = 0x80000
 
static const HcalDetId Undefined
 
- Static Public Attributes inherited from DetId
static const int kDetMask = 0xF
 
static const int kDetOffset = 28
 
static const int kSubdetMask = 0x7
 
static const int kSubdetOffset = 25
 

Private Member Functions

constexpr void newFromOld (const uint32_t &rawid)
 

Static Private Member Functions

static constexpr void unpackId (const uint32_t &rawid, int &zsid, int &eta, int &phi, int &dep)
 

Additional Inherited Members

- Public Types inherited from DetId
enum  Detector {
  Tracker = 1, Muon = 2, Ecal = 3, Hcal = 4,
  Calo = 5, Forward = 6, VeryForward = 7, HGCalEE = 8,
  HGCalHSi = 9, HGCalHSc = 10, HGCalTrigger = 11
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Cell identifier class for the HCAL subdetectors, precision readout cells only

Definition at line 12 of file HcalDetId.h.

Constructor & Destructor Documentation

◆ HcalDetId() [1/4]

constexpr HcalDetId::HcalDetId ( )
inline

Create a null cellid

Definition at line 33 of file HcalDetId.h.

Referenced by baseDetId(), and secondAnodeId().

33 : DetId() {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ HcalDetId() [2/4]

constexpr HcalDetId::HcalDetId ( uint32_t  rawid)
inline

Create cellid from raw id (0=invalid tower id)

Definition at line 35 of file HcalDetId.h.

References DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, DetId::id_, DetId::kDetMask, DetId::kDetOffset, DetId::kSubdetMask, DetId::kSubdetOffset, newForm(), and subdet().

35  {
37  id_ = rawid;
38  } else {
40  if ((subdet == HcalBarrel) || (subdet == HcalEndcap) || (subdet == HcalOuter) || (subdet == HcalForward)) {
41  id_ = newForm(rawid);
42  } else {
43  id_ = rawid;
44  }
45  }
46  }
static const int kSubdetOffset
Definition: DetId.h:22
constexpr uint32_t newForm() const
Definition: HcalDetId.h:199
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
static const int kSubdetMask
Definition: DetId.h:20
HcalSubdetector
Definition: HcalAssistant.h:31
Detector
Definition: DetId.h:24
static const int kDetMask
Definition: DetId.h:19
uint32_t id_
Definition: DetId.h:69
static const int kDetOffset
Definition: DetId.h:21

◆ HcalDetId() [3/4]

constexpr HcalDetId::HcalDetId ( HcalSubdetector  subdet,
int  tower_ieta,
int  tower_iphi,
int  depth 
)
inline

Constructor from subdetector, signed tower ieta,iphi,and depth

Definition at line 49 of file HcalDetId.h.

References depth(), DetId::id_, kHcalDepthMask2, kHcalDepthOffset2, kHcalEtaOffset2, kHcalIdFormat2, kHcalPhiMask2, and kHcalZsideMask2.

49  : DetId(Hcal, subdet) {
50  // (no checking at this point!)
51  id_ |=
53  ((tower_ieta > 0) ? (kHcalZsideMask2 | (tower_ieta << kHcalEtaOffset2)) : ((-tower_ieta) << kHcalEtaOffset2)) |
54  (tower_iphi & kHcalPhiMask2);
55  }
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
static constexpr uint32_t kHcalZsideMask2
Definition: HcalDetId.h:21
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
static constexpr uint32_t kHcalDepthOffset2
Definition: HcalDetId.h:23
static constexpr uint32_t kHcalIdFormat2
Definition: HcalDetId.h:28
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t kHcalEtaOffset2
Definition: HcalDetId.h:17
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
static constexpr uint32_t kHcalDepthMask2
Definition: HcalDetId.h:25
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ HcalDetId() [4/4]

constexpr HcalDetId::HcalDetId ( const DetId gen)
inline

Constructor from a generic cell id

Definition at line 57 of file HcalDetId.h.

References TauDecayModes::dec, Exception, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, DetId::id_, newForm(), and subdet().

57  {
58  if (!gen.null()) {
59  HcalSubdetector subdet = (HcalSubdetector(gen.subdetId()));
60  if (gen.det() != Hcal || (subdet != HcalBarrel && subdet != HcalEndcap && subdet != HcalOuter &&
62  throw cms::Exception("Invalid DetId")
63  << "Cannot initialize HcalDetId from " << std::hex << gen.rawId() << std::dec;
64  }
65  if ((subdet == HcalBarrel) || (subdet == HcalEndcap) || (subdet == HcalOuter) || (subdet == HcalForward)) {
66  id_ = newForm(gen.rawId());
67  } else {
68  id_ = gen.rawId();
69  }
70  } else {
71  id_ = gen.rawId();
72  }
73  }
constexpr uint32_t newForm() const
Definition: HcalDetId.h:199
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalSubdetector
Definition: HcalAssistant.h:31
uint32_t id_
Definition: DetId.h:69

Member Function Documentation

◆ baseDetId()

constexpr HcalDetId HcalDetId::baseDetId ( ) const
inline

Definition at line 226 of file HcalDetId.h.

References depth(), PVValHelper::eta, HcalDetId(), HcalForward, DetId::id_, kHcalDepthMask2, kHcalDepthOffset2, kHcalEtaOffset2, kHcalIdFormat2, kHcalIdMask, kHcalPhiMask2, kHcalZsideMask2, phi, subdet(), and unpackId().

226  {
227  if (subdet() != HcalForward || depth() <= 2) {
228  return HcalDetId(id_);
229  } else {
230  int zsid{0}, eta{0}, phi{0}, dep{0};
231  unpackId(id_, zsid, eta, phi, dep);
232  dep -= 2;
233  uint32_t rawid = id_ & kHcalIdMask;
234  rawid |= (kHcalIdFormat2) | ((dep & kHcalDepthMask2) << kHcalDepthOffset2) |
235  ((zsid > 0) ? (kHcalZsideMask2 | (eta << kHcalEtaOffset2)) : ((eta) << kHcalEtaOffset2)) |
236  (phi & kHcalPhiMask2);
237  return HcalDetId(rawid);
238  }
239  }
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
static constexpr void unpackId(const uint32_t &rawid, int &zsid, int &eta, int &phi, int &dep)
Definition: HcalDetId.h:278
static constexpr uint32_t kHcalZsideMask2
Definition: HcalDetId.h:21
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
static constexpr uint32_t kHcalIdMask
Definition: HcalDetId.h:29
static constexpr uint32_t kHcalDepthOffset2
Definition: HcalDetId.h:23
static constexpr uint32_t kHcalIdFormat2
Definition: HcalDetId.h:28
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t kHcalEtaOffset2
Definition: HcalDetId.h:17
constexpr HcalDetId()
Definition: HcalDetId.h:33
static constexpr uint32_t kHcalDepthMask2
Definition: HcalDetId.h:25
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ changeForm()

constexpr void HcalDetId::changeForm ( )
inline

Definition at line 198 of file HcalDetId.h.

References DetId::id_, and otherForm().

Referenced by HcalTopology::down(), HcalTopology::north(), HcalTopology::south(), and HcalTopology::up().

198 { id_ = otherForm(); }
uint32_t id_
Definition: DetId.h:69
constexpr uint32_t otherForm() const
change format
Definition: HcalDetId.h:187

◆ crystal_ieta_high()

constexpr int HcalDetId::crystal_ieta_high ( ) const
inline

get the largest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only)

Definition at line 259 of file HcalDetId.h.

References ieta(), and zside().

Referenced by CaloTowerConstituentsMap::constituentsOf().

259 { return ((ieta() - zside()) * 5) + 5 * zside(); }
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155

◆ crystal_ieta_low()

constexpr int HcalDetId::crystal_ieta_low ( ) const
inline

get the smallest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only)

Definition at line 257 of file HcalDetId.h.

References ieta(), and zside().

Referenced by CaloTowerConstituentsMap::constituentsOf().

257 { return ((ieta() - zside()) * 5) + zside(); }
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155

◆ crystal_iphi_high()

constexpr int HcalDetId::crystal_iphi_high ( ) const
inline

get the largest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only)

Definition at line 267 of file HcalDetId.h.

References iphi().

Referenced by CaloTowerConstituentsMap::constituentsOf().

267  {
268  int simple_iphi = ((iphi() - 1) * 5) + 5;
269  simple_iphi += 10;
270  return ((simple_iphi > 360) ? (simple_iphi - 360) : (simple_iphi));
271  }
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157

◆ crystal_iphi_low()

constexpr int HcalDetId::crystal_iphi_low ( ) const
inline

get the smallest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only)

Definition at line 261 of file HcalDetId.h.

References iphi().

Referenced by CaloTowerConstituentsMap::constituentsOf().

261  {
262  int simple_iphi = ((iphi() - 1) * 5) + 1;
263  simple_iphi += 10;
264  return ((simple_iphi > 360) ? (simple_iphi - 360) : (simple_iphi));
265  }
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157

◆ depth()

constexpr int HcalDetId::depth ( ) const
inline

get the tower depth

Definition at line 164 of file HcalDetId.h.

References DetId::id_, kHcalDepthMask1, kHcalDepthMask2, kHcalDepthOffset1, kHcalDepthOffset2, and oldFormat().

Referenced by LEDTask::_process(), JetToDigiDump::analyze(), HCALRecHitAnalyzer::analyze(), DQMHcalIterativePhiSymAlCaReco::analyze(), DQMHcalPhiSymAlCaReco::analyze(), cms::Analyzer_minbias::analyze(), CMTRawAnalyzer::analyze(), HcalSimHitStudy::analyzeHits(), HcalSimHitCheck::analyzeHits(), CaloSimHitAnalysis::analyzePassiveHits(), CaloTowersCreationAlgo::assignHitHcal(), PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::backwardCompatibilityCheck(), baseDetId(), RecAnalyzerHF::beginJob(), PFCandidateRecalibrator::beginRun(), PhotonMVABasedHaloTagger::calmatchedHBHECoordForBothHypothesis(), reco::helper::JetIDHelper::classifyJetComponents(), convertHB(), HcalTopology::detId2denseId(), HcalTopology::detId2denseIdHB(), HcalTopology::detId2denseIdHE(), HcalTopology::detId2denseIdHF(), HcalTopology::detId2denseIdPreLS1(), cms::MinBias::endJob(), ChannelPattern::Fill_by_hand(), CMTRawAnalyzer::fillDigiAmplitude(), CMTRawAnalyzer::fillDigiAmplitudeHF(), CMTRawAnalyzer::fillDigiAmplitudeHFQIE10(), CMTRawAnalyzer::fillDigiAmplitudeHO(), CMTRawAnalyzer::fillDigiAmplitudeQIE11(), CMTRawAnalyzer::fillDigiErrors(), CMTRawAnalyzer::fillDigiErrorsHF(), CMTRawAnalyzer::fillDigiErrorsHFQIE10(), CMTRawAnalyzer::fillDigiErrorsHO(), CMTRawAnalyzer::fillDigiErrorsQIE11(), HcalHardcodeGeometryLoader::fillHBHO(), HcalObjRepresent::fillOneGain(), hcaldqm::quantity::getBin_depth(), HcalChannelIterator::getDepth(), ALPAKA_ACCELERATOR_NAMESPACE::particleFlowRecHitProducer::HCAL::getDepth(), HcalDbHardcode::getGainIndex(), hgcal::RecHitTools::getLayer(), HCALConfigDB::getOnlineLUT(), HCALConfigDB::getOnlineLUTFromXML(), HcalDbHardcode::getParameters(), CaloTowersCreationAlgo::getThresholdAndWeight(), hcaldqm::quantity::getValue_depth(), HcalMLTask::globalEndLuminosityBlock(), EgammaHcalIsolation::goodHitEnergy(), CaloTowersCreationAlgo::hadShwrPos(), egamma::hasActiveHcal(), hcaldqm::hashfunctions::hash_depth(), hcaldqm::hashfunctions::hash_Subdetdepth(), HcalDetId(), hcalTransformedId(), hfdepth(), HcalText2DetIdConverter::init(), CastorDbHardcode::makeGain(), HcalDbHardcode::makeHardcodeSiPMParameter(), HcalDbHardcode::makePFCut(), hcaldqm::hashfunctions::name_DChannel(), hcaldqm::hashfunctions::name_depth(), hcaldqm::hashfunctions::name_Subdetdepth(), HcalIsoTrkSimAnalyzer::newId(), HcalIsoTrkAnalyzer::newId(), AlCaHcalIsotrkProducer::newId(), operator!=(), CastorDbASCIIIO::DetIdLess::operator()(), operator==(), otherForm(), PulseShapeFitOOTPileupCorrection::phase1Apply(), HBHEHFLogicalMapEntry::printLMapLine(), HOHXLogicalMapEntry::printLMapLine(), PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::printNeighbourInfo(), HcalHitRelabeller::process(), HcalHardcodeCalibrations::produceChannelQuality(), HcalHardcodeCalibrations::produceRespCorrs(), HcalDigisValidation::reco(), CaloTowersCreationAlgo::rescale(), HFStripFilter::runFilter(), secondAnodeId(), HCalSD::setDetUnitId(), HcalSimParameterMap::simParameters(), hcalCalib::Terminate(), HcalTrigTowerGeometry::towerIds(), HcaluLUTTPGCoder::update(), and CalorimetryManager::updateHCAL().

164  {
165  if (oldFormat())
166  return (id_ >> kHcalDepthOffset1) & kHcalDepthMask1;
167  else
168  return (id_ >> kHcalDepthOffset2) & kHcalDepthMask2;
169  }
constexpr bool oldFormat() const
Definition: HcalDetId.h:139
static constexpr uint32_t kHcalDepthMask1
Definition: HcalDetId.h:24
static constexpr uint32_t kHcalDepthOffset2
Definition: HcalDetId.h:23
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t kHcalDepthMask2
Definition: HcalDetId.h:25
static constexpr uint32_t kHcalDepthOffset1
Definition: HcalDetId.h:22

◆ hfdepth()

constexpr int HcalDetId::hfdepth ( ) const
inline

get full depth information for HF

Definition at line 171 of file HcalDetId.h.

References depth(), HcalForward, and subdet().

Referenced by sameBaseDetId().

171  {
172  int dep = depth();
173  if (subdet() == HcalForward) {
174  if (dep > 2)
175  dep -= 2;
176  }
177  return dep;
178  }
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ ieta()

constexpr int HcalDetId::ieta ( ) const
inline

get the cell ieta

Definition at line 155 of file HcalDetId.h.

References ietaAbs(), and zside().

Referenced by LEDTask::_process(), RecHitTask::_process(), HcalGeometry::alignmentBarEndForIndexLocal(), HcalGeometry::alignmentOuterIndexLocal(), JetToDigiDump::analyze(), HCALRecHitAnalyzer::analyze(), DQMHcalIterativePhiSymAlCaReco::analyze(), DQMHcalPhiSymAlCaReco::analyze(), HCALGPUAnalyzer::analyze(), HcalTB06Analysis::analyze(), ValidIsoTrkCalib::analyze(), cms::Analyzer_minbias::analyze(), HcalHBHEMuonAnalyzer::analyze(), IsolatedTracksHcalScale::analyze(), CMTRawAnalyzer::analyze(), RecAnalyzerMinbias::analyzeHcal(), HcalSimHitStudy::analyzeHits(), HcalSimHitCheck::analyzeHits(), HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(), PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::backwardCompatibilityCheck(), RecAnalyzerHF::beginJob(), PFCandidateRecalibrator::beginRun(), HcalHaloAlgo::Calculate(), convertHB(), crystal_ieta_high(), crystal_ieta_low(), HcalTopology::detId2denseId(), HcalTopology::detId2denseIdHB(), HcalTopology::detId2denseIdHE(), HcalTopology::detId2denseIdHF(), HcalTopology::detId2denseIdHO(), spr::eHCALmatrix(), cms::MinBias::endJob(), CMTRawAnalyzer::fillDigiAmplitudeHFQIE10(), CMTRawAnalyzer::fillDigiAmplitudeQIE11(), CMTRawAnalyzer::fillDigiErrorsHFQIE10(), CMTRawAnalyzer::fillDigiErrorsQIE11(), HCALRecHitAnalyzer::FillGeometry(), HcalHardcodeGeometryLoader::fillHBHO(), AlCaHOCalibProducer::fillHOStore(), HcalObjRepresent::fillOneGain(), HLTHcalLaserMisfireFilter::filter(), HcalLaserHBHEFilter2012::filter(), HcalLaserHBHEHFFilter2012::filter(), TrackDetMatchInfo::findMaxDeposition(), CaloGeometryHelper::getClosestCell(), hcalCalib::GetCoefFromMtrxInvOfAve(), HcalDbHardcode::getGainIndex(), spr::getHotCell(), HcalChannelIterator::getIeta(), HBHERecHit::getMergedIds(), HcalDbHardcode::getParameters(), CaloTowersCreationAlgo::getThresholdAndWeight(), hcaldqm::quantity::getValue_ieta(), hcaldqm::quantity::getValue_SubdetPM(), HcalMLTask::globalEndLuminosityBlock(), egamma::hasActiveHcal(), hcaldqm::hashfunctions::hash_HFPMiphi(), hcaldqm::hashfunctions::hash_ieta(), hcaldqm::hashfunctions::hash_Subdetieta(), hcaldqm::hashfunctions::hash_SubdetPM(), hcaldqm::hashfunctions::hash_SubdetPMiphi(), SimpleHBHEPhase1Algo::hbminusCorrectionFactor(), hcalTransformedId(), HBHERecHit::idFront(), HcalText2DetIdConverter::init(), HFClusterAlgo::makeCluster(), HcalDbHardcode::makeMCParam(), hcaldqm::hashfunctions::name_DChannel(), hcaldqm::hashfunctions::name_HFPMiphi(), hcaldqm::hashfunctions::name_ieta(), hcaldqm::hashfunctions::name_Subdetieta(), hcaldqm::hashfunctions::name_SubdetPM(), hcaldqm::hashfunctions::name_SubdetPMiphi(), HcalIsoTrkSimAnalyzer::newId(), HcalIsoTrkAnalyzer::newId(), AlCaHcalIsotrkProducer::newId(), TrackDetMatchInfo::nXnEnergy(), otherForm(), PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::printNeighbourInfo(), reco::CentralityProducer::produce(), AlCaHcalHBHEMuonProducer::produce(), HcalHardcodeCalibrations::produceChannelQuality(), HcalHardcodeCalibrations::produceRespCorrs(), HcalDigisValidation::reco(), HFStripFilter::runFilter(), L1Analysis::L1AnalysisL1HO::SetHO(), PileUpSubtractor::setupGeometryMap(), HiPuRhoProducer::setupGeometryMap(), hcalCalib::Terminate(), HcalTrigTowerGeometry::towerIds(), HcalUnpacker::unpackVME(), and HcaluLUTTPGCoder::update().

155 { return zside() * ietaAbs(); }
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148

◆ ietaAbs()

constexpr int HcalDetId::ietaAbs ( ) const
inline

get the absolute value of the cell ieta

Definition at line 148 of file HcalDetId.h.

References DetId::id_, kHcalEtaMask1, kHcalEtaMask2, kHcalEtaOffset1, kHcalEtaOffset2, and oldFormat().

Referenced by CaloSimHitAnalysis::analyzePassiveHits(), CaloTowersCreationAlgo::assignHitHcal(), HcalTopology::detId2denseIdHB(), HcalTopology::detId2denseIdHE(), HcalTopology::detId2denseIdHF(), HcalTopology::detId2denseIdHO(), HcalTopology::detId2denseIdPreLS1(), ChannelPattern::Fill_by_hand(), HCalSD::getEnergyDeposit(), ALPAKA_ACCELERATOR_NAMESPACE::particleFlowRecHitProducer::HCAL::getIetaAbs(), HCALConfigDB::getOnlineLUT(), HCALConfigDB::getOnlineLUTFromXML(), CaloTowersCreationAlgo::getThresholdAndWeight(), ieta(), HFClusterAlgo::makeCluster(), HcalDbHardcode::makeHardcodeSiPMParameter(), CaloTowersCreationAlgo::makeHcalDropChMap(), HcalIsoTrkSimAnalyzer::newId(), HcalIsoTrkAnalyzer::newId(), AlCaHcalIsotrkProducer::newId(), operator!=(), CastorDbASCIIIO::DetIdLess::operator()(), operator==(), HBHEHFLogicalMapEntry::printLMapLine(), HOHXLogicalMapEntry::printLMapLine(), HcalHitRelabeller::process(), HcalHardcodeCalibrations::produceChannelQuality(), sameBaseDetId(), HcalSimParameters::samplingFactor(), HCalSD::setDetUnitId(), hcalCalib::Terminate(), HcalTrigTowerGeometry::towerIds(), CaloTowerConstituentsMap::towerOf(), HcaluLUTTPGCoder::update(), and CalorimetryManager::updateHCAL().

148  {
149  if (oldFormat())
150  return (id_ >> kHcalEtaOffset1) & kHcalEtaMask1;
151  else
152  return (id_ >> kHcalEtaOffset2) & kHcalEtaMask2;
153  }
constexpr bool oldFormat() const
Definition: HcalDetId.h:139
static constexpr uint32_t kHcalEtaMask2
Definition: HcalDetId.h:19
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t kHcalEtaOffset1
Definition: HcalDetId.h:16
static constexpr uint32_t kHcalEtaOffset2
Definition: HcalDetId.h:17
static constexpr uint32_t kHcalEtaMask1
Definition: HcalDetId.h:18

◆ iphi()

constexpr int HcalDetId::iphi ( ) const
inline

get the cell iphi

Definition at line 157 of file HcalDetId.h.

References DetId::id_, kHcalPhiMask1, kHcalPhiMask2, and oldFormat().

Referenced by LEDTask::_process(), LaserTask::_process(), HcalGeometry::alignmentBarEndForIndexLocal(), HcalGeometry::alignmentOuterIndexLocal(), JetToDigiDump::analyze(), HCALRecHitAnalyzer::analyze(), DQMHcalIterativePhiSymAlCaReco::analyze(), DQMHcalPhiSymAlCaReco::analyze(), HCALGPUAnalyzer::analyze(), HcalTB06Analysis::analyze(), ValidIsoTrkCalib::analyze(), cms::Analyzer_minbias::analyze(), HcalHBHEMuonAnalyzer::analyze(), IsolatedTracksHcalScale::analyze(), CMTRawAnalyzer::analyze(), RecAnalyzerMinbias::analyzeHcal(), HcalSimHitStudy::analyzeHits(), HcalSimHitCheck::analyzeHits(), HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(), PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::backwardCompatibilityCheck(), RecAnalyzerHF::beginJob(), PFCandidateRecalibrator::beginRun(), crystal_iphi_high(), crystal_iphi_low(), HcalTopology::detId2denseId(), HcalTopology::detId2denseIdHB(), HcalTopology::detId2denseIdHE(), HcalTopology::detId2denseIdHF(), HcalTopology::detId2denseIdHO(), HcalTopology::detId2denseIdPreLS1(), spr::eHCALmatrix(), cms::MinBias::endJob(), ChannelPattern::Fill_by_hand(), CMTRawAnalyzer::fillDigiAmplitudeHFQIE10(), CMTRawAnalyzer::fillDigiAmplitudeQIE11(), CMTRawAnalyzer::fillDigiErrorsHFQIE10(), CMTRawAnalyzer::fillDigiErrorsQIE11(), HCALRecHitAnalyzer::FillGeometry(), HcalHardcodeGeometryLoader::fillHBHO(), AlCaHOCalibProducer::fillHOStore(), HcalObjRepresent::fillOneGain(), HLTHcalLaserMisfireFilter::filter(), HcalLaserHBHEFilter2012::filter(), HcalLaserHBHEHFFilter2012::filter(), TrackDetMatchInfo::findMaxDeposition(), hcaldqm::quantity::getBin_iphi(), CaloGeometryHelper::getClosestCell(), HCalSD::getEnergyDeposit(), spr::getHotCell(), HcalChannelIterator::getIphi(), ALPAKA_ACCELERATOR_NAMESPACE::particleFlowRecHitProducer::HCAL::getIphi(), HBHERecHit::getMergedIds(), HCALConfigDB::getOnlineLUT(), HCALConfigDB::getOnlineLUTFromXML(), HcalDbHardcode::getParameters(), hcaldqm::quantity::getValue_iphi(), HcalMLTask::globalEndLuminosityBlock(), egamma::hasActiveHcal(), hcaldqm::hashfunctions::hash_HBHEPartition(), hcaldqm::hashfunctions::hash_HFPMiphi(), hcaldqm::hashfunctions::hash_iphi(), hcaldqm::hashfunctions::hash_Subdetiphi(), hcaldqm::hashfunctions::hash_SubdetPMiphi(), SimpleHBHEPhase1Algo::hbminusCorrectionFactor(), hcalTransformedId(), HBHERecHit::idFront(), HcalText2DetIdConverter::init(), HcalDbHardcode::isHEPlan1(), HFClusterAlgo::makeCluster(), HcalDbHardcode::makeMCParam(), hcaldqm::hashfunctions::name_DChannel(), hcaldqm::hashfunctions::name_HBHEPartition(), hcaldqm::hashfunctions::name_HFPMiphi(), hcaldqm::hashfunctions::name_iphi(), hcaldqm::hashfunctions::name_Subdetiphi(), hcaldqm::hashfunctions::name_SubdetPMiphi(), HcalIsoTrkSimAnalyzer::newId(), HcalIsoTrkAnalyzer::newId(), AlCaHcalIsotrkProducer::newId(), TrackDetMatchInfo::nXnEnergy(), operator!=(), CastorDbASCIIIO::DetIdLess::operator()(), operator==(), otherForm(), HBHEHFLogicalMapEntry::printLMapLine(), HOHXLogicalMapEntry::printLMapLine(), PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::printNeighbourInfo(), HcalHitRelabeller::process(), AlCaHcalHBHEMuonProducer::produce(), HcalHardcodeCalibrations::produceChannelQuality(), HcalDigisValidation::reco(), HFStripFilter::runFilter(), sameBaseDetId(), HCalSD::setDetUnitId(), L1Analysis::L1AnalysisL1HO::SetHO(), HiPuRhoProducer::setupGeometryMap(), hcalCalib::Terminate(), HcalTrigTowerGeometry::towerIds(), CaloTowerConstituentsMap::towerOf(), and HcalUnpacker::unpackVME().

157  {
158  if (oldFormat())
159  return id_ & kHcalPhiMask1;
160  else
161  return id_ & kHcalPhiMask2;
162  }
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
constexpr bool oldFormat() const
Definition: HcalDetId.h:139
static constexpr uint32_t kHcalPhiMask1
Definition: HcalDetId.h:14
uint32_t id_
Definition: DetId.h:69

◆ maskDepth()

constexpr uint32_t HcalDetId::maskDepth ( ) const
inline

get the tower depth

Definition at line 180 of file HcalDetId.h.

References DetId::id_, kHcalDepthSet1, kHcalDepthSet2, and oldFormat().

180  {
181  if (oldFormat())
182  return (id_ | kHcalDepthSet1);
183  else
184  return (id_ | kHcalDepthSet2);
185  }
constexpr bool oldFormat() const
Definition: HcalDetId.h:139
static constexpr uint32_t kHcalDepthSet1
Definition: HcalDetId.h:26
static constexpr uint32_t kHcalDepthSet2
Definition: HcalDetId.h:27
uint32_t id_
Definition: DetId.h:69

◆ newForm() [1/2]

constexpr uint32_t HcalDetId::newForm ( ) const
inline

Definition at line 199 of file HcalDetId.h.

References DetId::id_, and newForm().

Referenced by HcalDigitizer::accumulateCaloHits(), HcalDetId(), newForm(), newFromOld(), operator=(), and otherForm().

199 { return newForm(id_); }
constexpr uint32_t newForm() const
Definition: HcalDetId.h:199
uint32_t id_
Definition: DetId.h:69

◆ newForm() [2/2]

static constexpr int32_t HcalDetId::newForm ( const uint32_t &  inpid)
inlinestatic

Definition at line 200 of file HcalDetId.h.

References PVValHelper::eta, kHcalDepthMask2, kHcalDepthOffset2, kHcalEtaOffset2, kHcalIdFormat2, kHcalIdMask, kHcalPhiMask2, kHcalZsideMask2, phi, and unpackId().

200  {
201  uint32_t rawid(inpid);
202  if ((rawid & kHcalIdFormat2) == 0) {
203  int zsid{0}, eta{0}, phi{0}, dep{0};
204  unpackId(rawid, zsid, eta, phi, dep);
205  rawid = inpid & kHcalIdMask;
206  rawid |= ((kHcalIdFormat2) | ((dep & kHcalDepthMask2) << kHcalDepthOffset2) |
207  ((zsid > 0) ? (kHcalZsideMask2 | (eta << kHcalEtaOffset2)) : ((eta) << kHcalEtaOffset2)) |
208  (phi & kHcalPhiMask2));
209  }
210  return rawid;
211  }
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
static constexpr void unpackId(const uint32_t &rawid, int &zsid, int &eta, int &phi, int &dep)
Definition: HcalDetId.h:278
static constexpr uint32_t kHcalZsideMask2
Definition: HcalDetId.h:21
static constexpr uint32_t kHcalIdMask
Definition: HcalDetId.h:29
static constexpr uint32_t kHcalDepthOffset2
Definition: HcalDetId.h:23
static constexpr uint32_t kHcalIdFormat2
Definition: HcalDetId.h:28
static constexpr uint32_t kHcalEtaOffset2
Definition: HcalDetId.h:17
static constexpr uint32_t kHcalDepthMask2
Definition: HcalDetId.h:25

◆ newFromOld()

constexpr void HcalDetId::newFromOld ( const uint32_t &  rawid)
inlineprivate

Definition at line 276 of file HcalDetId.h.

References DetId::id_, and newForm().

276 { id_ = newForm(rawid); }
constexpr uint32_t newForm() const
Definition: HcalDetId.h:199
uint32_t id_
Definition: DetId.h:69

◆ oldFormat()

constexpr bool HcalDetId::oldFormat ( ) const
inline

Definition at line 139 of file HcalDetId.h.

References DetId::id_, and kHcalIdFormat2.

Referenced by HcalDigitizer::accumulateCaloHits(), depth(), HcalTopology::down(), ietaAbs(), iphi(), maskDepth(), HcalTopology::north(), operator<(), otherForm(), HcalTopology::south(), HcalTopology::up(), and zside().

139 { return ((id_ & kHcalIdFormat2) == 0) ? (true) : (false); }
static constexpr uint32_t kHcalIdFormat2
Definition: HcalDetId.h:28
uint32_t id_
Definition: DetId.h:69

◆ operator!=()

constexpr bool HcalDetId::operator!= ( DetId  gen) const
inline

Definition at line 105 of file HcalDetId.h.

References depth(), PVValHelper::eta, DetId::id_, ietaAbs(), iphi(), kHcalIdMask, phi, mps_fire::result, unpackId(), and zside().

105  {
106  uint32_t rawid = gen.rawId();
107  if (rawid == id_)
108  return false;
109  int zsid{0}, eta{0}, phi{0}, dep{0};
110  unpackId(rawid, zsid, eta, phi, dep);
111  bool result = (((id_ & kHcalIdMask) != (rawid & kHcalIdMask)) || (zsid != zside()) || (eta != ietaAbs()) ||
112  (phi != iphi()) || (dep != depth()));
113  return result;
114  }
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
static constexpr void unpackId(const uint32_t &rawid, int &zsid, int &eta, int &phi, int &dep)
Definition: HcalDetId.h:278
static constexpr uint32_t kHcalIdMask
Definition: HcalDetId.h:29
uint32_t id_
Definition: DetId.h:69
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ operator<()

constexpr bool HcalDetId::operator< ( DetId  gen) const
inline

Definition at line 116 of file HcalDetId.h.

References PVValHelper::eta, DetId::id_, kHcalDepthMask1, kHcalDepthMask2, kHcalDepthOffset1, kHcalDepthOffset2, kHcalEtaOffset1, kHcalEtaOffset2, kHcalIdFormat2, kHcalIdMask, kHcalPhiMask1, kHcalPhiMask2, kHcalZsideMask1, kHcalZsideMask2, oldFormat(), phi, and unpackId().

116  {
117  uint32_t rawid = gen.rawId();
118  if ((rawid & kHcalIdFormat2) == (id_ & kHcalIdFormat2)) {
119  return id_ < rawid;
120  } else {
121  int zsid{0}, eta{0}, phi{0}, dep{0};
122  unpackId(rawid, zsid, eta, phi, dep);
123  rawid &= kHcalIdMask;
124  if (oldFormat()) {
125  rawid |= (((dep & kHcalDepthMask1) << kHcalDepthOffset1) |
126  ((zsid > 0) ? (kHcalZsideMask1 | (eta << kHcalEtaOffset1)) : ((eta) << kHcalEtaOffset1)) |
127  (phi & kHcalPhiMask1));
128  } else {
129  rawid |= ((kHcalIdFormat2) | ((dep & kHcalDepthMask2) << kHcalDepthOffset2) |
130  ((zsid > 0) ? (kHcalZsideMask2 | (eta << kHcalEtaOffset2)) : ((eta) << kHcalEtaOffset2)) |
131  (phi & kHcalPhiMask2));
132  }
133  return (id_ < rawid);
134  }
135  }
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
static constexpr uint32_t kHcalZsideMask1
Definition: HcalDetId.h:20
constexpr bool oldFormat() const
Definition: HcalDetId.h:139
static constexpr void unpackId(const uint32_t &rawid, int &zsid, int &eta, int &phi, int &dep)
Definition: HcalDetId.h:278
static constexpr uint32_t kHcalPhiMask1
Definition: HcalDetId.h:14
static constexpr uint32_t kHcalZsideMask2
Definition: HcalDetId.h:21
static constexpr uint32_t kHcalDepthMask1
Definition: HcalDetId.h:24
static constexpr uint32_t kHcalIdMask
Definition: HcalDetId.h:29
static constexpr uint32_t kHcalDepthOffset2
Definition: HcalDetId.h:23
static constexpr uint32_t kHcalIdFormat2
Definition: HcalDetId.h:28
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t kHcalEtaOffset1
Definition: HcalDetId.h:16
static constexpr uint32_t kHcalEtaOffset2
Definition: HcalDetId.h:17
static constexpr uint32_t kHcalDepthMask2
Definition: HcalDetId.h:25
static constexpr uint32_t kHcalDepthOffset1
Definition: HcalDetId.h:22

◆ operator=()

constexpr HcalDetId& HcalDetId::operator= ( const DetId gen)
inline

Assignment from a generic cell id

Definition at line 75 of file HcalDetId.h.

References TauDecayModes::dec, Exception, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, DetId::id_, newForm(), and subdet().

75  {
76  if (!gen.null()) {
77  HcalSubdetector subdet = (HcalSubdetector(gen.subdetId()));
78  if (gen.det() != Hcal || (subdet != HcalBarrel && subdet != HcalEndcap && subdet != HcalOuter &&
80  throw cms::Exception("Invalid DetId") << "Cannot assign HcalDetId from " << std::hex << gen.rawId() << std::dec;
81  }
82  if ((subdet == HcalBarrel) || (subdet == HcalEndcap) || (subdet == HcalOuter) || (subdet == HcalForward)) {
83  id_ = newForm(gen.rawId());
84  } else {
85  id_ = gen.rawId();
86  }
87  } else {
88  id_ = gen.rawId();
89  }
90  return (*this);
91  }
constexpr uint32_t newForm() const
Definition: HcalDetId.h:199
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalSubdetector
Definition: HcalAssistant.h:31
uint32_t id_
Definition: DetId.h:69

◆ operator==()

constexpr bool HcalDetId::operator== ( DetId  gen) const
inline

Comparison operator

Definition at line 94 of file HcalDetId.h.

References depth(), PVValHelper::eta, DetId::id_, ietaAbs(), iphi(), kHcalIdMask, phi, mps_fire::result, unpackId(), and zside().

94  {
95  uint32_t rawid = gen.rawId();
96  if (rawid == id_)
97  return true;
98  int zsid{0}, eta{0}, phi{0}, dep{0};
99  unpackId(rawid, zsid, eta, phi, dep);
100  bool result = (((id_ & kHcalIdMask) == (rawid & kHcalIdMask)) && (zsid == zside()) && (eta == ietaAbs()) &&
101  (phi == iphi()) && (dep == depth()));
102  return result;
103  }
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
static constexpr void unpackId(const uint32_t &rawid, int &zsid, int &eta, int &phi, int &dep)
Definition: HcalDetId.h:278
static constexpr uint32_t kHcalIdMask
Definition: HcalDetId.h:29
uint32_t id_
Definition: DetId.h:69
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ otherForm()

constexpr uint32_t HcalDetId::otherForm ( ) const
inline

change format

Definition at line 187 of file HcalDetId.h.

References depth(), DetId::id_, ieta(), iphi(), kHcalDepthMask1, kHcalDepthOffset1, kHcalEtaOffset1, kHcalIdMask, kHcalPhiMask1, kHcalZsideMask1, newForm(), and oldFormat().

Referenced by changeForm().

187  {
188  uint32_t rawid = (id_ & kHcalIdMask);
189  if (oldFormat()) {
190  rawid = newForm(id_);
191  } else {
192  rawid |= ((depth() & kHcalDepthMask1) << kHcalDepthOffset1) |
193  ((ieta() > 0) ? (kHcalZsideMask1 | (ieta() << kHcalEtaOffset1)) : ((-ieta()) << kHcalEtaOffset1)) |
194  (iphi() & kHcalPhiMask1);
195  }
196  return rawid;
197  }
static constexpr uint32_t kHcalZsideMask1
Definition: HcalDetId.h:20
constexpr bool oldFormat() const
Definition: HcalDetId.h:139
static constexpr uint32_t kHcalPhiMask1
Definition: HcalDetId.h:14
constexpr uint32_t newForm() const
Definition: HcalDetId.h:199
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
static constexpr uint32_t kHcalDepthMask1
Definition: HcalDetId.h:24
static constexpr uint32_t kHcalIdMask
Definition: HcalDetId.h:29
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t kHcalEtaOffset1
Definition: HcalDetId.h:16
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
static constexpr uint32_t kHcalDepthOffset1
Definition: HcalDetId.h:22
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ sameBaseDetId()

constexpr bool HcalDetId::sameBaseDetId ( const DetId gen) const
inline

base detId for HF dual channels

Definition at line 213 of file HcalDetId.h.

References PVValHelper::eta, HcalForward, hfdepth(), DetId::id_, ietaAbs(), iphi(), kHcalIdMask, phi, mps_fire::result, subdet(), unpackId(), and zside().

213  {
214  uint32_t rawid = gen.rawId();
215  if (rawid == id_)
216  return true;
217  int zsid{0}, eta{0}, phi{0}, dep{0};
218  if ((id_ & kHcalIdMask) != (rawid & kHcalIdMask))
219  return false;
220  unpackId(rawid, zsid, eta, phi, dep);
221  if (subdet() == HcalForward && dep > 2)
222  dep -= 2;
223  bool result = ((zsid == zside()) && (eta == ietaAbs()) && (phi == iphi()) && (dep == hfdepth()));
224  return result;
225  }
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
static constexpr void unpackId(const uint32_t &rawid, int &zsid, int &eta, int &phi, int &dep)
Definition: HcalDetId.h:278
constexpr int hfdepth() const
get full depth information for HF
Definition: HcalDetId.h:171
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
static constexpr uint32_t kHcalIdMask
Definition: HcalDetId.h:29
uint32_t id_
Definition: DetId.h:69
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157

◆ secondAnodeId()

constexpr HcalDetId HcalDetId::secondAnodeId ( ) const
inline

second PMT anode detId for HF dual channels

Definition at line 241 of file HcalDetId.h.

References depth(), PVValHelper::eta, HcalDetId(), HcalForward, DetId::id_, kHcalDepthMask2, kHcalDepthOffset2, kHcalEtaOffset2, kHcalIdFormat2, kHcalIdMask, kHcalPhiMask2, kHcalZsideMask2, phi, subdet(), and unpackId().

Referenced by HFPhase1Reconstructor::produce().

241  {
242  if (subdet() != HcalForward || depth() > 2) {
243  return HcalDetId(id_);
244  } else {
245  int zsid{0}, eta{0}, phi{0}, dep{0};
246  unpackId(id_, zsid, eta, phi, dep);
247  dep += 2;
248  uint32_t rawid = id_ & kHcalIdMask;
249  rawid |= (kHcalIdFormat2) | ((dep & kHcalDepthMask2) << kHcalDepthOffset2) |
250  ((zsid > 0) ? (kHcalZsideMask2 | (eta << kHcalEtaOffset2)) : ((eta) << kHcalEtaOffset2)) |
251  (phi & kHcalPhiMask2);
252  return HcalDetId(rawid);
253  }
254  }
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
static constexpr void unpackId(const uint32_t &rawid, int &zsid, int &eta, int &phi, int &dep)
Definition: HcalDetId.h:278
static constexpr uint32_t kHcalZsideMask2
Definition: HcalDetId.h:21
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
static constexpr uint32_t kHcalIdMask
Definition: HcalDetId.h:29
static constexpr uint32_t kHcalDepthOffset2
Definition: HcalDetId.h:23
static constexpr uint32_t kHcalIdFormat2
Definition: HcalDetId.h:28
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t kHcalEtaOffset2
Definition: HcalDetId.h:17
constexpr HcalDetId()
Definition: HcalDetId.h:33
static constexpr uint32_t kHcalDepthMask2
Definition: HcalDetId.h:25
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ subdet()

constexpr HcalSubdetector HcalDetId::subdet ( ) const
inline

get the subdetector

Definition at line 138 of file HcalDetId.h.

References DetId::subdetId().

Referenced by LaserTask::_dump(), HFRaddamTask::_process(), QIE10Task::_process(), PedestalTask::_process(), LEDTask::_process(), RecHitTask::_process(), DigiTask::_process(), UMNioTask::_process(), LaserTask::_process(), HcalMLTask::_process(), HcalDigitizer::accumulateCaloHits(), HcalGeometry::alignmentTransformIndexLocal(), JetToDigiDump::analyze(), CaloTowersValidation::analyze(), CaloTowersAnalyzer::analyze(), WriteL1TriggerObjectsTxt::analyze(), HcalSimHitsValidation::analyze(), HcalRecHitsValidation::analyze(), HcalTB06Analysis::analyze(), HcalHBHEMuonAnalyzer::analyze(), CMTRawAnalyzer::analyze(), AnalyzerMinbias::analyzeHcal(), RecAnalyzerMinbias::analyzeHcal(), HcalSimHitStudy::analyzeHits(), HcalSimHitCheck::analyzeHits(), HitParentTest::analyzeHits(), CaloSimHitAnalysis::analyzeHits(), CaloSimHitStudy::analyzeHits(), HGCalTB23Analyzer::analyzeSimHits(), HGCalTBAnalyzer::analyzeSimHits(), HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(), CaloTowersCreationAlgo::assignHitHcal(), baseDetId(), PhotonMVABasedHaloTagger::calmatchedHBHECoordForBothHypothesis(), reco::helper::JetIDHelper::classifyJetComponents(), reco::helper::JetIDHelper::classifyJetTowers(), CaloTowersCreationAlgo::convert(), HcalTimeSlewSim::delay(), HcalTopology::detId2denseId(), HcalTopology::detId2denseIdPreLS1(), spr::eHCALmatrix(), hcaldqm::RecoRunSummary::endJob(), hcaldqm::TPRunSummary::endJob(), hcaldqm::DigiRunSummary::endJob(), hcaldqm::DigiRunSummary::endLuminosityBlock(), ChannelPattern::Fill_by_hand(), CMTRawAnalyzer::fillDigiAmplitudeHFQIE10(), CMTRawAnalyzer::fillDigiAmplitudeQIE11(), CMTRawAnalyzer::fillDigiErrorsHFQIE10(), CMTRawAnalyzer::fillDigiErrorsQIE11(), HcalObjRepresent::fillOneGain(), CaloParticleDebugger::fillSimHits(), CaloTruthAccumulator::fillSimHits(), HLTHcalLaserMisfireFilter::filter(), HcalLaserHBHEFilter2012::filter(), HcalLaserHBHEHFFilter2012::filter(), hcaldqm::quantity::getBin_depth(), hcaldqm::quantity::getBin_Subdet(), HcalChannelIterator::getHcalSubdetector(), spr::getHotCell(), HBHERecHit::getMergedIds(), HCALConfigDB::getOnlineLUT(), HCALConfigDB::getOnlineLUTFromXML(), CaloTowersCreationAlgo::getThresholdAndWeight(), hcaldqm::quantity::getValue_ieta(), hcaldqm::quantity::getValue_Subdet(), hcaldqm::quantity::getValue_SubdetPM(), HcalDetIdTableProducer::globalBeginRunProduce(), HcalMLTask::globalEndLuminosityBlock(), HcalHBHEMuonAnalyzer::goodCell(), HcalHBHEMuonHighEtaAnalyzer::goodCell(), AlCaHcalHBHEMuonProducer::goodCell(), CaloTowersCreationAlgo::hadShwrPos(), egamma::hasActiveHcal(), hcaldqm::hashfunctions::hash_depth(), hcaldqm::hashfunctions::hash_Subdet(), hcaldqm::hashfunctions::hash_Subdetdepth(), hcaldqm::hashfunctions::hash_Subdetieta(), hcaldqm::hashfunctions::hash_Subdetiphi(), hcaldqm::hashfunctions::hash_SubdetPM(), hcaldqm::hashfunctions::hash_SubdetPMiphi(), SimpleHBHEPhase1Algo::hbminusCorrectionFactor(), HcalDetId(), hcalTransformedId(), hfdepth(), HBHERecHit::idFront(), HcalGeometry::localCorners(), HcalDbHardcode::makeHardcodeFrontEndMap(), CaloTowersCreationAlgo::makeHcalDropChMap(), SignCaloSpecificAlgo::makeVectorOutOfCaloTowers(), hcaldqm::hashfunctions::name_DChannel(), hcaldqm::hashfunctions::name_depth(), hcaldqm::hashfunctions::name_Subdet(), hcaldqm::hashfunctions::name_Subdetdepth(), hcaldqm::hashfunctions::name_Subdetieta(), hcaldqm::hashfunctions::name_Subdetiphi(), hcaldqm::hashfunctions::name_SubdetPM(), hcaldqm::hashfunctions::name_SubdetPMiphi(), HcalIsoTrkSimAnalyzer::newId(), HcalIsoTrkAnalyzer::newId(), AlCaHcalIsotrkProducer::newId(), operator=(), HBHEHFLogicalMapEntry::printLMapLine(), HOHXLogicalMapEntry::printLMapLine(), HcalHitRelabeller::process(), HBHEPhase1Reconstructor::processData(), AlCaHcalHBHEMuonProducer::produce(), HcalDigiSortedTableProducer::produce(), HcalDigisValidation::reco(), CaloTowersCreationAlgo::rescale(), CaloTowersCreationAlgo::rescaleTowers(), sameBaseDetId(), secondAnodeId(), HcalSimParameterMap::setFrameSize(), HcalZSAlgoRealistic::shouldKeep(), HcalTBSimParameterMap::simParameters(), HcalSimParameterMap::simParameters(), hcalCalib::Terminate(), HcalTrigTowerGeometry::towerIds(), CaloTowerConstituentsMap::towerOf(), HcaluLUTTPGCoder::update(), CaloSpecificAlgo::update_HadEtInHB_HadEtInHE_HadEtInHO_HadEtInHF_EmEtInHF(), CaloSpecificAlgo::update_MaxTowerEm_MaxTowerHad(), CaloSpecificAlgo::update_sumEtInpHF_MExInpHF_MEyInpHF_sumEtInmHF_MExInmHF_MEyInmHF(), and CaloSpecificAlgo::update_totalEt_totalEm().

138 { return (HcalSubdetector)(subdetId()); }
HcalSubdetector
Definition: HcalAssistant.h:31
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ unpackId()

static constexpr void HcalDetId::unpackId ( const uint32_t &  rawid,
int &  zsid,
int &  eta,
int &  phi,
int &  dep 
)
inlinestaticprivate

Definition at line 278 of file HcalDetId.h.

References PVValHelper::eta, kHcalDepthMask1, kHcalDepthMask2, kHcalDepthOffset1, kHcalDepthOffset2, kHcalEtaMask1, kHcalEtaMask2, kHcalEtaOffset1, kHcalEtaOffset2, kHcalIdFormat2, kHcalPhiMask1, kHcalPhiMask2, kHcalZsideMask1, kHcalZsideMask2, and phi.

Referenced by baseDetId(), newForm(), operator!=(), operator<(), operator==(), sameBaseDetId(), and secondAnodeId().

278  {
279  if ((rawid & kHcalIdFormat2) == 0) {
280  zsid = (rawid & kHcalZsideMask1) ? (1) : (-1);
281  eta = (rawid >> kHcalEtaOffset1) & kHcalEtaMask1;
282  phi = rawid & kHcalPhiMask1;
283  dep = (rawid >> kHcalDepthOffset1) & kHcalDepthMask1;
284  } else {
285  zsid = (rawid & kHcalZsideMask2) ? (1) : (-1);
286  eta = (rawid >> kHcalEtaOffset2) & kHcalEtaMask2;
287  phi = rawid & kHcalPhiMask2;
288  dep = (rawid >> kHcalDepthOffset2) & kHcalDepthMask2;
289  }
290  }
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
static constexpr uint32_t kHcalZsideMask1
Definition: HcalDetId.h:20
static constexpr uint32_t kHcalPhiMask1
Definition: HcalDetId.h:14
static constexpr uint32_t kHcalZsideMask2
Definition: HcalDetId.h:21
static constexpr uint32_t kHcalDepthMask1
Definition: HcalDetId.h:24
static constexpr uint32_t kHcalEtaMask2
Definition: HcalDetId.h:19
static constexpr uint32_t kHcalDepthOffset2
Definition: HcalDetId.h:23
static constexpr uint32_t kHcalIdFormat2
Definition: HcalDetId.h:28
static constexpr uint32_t kHcalEtaOffset1
Definition: HcalDetId.h:16
static constexpr uint32_t kHcalEtaOffset2
Definition: HcalDetId.h:17
static constexpr uint32_t kHcalEtaMask1
Definition: HcalDetId.h:18
static constexpr uint32_t kHcalDepthMask2
Definition: HcalDetId.h:25
static constexpr uint32_t kHcalDepthOffset1
Definition: HcalDetId.h:22

◆ zside()

constexpr int HcalDetId::zside ( ) const
inline

get the z-side of the cell (1/-1)

Definition at line 141 of file HcalDetId.h.

References DetId::id_, kHcalZsideMask1, kHcalZsideMask2, and oldFormat().

Referenced by CaloTowerConstituentsMap::constituentsOf(), crystal_ieta_high(), crystal_ieta_low(), HcalTopology::detId2denseIdHB(), HcalTopology::detId2denseIdHE(), HcalTopology::detId2denseIdHF(), HcalTopology::detId2denseIdHO(), HcalTopology::detId2denseIdPreLS1(), ChannelPattern::Fill_by_hand(), HCalSD::getEnergyDeposit(), HCALConfigDB::getOnlineLUT(), HCALConfigDB::getOnlineLUTFromXML(), HcalDbHardcode::getParameters(), ALPAKA_ACCELERATOR_NAMESPACE::particleFlowRecHitProducer::HCAL::getZside(), ieta(), HcalDbHardcode::isHEPlan1(), HFClusterAlgo::makeCluster(), HcalIsoTrkSimAnalyzer::newId(), HcalIsoTrkAnalyzer::newId(), AlCaHcalIsotrkProducer::newId(), operator!=(), CastorDbASCIIIO::DetIdLess::operator()(), operator==(), HBHEHFLogicalMapEntry::printLMapLine(), HOHXLogicalMapEntry::printLMapLine(), HcalHitRelabeller::process(), sameBaseDetId(), HCalSD::setDetUnitId(), HcalTrigTowerGeometry::towerIds(), CaloTowerConstituentsMap::towerOf(), and hgcal::RecHitTools::zside().

141  {
142  if (oldFormat())
143  return (id_ & kHcalZsideMask1) ? (1) : (-1);
144  else
145  return (id_ & kHcalZsideMask2) ? (1) : (-1);
146  }
static constexpr uint32_t kHcalZsideMask1
Definition: HcalDetId.h:20
constexpr bool oldFormat() const
Definition: HcalDetId.h:139
static constexpr uint32_t kHcalZsideMask2
Definition: HcalDetId.h:21
uint32_t id_
Definition: DetId.h:69

Member Data Documentation

◆ kHcalDepthMask1

constexpr uint32_t HcalDetId::kHcalDepthMask1 = 0x1F
static

Definition at line 24 of file HcalDetId.h.

Referenced by depth(), operator<(), otherForm(), and unpackId().

◆ kHcalDepthMask2

constexpr uint32_t HcalDetId::kHcalDepthMask2 = 0xF
static

◆ kHcalDepthOffset1

constexpr uint32_t HcalDetId::kHcalDepthOffset1 = 14
static

◆ kHcalDepthOffset2

constexpr uint32_t HcalDetId::kHcalDepthOffset2 = 20
static

Definition at line 23 of file HcalDetId.h.

Referenced by baseDetId(), depth(), HcalDetId(), newForm(), operator<(), secondAnodeId(), and unpackId().

◆ kHcalDepthSet1

constexpr uint32_t HcalDetId::kHcalDepthSet1 = 0x1C000
static

Definition at line 26 of file HcalDetId.h.

Referenced by maskDepth().

◆ kHcalDepthSet2

constexpr uint32_t HcalDetId::kHcalDepthSet2 = 0xF00000
static

Definition at line 27 of file HcalDetId.h.

Referenced by maskDepth().

◆ kHcalEtaMask1

constexpr uint32_t HcalDetId::kHcalEtaMask1 = 0x3F
static

◆ kHcalEtaMask2

constexpr uint32_t HcalDetId::kHcalEtaMask2 = 0x1FF
static

◆ kHcalEtaOffset1

constexpr uint32_t HcalDetId::kHcalEtaOffset1 = 7
static

◆ kHcalEtaOffset2

constexpr uint32_t HcalDetId::kHcalEtaOffset2 = 10
static

Definition at line 17 of file HcalDetId.h.

Referenced by baseDetId(), HcalDetId(), ietaAbs(), newForm(), operator<(), secondAnodeId(), and unpackId().

◆ kHcalIdFormat2

constexpr uint32_t HcalDetId::kHcalIdFormat2 = 0x1000000
static

Definition at line 28 of file HcalDetId.h.

Referenced by baseDetId(), HcalDetId(), newForm(), oldFormat(), operator<(), secondAnodeId(), and unpackId().

◆ kHcalIdMask

constexpr uint32_t HcalDetId::kHcalIdMask = 0xFE000000
static

◆ kHcalPhiMask1

constexpr uint32_t HcalDetId::kHcalPhiMask1 = 0x7F
static

◆ kHcalPhiMask2

constexpr uint32_t HcalDetId::kHcalPhiMask2 = 0x3FF
static

◆ kHcalZsideMask1

constexpr uint32_t HcalDetId::kHcalZsideMask1 = 0x2000
static

Definition at line 20 of file HcalDetId.h.

Referenced by AHCalDetId::AHCalDetId(), operator<(), otherForm(), unpackId(), and zside().

◆ kHcalZsideMask2

constexpr uint32_t HcalDetId::kHcalZsideMask2 = 0x80000
static

◆ Undefined

const HcalDetId HcalDetId::Undefined
static