CMS 3D CMS Logo

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

#include <HFNoseDetId.h>

Inheritance diagram for HFNoseDetId:
DetId

Public Types

enum  hfNoseWaferType { HFNoseFine =0, HFNoseCoarseThin =1, HFNoseCoarseThick =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

int cellU () const
 get the cell #'s in u,v or in x,y More...
 
std::pair< int, int > cellUV () const
 
int cellV () const
 
int cellX () const
 
std::pair< int, int > cellXY () const
 
int cellY () const
 
HFNoseDetId geometryCell () const
 
 HFNoseDetId ()
 
 HFNoseDetId (uint32_t rawid)
 
 HFNoseDetId (int zp, int type, int layer, int waferU, int waferV, int cellU, int cellV)
 
 HFNoseDetId (const DetId &id)
 
bool isEE () const
 consistency check : no bits left => no overhead More...
 
bool isForward () const
 
bool isHE () const
 
int layer () const
 get the layer # More...
 
HFNoseDetIdoperator= (const DetId &id)
 
ForwardSubdetector subdet () const
 get the subdetector More...
 
int type () const
 get the type More...
 
int waferU () const
 
int waferUAbs () const
 get the wafer #'s in u,v or in x,y More...
 
std::pair< int, int > waferUV () const
 
int waferV () const
 
int waferVAbs () const
 
int waferX () const
 
std::pair< int, int > waferXY () const
 
int waferY () const
 
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 HFNoseCoarseN =8
 
static const int HFNoseCoarseTrigger =2
 
static const int HFNoseFineN =12
 
static const int HFNoseFineTrigger =3
 
static const HFNoseDetId 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
 

Static Private Attributes

static const int kHFNoseCellUMask = 0x1F
 
static const int kHFNoseCellUOffset = 0
 
static const int kHFNoseCellVMask = 0x1F
 
static const int kHFNoseCellVOffset = 5
 
static const int kHFNoseLayerEEmax = 6
 
static const int kHFNoseLayerMask = 0xF
 
static const int kHFNoseLayerOffset = 18
 
static const int kHFNoseTypeMask = 0x3
 
static const int kHFNoseTypeOffset = 23
 
static const int kHFNoseWaferUMask = 0x7
 
static const int kHFNoseWaferUOffset = 10
 
static const int kHFNoseWaferUSignMask = 0x1
 
static const int kHFNoseWaferUSignOffset = 13
 
static const int kHFNoseWaferVMask = 0x7
 
static const int kHFNoseWaferVOffset = 14
 
static const int kHFNoseWaferVSignMask = 0x1
 
static const int kHFNoseWaferVSignOffset = 17
 
static const int kHFNoseZsideMask = 0x1
 
static const int kHFNoseZsideOffset = 22
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Definition at line 23 of file HFNoseDetId.h.

Member Enumeration Documentation

Enumerator
HFNoseFine 
HFNoseCoarseThin 
HFNoseCoarseThick 

Definition at line 27 of file HFNoseDetId.h.

Constructor & Destructor Documentation

HFNoseDetId::HFNoseDetId ( )

Create a null cellid

Definition at line 8 of file HFNoseDetId.cc.

Referenced by geometryCell().

8  : DetId() {
9 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
HFNoseDetId::HFNoseDetId ( uint32_t  rawid)

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

Definition at line 11 of file HFNoseDetId.cc.

11  : DetId(rawid) {
12 }
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
HFNoseDetId::HFNoseDetId ( int  zp,
int  type,
int  layer,
int  waferU,
int  waferV,
int  cellU,
int  cellV 
)

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

Definition at line 14 of file HFNoseDetId.cc.

References funct::abs(), DetId::id_, kHFNoseCellUMask, kHFNoseCellUOffset, kHFNoseCellVMask, kHFNoseCellVOffset, kHFNoseLayerMask, kHFNoseLayerOffset, kHFNoseTypeMask, kHFNoseTypeOffset, kHFNoseWaferUMask, kHFNoseWaferUOffset, kHFNoseWaferUSignMask, kHFNoseWaferUSignOffset, kHFNoseWaferVMask, kHFNoseWaferVOffset, kHFNoseWaferVSignMask, kHFNoseWaferVSignOffset, kHFNoseZsideMask, kHFNoseZsideOffset, and zside().

15  : DetId(Forward,HFNose) {
16 
17  int waferUabs(std::abs(waferU)), waferVabs(std::abs(waferV));
18  int waferUsign = (waferU >= 0) ? 0 : 1;
19  int waferVsign = (waferV >= 0) ? 0 : 1;
20  int zside = (zp < 0) ? 1 : 0;
23  ((waferUabs & kHFNoseWaferUMask) << kHFNoseWaferUOffset) |
25  ((waferVabs & kHFNoseWaferVMask) << kHFNoseWaferVOffset) |
28  ((zside & kHFNoseZsideMask) << kHFNoseZsideOffset) |
30 }
type
Definition: HCALResponse.h:21
static const int kHFNoseWaferUOffset
Definition: HFNoseDetId.h:98
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseDetId.h:55
static const int kHFNoseZsideMask
Definition: HFNoseDetId.h:109
static const int kHFNoseTypeOffset
Definition: HFNoseDetId.h:110
int cellU() const
get the cell #&#39;s in u,v or in x,y
Definition: HFNoseDetId.h:61
static const int kHFNoseTypeMask
Definition: HFNoseDetId.h:111
static const int kHFNoseWaferUSignOffset
Definition: HFNoseDetId.h:100
static const int kHFNoseCellUMask
Definition: HFNoseDetId.h:95
static const int kHFNoseWaferVOffset
Definition: HFNoseDetId.h:102
static const int kHFNoseWaferUMask
Definition: HFNoseDetId.h:99
int cellV() const
Definition: HFNoseDetId.h:62
int waferV() const
Definition: HFNoseDetId.h:78
int layer() const
get the layer #
Definition: HFNoseDetId.h:58
static const int kHFNoseCellVMask
Definition: HFNoseDetId.h:97
int waferU() const
Definition: HFNoseDetId.h:77
static const int kHFNoseZsideOffset
Definition: HFNoseDetId.h:108
static const int kHFNoseLayerMask
Definition: HFNoseDetId.h:107
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHFNoseCellUOffset
Definition: HFNoseDetId.h:94
static const int kHFNoseLayerOffset
Definition: HFNoseDetId.h:106
static const int kHFNoseWaferVSignOffset
Definition: HFNoseDetId.h:104
uint32_t id_
Definition: DetId.h:62
static const int kHFNoseWaferUSignMask
Definition: HFNoseDetId.h:101
static const int kHFNoseWaferVSignMask
Definition: HFNoseDetId.h:105
static const int kHFNoseWaferVMask
Definition: HFNoseDetId.h:103
static const int kHFNoseCellVOffset
Definition: HFNoseDetId.h:96
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:30
HFNoseDetId::HFNoseDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 32 of file HFNoseDetId.cc.

References TauDecayModes::dec, DetId::det(), Exception, DetId::Forward, HFNose, DetId::id_, createfilelist::int, DetId::null(), DetId::rawId(), and DetId::subdetId().

32  {
33  if (!gen.null()) {
34  if (!((gen.det()==Forward) && (gen.subdetId()==(int)(HFNose)))) {
35  throw cms::Exception("Invalid DetId") << "Cannot initialize HFNoseDetId from " << std::hex << gen.rawId() << std::dec;
36  }
37  }
38  id_ = gen.rawId();
39 }
uint32_t id_
Definition: DetId.h:62

Member Function Documentation

int HFNoseDetId::cellU ( ) const
inline

get the cell #'s in u,v or in x,y

Definition at line 61 of file HFNoseDetId.h.

References DetId::id_, kHFNoseCellUMask, and kHFNoseCellUOffset.

Referenced by cellUV(), and cellY().

static const int kHFNoseCellUMask
Definition: HFNoseDetId.h:95
static const int kHFNoseCellUOffset
Definition: HFNoseDetId.h:94
uint32_t id_
Definition: DetId.h:62
std::pair<int,int> HFNoseDetId::cellUV ( ) const
inline

Definition at line 63 of file HFNoseDetId.h.

References cellU(), and cellV().

63 { return std::pair<int,int>(cellU(),cellV()); }
int cellU() const
get the cell #&#39;s in u,v or in x,y
Definition: HFNoseDetId.h:61
int cellV() const
Definition: HFNoseDetId.h:62
int HFNoseDetId::cellV ( ) const
inline

Definition at line 62 of file HFNoseDetId.h.

References DetId::id_, kHFNoseCellVMask, and kHFNoseCellVOffset.

Referenced by cellUV(), cellX(), and cellY().

static const int kHFNoseCellVMask
Definition: HFNoseDetId.h:97
uint32_t id_
Definition: DetId.h:62
static const int kHFNoseCellVOffset
Definition: HFNoseDetId.h:96
int HFNoseDetId::cellX ( ) const
inline

Definition at line 64 of file HFNoseDetId.h.

References cellV(), HFNoseFine, N, and type().

Referenced by cellXY().

64  {
65  int N = (type() == HFNoseFine) ? HFNoseFineN : HFNoseCoarseN;
66  return (3*(cellV()-N)+2);
67  }
static const int HFNoseCoarseN
Definition: HFNoseDetId.h:29
int type() const
get the type
Definition: HFNoseDetId.h:52
static const int HFNoseFineN
Definition: HFNoseDetId.h:28
int cellV() const
Definition: HFNoseDetId.h:62
#define N
Definition: blowfish.cc:9
std::pair<int,int> HFNoseDetId::cellXY ( ) const
inline

Definition at line 72 of file HFNoseDetId.h.

References cellX(), and cellY().

72 { return std::pair<int,int>(cellX(),cellY()); }
int cellX() const
Definition: HFNoseDetId.h:64
int cellY() const
Definition: HFNoseDetId.h:68
int HFNoseDetId::cellY ( ) const
inline

Definition at line 68 of file HFNoseDetId.h.

References cellU(), cellV(), HFNoseFine, N, and type().

Referenced by cellXY().

68  {
69  int N = (type() == HFNoseFine) ? HFNoseFineN : HFNoseCoarseN;
70  return (2*cellU()-(N+cellV()));
71  }
static const int HFNoseCoarseN
Definition: HFNoseDetId.h:29
int type() const
get the type
Definition: HFNoseDetId.h:52
int cellU() const
get the cell #&#39;s in u,v or in x,y
Definition: HFNoseDetId.h:61
static const int HFNoseFineN
Definition: HFNoseDetId.h:28
int cellV() const
Definition: HFNoseDetId.h:62
#define N
Definition: blowfish.cc:9
HFNoseDetId HFNoseDetId::geometryCell ( ) const
inline

Converter for a geometry cell id

Definition at line 49 of file HFNoseDetId.h.

References HFNoseDetId(), layer(), waferU(), waferV(), and zside().

Referenced by HGCalGeometry::getGeometryDetId().

49 {return HFNoseDetId (zside(), 0, layer(), waferU(), waferV(), 0, 0);}
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseDetId.h:55
int waferV() const
Definition: HFNoseDetId.h:78
int layer() const
get the layer #
Definition: HFNoseDetId.h:58
int waferU() const
Definition: HFNoseDetId.h:77
bool HFNoseDetId::isEE ( ) const
inline

consistency check : no bits left => no overhead

Definition at line 85 of file HFNoseDetId.h.

References kHFNoseLayerEEmax, and layer().

85 { return (layer() <= kHFNoseLayerEEmax); }
static const int kHFNoseLayerEEmax
Definition: HFNoseDetId.h:93
int layer() const
get the layer #
Definition: HFNoseDetId.h:58
bool HFNoseDetId::isForward ( ) const
inline

Definition at line 87 of file HFNoseDetId.h.

87 { return true; }
bool HFNoseDetId::isHE ( ) const
inline

Definition at line 86 of file HFNoseDetId.h.

References kHFNoseLayerEEmax, and layer().

86 { return (layer() > kHFNoseLayerEEmax); }
static const int kHFNoseLayerEEmax
Definition: HFNoseDetId.h:93
int layer() const
get the layer #
Definition: HFNoseDetId.h:58
int HFNoseDetId::layer ( ) const
inline
HFNoseDetId & HFNoseDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 41 of file HFNoseDetId.cc.

References TauDecayModes::dec, DetId::det(), Exception, DetId::Forward, HFNose, DetId::id_, createfilelist::int, DetId::null(), DetId::rawId(), and DetId::subdetId().

41  {
42  if (!gen.null()) {
43  if (!((gen.det()==Forward) && (gen.subdetId()==(int)(HFNose)))) {
44  throw cms::Exception("Invalid DetId") << "Cannot assign HFNoseDetId from " << std::hex << gen.rawId() << std::dec;
45  }
46  }
47  id_ = gen.rawId();
48  return (*this);
49 }
uint32_t id_
Definition: DetId.h:62
ForwardSubdetector HFNoseDetId::subdet ( ) const
inline

get the subdetector

Definition at line 46 of file HFNoseDetId.h.

References HFNose.

46 { return HFNose; }
int HFNoseDetId::type ( ) const
inline
int HFNoseDetId::waferU ( ) const
inline

Definition at line 77 of file HFNoseDetId.h.

References DetId::id_, kHFNoseWaferUSignMask, kHFNoseWaferUSignOffset, and waferUAbs().

Referenced by geometryCell(), waferUV(), and waferX().

static const int kHFNoseWaferUSignOffset
Definition: HFNoseDetId.h:100
uint32_t id_
Definition: DetId.h:62
static const int kHFNoseWaferUSignMask
Definition: HFNoseDetId.h:101
int waferUAbs() const
get the wafer #&#39;s in u,v or in x,y
Definition: HFNoseDetId.h:75
int HFNoseDetId::waferUAbs ( ) const
inline

get the wafer #'s in u,v or in x,y

Definition at line 75 of file HFNoseDetId.h.

References DetId::id_, kHFNoseWaferUMask, and kHFNoseWaferUOffset.

Referenced by waferU().

static const int kHFNoseWaferUOffset
Definition: HFNoseDetId.h:98
static const int kHFNoseWaferUMask
Definition: HFNoseDetId.h:99
uint32_t id_
Definition: DetId.h:62
std::pair<int,int> HFNoseDetId::waferUV ( ) const
inline

Definition at line 79 of file HFNoseDetId.h.

References waferU(), and waferV().

Referenced by HFNoseSD::setDetUnitId().

79 { return std::pair<int,int>(waferU(),waferV()); }
int waferV() const
Definition: HFNoseDetId.h:78
int waferU() const
Definition: HFNoseDetId.h:77
int HFNoseDetId::waferV ( ) const
inline

Definition at line 78 of file HFNoseDetId.h.

References DetId::id_, kHFNoseWaferVSignMask, kHFNoseWaferVSignOffset, and waferVAbs().

Referenced by geometryCell(), waferUV(), waferX(), and waferY().

int waferVAbs() const
Definition: HFNoseDetId.h:76
static const int kHFNoseWaferVSignOffset
Definition: HFNoseDetId.h:104
uint32_t id_
Definition: DetId.h:62
static const int kHFNoseWaferVSignMask
Definition: HFNoseDetId.h:105
int HFNoseDetId::waferVAbs ( ) const
inline

Definition at line 76 of file HFNoseDetId.h.

References DetId::id_, kHFNoseWaferVMask, and kHFNoseWaferVOffset.

Referenced by waferV().

static const int kHFNoseWaferVOffset
Definition: HFNoseDetId.h:102
uint32_t id_
Definition: DetId.h:62
static const int kHFNoseWaferVMask
Definition: HFNoseDetId.h:103
int HFNoseDetId::waferX ( ) const
inline

Definition at line 80 of file HFNoseDetId.h.

References waferU(), and waferV().

Referenced by waferXY().

80 { return (-2*waferU()+waferV()); }
int waferV() const
Definition: HFNoseDetId.h:78
int waferU() const
Definition: HFNoseDetId.h:77
std::pair<int,int> HFNoseDetId::waferXY ( ) const
inline

Definition at line 82 of file HFNoseDetId.h.

References waferX(), and waferY().

82 { return std::pair<int,int>(waferX(),waferY()); }
int waferX() const
Definition: HFNoseDetId.h:80
int waferY() const
Definition: HFNoseDetId.h:81
int HFNoseDetId::waferY ( ) const
inline

Definition at line 81 of file HFNoseDetId.h.

References waferV().

Referenced by waferXY().

81 { return (2*waferV()); }
int waferV() const
Definition: HFNoseDetId.h:78
int HFNoseDetId::zside ( ) const
inline

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

Definition at line 55 of file HFNoseDetId.h.

References DetId::id_, kHFNoseZsideMask, and kHFNoseZsideOffset.

Referenced by geometryCell(), and HFNoseDetId().

55 { return (((id_>>kHFNoseZsideOffset) & kHFNoseZsideMask) ? -1 : 1); }
static const int kHFNoseZsideMask
Definition: HFNoseDetId.h:109
static const int kHFNoseZsideOffset
Definition: HFNoseDetId.h:108
uint32_t id_
Definition: DetId.h:62

Member Data Documentation

const int HFNoseDetId::HFNoseCoarseN =8
static

Definition at line 29 of file HFNoseDetId.h.

const int HFNoseDetId::HFNoseCoarseTrigger =2
static

Definition at line 31 of file HFNoseDetId.h.

const int HFNoseDetId::HFNoseFineN =12
static

Definition at line 28 of file HFNoseDetId.h.

const int HFNoseDetId::HFNoseFineTrigger =3
static

Definition at line 30 of file HFNoseDetId.h.

const int HFNoseDetId::kHFNoseCellUMask = 0x1F
staticprivate

Definition at line 95 of file HFNoseDetId.h.

Referenced by cellU(), and HFNoseDetId().

const int HFNoseDetId::kHFNoseCellUOffset = 0
staticprivate

Definition at line 94 of file HFNoseDetId.h.

Referenced by cellU(), and HFNoseDetId().

const int HFNoseDetId::kHFNoseCellVMask = 0x1F
staticprivate

Definition at line 97 of file HFNoseDetId.h.

Referenced by cellV(), and HFNoseDetId().

const int HFNoseDetId::kHFNoseCellVOffset = 5
staticprivate

Definition at line 96 of file HFNoseDetId.h.

Referenced by cellV(), and HFNoseDetId().

const int HFNoseDetId::kHFNoseLayerEEmax = 6
staticprivate

Definition at line 93 of file HFNoseDetId.h.

Referenced by isEE(), and isHE().

const int HFNoseDetId::kHFNoseLayerMask = 0xF
staticprivate

Definition at line 107 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and layer().

const int HFNoseDetId::kHFNoseLayerOffset = 18
staticprivate

Definition at line 106 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and layer().

const int HFNoseDetId::kHFNoseTypeMask = 0x3
staticprivate

Definition at line 111 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and type().

const int HFNoseDetId::kHFNoseTypeOffset = 23
staticprivate

Definition at line 110 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and type().

const int HFNoseDetId::kHFNoseWaferUMask = 0x7
staticprivate

Definition at line 99 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and waferUAbs().

const int HFNoseDetId::kHFNoseWaferUOffset = 10
staticprivate

Definition at line 98 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and waferUAbs().

const int HFNoseDetId::kHFNoseWaferUSignMask = 0x1
staticprivate

Definition at line 101 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and waferU().

const int HFNoseDetId::kHFNoseWaferUSignOffset = 13
staticprivate

Definition at line 100 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and waferU().

const int HFNoseDetId::kHFNoseWaferVMask = 0x7
staticprivate

Definition at line 103 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and waferVAbs().

const int HFNoseDetId::kHFNoseWaferVOffset = 14
staticprivate

Definition at line 102 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and waferVAbs().

const int HFNoseDetId::kHFNoseWaferVSignMask = 0x1
staticprivate

Definition at line 105 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and waferV().

const int HFNoseDetId::kHFNoseWaferVSignOffset = 17
staticprivate

Definition at line 104 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and waferV().

const int HFNoseDetId::kHFNoseZsideMask = 0x1
staticprivate

Definition at line 109 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and zside().

const int HFNoseDetId::kHFNoseZsideOffset = 22
staticprivate

Definition at line 108 of file HFNoseDetId.h.

Referenced by HFNoseDetId(), and zside().

const HFNoseDetId HFNoseDetId::Undefined
static

Definition at line 89 of file HFNoseDetId.h.