CMS 3D CMS Logo

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

#include <MuonHitHelper.h>

Public Types

enum  CSCType {
  CSC_ALL = 0, CSC_ME11, CSC_ME1a, CSC_ME1b,
  CSC_ME12, CSC_ME13, CSC_ME21, CSC_ME22,
  CSC_ME31, CSC_ME32, CSC_ME41, CSC_ME42
}
 CSC chamber types, according to CSCDetId::iChamberType() More...
 
enum  DTType {
  DT_ALL = 0, DT_MB01, DT_MB02, DT_MB03,
  DT_MB04, DT_MB11p, DT_MB12p, DT_MB13p,
  DT_MB14p, DT_MB21p, DT_MB22p, DT_MB23p,
  DT_MB24p, DT_MB11n, DT_MB12n, DT_MB13n,
  DT_MB14n, DT_MB21n, DT_MB22n, DT_MB23n,
  DT_MB24n
}
 DT chamber types. More...
 
enum  GEMType { GEM_ALL = 0, GEM_ME11, GEM_ME21 }
 GEM chamber types. More...
 
enum  RPCType {
  RPC_ALL = 0, RPC_ME12, RPC_ME13, RPC_ME22,
  RPC_ME23, RPC_ME31, RPC_ME32, RPC_ME33,
  RPC_ME41, RPC_ME42, RPC_ME43, RPC_MB01,
  RPC_MB02, RPC_MB03, RPC_MB04, RPC_MB11p,
  RPC_MB12p, RPC_MB13p, RPC_MB14p, RPC_MB21p,
  RPC_MB22p, RPC_MB23p, RPC_MB24p, RPC_MB11n,
  RPC_MB12n, RPC_MB13n, RPC_MB14n, RPC_MB21n,
  RPC_MB22n, RPC_MB23n, RPC_MB24n
}
 RPC endcap chamber types. More...
 

Static Public Member Functions

static int chamber (const DetId &id)
 
static bool isCSC (unsigned int detId)
 
static bool isDT (unsigned int detId)
 check detid type More...
 
static bool isGEM (unsigned int detId)
 
static bool isME0 (unsigned int detId)
 
static bool isRPC (unsigned int detId)
 
static int toCSCType (int st, int ri)
 
static int toDTType (int wh, int st)
 
static int toGEMType (int st, int ri)
 
static int toRPCType (int re, int st, int ri)
 

Detailed Description

Definition at line 11 of file MuonHitHelper.h.

Member Enumeration Documentation

CSC chamber types, according to CSCDetId::iChamberType()

Enumerator
CSC_ALL 
CSC_ME11 
CSC_ME1a 
CSC_ME1b 
CSC_ME12 
CSC_ME13 
CSC_ME21 
CSC_ME22 
CSC_ME31 
CSC_ME32 
CSC_ME41 
CSC_ME42 

Definition at line 14 of file MuonHitHelper.h.

DT chamber types.

Enumerator
DT_ALL 
DT_MB01 
DT_MB02 
DT_MB03 
DT_MB04 
DT_MB11p 
DT_MB12p 
DT_MB13p 
DT_MB14p 
DT_MB21p 
DT_MB22p 
DT_MB23p 
DT_MB24p 
DT_MB11n 
DT_MB12n 
DT_MB13n 
DT_MB14n 
DT_MB21n 
DT_MB22n 
DT_MB23n 
DT_MB24n 

Definition at line 68 of file MuonHitHelper.h.

GEM chamber types.

Enumerator
GEM_ALL 
GEM_ME11 
GEM_ME21 

Definition at line 30 of file MuonHitHelper.h.

RPC endcap chamber types.

Enumerator
RPC_ALL 
RPC_ME12 
RPC_ME13 
RPC_ME22 
RPC_ME23 
RPC_ME31 
RPC_ME32 
RPC_ME33 
RPC_ME41 
RPC_ME42 
RPC_ME43 
RPC_MB01 
RPC_MB02 
RPC_MB03 
RPC_MB04 
RPC_MB11p 
RPC_MB12p 
RPC_MB13p 
RPC_MB14p 
RPC_MB21p 
RPC_MB22p 
RPC_MB23p 
RPC_MB24p 
RPC_MB11n 
RPC_MB12n 
RPC_MB13n 
RPC_MB14n 
RPC_MB21n 
RPC_MB22n 
RPC_MB23n 
RPC_MB24n 

Definition at line 33 of file MuonHitHelper.h.

33  {
34  RPC_ALL = 0,
35  RPC_ME12,
36  RPC_ME13,
37  RPC_ME22,
38  RPC_ME23,
39  RPC_ME31,
40  RPC_ME32,
41  RPC_ME33,
42  RPC_ME41,
43  RPC_ME42,
44  RPC_ME43,
45  RPC_MB01,
46  RPC_MB02,
47  RPC_MB03,
48  RPC_MB04,
49  RPC_MB11p,
50  RPC_MB12p,
51  RPC_MB13p,
52  RPC_MB14p,
53  RPC_MB21p,
54  RPC_MB22p,
55  RPC_MB23p,
56  RPC_MB24p,
57  RPC_MB11n,
58  RPC_MB12n,
59  RPC_MB13n,
60  RPC_MB14n,
61  RPC_MB21n,
62  RPC_MB22n,
63  RPC_MB23n,
64  RPC_MB24n
65  };

Member Function Documentation

int MuonHitHelper::chamber ( const DetId id)
static

Definition at line 28 of file MuonHitHelper.cc.

References ME0DetId::chamber(), CSCDetId::chamber(), GEMDetId::chamber(), MuonSubdetId::CSC, MuonSubdetId::DT, MuonSubdetId::GEM, MuonSubdetId::ME0, nanoDQM_cff::Muon, MuonSubdetId::RPC, DTChamberId::sector(), and RPCDetId::sector().

Referenced by geometryXMLparser.CSCAlignable::index().

28  {
29  if (id.det() != DetId::Detector::Muon) return -99;
30  int chamberN = 0;
31  switch (id.subdetId()) {
32  case MuonSubdetId::GEM:
33  chamberN = GEMDetId(id).chamber();
34  break;
35  case MuonSubdetId::RPC:
36  // works only for endcap!!
37  chamberN = RPCDetId(id).sector();
38  break;
39  case MuonSubdetId::CSC:
40  chamberN = CSCDetId(id).chamber();
41  break;
42  case MuonSubdetId::ME0:
43  chamberN = ME0DetId(id).chamber();
44  break;
45  case MuonSubdetId::DT:
46  chamberN = DTChamberId(id).sector();
47  break;
48  };
49  return chamberN;
50 }
int chamber() const
Definition: CSCDetId.h:68
static constexpr int GEM
Definition: MuonSubdetId.h:15
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: GEMDetId.h:74
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: ME0DetId.h:51
static constexpr int ME0
Definition: MuonSubdetId.h:16
static constexpr int RPC
Definition: MuonSubdetId.h:14
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
int sector() const
Definition: DTChamberId.h:61
static constexpr int DT
Definition: MuonSubdetId.h:12
static constexpr int CSC
Definition: MuonSubdetId.h:13
bool MuonHitHelper::isCSC ( unsigned int  detId)
static

Definition at line 13 of file MuonHitHelper.cc.

References MuonSubdetId::CSC, and DetId::Muon.

13  {
14  return (DetId(detId)).det() == DetId::Muon &&
15  (DetId(detId)).subdetId() == MuonSubdetId::CSC;
16 }
Definition: DetId.h:18
static constexpr int CSC
Definition: MuonSubdetId.h:13
bool MuonHitHelper::isDT ( unsigned int  detId)
static
bool MuonHitHelper::isGEM ( unsigned int  detId)
static

Definition at line 8 of file MuonHitHelper.cc.

References MuonSubdetId::GEM, and DetId::Muon.

Referenced by GEMSimHitMatcher::hitsInSuperChamber(), and GEMSimHitMatcher::simHitsGEMCentralPosition().

8  {
9  return (DetId(detId)).det() == DetId::Muon &&
10  (DetId(detId)).subdetId() == MuonSubdetId::GEM;
11 }
static constexpr int GEM
Definition: MuonSubdetId.h:15
Definition: DetId.h:18
bool MuonHitHelper::isME0 ( unsigned int  detId)
static

Definition at line 23 of file MuonHitHelper.cc.

References MuonSubdetId::ME0, and DetId::Muon.

23  {
24  return (DetId(detId)).det() == DetId::Muon &&
25  (DetId(detId)).subdetId() == MuonSubdetId::ME0;
26 }
static constexpr int ME0
Definition: MuonSubdetId.h:16
Definition: DetId.h:18
bool MuonHitHelper::isRPC ( unsigned int  detId)
static

Definition at line 18 of file MuonHitHelper.cc.

References DetId::Muon, and MuonSubdetId::RPC.

18  {
19  return (DetId(detId)).det() == DetId::Muon &&
20  (DetId(detId)).subdetId() == MuonSubdetId::RPC;
21 }
Definition: DetId.h:18
static constexpr int RPC
Definition: MuonSubdetId.h:14
int MuonHitHelper::toCSCType ( int  st,
int  ri 
)
static

Definition at line 147 of file MuonHitHelper.cc.

References CSC_ALL, CSC_ME11, CSC_ME12, CSC_ME13, CSC_ME1a, CSC_ME1b, CSC_ME21, CSC_ME22, CSC_ME31, CSC_ME32, CSC_ME41, and CSC_ME42.

Referenced by CSCSimHitMatcher::chamberIds(), and CSCSimHitMatcher::detIds().

147  {
148  if (st == 1) {
149  if (ri == 0) return CSC_ME11;
150  if (ri == 1) return CSC_ME1b;
151  if (ri == 2) return CSC_ME12;
152  if (ri == 3) return CSC_ME13;
153  if (ri == 4) return CSC_ME1a;
154  } else if (st == 2) {
155  if (ri == 1) return CSC_ME21;
156  if (ri == 2) return CSC_ME22;
157  } else if (st == 3) {
158  if (ri == 1) return CSC_ME31;
159  if (ri == 2) return CSC_ME32;
160  } else if (st == 4) {
161  if (ri == 1) return CSC_ME41;
162  if (ri == 2) return CSC_ME42;
163  }
164  return CSC_ALL;
165 }
int MuonHitHelper::toDTType ( int  wh,
int  st 
)
static

Definition at line 113 of file MuonHitHelper.cc.

References DT_ALL, DT_MB01, DT_MB02, DT_MB03, DT_MB04, DT_MB11n, DT_MB11p, DT_MB12n, DT_MB12p, DT_MB13n, DT_MB13p, DT_MB14n, DT_MB14p, DT_MB21n, DT_MB21p, DT_MB22n, DT_MB22p, DT_MB23n, DT_MB23p, DT_MB24n, and DT_MB24p.

Referenced by DTSimHitMatcher::chamberIds(), and DTSimHitMatcher::detIds().

113  {
114  if (wh == -2) {
115  if (st == 1) return DT_MB21n;
116  if (st == 2) return DT_MB22n;
117  if (st == 3) return DT_MB23n;
118  if (st == 4) return DT_MB24n;
119  }
120  if (wh == -1) {
121  if (st == 1) return DT_MB11n;
122  if (st == 2) return DT_MB12n;
123  if (st == 3) return DT_MB13n;
124  if (st == 4) return DT_MB14n;
125  }
126  if (wh == 0) {
127  if (st == 1) return DT_MB01;
128  if (st == 2) return DT_MB02;
129  if (st == 3) return DT_MB03;
130  if (st == 4) return DT_MB04;
131  }
132  if (wh == 1) {
133  if (st == 1) return DT_MB11p;
134  if (st == 2) return DT_MB12p;
135  if (st == 3) return DT_MB13p;
136  if (st == 4) return DT_MB14p;
137  }
138  if (wh == 2) {
139  if (st == 1) return DT_MB21p;
140  if (st == 2) return DT_MB22p;
141  if (st == 3) return DT_MB23p;
142  if (st == 4) return DT_MB24p;
143  }
144  return DT_ALL;
145 }
int MuonHitHelper::toGEMType ( int  st,
int  ri 
)
static

Definition at line 53 of file MuonHitHelper.cc.

References GEM_ALL, GEM_ME11, and GEM_ME21.

Referenced by GEMSimHitMatcher::chamberIds(), and GEMSimHitMatcher::detIds().

53  {
54  if (st == 1) {
55  if (ri == 1) return GEM_ME11;
56  } else if (st == 2) {
57  if (ri == 1) return GEM_ME21;
58  }
59  return GEM_ALL;
60 }
int MuonHitHelper::toRPCType ( int  re,
int  st,
int  ri 
)
static

Definition at line 62 of file MuonHitHelper.cc.

References funct::abs(), RPC_ALL, RPC_MB01, RPC_MB02, RPC_MB03, RPC_MB04, RPC_MB11n, RPC_MB11p, RPC_MB12n, RPC_MB12p, RPC_MB13n, RPC_MB13p, RPC_MB14n, RPC_MB14p, RPC_MB21n, RPC_MB21p, RPC_MB22n, RPC_MB22p, RPC_MB23n, RPC_MB23p, RPC_MB24n, RPC_MB24p, RPC_ME12, RPC_ME13, RPC_ME22, RPC_ME23, RPC_ME31, RPC_ME32, RPC_ME33, RPC_ME41, RPC_ME42, and RPC_ME43.

Referenced by RPCSimHitMatcher::chamberIds(), and RPCSimHitMatcher::detIds().

62  {
63  // endcap
64  if (std::abs(re) == 1) {
65  if (st == 1) {
66  if (ri == 2) return RPC_ME12;
67  if (ri == 3) return RPC_ME13;
68  } else if (st == 2) {
69  if (ri == 2) return RPC_ME22;
70  if (ri == 3) return RPC_ME23;
71  } else if (st == 3) {
72  if (ri == 1) return RPC_ME31;
73  if (ri == 2) return RPC_ME32;
74  if (ri == 3) return RPC_ME33;
75  } else if (st == 4) {
76  if (ri == 1) return RPC_ME41;
77  if (ri == 2) return RPC_ME42;
78  if (ri == 3) return RPC_ME43;
79  }
80  }
81  // Barrel
82  else {
83  if (ri == -2) {
84  if (st == 1) return RPC_MB21n;
85  if (st == 2) return RPC_MB22n;
86  if (st == 3) return RPC_MB23n;
87  if (st == 4) return RPC_MB24n;
88  } else if (ri == -1) {
89  if (st == 1) return RPC_MB11n;
90  if (st == 2) return RPC_MB12n;
91  if (st == 3) return RPC_MB13n;
92  if (st == 4) return RPC_MB14n;
93  } else if (ri == 0) {
94  if (st == 1) return RPC_MB01;
95  if (st == 2) return RPC_MB02;
96  if (st == 3) return RPC_MB03;
97  if (st == 4) return RPC_MB04;
98  } else if (ri == 1) {
99  if (st == 1) return RPC_MB11p;
100  if (st == 2) return RPC_MB12p;
101  if (st == 3) return RPC_MB13p;
102  if (st == 4) return RPC_MB14p;
103  } else if (ri == 2) {
104  if (st == 1) return RPC_MB21p;
105  if (st == 2) return RPC_MB22p;
106  if (st == 3) return RPC_MB23p;
107  if (st == 4) return RPC_MB24p;
108  }
109  }
110  return RPC_ALL;
111 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22