CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Attributes
HcalTrigTowerDetId Class Reference

#include <HcalTrigTowerDetId.h>

Inheritance diagram for HcalTrigTowerDetId:
DetId

Public Member Functions

int depth () const
 get the depth (zero for LHC Run 1, may be nonzero for later runs) More...
 
 HcalTrigTowerDetId ()
 
 HcalTrigTowerDetId (uint32_t rawid)
 
 HcalTrigTowerDetId (int ieta, int iphi)
 Constructor from signed ieta, iphi. More...
 
 HcalTrigTowerDetId (int ieta, int iphi, int depth)
 Constructor from signed ieta, iphi, depth. More...
 
 HcalTrigTowerDetId (int ieta, int iphi, int depth, int version)
 Constructor from signed ieta, iphi, depth, version. More...
 
 HcalTrigTowerDetId (const DetId &id)
 
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...
 
HcalTrigTowerDetIdoperator= (const DetId &id)
 
void setVersion (int version)
 
HcalSubdetector subdet () const
 get the subdetector More...
 
int version () const
 get the version code for the trigger tower More...
 
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 (uint32_t id)
 Create an id from a raw number. More...
 
constexpr DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. 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 kHcalDepthMask = 0x7
 
static const int kHcalDepthOffset = 14
 
static const int kHcalEtaMask = 0x3F
 
static const int kHcalEtaOffset = 7
 
static const int kHcalPhiMask = 0x7F
 
static const int kHcalVersMask = 0x7
 
static const int kHcalVersOffset = 17
 
static const int kHcalZsideMask = 0x2000
 
static const HcalTrigTowerDetId Undefined
 
- 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

Cell id for an Calo Trigger tower

Author
J. Mans - Minnesota

Definition at line 14 of file HcalTrigTowerDetId.h.

Constructor & Destructor Documentation

HcalTrigTowerDetId::HcalTrigTowerDetId ( )

Constructor of a null id

Definition at line 7 of file HcalTrigTowerDetId.cc.

7 {}
HcalTrigTowerDetId::HcalTrigTowerDetId ( uint32_t  rawid)

Constructor from a raw value

Definition at line 9 of file HcalTrigTowerDetId.cc.

9 : DetId(rawid) {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
HcalTrigTowerDetId::HcalTrigTowerDetId ( int  ieta,
int  iphi 
)

Constructor from signed ieta, iphi.

Definition at line 11 of file HcalTrigTowerDetId.cc.

References DetId::id_, kHcalEtaOffset, kHcalPhiMask, and kHcalZsideMask.

12  id_ |=
13  ((ieta > 0) ? (kHcalZsideMask | (ieta << kHcalEtaOffset)) : ((-ieta) << kHcalEtaOffset)) | (iphi & kHcalPhiMask);
14  // Default to depth = 0 & version = 0
15 }
static const int kHcalEtaOffset
int ieta() const
get the tower ieta
static const int kHcalPhiMask
uint32_t id_
Definition: DetId.h:69
static const int kHcalZsideMask
int iphi() const
get the tower iphi
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
HcalTrigTowerDetId::HcalTrigTowerDetId ( int  ieta,
int  iphi,
int  depth 
)

Constructor from signed ieta, iphi, depth.

Definition at line 17 of file HcalTrigTowerDetId.cc.

References DetId::id_, kHcalDepthMask, kHcalDepthOffset, kHcalEtaOffset, kHcalPhiMask, kHcalVersMask, kHcalVersOffset, kHcalZsideMask, and version().

18  const int ones = depth % 10;
19  const int tens = (depth - ones) / 10;
20  // version convension 0 : default for 3x2 TP; 1, 2, 3 : for future & currently version = 1 is for 1x1 TP
21  // Note that in this conversion, depth can take values from 0 to 9 for different purpose
22  // -> so depth should be = ones!
23  id_ |= ((ones & kHcalDepthMask) << kHcalDepthOffset) |
24  ((ieta > 0) ? (kHcalZsideMask | (ieta << kHcalEtaOffset)) : ((-ieta) << kHcalEtaOffset)) |
25  (iphi & kHcalPhiMask);
26 
27  const int version = tens;
28  if (version > 9) { // do NOT envision to have versions over 9...
29  edm::LogError("HcalTrigTowerDetId") << "in its ctor using depth, version larger than 9 (too many of it!)?"
30  << std::endl;
31  }
32 
33  id_ |= ((version & kHcalVersMask) << kHcalVersOffset);
34 }
static const int kHcalVersMask
static const int kHcalEtaOffset
Log< level::Error, false > LogError
int ieta() const
get the tower ieta
int depth() const
get the depth (zero for LHC Run 1, may be nonzero for later runs)
static const int kHcalDepthMask
static const int kHcalPhiMask
static const int kHcalDepthOffset
static const int kHcalVersOffset
int version() const
get the version code for the trigger tower
uint32_t id_
Definition: DetId.h:69
static const int kHcalZsideMask
int iphi() const
get the tower iphi
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
HcalTrigTowerDetId::HcalTrigTowerDetId ( int  ieta,
int  iphi,
int  depth,
int  version 
)

Constructor from signed ieta, iphi, depth, version.

Definition at line 36 of file HcalTrigTowerDetId.cc.

References DetId::id_, kHcalDepthMask, kHcalDepthOffset, kHcalEtaOffset, kHcalPhiMask, kHcalVersMask, kHcalVersOffset, and kHcalZsideMask.

38  ((ieta > 0) ? (kHcalZsideMask | (ieta << kHcalEtaOffset)) : ((-ieta) << kHcalEtaOffset)) |
39  (iphi & kHcalPhiMask);
41 }
static const int kHcalVersMask
static const int kHcalEtaOffset
int ieta() const
get the tower ieta
int depth() const
get the depth (zero for LHC Run 1, may be nonzero for later runs)
static const int kHcalDepthMask
static const int kHcalPhiMask
static const int kHcalDepthOffset
static const int kHcalVersOffset
int version() const
get the version code for the trigger tower
uint32_t id_
Definition: DetId.h:69
static const int kHcalZsideMask
int iphi() const
get the tower iphi
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
HcalTrigTowerDetId::HcalTrigTowerDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 43 of file HcalTrigTowerDetId.cc.

References TauDecayModes::dec, DetId::det(), Exception, DetId::Hcal, HcalTriggerTower, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().

43  {
44  if (!gen.null() && (gen.det() != Hcal || gen.subdetId() != HcalTriggerTower)) {
45  throw cms::Exception("Invalid DetId")
46  << "Cannot initialize HcalTrigTowerDetId from " << std::hex << gen.rawId() << std::dec;
47  }
48  id_ = gen.rawId();
49 }
uint32_t id_
Definition: DetId.h:69

Member Function Documentation

int HcalTrigTowerDetId::depth ( ) const
inline

get the depth (zero for LHC Run 1, may be nonzero for later runs)

Definition at line 58 of file HcalTrigTowerDetId.h.

References DetId::id_, kHcalDepthMask, and kHcalDepthOffset.

Referenced by hcaldqm::quantity::getValue_TTdepth(), hcaldqm::hashfunctions::hash_TChannel(), hcaldqm::hashfunctions::hash_TTdepth(), HcalText2DetIdConverter::init(), and hcaldqm::hashfunctions::name_TTdepth().

58 { return (id_ >> kHcalDepthOffset) & kHcalDepthMask; }
static const int kHcalDepthMask
static const int kHcalDepthOffset
uint32_t id_
Definition: DetId.h:69
int HcalTrigTowerDetId::ieta ( ) const
inline
int HcalTrigTowerDetId::ietaAbs ( ) const
inline
int HcalTrigTowerDetId::iphi ( ) const
inline
HcalTrigTowerDetId & HcalTrigTowerDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 53 of file HcalTrigTowerDetId.cc.

References TauDecayModes::dec, DetId::det(), Exception, DetId::Hcal, HcalTriggerTower, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().

53  {
54  if (!gen.null() && (gen.det() != Hcal || gen.subdetId() != HcalTriggerTower)) {
55  throw cms::Exception("Invalid DetId")
56  << "Cannot assign HcalTrigTowerDetId from " << std::hex << gen.rawId() << std::dec;
57  }
58  id_ = gen.rawId();
59  return *this;
60 }
uint32_t id_
Definition: DetId.h:69
void HcalTrigTowerDetId::setVersion ( int  version)

Definition at line 51 of file HcalTrigTowerDetId.cc.

References DetId::id_, kHcalVersMask, and kHcalVersOffset.

static const int kHcalVersMask
static const int kHcalVersOffset
int version() const
get the version code for the trigger tower
uint32_t id_
Definition: DetId.h:69
HcalSubdetector HcalTrigTowerDetId::subdet ( ) const
inline

get the subdetector

Definition at line 48 of file HcalTrigTowerDetId.h.

References DetId::subdetId().

48 { return (HcalSubdetector)(subdetId()); }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
HcalSubdetector
Definition: HcalAssistant.h:31
int HcalTrigTowerDetId::version ( ) const
inline
int HcalTrigTowerDetId::zside ( ) const
inline

get the z-side of the tower (1/-1)

Definition at line 50 of file HcalTrigTowerDetId.h.

References DetId::id_, and kHcalZsideMask.

Referenced by HcalTopology::detId2denseIdHT(), HcalTrigTowerGeometry::detIds(), and ieta().

50 { return (id_ & kHcalZsideMask) ? (1) : (-1); }
uint32_t id_
Definition: DetId.h:69
static const int kHcalZsideMask

Member Data Documentation

const int HcalTrigTowerDetId::kHcalDepthMask = 0x7
static

Definition at line 21 of file HcalTrigTowerDetId.h.

Referenced by depth(), and HcalTrigTowerDetId().

const int HcalTrigTowerDetId::kHcalDepthOffset = 14
static

Definition at line 20 of file HcalTrigTowerDetId.h.

Referenced by depth(), and HcalTrigTowerDetId().

const int HcalTrigTowerDetId::kHcalEtaMask = 0x3F
static

Definition at line 18 of file HcalTrigTowerDetId.h.

Referenced by ietaAbs().

const int HcalTrigTowerDetId::kHcalEtaOffset = 7
static

Definition at line 17 of file HcalTrigTowerDetId.h.

Referenced by HcalTrigTowerDetId(), and ietaAbs().

const int HcalTrigTowerDetId::kHcalPhiMask = 0x7F
static

Definition at line 16 of file HcalTrigTowerDetId.h.

Referenced by HcalTrigTowerDetId(), and iphi().

const int HcalTrigTowerDetId::kHcalVersMask = 0x7
static

Definition at line 23 of file HcalTrigTowerDetId.h.

Referenced by HcalTrigTowerDetId(), setVersion(), and version().

const int HcalTrigTowerDetId::kHcalVersOffset = 17
static

Definition at line 22 of file HcalTrigTowerDetId.h.

Referenced by HcalTrigTowerDetId(), setVersion(), and version().

const int HcalTrigTowerDetId::kHcalZsideMask = 0x2000
static

Definition at line 19 of file HcalTrigTowerDetId.h.

Referenced by HcalTrigTowerDetId(), and zside().

const HcalTrigTowerDetId HcalTrigTowerDetId::Undefined
static