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
}
 

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
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
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 kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 9 of file FastTimeDetId.h.

Member Enumeration Documentation

anonymous enum
Enumerator
Subdet 

Definition at line 19 of file FastTimeDetId.h.

anonymous enum
Enumerator
FastTimeUnknown 
FastTimeBarrel 
FastTimeEndcap 

Definition at line 20 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() { }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
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) { }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
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.

14  int zsid = (module_zside>0) ? (kFastTimeZsideMask) : (0);
15  id_ |= (((module_type&kFastTimeTypeMask)<<kFastTimeTypeOffset) |
18  (zsid<<kFastTimeZsideOffset));
19 }
static const int kFastTimeTypeMask
Definition: FastTimeDetId.h:18
static const int kFastTimeTypeOffset
Definition: FastTimeDetId.h:17
static const int kFastTimeZsideMask
Definition: FastTimeDetId.h:16
static const int kFastTimeCellPhiMask
Definition: FastTimeDetId.h:14
static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:11
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:12
static const int kFastTimeZsideOffset
Definition: FastTimeDetId.h:15
uint32_t id_
Definition: DetId.h:55
static const int kFastTimeCellPhiOffset
Definition: FastTimeDetId.h:13
FastTimeDetId::FastTimeDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 21 of file FastTimeDetId.cc.

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

21  {
22  if (!gen.null()) {
24  if (gen.det()!=Forward || (subdet!=FastTime)) {
25  throw cms::Exception("Invalid DetId") << "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:36
ForwardSubdetector
uint32_t id_
Definition: DetId.h:55

Member Function Documentation

FastTimeDetId FastTimeDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 33 of file FastTimeDetId.h.

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

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

33 {return FastTimeDetId (type(), 0, 0, zside());}
int zside() const
get the z-side of the cell (1/-1)
Definition: FastTimeDetId.h:49
int type() const
get the type (barrel vs endcap)
Definition: FastTimeDetId.h:39
int FastTimeDetId::ieta ( ) const
inline

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

Definition at line 42 of file FastTimeDetId.h.

References DetId::id_, and kFastTimeCellZMask.

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

static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:11
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:12
uint32_t id_
Definition: DetId.h:55
int FastTimeDetId::iphi ( ) const
inline

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

Definition at line 46 of file FastTimeDetId.h.

References DetId::id_, and kFastTimeCellPhiMask.

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

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

consistency check : no bits left => no overhead

Definition at line 52 of file FastTimeDetId.h.

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

Definition at line 53 of file FastTimeDetId.h.

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

Definition at line 43 of file FastTimeDetId.h.

References DetId::id_, and kFastTimeCellZMask.

static const int kFastTimeCellZOffset
Definition: FastTimeDetId.h:11
static const int kFastTimeCellZMask
Definition: FastTimeDetId.h:12
uint32_t id_
Definition: DetId.h:55
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") << "Cannot assign FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
36  }
37  }
38  id_ = gen.rawId();
39  return (*this);
40 }
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:36
ForwardSubdetector
uint32_t id_
Definition: DetId.h:55
ForwardSubdetector FastTimeDetId::subdet ( ) const
inline

get the subdetector

Definition at line 36 of file FastTimeDetId.h.

References FastTime.

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

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

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

Definition at line 49 of file FastTimeDetId.h.

References DetId::id_.

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

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

Member Data Documentation

const int FastTimeDetId::kFastTimeCellPhiMask = 0x3FF
static

Definition at line 14 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and iphi().

const int FastTimeDetId::kFastTimeCellPhiOffset = 0
static

Definition at line 13 of file FastTimeDetId.h.

Referenced by FastTimeDetId().

const int FastTimeDetId::kFastTimeCellZMask = 0x3FF
static

Definition at line 12 of file FastTimeDetId.h.

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

const int FastTimeDetId::kFastTimeCellZOffset = 10
static

Definition at line 11 of file FastTimeDetId.h.

Referenced by FastTimeDetId().

const int FastTimeDetId::kFastTimeTypeMask = 0x3
static

Definition at line 18 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and type().

const int FastTimeDetId::kFastTimeTypeOffset = 21
static

Definition at line 17 of file FastTimeDetId.h.

Referenced by FastTimeDetId().

const int FastTimeDetId::kFastTimeZsideMask = 0x1
static

Definition at line 16 of file FastTimeDetId.h.

Referenced by FastTimeDetId().

const int FastTimeDetId::kFastTimeZsideOffset = 20
static

Definition at line 15 of file FastTimeDetId.h.

Referenced by FastTimeDetId().

const FastTimeDetId FastTimeDetId::Undefined
static

Definition at line 55 of file FastTimeDetId.h.