CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 }
 
- 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 module_ix, int module_iy, int iz)
 
 FastTimeDetId (const DetId &id)
 
FastTimeDetId geometryCell () const
 
bool isFastTime () const
 consistency check : no bits left => no overhead More...
 
bool isForward () const
 
int ix () const
 get the absolute value of the cell #'s along x-axis More...
 
int iy () const
 get the absolute value of the cell #'s along y-axis More...
 
FastTimeDetIdoperator= (const DetId &id)
 
ForwardSubdetector subdet () const
 get the subdetector 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 kFastTimeCellXMask = 0xFF
 
static const int kFastTimeCellXOffset = 8
 
static const int kFastTimeCellYMask = 0xFFF
 
static const int kFastTimeCellYOffset = 0
 
static const int kFastTimeZsideMask = 0x10000
 
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 16 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  module_ix,
int  module_iy,
int  iz 
)

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

Definition at line 12 of file FastTimeDetId.cc.

References DetId::id_, kFastTimeCellXMask, kFastTimeCellXOffset, kFastTimeCellYMask, and kFastTimeCellYOffset.

13  id_ |= (((module_iy&kFastTimeCellYMask)<<kFastTimeCellYOffset) |
15  ((iz>0)?(0x10000):(0)));
16 }
static const int kFastTimeCellXOffset
Definition: FastTimeDetId.h:11
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
static const int kFastTimeCellYMask
Definition: FastTimeDetId.h:14
uint32_t id_
Definition: DetId.h:55
static const int kFastTimeCellXMask
Definition: FastTimeDetId.h:12
static const int kFastTimeCellYOffset
Definition: FastTimeDetId.h:13
FastTimeDetId::FastTimeDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 18 of file FastTimeDetId.cc.

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

18  {
19  if (!gen.null()) {
21  if (gen.det()!=Forward || (subdet!=FastTime)) {
22  throw cms::Exception("Invalid DetId") << "Cannot initialize FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
23  }
24  }
25  id_ = gen.rawId();
26 }
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:32
ForwardSubdetector
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
uint32_t id_
Definition: DetId.h:55

Member Function Documentation

FastTimeDetId FastTimeDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 29 of file FastTimeDetId.h.

References FastTimeDetId(), and zside().

29 {return FastTimeDetId (0, 0, zside());}
int zside() const
get the z-side of the cell (1/-1)
Definition: FastTimeDetId.h:41
bool FastTimeDetId::isFastTime ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 44 of file FastTimeDetId.h.

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

Definition at line 45 of file FastTimeDetId.h.

45 { return true; }
int FastTimeDetId::ix ( ) const
inline

get the absolute value of the cell #'s along x-axis

Definition at line 35 of file FastTimeDetId.h.

References DetId::id_, kFastTimeCellXMask, and kFastTimeCellXOffset.

static const int kFastTimeCellXOffset
Definition: FastTimeDetId.h:11
uint32_t id_
Definition: DetId.h:55
static const int kFastTimeCellXMask
Definition: FastTimeDetId.h:12
int FastTimeDetId::iy ( ) const
inline

get the absolute value of the cell #'s along y-axis

Definition at line 38 of file FastTimeDetId.h.

References DetId::id_, kFastTimeCellYMask, and kFastTimeCellYOffset.

static const int kFastTimeCellYMask
Definition: FastTimeDetId.h:14
uint32_t id_
Definition: DetId.h:55
static const int kFastTimeCellYOffset
Definition: FastTimeDetId.h:13
FastTimeDetId & FastTimeDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 28 of file FastTimeDetId.cc.

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

28  {
29  if (!gen.null()) {
31  if (gen.det()!=Forward || (subdet!=FastTime)) {
32  throw cms::Exception("Invalid DetId") << "Cannot assign FastTimeDetId from " << std::hex << gen.rawId() << std::dec;
33  }
34  }
35  id_ = gen.rawId();
36  return (*this);
37 }
ForwardSubdetector subdet() const
get the subdetector
Definition: FastTimeDetId.h:32
ForwardSubdetector
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
uint32_t id_
Definition: DetId.h:55
ForwardSubdetector FastTimeDetId::subdet ( ) const
inline

get the subdetector

Definition at line 32 of file FastTimeDetId.h.

References FastTime.

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

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

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

Definition at line 41 of file FastTimeDetId.h.

References DetId::id_, and kFastTimeZsideMask.

Referenced by geometryCell().

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

Member Data Documentation

const int FastTimeDetId::kFastTimeCellXMask = 0xFF
static

Definition at line 12 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and ix().

const int FastTimeDetId::kFastTimeCellXOffset = 8
static

Definition at line 11 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and ix().

const int FastTimeDetId::kFastTimeCellYMask = 0xFFF
static

Definition at line 14 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and iy().

const int FastTimeDetId::kFastTimeCellYOffset = 0
static

Definition at line 13 of file FastTimeDetId.h.

Referenced by FastTimeDetId(), and iy().

const int FastTimeDetId::kFastTimeZsideMask = 0x10000
static

Definition at line 15 of file FastTimeDetId.h.

Referenced by zside().

const FastTimeDetId FastTimeDetId::Undefined
static

Definition at line 47 of file FastTimeDetId.h.