CMS 3D CMS Logo

List of all members | Public Member Functions
CaloGenericDetId Class Reference

#include <CaloGenericDetId.h>

Inheritance diagram for CaloGenericDetId:
DetId

Public Member Functions

 CaloGenericDetId (uint32_t rawid)
 
 CaloGenericDetId (const DetId &id)
 
 CaloGenericDetId (DetId::Detector iDet, int iSub, uint32_t iDenseIndex)
 
uint32_t denseIndex () const
 
bool isCalo () const
 
bool isCaloTower () const
 
bool isCastor () const
 
bool isEB () const
 
bool isEcal () const
 
bool isEE () const
 
bool isES () const
 
bool isHcal () const
 
bool isZDC () const
 
uint32_t sizeForDenseIndexing () const
 
bool validDetId () const
 
- 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...
 

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
}
 
- 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
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 12 of file CaloGenericDetId.h.

Constructor & Destructor Documentation

◆ CaloGenericDetId() [1/3]

CaloGenericDetId::CaloGenericDetId ( uint32_t  rawid)
inline

Definition at line 15 of file CaloGenericDetId.h.

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

◆ CaloGenericDetId() [2/3]

CaloGenericDetId::CaloGenericDetId ( const DetId id)
inline

Definition at line 17 of file CaloGenericDetId.h.

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

◆ CaloGenericDetId() [3/3]

CaloGenericDetId::CaloGenericDetId ( DetId::Detector  iDet,
int  iSub,
uint32_t  iDenseIndex 
)

Definition at line 6 of file CaloGenericDetId.cc.

References ESDetId::detIdFromDenseIndex(), HcalCastorDetId::detIdFromDenseIndex(), EBDetId::detIdFromDenseIndex(), HcalZDCDetId::detIdFromDenseIndex(), EEDetId::detIdFromDenseIndex(), Exception, DetId::id_, isCaloTower(), isCastor(), isEB(), isEE(), isES(), isHcal(), isZDC(), and DetId::rawId().

6  : DetId(iDet, iSub) {
7  if (isHcal()) {
8  edm::LogError("CaloGenericDetIdError") << "No support for HB/HE/HO/HF in CaloGenericDetId";
9  throw cms::Exception("No support");
10  } else if (isCaloTower()) {
11  edm::LogError("CaloGenericDetIdError") << "No support for CaloTower in CaloGenericDetId";
12  throw cms::Exception("No support");
13  } else {
14  id_ =
15  (isEB()
20  : (isCastor() ? HcalCastorDetId::detIdFromDenseIndex(iDin).rawId() : 0)))));
21  }
22 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
static constexpr HcalZDCDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalZDCDetId.h:145
Log< level::Error, false > LogError
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
bool isES() const
bool isHcal() const
bool isCaloTower() const
static ESDetId detIdFromDenseIndex(uint32_t din)
Definition: ESDetId.h:55
bool isEB() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
uint32_t id_
Definition: DetId.h:69
bool isEE() const
bool isCastor() const
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
bool isZDC() const

Member Function Documentation

◆ denseIndex()

uint32_t CaloGenericDetId::denseIndex ( ) const

Definition at line 24 of file CaloGenericDetId.cc.

References Exception, isCaloTower(), isCastor(), isEB(), isEE(), isES(), isHcal(), isZDC(), and DetId::rawId().

Referenced by CaloSubdetectorGeometry::indexFor(), ZdcGeometry::newCell(), CastorGeometry::newCell(), and EcalPreshowerGeometry::present().

24  {
25  if (isHcal()) {
26  edm::LogError("CaloGenericDetIdError") << "No support for HB/HE/HO/HF in CaloGenericDetId";
27  throw cms::Exception("No support");
28  } else if (isCaloTower()) {
29  edm::LogError("CaloGenericDetIdError") << "No support for CaloTower in CaloGenericDetId";
30  throw cms::Exception("No support");
31  }
32 
33  return (isEB() ? EBDetId(rawId()).denseIndex()
34  : (isEE() ? EEDetId(rawId()).denseIndex()
35  : (isES() ? ESDetId(rawId()).denseIndex()
37  : (isCastor() ? HcalCastorDetId(rawId()).denseIndex() : ~0)))));
38 }
uint32_t denseIndex() const
Log< level::Error, false > LogError
bool isES() const
bool isHcal() const
bool isCaloTower() const
bool isEB() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool isEE() const
bool isCastor() const
bool isZDC() const

◆ isCalo()

bool CaloGenericDetId::isCalo ( ) const
inline

Definition at line 32 of file CaloGenericDetId.h.

References DetId::Calo, and DetId::det().

Referenced by isCaloTower(), isCastor(), and isZDC().

32 { return det() == DetId::Calo; }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46

◆ isCaloTower()

bool CaloGenericDetId::isCaloTower ( ) const
inline

Definition at line 36 of file CaloGenericDetId.h.

References isCalo(), CaloTowerDetId::SubdetId, and DetId::subdetId().

Referenced by CaloTowerGeometry::alignmentTransformIndexLocal(), CaloGenericDetId(), denseIndex(), CaloTowerGeometry::newCell(), sizeForDenseIndexing(), and validDetId().

36 { return isCalo() && subdetId() == CaloTowerDetId::SubdetId; }
static const int SubdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
bool isCalo() const

◆ isCastor()

bool CaloGenericDetId::isCastor ( ) const
inline

Definition at line 35 of file CaloGenericDetId.h.

References isCalo(), HcalCastorDetId::SubdetectorId, and DetId::subdetId().

Referenced by CastorGeometry::alignmentTransformIndexLocal(), CaloGenericDetId(), denseIndex(), CastorGeometry::newCell(), sizeForDenseIndexing(), and validDetId().

constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const int SubdetectorId
bool isCalo() const

◆ isEB()

bool CaloGenericDetId::isEB ( ) const
inline

Definition at line 29 of file CaloGenericDetId.h.

References isEcal(), EBDetId::Subdet, and DetId::subdetId().

Referenced by Electron.Electron::absIsoWithFSR(), EcalBarrelGeometry::alignmentTransformIndexLocal(), CaloGenericDetId(), denseIndex(), sizeForDenseIndexing(), and validDetId().

29 { return isEcal() && subdetId() == EBDetId::Subdet; }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
bool isEcal() const

◆ isEcal()

bool CaloGenericDetId::isEcal ( ) const
inline

Definition at line 28 of file CaloGenericDetId.h.

References DetId::det(), and DetId::Ecal.

Referenced by isEB(), isEE(), and isES().

28 { return det() == DetId::Ecal; }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46

◆ isEE()

bool CaloGenericDetId::isEE ( ) const
inline

Definition at line 30 of file CaloGenericDetId.h.

References isEcal(), EEDetId::Subdet, and DetId::subdetId().

Referenced by EcalEndcapGeometry::alignmentTransformIndexLocal(), CaloGenericDetId(), denseIndex(), sizeForDenseIndexing(), and validDetId().

30 { return isEcal() && subdetId() == EEDetId::Subdet; }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
bool isEcal() const

◆ isES()

bool CaloGenericDetId::isES ( ) const
inline

Definition at line 31 of file CaloGenericDetId.h.

References isEcal(), ESDetId::Subdet, and DetId::subdetId().

Referenced by EcalPreshowerGeometry::alignmentTransformIndexLocal(), CaloGenericDetId(), denseIndex(), sizeForDenseIndexing(), and validDetId().

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

◆ isHcal()

bool CaloGenericDetId::isHcal ( ) const
inline

Definition at line 33 of file CaloGenericDetId.h.

References DetId::det(), and DetId::Hcal.

Referenced by CaloGenericDetId(), denseIndex(), sizeForDenseIndexing(), and validDetId().

33 { return det() == DetId::Hcal; }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46

◆ isZDC()

bool CaloGenericDetId::isZDC ( ) const
inline

Definition at line 34 of file CaloGenericDetId.h.

References isCalo(), HcalZDCDetId::SubdetectorId, and DetId::subdetId().

Referenced by ZdcGeometry::alignmentTransformIndexLocal(), CaloGenericDetId(), denseIndex(), ZdcGeometry::newCell(), sizeForDenseIndexing(), and validDetId().

34 { return isCalo() && subdetId() == HcalZDCDetId::SubdetectorId; }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr int32_t SubdetectorId
Definition: HcalZDCDetId.h:35
bool isCalo() const

◆ sizeForDenseIndexing()

uint32_t CaloGenericDetId::sizeForDenseIndexing ( ) const

Definition at line 40 of file CaloGenericDetId.cc.

References Exception, isCaloTower(), isCastor(), isEB(), isEE(), isES(), isHcal(), isZDC(), HcalCastorDetId::kSizeForDenseIndexing, ESDetId::kSizeForDenseIndexing, EBDetId::kSizeForDenseIndexing, HcalZDCDetId::kSizeForDenseIndexing, and EEDetId::kSizeForDenseIndexing.

Referenced by CaloSubdetectorGeometry::sizeForDenseIndex().

40  {
41  if (isHcal()) {
42  edm::LogError("CaloGenericDetIdError") << "No support for HB/HE/HO/HF in CaloGenericDetId";
43  throw cms::Exception("No support");
44  } else if (isCaloTower()) {
45  edm::LogError("CaloGenericDetIdError") << "No support for CaloTower in CaloGenericDetId";
46  throw cms::Exception("No support");
47  }
48 
54 }
Log< level::Error, false > LogError
bool isES() const
bool isHcal() const
bool isCaloTower() const
bool isEB() const
bool isEE() const
bool isCastor() const
bool isZDC() const

◆ validDetId()

bool CaloGenericDetId::validDetId ( ) const

Definition at line 56 of file CaloGenericDetId.cc.

References HcalZDCDetId::channel(), Exception, EBDetId::ieta(), EBDetId::iphi(), isCaloTower(), isCastor(), isEB(), isEE(), isES(), isHcal(), isZDC(), EEDetId::ix(), EEDetId::iy(), HcalCastorDetId::module(), ESDetId::plane(), DetId::rawId(), HcalCastorDetId::section(), HcalZDCDetId::section(), HcalCastorDetId::sector(), ESDetId::six(), ESDetId::siy(), ESDetId::strip(), ESDetId::validDetId(), HcalCastorDetId::validDetId(), EBDetId::validDetId(), HcalZDCDetId::validDetId(), EEDetId::validDetId(), ESDetId::zside(), HcalCastorDetId::zside(), and EEDetId::zside().

56  {
57  bool returnValue(false);
58  if (isEB()) {
59  const EBDetId ebid(rawId());
60  returnValue = EBDetId::validDetId(ebid.ieta(), ebid.iphi());
61  } else if (isEE()) {
62  const EEDetId eeid(rawId());
63  returnValue = EEDetId::validDetId(eeid.ix(), eeid.iy(), eeid.zside());
64  } else if (isES()) {
65  const ESDetId esid(rawId());
66  returnValue = ESDetId::validDetId(esid.strip(), esid.six(), esid.siy(), esid.plane(), esid.zside());
67  } else if (isHcal()) {
68  edm::LogError("CaloGenericDetIdError") << "No support for HB/HE/HO/HF in CaloGenericDetId";
69  throw cms::Exception("No support");
70 
71  returnValue = false;
72  } else if (isZDC()) {
73  const HcalZDCDetId zdid(rawId());
74  returnValue = HcalZDCDetId::validDetId(zdid.section(), zdid.channel());
75  } else if (isCastor()) {
76  const HcalCastorDetId zdid(rawId());
77  returnValue = HcalCastorDetId::validDetId(zdid.section(), zdid.zside() > 0, zdid.sector(), zdid.module());
78  } else if (isCaloTower()) {
79  edm::LogError("CaloGenericDetIdError") << "No support for CaloTower in CaloGenericDetId";
80  throw cms::Exception("No support");
81 
82  returnValue = false;
83  }
84 
85  return returnValue;
86 }
static bool validDetId(Section iSection, bool posEta, int iSector, int iMod)
Log< level::Error, false > LogError
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
bool isES() const
bool isHcal() const
bool isCaloTower() const
static constexpr bool validDetId(Section se, int32_t dp)
Definition: HcalZDCDetId.h:166
bool isEB() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:15
bool isEE() const
bool isCastor() const
bool isZDC() const