CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes
CaloTowerDetId Class Reference

#include <CaloTowerDetId.h>

Inheritance diagram for CaloTowerDetId:
DetId

Public Member Functions

 CaloTowerDetId ()
 
 CaloTowerDetId (const DetId &id)
 
 CaloTowerDetId (int tower_ieta, int tower_iphi)
 
 CaloTowerDetId (uint32_t rawid)
 
int ieta () const
 get the tower ieta More...
 
int ietaAbs () const
 get the absolute value of the tower ieta More...
 
int iphi () const
 get the tower iphi More...
 
CaloTowerDetIdoperator= (const DetId &id)
 
int zside () const
 get the z-side of the tower (1/-1) More...
 
- 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...
 

Static Public Attributes

static const int SubdetId = 1
 
- 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
 

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

Detailed Description

CaloTowerDetId uses DetId::Det of Calo and subdetId() of 1.

Author
J. Mans - Minnesota

Definition at line 12 of file CaloTowerDetId.h.

Constructor & Destructor Documentation

◆ CaloTowerDetId() [1/4]

CaloTowerDetId::CaloTowerDetId ( )

Create a null cellid

Definition at line 5 of file CaloTowerDetId.cc.

5 : DetId() {}

◆ CaloTowerDetId() [2/4]

CaloTowerDetId::CaloTowerDetId ( uint32_t  rawid)
explicit

Create cellid from raw id (0=invalid tower id)

Definition at line 7 of file CaloTowerDetId.cc.

7 : DetId(rawid & 0xFFF0FFFFu) {}

◆ CaloTowerDetId() [3/4]

CaloTowerDetId::CaloTowerDetId ( int  tower_ieta,
int  tower_iphi 
)

Constructor from signed tower ieta and iphi

Definition at line 9 of file CaloTowerDetId.cc.

9  : DetId(Calo, SubdetId) {
10  id_ |= ((ieta > 0) ? (0x2000 | ((ieta & 0x3F) << 7)) : (((-ieta) & 0x3f) << 7)) | (iphi & 0x7F);
11 }

References DetId::id_, ieta(), and iphi().

◆ CaloTowerDetId() [4/4]

CaloTowerDetId::CaloTowerDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 13 of file CaloTowerDetId.cc.

13  {
14  if (!gen.null() && (gen.det() != Calo || gen.subdetId() != SubdetId)) {
15  throw cms::Exception("Invalid DetId")
16  << "Cannot initialize CaloTowerDetId from " << std::hex << gen.rawId() << std::dec;
17  }
18  id_ = gen.rawId();
19 }

References DetId::Calo, TauDecayModes::dec, Exception, DetId::id_, and SubdetId.

Member Function Documentation

◆ ieta()

int CaloTowerDetId::ieta ( ) const
inline

◆ ietaAbs()

int CaloTowerDetId::ietaAbs ( ) const
inline

◆ iphi()

int CaloTowerDetId::iphi ( ) const

◆ operator=()

CaloTowerDetId & CaloTowerDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 21 of file CaloTowerDetId.cc.

21  {
22  if (!gen.null() && (gen.det() != Calo || gen.subdetId() != SubdetId)) {
23  throw cms::Exception("Invalid DetId")
24  << "Cannot assign CaloTowerDetId from " << std::hex << gen.rawId() << std::dec;
25  }
26  id_ = gen.rawId();
27  return *this;
28 }

References DetId::Calo, TauDecayModes::dec, Exception, DetId::id_, and SubdetId.

◆ zside()

int CaloTowerDetId::zside ( ) const
inline

Member Data Documentation

◆ SubdetId

const int CaloTowerDetId::SubdetId = 1
static
CaloTowerDetId::ietaAbs
int ietaAbs() const
get the absolute value of the tower ieta
Definition: CaloTowerDetId.h:28
CaloTowerDetId::SubdetId
static const int SubdetId
Definition: CaloTowerDetId.h:34
DetId::Calo
Definition: DetId.h:29
gen
Definition: PythiaDecays.h:13
DetId::id_
uint32_t id_
Definition: DetId.h:69
CaloTowerDetId::iphi
int iphi() const
get the tower iphi
Definition: CaloTowerDetId.cc:30
CaloTowerDetId::ieta
int ieta() const
get the tower ieta
Definition: CaloTowerDetId.h:30
Exception
Definition: hltDiff.cc:246
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
CaloTowerDetId::zside
int zside() const
get the z-side of the tower (1/-1)
Definition: CaloTowerDetId.h:26
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143