CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
HGCTriggerDetId Class Reference

#include <HGCTriggerDetId.h>

Inheritance diagram for HGCTriggerDetId:
DetId

Public Types

enum  { Subdet =HGCTrigger }
 
- 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
}
 

Public Member Functions

int cell () const
 get the absolute value of the cell #'s in x and y More...
 
 HGCTriggerDetId ()
 
 HGCTriggerDetId (uint32_t rawid)
 
 HGCTriggerDetId (ForwardSubdetector subdet, int zp, int lay, int sector, int mod, int cell)
 
 HGCTriggerDetId (const DetId &id)
 
bool isEE () const
 consistency check : no bits left => no overhead More...
 
bool isForward () const
 
int layer () const
 get the layer # More...
 
int module () const
 get the degree module More...
 
HGCTriggerDetIdoperator= (const DetId &id)
 
int sector () const
 get the sector # More...
 
ForwardSubdetector subdet () const
 get the subdetector More...
 
int zside () const
 get the z-side of the cell (1/-1) More...
 
virtual ~HGCTriggerDetId ()
 
- 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 Member Functions

static const uint32_t UndefinedCell ()
 

Static Public Attributes

static const HGCTriggerDetId 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
 

Private Member Functions

const int getMaskedId (const uint32_t &shift, const uint32_t &mask) const
 
void setMaskedId (const uint32_t value, const uint32_t &shift, const uint32_t &mask)
 

Static Private Attributes

static const uint32_t cell_mask = 0x7F
 
static const uint32_t cell_shift = 0
 
static const uint32_t layer_mask = 0x1F
 
static const uint32_t layer_shift = 19
 
static const uint32_t module_mask = 0x3F
 
static const uint32_t module_shift = 7
 
static const uint32_t sector_mask = 0x3F
 
static const uint32_t sector_shift = 13
 
static const uint32_t zside_mask = 0x1
 
static const uint32_t zside_shift = 24
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 9 of file HGCTriggerDetId.h.

Member Enumeration Documentation

anonymous enum
Enumerator
Subdet 

Definition at line 35 of file HGCTriggerDetId.h.

Constructor & Destructor Documentation

HGCTriggerDetId::HGCTriggerDetId ( )

Create a null cellid

Definition at line 19 of file HGCTriggerDetId.cc.

Referenced by ~HGCTriggerDetId().

19  : DetId() {
20 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
virtual HGCTriggerDetId::~HGCTriggerDetId ( )
inlinevirtual

Definition at line 38 of file HGCTriggerDetId.h.

References cell(), HGCTriggerDetId(), mod(), operator=(), sector(), and subdet().

38 {}
HGCTriggerDetId::HGCTriggerDetId ( uint32_t  rawid)

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

Definition at line 22 of file HGCTriggerDetId.cc.

22  : DetId(rawid) {
23 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
HGCTriggerDetId::HGCTriggerDetId ( ForwardSubdetector  subdet,
int  zp,
int  lay,
int  sector,
int  mod,
int  cell 
)

Constructor from subdetector, zplus, layer, module, cell numbers

Definition at line 25 of file HGCTriggerDetId.cc.

References cell_mask, cell_shift, layer_mask, layer_shift, module_mask, module_shift, sector_mask, sector_shift, setMaskedId(), zside_mask, and zside_shift.

25  : DetId(Forward,subdet) {
26 
27  if( zp<0) zp = 0;
28 
34 }
static const uint32_t cell_shift
static const uint32_t cell_mask
static const uint32_t layer_shift
static const uint32_t zside_mask
static const uint32_t sector_mask
static const uint32_t layer_mask
static const uint32_t zside_shift
int cell() const
get the absolute value of the cell #&#39;s in x and y
ForwardSubdetector subdet() const
get the subdetector
void setMaskedId(const uint32_t value, const uint32_t &shift, const uint32_t &mask)
static const uint32_t sector_shift
static const uint32_t module_shift
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
static const uint32_t module_mask
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
HGCTriggerDetId::HGCTriggerDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 36 of file HGCTriggerDetId.cc.

References TauDecayModes::dec, DetId::det(), Exception, DetId::Forward, HGCTrigger, DetId::id_, DetId::null(), DetId::rawId(), subdet(), and DetId::subdetId().

36  {
37  if (!gen.null()) {
39  if (gen.det()!=Forward || (subdet!=HGCTrigger)) {
40  throw cms::Exception("Invalid DetId") << "Cannot initialize HGCTriggerDetId from " << std::hex << gen.rawId() << std::dec;
41  }
42  }
43  id_ = gen.rawId();
44 }
ForwardSubdetector
ForwardSubdetector subdet() const
get the subdetector
uint32_t id_
Definition: DetId.h:59

Member Function Documentation

int HGCTriggerDetId::cell ( ) const
inline

get the absolute value of the cell #'s in x and y

Definition at line 57 of file HGCTriggerDetId.h.

References getMaskedId().

Referenced by ~HGCTriggerDetId().

57 { return getMaskedId(cell_shift,cell_mask); }
const int getMaskedId(const uint32_t &shift, const uint32_t &mask) const
static const uint32_t cell_shift
static const uint32_t cell_mask
const int HGCTriggerDetId::getMaskedId ( const uint32_t &  shift,
const uint32_t &  mask 
) const
inlineprivate

Definition at line 27 of file HGCTriggerDetId.h.

References DetId::id_, and RecoTauDiscriminantConfiguration::mask.

Referenced by cell(), layer(), module(), sector(), and zside().

27 { return (id_ >> shift) & mask ; }
uint32_t id_
Definition: DetId.h:59
static unsigned int const shift
bool HGCTriggerDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 72 of file HGCTriggerDetId.h.

72 { return true; }
bool HGCTriggerDetId::isForward ( ) const
inline

Definition at line 73 of file HGCTriggerDetId.h.

73 { return true; }
int HGCTriggerDetId::layer ( ) const
inline

get the layer #

Definition at line 66 of file HGCTriggerDetId.h.

References getMaskedId().

Referenced by geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

const int getMaskedId(const uint32_t &shift, const uint32_t &mask) const
static const uint32_t layer_shift
static const uint32_t layer_mask
int HGCTriggerDetId::module ( ) const
inline

get the degree module

Definition at line 63 of file HGCTriggerDetId.h.

References getMaskedId().

const int getMaskedId(const uint32_t &shift, const uint32_t &mask) const
static const uint32_t module_shift
static const uint32_t module_mask
HGCTriggerDetId & HGCTriggerDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 46 of file HGCTriggerDetId.cc.

References TauDecayModes::dec, DetId::det(), Exception, DetId::Forward, HGCTrigger, DetId::id_, DetId::null(), DetId::rawId(), subdet(), and DetId::subdetId().

Referenced by ~HGCTriggerDetId().

46  {
47  if (!gen.null()) {
49  if (gen.det()!=Forward || (subdet!=HGCTrigger)) {
50  throw cms::Exception("Invalid DetId") << "Cannot assign HGCTriggerDetId from " << std::hex << gen.rawId() << std::dec;
51  }
52  }
53  id_ = gen.rawId();
54  return (*this);
55 }
ForwardSubdetector
ForwardSubdetector subdet() const
get the subdetector
uint32_t id_
Definition: DetId.h:59
int HGCTriggerDetId::sector ( ) const
inline

get the sector #

Definition at line 60 of file HGCTriggerDetId.h.

References getMaskedId().

Referenced by geometryXMLparser.DTAlignable::index(), and ~HGCTriggerDetId().

const int getMaskedId(const uint32_t &shift, const uint32_t &mask) const
static const uint32_t sector_mask
static const uint32_t sector_shift
void HGCTriggerDetId::setMaskedId ( const uint32_t  value,
const uint32_t &  shift,
const uint32_t &  mask 
)
inlineprivate

Definition at line 28 of file HGCTriggerDetId.h.

References DetId::id_, and RecoTauDiscriminantConfiguration::mask.

Referenced by HGCTriggerDetId().

28 { id_|= ((value & mask ) <<shift ); }
Definition: value.py:1
uint32_t id_
Definition: DetId.h:59
static unsigned int const shift
ForwardSubdetector HGCTriggerDetId::subdet ( ) const
inline

get the subdetector

Converter for a geometry cell id

Parameters
idfull EKDetId

Definition at line 54 of file HGCTriggerDetId.h.

References HGCTrigger.

Referenced by HGCTriggerDetId(), operator<<(), operator=(), and ~HGCTriggerDetId().

54 { return HGCTrigger; }
static const uint32_t HGCTriggerDetId::UndefinedCell ( )
inlinestatic

Definition at line 32 of file HGCTriggerDetId.h.

References cell_mask.

Referenced by HGCalTriggerGeometryImp1::initialize().

32 { return cell_mask ; }
static const uint32_t cell_mask
int HGCTriggerDetId::zside ( ) const
inline

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

Definition at line 69 of file HGCTriggerDetId.h.

References getMaskedId().

69 { return ( getMaskedId(zside_shift,zside_mask) ? 1 : -1); }
const int getMaskedId(const uint32_t &shift, const uint32_t &mask) const
static const uint32_t zside_mask
static const uint32_t zside_shift

Member Data Documentation

const uint32_t HGCTriggerDetId::cell_mask = 0x7F
staticprivate

Definition at line 17 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId(), and UndefinedCell().

const uint32_t HGCTriggerDetId::cell_shift = 0
staticprivate

Definition at line 16 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().

const uint32_t HGCTriggerDetId::layer_mask = 0x1F
staticprivate

Definition at line 23 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().

const uint32_t HGCTriggerDetId::layer_shift = 19
staticprivate

Definition at line 22 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().

const uint32_t HGCTriggerDetId::module_mask = 0x3F
staticprivate

Definition at line 18 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().

const uint32_t HGCTriggerDetId::module_shift = 7
staticprivate

Definition at line 19 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().

const uint32_t HGCTriggerDetId::sector_mask = 0x3F
staticprivate

Definition at line 21 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().

const uint32_t HGCTriggerDetId::sector_shift = 13
staticprivate

Definition at line 20 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().

const HGCTriggerDetId HGCTriggerDetId::Undefined
static

Definition at line 75 of file HGCTriggerDetId.h.

const uint32_t HGCTriggerDetId::zside_mask = 0x1
staticprivate

Definition at line 25 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().

const uint32_t HGCTriggerDetId::zside_shift = 24
staticprivate

Definition at line 24 of file HGCTriggerDetId.h.

Referenced by HGCTriggerDetId().