CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 (uint32_t rawid)
 
 FastTimeDetId (int type, int module_izeta, int module_iphi, int iz)
 
 FastTimeDetId (const DetId &id)
 
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 (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 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
Enumerator
Subdet 

Definition at line 18 of file FastTimeDetId.h.

anonymous enum
Enumerator
FastTimeUnknown 
FastTimeBarrel 
FastTimeEndcap 

Definition at line 19 of file FastTimeDetId.h.

Constructor & Destructor Documentation

FastTimeDetId::FastTimeDetId ( )

Create a null cellid

Definition at line 8 of file FastTimeDetId.cc.

Referenced by geometryCell().

8 : DetId() {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
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) {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
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.

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

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 }
static const int kFastTimeTypeMask
Definition: FastTimeDetId.h:17
static const int kFastTimeTypeOffset
Definition: FastTimeDetId.h:16
static const int kFastTimeZsideMask
Definition: FastTimeDetId.h:15
static const int kFastTimeCellPhiMask
Definition: FastTimeDetId.h:13
static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:10
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:11
static const int kFastTimeZsideOffset
Definition: FastTimeDetId.h:14
uint32_t id_
Definition: DetId.h:69
static const int kFastTimeCellPhiOffset
Definition: FastTimeDetId.h:12
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38
FastTimeDetId::FastTimeDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 20 of file FastTimeDetId.cc.

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

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 }
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:35
ForwardSubdetector
uint32_t id_
Definition: DetId.h:69

Member Function Documentation

FastTimeDetId FastTimeDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 32 of file FastTimeDetId.h.

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

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

32 { return FastTimeDetId(type(), 0, 0, zside()); }
int zside() const
get the z-side of the cell (1/-1)
Definition: FastTimeDetId.h:48
int type() const
get the type (barrel vs endcap)
Definition: FastTimeDetId.h:38
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().

static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:10
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:11
uint32_t id_
Definition: DetId.h:69
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().

static const int kFastTimeCellPhiMask
Definition: FastTimeDetId.h:13
uint32_t id_
Definition: DetId.h:69
static const int kFastTimeCellPhiOffset
Definition: FastTimeDetId.h:12
bool FastTimeDetId::isFastTime ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 51 of file FastTimeDetId.h.

51 { return true; }
bool FastTimeDetId::isForward ( ) const
inline

Definition at line 52 of file FastTimeDetId.h.

52 { return true; }
int FastTimeDetId::iz ( ) const
inline

Definition at line 42 of file FastTimeDetId.h.

References DetId::id_, kFastTimeCellZMask, and kFastTimeCellZOffset.

static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:10
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:11
uint32_t id_
Definition: DetId.h:69
FastTimeDetId & FastTimeDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 31 of file FastTimeDetId.cc.

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

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 }
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:35
ForwardSubdetector
uint32_t id_
Definition: DetId.h:69
ForwardSubdetector FastTimeDetId::subdet ( ) const
inline

get the subdetector

Definition at line 35 of file FastTimeDetId.h.

References FastTime.

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

35 { return FastTime; }
int FastTimeDetId::type ( ) const
inline

get the type (barrel vs endcap)

Definition at line 38 of file FastTimeDetId.h.

References DetId::id_, kFastTimeTypeMask, and kFastTimeTypeOffset.

Referenced by geometryCell().

38 { return (id_ >> kFastTimeTypeOffset) & kFastTimeTypeMask; }
static const int kFastTimeTypeMask
Definition: FastTimeDetId.h:17
static const int kFastTimeTypeOffset
Definition: FastTimeDetId.h:16
uint32_t id_
Definition: DetId.h:69
int FastTimeDetId::zside ( ) const
inline

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

Definition at line 48 of file FastTimeDetId.h.

References DetId::id_, kFastTimeZsideMask, and kFastTimeZsideOffset.

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

48 { return ((((id_ >> kFastTimeZsideOffset) & kFastTimeZsideMask) > 0) ? 1 : -1); }
static const int kFastTimeZsideMask
Definition: FastTimeDetId.h:15
static const int kFastTimeZsideOffset
Definition: FastTimeDetId.h:14
uint32_t id_
Definition: DetId.h:69

Member Data Documentation

const int FastTimeDetId::kFastTimeCellPhiMask = 0x3FF
static

Definition at line 13 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and iphi().

const int FastTimeDetId::kFastTimeCellPhiOffset = 0
static

Definition at line 12 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and iphi().

const int FastTimeDetId::kFastTimeCellZMask = 0x3FF
static

Definition at line 11 of file FastTimeDetId.h.

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

const int FastTimeDetId::kFastTimeCellZOffset = 10
static

Definition at line 10 of file FastTimeDetId.h.

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

const int FastTimeDetId::kFastTimeTypeMask = 0x3
static

Definition at line 17 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and type().

const int FastTimeDetId::kFastTimeTypeOffset = 21
static

Definition at line 16 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and type().

const int FastTimeDetId::kFastTimeZsideMask = 0x1
static

Definition at line 15 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and zside().

const int FastTimeDetId::kFastTimeZsideOffset = 20
static

Definition at line 14 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and zside().

const FastTimeDetId FastTimeDetId::Undefined
static

Definition at line 54 of file FastTimeDetId.h.