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

◆ CSCType

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.

◆ DTType

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.

◆ GEMType

GEM chamber types.

Enumerator
GEM_ALL 
GEM_ME11 
GEM_ME21 

Definition at line 30 of file MuonHitHelper.h.

◆ RPCType

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

◆ chamber()

int MuonHitHelper::chamber ( const DetId id)
static

Definition at line 23 of file MuonHitHelper.cc.

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

Referenced by geometryXMLparser.CSCAlignable::index().

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

◆ isCSC()

bool MuonHitHelper::isCSC ( unsigned int  detId)
static

◆ isDT()

bool MuonHitHelper::isDT ( unsigned int  detId)
static

◆ isGEM()

bool MuonHitHelper::isGEM ( unsigned int  detId)
static

◆ isME0()

bool MuonHitHelper::isME0 ( unsigned int  detId)
static

Definition at line 19 of file MuonHitHelper.cc.

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

19  {
20  return (DetId(detId)).det() == DetId::Muon && (DetId(detId)).subdetId() == MuonSubdetId::ME0;
21 }
static constexpr int ME0
Definition: MuonSubdetId.h:15
Definition: DetId.h:17

◆ isRPC()

bool MuonHitHelper::isRPC ( unsigned int  detId)
static

Definition at line 15 of file MuonHitHelper.cc.

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

15  {
16  return (DetId(detId)).det() == DetId::Muon && (DetId(detId)).subdetId() == MuonSubdetId::RPC;
17 }
Definition: DetId.h:17
static constexpr int RPC
Definition: MuonSubdetId.h:13

◆ toCSCType()

int MuonHitHelper::toCSCType ( int  st,
int  ri 
)
static

Definition at line 195 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(), CSCSimHitMatcher::detIds(), CSCDigiMatcher::selectDetIds(), and CSCStubMatcher::selectDetIds().

195  {
196  if (st == 1) {
197  if (ri == 0)
198  return CSC_ME11;
199  if (ri == 1)
200  return CSC_ME1b;
201  if (ri == 2)
202  return CSC_ME12;
203  if (ri == 3)
204  return CSC_ME13;
205  if (ri == 4)
206  return CSC_ME1a;
207  } else if (st == 2) {
208  if (ri == 1)
209  return CSC_ME21;
210  if (ri == 2)
211  return CSC_ME22;
212  } else if (st == 3) {
213  if (ri == 1)
214  return CSC_ME31;
215  if (ri == 2)
216  return CSC_ME32;
217  } else if (st == 4) {
218  if (ri == 1)
219  return CSC_ME41;
220  if (ri == 2)
221  return CSC_ME42;
222  }
223  return CSC_ALL;
224 }

◆ toDTType()

int MuonHitHelper::toDTType ( int  wh,
int  st 
)
static

Definition at line 141 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().

141  {
142  if (wh == -2) {
143  if (st == 1)
144  return DT_MB21n;
145  if (st == 2)
146  return DT_MB22n;
147  if (st == 3)
148  return DT_MB23n;
149  if (st == 4)
150  return DT_MB24n;
151  }
152  if (wh == -1) {
153  if (st == 1)
154  return DT_MB11n;
155  if (st == 2)
156  return DT_MB12n;
157  if (st == 3)
158  return DT_MB13n;
159  if (st == 4)
160  return DT_MB14n;
161  }
162  if (wh == 0) {
163  if (st == 1)
164  return DT_MB01;
165  if (st == 2)
166  return DT_MB02;
167  if (st == 3)
168  return DT_MB03;
169  if (st == 4)
170  return DT_MB04;
171  }
172  if (wh == 1) {
173  if (st == 1)
174  return DT_MB11p;
175  if (st == 2)
176  return DT_MB12p;
177  if (st == 3)
178  return DT_MB13p;
179  if (st == 4)
180  return DT_MB14p;
181  }
182  if (wh == 2) {
183  if (st == 1)
184  return DT_MB21p;
185  if (st == 2)
186  return DT_MB22p;
187  if (st == 3)
188  return DT_MB23p;
189  if (st == 4)
190  return DT_MB24p;
191  }
192  return DT_ALL;
193 }

◆ toGEMType()

int MuonHitHelper::toGEMType ( int  st,
int  ri 
)
static

Definition at line 49 of file MuonHitHelper.cc.

References GEM_ALL, GEM_ME11, and GEM_ME21.

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

49  {
50  if (st == 1) {
51  if (ri == 1)
52  return GEM_ME11;
53  } else if (st == 2) {
54  if (ri == 1)
55  return GEM_ME21;
56  }
57  return GEM_ALL;
58 }

◆ toRPCType()

int MuonHitHelper::toRPCType ( int  re,
int  st,
int  ri 
)
static

Definition at line 60 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().

60  {
61  // endcap
62  if (std::abs(re) == 1) {
63  if (st == 1) {
64  if (ri == 2)
65  return RPC_ME12;
66  if (ri == 3)
67  return RPC_ME13;
68  } else if (st == 2) {
69  if (ri == 2)
70  return RPC_ME22;
71  if (ri == 3)
72  return RPC_ME23;
73  } else if (st == 3) {
74  if (ri == 1)
75  return RPC_ME31;
76  if (ri == 2)
77  return RPC_ME32;
78  if (ri == 3)
79  return RPC_ME33;
80  } else if (st == 4) {
81  if (ri == 1)
82  return RPC_ME41;
83  if (ri == 2)
84  return RPC_ME42;
85  if (ri == 3)
86  return RPC_ME43;
87  }
88  }
89  // Barrel
90  else {
91  if (ri == -2) {
92  if (st == 1)
93  return RPC_MB21n;
94  if (st == 2)
95  return RPC_MB22n;
96  if (st == 3)
97  return RPC_MB23n;
98  if (st == 4)
99  return RPC_MB24n;
100  } else if (ri == -1) {
101  if (st == 1)
102  return RPC_MB11n;
103  if (st == 2)
104  return RPC_MB12n;
105  if (st == 3)
106  return RPC_MB13n;
107  if (st == 4)
108  return RPC_MB14n;
109  } else if (ri == 0) {
110  if (st == 1)
111  return RPC_MB01;
112  if (st == 2)
113  return RPC_MB02;
114  if (st == 3)
115  return RPC_MB03;
116  if (st == 4)
117  return RPC_MB04;
118  } else if (ri == 1) {
119  if (st == 1)
120  return RPC_MB11p;
121  if (st == 2)
122  return RPC_MB12p;
123  if (st == 3)
124  return RPC_MB13p;
125  if (st == 4)
126  return RPC_MB14p;
127  } else if (ri == 2) {
128  if (st == 1)
129  return RPC_MB21p;
130  if (st == 2)
131  return RPC_MB22p;
132  if (st == 3)
133  return RPC_MB23p;
134  if (st == 4)
135  return RPC_MB24p;
136  }
137  }
138  return RPC_ALL;
139 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22