CMS 3D CMS Logo

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

#include <FastTimeDetId.h>

Inheritance diagram for FastTimeDetId:
DetId

Public Types

enum  { Subdet = FastTime }
 
enum  { FastTimeUnknown = 0, FastTimeBarrel = 1, FastTimeEndcap = 2 }
 
- 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

 FastTimeDetId ()
 
 FastTimeDetId (const DetId &id)
 
 FastTimeDetId (int type, int module_izeta, int module_iphi, int iz)
 
 FastTimeDetId (uint32_t rawid)
 
FastTimeDetId geometryCell () const
 
int ieta () const
 get the absolute value of the cell #'s along x-axis (EC) | z-axis (Barel) More...
 
int iphi () const
 get the absolute value of the cell #'s along y-axis (EC) | phi (Barrel) More...
 
bool isFastTime () const
 consistency check : no bits left => no overhead More...
 
bool isForward () const
 
int iz () const
 
FastTimeDetIdoperator= (const DetId &id)
 
ForwardSubdetector subdet () const
 get the subdetector More...
 
int type () const
 get the type (barrel vs endcap) More...
 
int zside () const
 get the z-side of the cell (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 kFastTimeCellPhiMask = 0x3FF
 
static const int kFastTimeCellPhiOffset = 0
 
static const int kFastTimeCellZMask = 0x3FF
 
static const int kFastTimeCellZOffset = 10
 
static const int kFastTimeTypeMask = 0x3
 
static const int kFastTimeTypeOffset = 21
 
static const int kFastTimeZsideMask = 0x1
 
static const int kFastTimeZsideOffset = 20
 
static const FastTimeDetId 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

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 8 of file FastTimeDetId.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Subdet 

Definition at line 18 of file FastTimeDetId.h.

18 { Subdet = FastTime };

◆ anonymous enum

anonymous enum
Enumerator
FastTimeUnknown 
FastTimeBarrel 
FastTimeEndcap 

Definition at line 19 of file FastTimeDetId.h.

Constructor & Destructor Documentation

◆ FastTimeDetId() [1/4]

FastTimeDetId::FastTimeDetId ( )

Create a null cellid

Definition at line 8 of file FastTimeDetId.cc.

8 : DetId() {}

Referenced by geometryCell().

◆ FastTimeDetId() [2/4]

FastTimeDetId::FastTimeDetId ( uint32_t  rawid)

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

Definition at line 10 of file FastTimeDetId.cc.

10 : DetId(rawid) {}

◆ FastTimeDetId() [3/4]

FastTimeDetId::FastTimeDetId ( int  type,
int  module_izeta,
int  module_iphi,
int  iz 
)

Constructor from subdetector, zplus, cell numbers along x and y axes

Definition at line 12 of file FastTimeDetId.cc.

13  : DetId(Forward, FastTime) {
14  int zsid = (module_zside > 0) ? (kFastTimeZsideMask) : (0);
15  id_ |= (((module_type & kFastTimeTypeMask) << kFastTimeTypeOffset) |
16  ((module_iz & kFastTimeCellZMask) << kFastTimeCellZOffset) |
17  ((module_iphi & kFastTimeCellPhiMask) << kFastTimeCellPhiOffset) | (zsid << kFastTimeZsideOffset));
18 }

References DetId::id_, kFastTimeCellPhiMask, kFastTimeCellPhiOffset, kFastTimeCellZMask, kFastTimeCellZOffset, kFastTimeTypeMask, kFastTimeTypeOffset, kFastTimeZsideMask, and kFastTimeZsideOffset.

◆ FastTimeDetId() [4/4]

FastTimeDetId::FastTimeDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 20 of file FastTimeDetId.cc.

20  {
21  if (!gen.null()) {
23  if (gen.det() != Forward || (subdet != FastTime)) {
24  throw cms::Exception("Invalid DetId")
25  << "Cannot initialize FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
26  }
27  }
28  id_ = gen.rawId();
29 }

References TauDecayModes::dec, Exception, FastTime, DetId::Forward, DetId::id_, and subdet().

Member Function Documentation

◆ geometryCell()

FastTimeDetId FastTimeDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 32 of file FastTimeDetId.h.

32 { return FastTimeDetId(type(), 0, 0, zside()); }

References FastTimeDetId(), type(), and zside().

Referenced by FastTimeGeometry::getGeometry(), FastTimeGeometry::indexFor(), FastTimeGeometry::newCell(), and FastTimeGeometry::present().

◆ ieta()

int FastTimeDetId::ieta ( ) const
inline

get the absolute value of the cell #'s along x-axis (EC) | z-axis (Barel)

Definition at line 41 of file FastTimeDetId.h.

References DetId::id_, kFastTimeCellZMask, and kFastTimeCellZOffset.

Referenced by FastTimeGeometry::getCorners(), and FastTimeGeometry::getPosition().

◆ iphi()

int FastTimeDetId::iphi ( ) const
inline

get the absolute value of the cell #'s along y-axis (EC) | phi (Barrel)

Definition at line 45 of file FastTimeDetId.h.

References DetId::id_, kFastTimeCellPhiMask, and kFastTimeCellPhiOffset.

Referenced by FastTimeGeometry::getCorners(), and FastTimeGeometry::getPosition().

◆ isFastTime()

bool FastTimeDetId::isFastTime ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 51 of file FastTimeDetId.h.

51 { return true; }

◆ isForward()

bool FastTimeDetId::isForward ( ) const
inline

Definition at line 52 of file FastTimeDetId.h.

52 { return true; }

◆ iz()

int FastTimeDetId::iz ( ) const
inline

Definition at line 42 of file FastTimeDetId.h.

References DetId::id_, kFastTimeCellZMask, and kFastTimeCellZOffset.

◆ operator=()

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

Assignment from a generic cell id

Definition at line 31 of file FastTimeDetId.cc.

31  {
32  if (!gen.null()) {
34  if (gen.det() != Forward || (subdet != FastTime)) {
35  throw cms::Exception("Invalid DetId")
36  << "Cannot assign FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
37  }
38  }
39  id_ = gen.rawId();
40  return (*this);
41 }

References TauDecayModes::dec, Exception, FastTime, DetId::Forward, DetId::id_, and subdet().

◆ subdet()

ForwardSubdetector FastTimeDetId::subdet ( ) const
inline

get the subdetector

Definition at line 35 of file FastTimeDetId.h.

35 { return FastTime; }

References FastTime.

Referenced by FastTimeDetId(), and operator=().

◆ type()

int FastTimeDetId::type ( ) const
inline

get the type (barrel vs endcap)

Definition at line 38 of file FastTimeDetId.h.

38 { return (id_ >> kFastTimeTypeOffset) & kFastTimeTypeMask; }

References DetId::id_, kFastTimeTypeMask, and kFastTimeTypeOffset.

Referenced by geometryCell().

◆ zside()

int FastTimeDetId::zside ( ) const
inline

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

Definition at line 48 of file FastTimeDetId.h.

48 { return ((((id_ >> kFastTimeZsideOffset) & kFastTimeZsideMask) > 0) ? 1 : -1); }

References DetId::id_, kFastTimeZsideMask, and kFastTimeZsideOffset.

Referenced by geometryCell(), FastTimeGeometry::getCorners(), and FastTimeGeometry::getPosition().

Member Data Documentation

◆ kFastTimeCellPhiMask

const int FastTimeDetId::kFastTimeCellPhiMask = 0x3FF
static

Definition at line 13 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and iphi().

◆ kFastTimeCellPhiOffset

const int FastTimeDetId::kFastTimeCellPhiOffset = 0
static

Definition at line 12 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and iphi().

◆ kFastTimeCellZMask

const int FastTimeDetId::kFastTimeCellZMask = 0x3FF
static

Definition at line 11 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), ieta(), and iz().

◆ kFastTimeCellZOffset

const int FastTimeDetId::kFastTimeCellZOffset = 10
static

Definition at line 10 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), ieta(), and iz().

◆ kFastTimeTypeMask

const int FastTimeDetId::kFastTimeTypeMask = 0x3
static

Definition at line 17 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and type().

◆ kFastTimeTypeOffset

const int FastTimeDetId::kFastTimeTypeOffset = 21
static

Definition at line 16 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and type().

◆ kFastTimeZsideMask

const int FastTimeDetId::kFastTimeZsideMask = 0x1
static

Definition at line 15 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and zside().

◆ kFastTimeZsideOffset

const int FastTimeDetId::kFastTimeZsideOffset = 20
static

Definition at line 14 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and zside().

◆ Undefined

const FastTimeDetId FastTimeDetId::Undefined
static

Definition at line 54 of file FastTimeDetId.h.

FastTimeDetId::type
int type() const
get the type (barrel vs endcap)
Definition: FastTimeDetId.h:38
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
FastTimeDetId::kFastTimeCellPhiMask
static const int kFastTimeCellPhiMask
Definition: FastTimeDetId.h:13
FastTimeDetId::kFastTimeTypeMask
static const int kFastTimeTypeMask
Definition: FastTimeDetId.h:17
FastTimeDetId::FastTimeDetId
FastTimeDetId()
Definition: FastTimeDetId.cc:8
FastTimeDetId::Subdet
Definition: FastTimeDetId.h:18
FastTimeDetId::FastTimeBarrel
Definition: FastTimeDetId.h:19
gen
Definition: PythiaDecays.h:13
DetId::id_
uint32_t id_
Definition: DetId.h:69
FastTimeDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: FastTimeDetId.h:48
FastTime
Definition: ForwardSubdetector.h:6
FastTimeDetId::kFastTimeZsideOffset
static const int kFastTimeZsideOffset
Definition: FastTimeDetId.h:14
FastTimeDetId::kFastTimeCellZMask
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:11
Exception
Definition: hltDiff.cc:245
FastTimeDetId::kFastTimeCellPhiOffset
static const int kFastTimeCellPhiOffset
Definition: FastTimeDetId.h:12
DetId::DetId
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
DetId::Forward
Definition: DetId.h:30
FastTimeDetId::kFastTimeZsideMask
static const int kFastTimeZsideMask
Definition: FastTimeDetId.h:15
FastTimeDetId::FastTimeEndcap
Definition: FastTimeDetId.h:19
FastTimeDetId::FastTimeUnknown
Definition: FastTimeDetId.h:19
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
FastTimeDetId::kFastTimeTypeOffset
static const int kFastTimeTypeOffset
Definition: FastTimeDetId.h:16
FastTimeDetId::kFastTimeCellZOffset
static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:10
FastTimeDetId::subdet
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:35