CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
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
}
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
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::CaloGenericDetId ( uint32_t  rawid)
inline

Definition at line 16 of file CaloGenericDetId.h.

16 : DetId( rawid ) {}
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
CaloGenericDetId::CaloGenericDetId ( const DetId id)
inline

Definition at line 18 of file CaloGenericDetId.h.

18 : DetId ( id ) {}
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
CaloGenericDetId::CaloGenericDetId ( DetId::Detector  iDet,
int  iSub,
uint32_t  iDenseIndex 
)

Definition at line 5 of file CaloGenericDetId.cc.

References dtNoiseDBValidation_cfg::cerr, DetId::det(), CaloTowerDetId::detIdFromDenseIndex(), HcalZDCDetId::detIdFromDenseIndex(), ESDetId::detIdFromDenseIndex(), HcalCastorDetId::detIdFromDenseIndex(), EBDetId::detIdFromDenseIndex(), EEDetId::detIdFromDenseIndex(), edm::hlt::Exception, DetId::Hcal, DetId::id_, isCaloTower(), isCastor(), isEB(), isEE(), isES(), isZDC(), and DetId::rawId().

7  : DetId( iDet, iSub )
8 {
9  if (det() == DetId::Hcal) {
10  std::cerr << "No support for HB/HE/HO/HF in CaloGenericDetId" << std::endl;
11  throw cms::Exception("No support");
12  } else {
13 
14  id_ = ( isEB() ? EBDetId::detIdFromDenseIndex( iDin ).rawId() :
15  ( isEE() ? EEDetId::detIdFromDenseIndex( iDin ).rawId() :
16  ( isES() ? ESDetId::detIdFromDenseIndex( iDin ).rawId() :
19  ( isCaloTower() ? CaloTowerDetId::detIdFromDenseIndex( iDin ).rawId() : 0 ) ) ) ) ) );
20  }
21 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:221
bool isCaloTower() const
bool isCastor() const
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
static CaloTowerDetId detIdFromDenseIndex(uint32_t din)
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:112
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
bool isEB() const
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
static HcalZDCDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalZDCDetId.cc:42
bool isES() const
static ESDetId detIdFromDenseIndex(uint32_t din)
Definition: ESDetId.h:49
uint32_t id_
Definition: DetId.h:57
bool isEE() const
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
bool isZDC() const

Member Function Documentation

uint32_t CaloGenericDetId::denseIndex ( ) const

Definition at line 24 of file CaloGenericDetId.cc.

References dtNoiseDBValidation_cfg::cerr, DetId::det(), edm::hlt::Exception, DetId::Hcal, isCaloTower(), isCastor(), isEB(), isEE(), isES(), isZDC(), and DetId::rawId().

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

25 {
26  if (det() == DetId::Hcal) {
27  std::cerr << "No support for HB/HE/HO/HF in CaloGenericDetId" << std::endl;
28  throw cms::Exception("No support");
29  }
30 
31  return ( isEB() ? EBDetId( rawId() ).denseIndex() :
32  ( isEE() ? EEDetId( rawId() ).denseIndex() :
33  ( isES() ? ESDetId( rawId() ).denseIndex() :
34  ( isZDC() ? HcalZDCDetId( rawId() ).denseIndex() :
36  ( isCaloTower() ? CaloTowerDetId( rawId() ).denseIndex() : ~0 ) ) ) ) ) ) ;
37 }
bool isCaloTower() const
bool isCastor() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
bool isEB() const
uint32_t denseIndex() const
bool isES() const
bool isEE() const
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
bool isZDC() const
bool CaloGenericDetId::isCalo ( ) const
inline

Definition at line 34 of file CaloGenericDetId.h.

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

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

34 { return det() == DetId::Calo ; }
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
bool CaloGenericDetId::isCaloTower ( ) const
inline

Definition at line 38 of file CaloGenericDetId.h.

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

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

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

Definition at line 37 of file CaloGenericDetId.h.

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

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

37 { return isCalo() && subdetId() == HcalCastorDetId::SubdetectorId ; }
bool isCalo() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
static const int SubdetectorId
bool CaloGenericDetId::isEB ( ) const
inline

Definition at line 31 of file CaloGenericDetId.h.

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

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

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

Definition at line 30 of file CaloGenericDetId.h.

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

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

30 { return det() == DetId::Ecal ; }
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
bool CaloGenericDetId::isEE ( ) const
inline

Definition at line 32 of file CaloGenericDetId.h.

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

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

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

Definition at line 33 of file CaloGenericDetId.h.

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

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

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

Definition at line 35 of file CaloGenericDetId.h.

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

35 { return det() == DetId::Hcal ; }
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
bool CaloGenericDetId::isZDC ( ) const
inline

Definition at line 36 of file CaloGenericDetId.h.

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

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

36 { return isCalo() && subdetId() == HcalZDCDetId::SubdetectorId ; }
bool isCalo() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
static const int SubdetectorId
Definition: HcalZDCDetId.h:22
uint32_t CaloGenericDetId::sizeForDenseIndexing ( ) const

Definition at line 40 of file CaloGenericDetId.cc.

References dtNoiseDBValidation_cfg::cerr, DetId::det(), edm::hlt::Exception, DetId::Hcal, isCaloTower(), isCastor(), isEB(), isEE(), isES(), isZDC(), HcalZDCDetId::kSizeForDenseIndexing, CaloTowerDetId::kSizeForDenseIndexing, HcalCastorDetId::kSizeForDenseIndexing, ESDetId::kSizeForDenseIndexing, EBDetId::kSizeForDenseIndexing, and EEDetId::kSizeForDenseIndexing.

Referenced by CaloSubdetectorGeometry::sizeForDenseIndex().

41 {
42  if (det() == DetId::Hcal) {
43  std::cerr << "No support for HB/HE/HO/HF in CaloGenericDetId" << std::endl;
44  throw cms::Exception("No support");
45  }
46 
52  ( isCaloTower() ? CaloTowerDetId::kSizeForDenseIndexing : 0 ) ) ) ) ) ) ;
53 }
bool isCaloTower() const
bool isCastor() const
bool isEB() const
bool isES() const
bool isEE() const
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
bool isZDC() const
bool CaloGenericDetId::validDetId ( ) const

Definition at line 56 of file CaloGenericDetId.cc.

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

57 {
58  bool returnValue ( false ) ;
59  if( isEB() )
60  {
61  const EBDetId ebid ( rawId() ) ;
62  returnValue = EBDetId::validDetId( ebid.ieta(),
63  ebid.iphi() ) ;
64  }
65  else
66  {
67  if( isEE() )
68  {
69  const EEDetId eeid ( rawId() ) ;
70  returnValue = EEDetId::validDetId( eeid.ix(),
71  eeid.iy(),
72  eeid.zside() ) ;
73  }
74  else
75  {
76  if( isES() )
77  {
78  const ESDetId esid ( rawId() ) ;
79  returnValue = ESDetId::validDetId( esid.strip(),
80  esid.six(),
81  esid.siy(),
82  esid.plane(),
83  esid.zside() ) ;
84  }
85  else
86  {
87  if (det() == DetId::Hcal) {
88  std::cerr << "No support for HB/HE/HO/HF in CaloGenericDetId" << std::endl;
89  throw cms::Exception("No support");
90 
91  returnValue = false;
92  }
93  else
94  {
95  if( isZDC() )
96  {
97  const HcalZDCDetId zdid ( rawId() ) ;
98  returnValue = HcalZDCDetId::validDetId( zdid.section(),
99  zdid.channel() ) ;
100  }
101  else
102  {
103  if( isCastor() )
104  {
105  const HcalCastorDetId zdid ( rawId() ) ;
106  returnValue = HcalCastorDetId::validDetId( zdid.section(),
107  zdid.zside()>0,
108  zdid.sector(),
109  zdid.module() ) ;
110  }
111  else
112  {
113  if( isCaloTower() )
114  {
115  const CaloTowerDetId ctid ( rawId() ) ;
116  returnValue = CaloTowerDetId::validDetId( ctid.ieta(),
117  ctid.iphi() ) ;
118  }
119  }
120  }
121  }
122  }
123  }
124  }
125  return returnValue ;
126 }
static bool validDetId(Section iSection, bool posEta, int iSector, int iMod)
static bool validDetId(int ie, int ip)
static bool validDetId(Section se, int dp)
Definition: HcalZDCDetId.cc:61
bool isCaloTower() const
bool isCastor() const
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:125
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
bool isEB() const
bool isES() const
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:249
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:50
bool isEE() const
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
bool isZDC() const