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, Forward =6
}
 
- 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:26
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:26
CaloGenericDetId::CaloGenericDetId ( DetId::Detector  iDet,
int  iSub,
uint32_t  iDenseIndex 
)

Definition at line 6 of file CaloGenericDetId.cc.

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

8  : DetId( iDet, iSub )
9 {
10  if (isHcal()) {
11  edm::LogError("CaloGenericDetIdError") << "No support for HB/HE/HO/HF in CaloGenericDetId";
12  throw cms::Exception("No support");
13  }
14  else if(isCaloTower()) {
15  edm::LogError("CaloGenericDetIdError") << "No support for CaloTower in CaloGenericDetId";
16  throw cms::Exception("No support");
17  }
18  else {
19 
20  id_ = ( isEB() ? EBDetId::detIdFromDenseIndex( iDin ).rawId() :
21  ( isEE() ? EEDetId::detIdFromDenseIndex( iDin ).rawId() :
22  ( isES() ? ESDetId::detIdFromDenseIndex( iDin ).rawId() :
24  ( isCastor() ? HcalCastorDetId::detIdFromDenseIndex( iDin ).rawId() : 0 ) ) ) ) );
25  }
26 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:220
bool isCaloTower() const
bool isCastor() const
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
static EBDetId detIdFromDenseIndex(uint32_t di)
Definition: EBDetId.h:111
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool isEB() const
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
bool isHcal() const
static HcalZDCDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalZDCDetId.cc:42
bool isES() const
static ESDetId detIdFromDenseIndex(uint32_t din)
Definition: ESDetId.h:60
uint32_t id_
Definition: DetId.h:55
bool isEE() const
bool isZDC() const

Member Function Documentation

uint32_t CaloGenericDetId::denseIndex ( ) const

Definition at line 29 of file CaloGenericDetId.cc.

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

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

30 {
31  if (isHcal()) {
32  edm::LogError("CaloGenericDetIdError") << "No support for HB/HE/HO/HF in CaloGenericDetId";
33  throw cms::Exception("No support");
34  }
35  else if(isCaloTower()) {
36  edm::LogError("CaloGenericDetIdError") << "No support for CaloTower in CaloGenericDetId";
37  throw cms::Exception("No support");
38  }
39 
40  return ( isEB() ? EBDetId( rawId() ).denseIndex() :
41  ( isEE() ? EEDetId( rawId() ).denseIndex() :
42  ( isES() ? ESDetId( rawId() ).denseIndex() :
43  ( isZDC() ? HcalZDCDetId( rawId() ).denseIndex() :
44  ( isCastor() ? HcalCastorDetId( rawId() ).denseIndex() : ~0 ) ) ) ) );
45 }
bool isCaloTower() const
bool isCastor() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool isEB() const
bool isHcal() const
uint32_t denseIndex() const
bool isES() const
bool isEE() const
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:35
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:37
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:37
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 EcalBarrelGeometry::alignmentTransformIndexLocal(), 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:37
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:35
bool CaloGenericDetId::isEE ( ) const
inline

Definition at line 32 of file CaloGenericDetId.h.

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

Referenced by EcalEndcapGeometry::alignmentTransformIndexLocal(), 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:37
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:37
bool isEcal() const
bool CaloGenericDetId::isHcal ( ) const
inline

Definition at line 35 of file CaloGenericDetId.h.

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

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

35 { return det() == DetId::Hcal ; }
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
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:37
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
uint32_t CaloGenericDetId::sizeForDenseIndexing ( ) const

Definition at line 48 of file CaloGenericDetId.cc.

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

Referenced by CaloSubdetectorGeometry::sizeForDenseIndex().

49 {
50  if (isHcal()) {
51  edm::LogError("CaloGenericDetIdError") << "No support for HB/HE/HO/HF in CaloGenericDetId";
52  throw cms::Exception("No support");
53  }
54  else if(isCaloTower()) {
55  edm::LogError("CaloGenericDetIdError") << "No support for CaloTower in CaloGenericDetId";
56  throw cms::Exception("No support");
57  }
58 
64 }
bool isCaloTower() const
bool isCastor() const
bool isEB() const
bool isHcal() const
bool isES() const
bool isEE() const
bool isZDC() const
bool CaloGenericDetId::validDetId ( ) const

Definition at line 67 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(), 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().

68 {
69  bool returnValue ( false ) ;
70  if( isEB() )
71  {
72  const EBDetId ebid ( rawId() ) ;
73  returnValue = EBDetId::validDetId( ebid.ieta(),
74  ebid.iphi() ) ;
75  }
76  else if( isEE() )
77  {
78  const EEDetId eeid ( rawId() ) ;
79  returnValue = EEDetId::validDetId( eeid.ix(),
80  eeid.iy(),
81  eeid.zside() ) ;
82  }
83  else if( isES() )
84  {
85  const ESDetId esid ( rawId() ) ;
86  returnValue = ESDetId::validDetId( esid.strip(),
87  esid.six(),
88  esid.siy(),
89  esid.plane(),
90  esid.zside() ) ;
91  }
92  else if ( isHcal() )
93  {
94  edm::LogError("CaloGenericDetIdError") << "No support for HB/HE/HO/HF in CaloGenericDetId";
95  throw cms::Exception("No support");
96 
97  returnValue = false;
98  }
99  else if( isZDC() )
100  {
101  const HcalZDCDetId zdid ( rawId() ) ;
102  returnValue = HcalZDCDetId::validDetId( zdid.section(),
103  zdid.channel() ) ;
104  }
105  else if( isCastor() )
106  {
107  const HcalCastorDetId zdid ( rawId() ) ;
108  returnValue = HcalCastorDetId::validDetId( zdid.section(),
109  zdid.zside()>0,
110  zdid.sector(),
111  zdid.module() ) ;
112  }
113  else if( isCaloTower() )
114  {
115  edm::LogError("CaloGenericDetIdError") << "No support for CaloTower in CaloGenericDetId";
116  throw cms::Exception("No support");
117 
118  returnValue = false;
119  }
120 
121  return returnValue ;
122 }
static bool validDetId(Section iSection, bool posEta, int iSector, int iMod)
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:124
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool isEB() const
bool isHcal() const
bool isES() const
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:34
bool isEE() const
bool isZDC() const