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 isHB () const
 
bool isHcal () const
 
bool isHE () const
 
bool isHF () const
 
bool isHO () 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 13 of file CaloGenericDetId.h.

Constructor & Destructor Documentation

CaloGenericDetId::CaloGenericDetId ( uint32_t  rawid)
inline

Definition at line 17 of file CaloGenericDetId.h.

17 : 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 19 of file CaloGenericDetId.h.

19 : 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 4 of file CaloGenericDetId.cc.

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

6  : DetId( iDet, iSub )
7 {
8  id_ = ( isEB() ? EBDetId::detIdFromDenseIndex( iDin ).rawId() :
9  ( isEE() ? EEDetId::detIdFromDenseIndex( iDin ).rawId() :
10  ( isES() ? ESDetId::detIdFromDenseIndex( iDin ).rawId() :
14  ( isCaloTower() ? CaloTowerDetId::detIdFromDenseIndex( iDin ).rawId() : 0 ) ) ) ) ) ) ) ;
15 }
static EEDetId detIdFromDenseIndex(uint32_t din)
Definition: EEDetId.h:215
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:98
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
bool isEB() const
static HcalCastorDetId detIdFromDenseIndex(uint32_t di)
static HcalDetId detIdFromDenseIndex(uint32_t di)
Definition: HcalDetId.cc:155
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:49
uint32_t id_
Definition: DetId.h:57
bool isEE() const
bool isZDC() const

Member Function Documentation

uint32_t CaloGenericDetId::denseIndex ( ) const

Definition at line 18 of file CaloGenericDetId.cc.

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

Referenced by CaloSubdetectorGeometry::deltaEta(), CaloSubdetectorGeometry::deltaPhi(), HcalDDDGeometry::newCell(), ZdcGeometry::newCell(), CaloTowerGeometry::newCell(), CastorGeometry::newCell(), and HcalGeometry::newCell().

19 {
20  return ( isEB() ? EBDetId( rawId() ).denseIndex() :
21  ( isEE() ? EEDetId( rawId() ).denseIndex() :
22  ( isES() ? ESDetId( rawId() ).denseIndex() :
23  ( isHcal() ? HcalDetId( rawId() ).denseIndex() :
24  ( isZDC() ? HcalZDCDetId( rawId() ).denseIndex() :
26  ( isCaloTower() ? CaloTowerDetId( rawId() ).denseIndex() : ~0 ) ) ) ) ) ) ) ;
27 }
bool isCaloTower() const
bool isCastor() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
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 40 of file CaloGenericDetId.h.

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

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

40 { 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 43 of file CaloGenericDetId.h.

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

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

43 { 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 42 of file CaloGenericDetId.h.

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

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

42 { 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 32 of file CaloGenericDetId.h.

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

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

32 { 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 31 of file CaloGenericDetId.h.

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

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

31 { 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 33 of file CaloGenericDetId.h.

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

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

33 { 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 34 of file CaloGenericDetId.h.

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

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

34 { 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::isHB ( ) const
inline

Definition at line 36 of file CaloGenericDetId.h.

References HcalBarrel, isHcal(), and DetId::subdetId().

Referenced by HcalGeometry::alignmentTransformIndexLocal(), HcalDDDGeometry::newCell(), and HcalGeometry::newCell().

36 { return isHcal() && subdetId() == HcalBarrel ; }
bool isHcal() const
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::isHcal ( ) const
inline

Definition at line 35 of file CaloGenericDetId.h.

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

Referenced by HcalGeometry::alignmentTransformIndexLocal(), CaloGenericDetId(), denseIndex(), isHB(), isHE(), isHF(), isHO(), HcalDDDGeometry::newCell(), HcalGeometry::newCell(), sizeForDenseIndexing(), and validDetId().

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

Definition at line 37 of file CaloGenericDetId.h.

References HcalEndcap, isHcal(), and DetId::subdetId().

Referenced by HcalGeometry::alignmentTransformIndexLocal(), HcalDDDGeometry::newCell(), and HcalGeometry::newCell().

37 { return isHcal() && subdetId() == HcalEndcap ; }
bool isHcal() const
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::isHF ( ) const
inline

Definition at line 39 of file CaloGenericDetId.h.

References HcalForward, isHcal(), and DetId::subdetId().

Referenced by HcalGeometry::alignmentTransformIndexLocal(), and HcalGeometry::localCorners().

39 { return isHcal() && subdetId() == HcalForward ; }
bool isHcal() const
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::isHO ( ) const
inline

Definition at line 38 of file CaloGenericDetId.h.

References HcalOuter, isHcal(), and DetId::subdetId().

Referenced by HcalGeometry::alignmentTransformIndexLocal(), HcalDDDGeometry::newCell(), and HcalGeometry::newCell().

38 { return isHcal() && subdetId() == HcalOuter ; }
bool isHcal() const
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::isZDC ( ) const
inline

Definition at line 41 of file CaloGenericDetId.h.

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

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

41 { 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 30 of file CaloGenericDetId.cc.

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

Referenced by CaloSubdetectorGeometry::deltaEta(), and CaloSubdetectorGeometry::deltaPhi().

bool CaloGenericDetId::validDetId ( ) const

Definition at line 42 of file CaloGenericDetId.cc.

References HcalZDCDetId::channel(), HcalDetId::depth(), CaloTowerDetId::ieta(), HcalDetId::ieta(), EBDetId::ieta(), CaloTowerDetId::iphi(), HcalDetId::iphi(), 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(), HcalDetId::subdet(), CaloTowerDetId::validDetId(), HcalZDCDetId::validDetId(), HcalDetId::validDetId(), ESDetId::validDetId(), HcalCastorDetId::validDetId(), EBDetId::validDetId(), EEDetId::validDetId(), ESDetId::zside(), HcalCastorDetId::zside(), and EEDetId::zside().

43 {
44  bool returnValue ( false ) ;
45  if( isEB() )
46  {
47  const EBDetId ebid ( rawId() ) ;
48  returnValue = EBDetId::validDetId( ebid.ieta(),
49  ebid.iphi() ) ;
50  }
51  else
52  {
53  if( isEE() )
54  {
55  const EEDetId eeid ( rawId() ) ;
56  returnValue = EEDetId::validDetId( eeid.ix(),
57  eeid.iy(),
58  eeid.zside() ) ;
59  }
60  else
61  {
62  if( isES() )
63  {
64  const ESDetId esid ( rawId() ) ;
65  returnValue = ESDetId::validDetId( esid.strip(),
66  esid.six(),
67  esid.siy(),
68  esid.plane(),
69  esid.zside() ) ;
70  }
71  else
72  {
73  if( isHcal() )
74  {
75  const HcalDetId hcid ( rawId() ) ;
76  returnValue = HcalDetId::validDetId( hcid.subdet(),
77  hcid.ieta() ,
78  hcid.iphi() ,
79  hcid.depth() ) ;
80  }
81  else
82  {
83  if( isZDC() )
84  {
85  const HcalZDCDetId zdid ( rawId() ) ;
86  returnValue = HcalZDCDetId::validDetId( zdid.section(),
87  zdid.channel() ) ;
88  }
89  else
90  {
91  if( isCastor() )
92  {
93  const HcalCastorDetId zdid ( rawId() ) ;
94  returnValue = HcalCastorDetId::validDetId( zdid.section(),
95  zdid.zside()>0,
96  zdid.sector(),
97  zdid.module() ) ;
98  }
99  else
100  {
101  if( isCaloTower() )
102  {
103  const CaloTowerDetId ctid ( rawId() ) ;
104  returnValue = CaloTowerDetId::validDetId( ctid.ieta(),
105  ctid.iphi() ) ;
106  }
107  }
108  }
109  }
110  }
111  }
112  }
113  return returnValue ;
114 }
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.cc:59
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(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth)
Definition: HcalDetId.cc:70
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
bool isEB() const
bool isHcal() const
bool isES() const
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
bool isZDC() const