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 (const DetId &id)
 
 CaloGenericDetId (DetId::Detector iDet, int iSub, uint32_t iDenseIndex)
 
 CaloGenericDetId (uint32_t rawid)
 
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 (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. 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) {}

◆ CaloGenericDetId() [2/3]

CaloGenericDetId::CaloGenericDetId ( const DetId id)
inline

Definition at line 17 of file CaloGenericDetId.h.

17 : DetId(id) {}

◆ CaloGenericDetId() [3/3]

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

Definition at line 6 of file CaloGenericDetId.cc.

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 }

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

Member Function Documentation

◆ denseIndex()

uint32_t CaloGenericDetId::denseIndex ( ) const

Definition at line 24 of file CaloGenericDetId.cc.

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 }

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

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

◆ isCalo()

bool CaloGenericDetId::isCalo ( ) const
inline

Definition at line 32 of file CaloGenericDetId.h.

32 { return det() == DetId::Calo; }

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

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

◆ isCaloTower()

bool CaloGenericDetId::isCaloTower ( ) const
inline

◆ isCastor()

bool CaloGenericDetId::isCastor ( ) const
inline

◆ isEB()

bool CaloGenericDetId::isEB ( ) const
inline

◆ isEcal()

bool CaloGenericDetId::isEcal ( ) const
inline

Definition at line 28 of file CaloGenericDetId.h.

28 { return det() == DetId::Ecal; }

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

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

◆ isEE()

bool CaloGenericDetId::isEE ( ) const
inline

◆ isES()

bool CaloGenericDetId::isES ( ) const
inline

◆ isHcal()

bool CaloGenericDetId::isHcal ( ) const
inline

Definition at line 33 of file CaloGenericDetId.h.

33 { return det() == DetId::Hcal; }

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

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

◆ isZDC()

bool CaloGenericDetId::isZDC ( ) const
inline

◆ sizeForDenseIndexing()

uint32_t CaloGenericDetId::sizeForDenseIndexing ( ) const

Definition at line 40 of file CaloGenericDetId.cc.

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 }

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

Referenced by CaloSubdetectorGeometry::sizeForDenseIndex().

◆ validDetId()

bool CaloGenericDetId::validDetId ( ) const

Definition at line 56 of file CaloGenericDetId.cc.

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 }

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(), HcalZDCDetId::section(), HcalCastorDetId::section(), HcalCastorDetId::sector(), ESDetId::six(), ESDetId::siy(), ESDetId::strip(), HcalZDCDetId::validDetId(), ESDetId::validDetId(), HcalCastorDetId::validDetId(), EBDetId::validDetId(), EEDetId::validDetId(), ESDetId::zside(), HcalCastorDetId::zside(), and EEDetId::zside().

HcalZDCDetId::detIdFromDenseIndex
static HcalZDCDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalZDCDetId.cc:80
HcalCastorDetId::validDetId
static bool validDetId(Section iSection, bool posEta, int iSector, int iMod)
Definition: HcalCastorDetId.cc:69
CaloGenericDetId::isCaloTower
bool isCaloTower() const
Definition: CaloGenericDetId.h:36
EBDetId
Definition: EBDetId.h:17
CaloGenericDetId::isES
bool isES() const
Definition: CaloGenericDetId.h:31
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
DetId::Hcal
Definition: DetId.h:28
CaloGenericDetId::isEcal
bool isEcal() const
Definition: CaloGenericDetId.h:28
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalCastorDetId.h:28
ESDetId
Definition: ESDetId.h:15
CaloTowerDetId::SubdetId
static const int SubdetId
Definition: CaloTowerDetId.h:34
DetId::Calo
Definition: DetId.h:29
HcalZDCDetId::validDetId
static bool validDetId(Section se, int dp)
Definition: HcalZDCDetId.cc:101
CaloGenericDetId::isEB
bool isEB() const
Definition: CaloGenericDetId.h:29
CaloGenericDetId::isEE
bool isEE() const
Definition: CaloGenericDetId.h:30
EEDetId::detIdFromDenseIndex
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
HcalZDCDetId
Definition: HcalZDCDetId.h:16
HcalCastorDetId::detIdFromDenseIndex
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalCastorDetId.cc:73
EEDetId::kSizeForDenseIndexing
Definition: EEDetId.h:329
CaloGenericDetId::isZDC
bool isZDC() const
Definition: CaloGenericDetId.h:34
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
EEDetId
Definition: EEDetId.h:14
ESDetId::kSizeForDenseIndexing
Definition: ESDetId.h:102
HcalCastorDetId
Definition: HcalCastorDetId.h:23
CaloGenericDetId::isCalo
bool isCalo() const
Definition: CaloGenericDetId.h:32
CaloGenericDetId::isCastor
bool isCastor() const
Definition: CaloGenericDetId.h:35
ESDetId::detIdFromDenseIndex
static ESDetId detIdFromDenseIndex(uint32_t din)
Definition: ESDetId.h:55
DetId::id_
uint32_t id_
Definition: DetId.h:69
HcalZDCDetId::kSizeForDenseIndexing
Definition: HcalZDCDetId.h:66
EBDetId::detIdFromDenseIndex
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:107
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DetId::Ecal
Definition: DetId.h:27
EBDetId::validDetId
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
EBDetId::Subdet
Definition: EBDetId.h:19
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CaloGenericDetId::denseIndex
uint32_t denseIndex() const
Definition: CaloGenericDetId.cc:24
ESDetId::validDetId
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:15
EBDetId::kSizeForDenseIndexing
Definition: EBDetId.h:155
Exception
Definition: hltDiff.cc:245
HcalCastorDetId::kSizeForDenseIndexing
Definition: HcalCastorDetId.h:71
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
EEDetId::Subdet
Definition: EEDetId.h:19
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
CaloGenericDetId::isHcal
bool isHcal() const
Definition: CaloGenericDetId.h:33
ESDetId::Subdet
Definition: ESDetId.h:17