CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LCTQualityAssignment.cc
Go to the documentation of this file.
2 
4  unsigned station,
5  unsigned sector,
6  unsigned subsector,
7  unsigned chamber,
8  const edm::ParameterSet& conf)
9  : CSCBaseboard(endcap, station, sector, subsector, chamber, conf) {
10  // at least one integrated local trigger is running
12 }
13 
14 unsigned LCTQualityAssignment::findQuality(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT) const {
15  // ALCT-CLCT matching without a cluster and ILT off
16  if (runCCLUT_ and !runILT_) {
17  return findQualityRun3(aLCT, cLCT);
18  }
19  // ALCT-CLCT matching without a cluster and ILT on
20  // preferred for Run-3
21  else if (runCCLUT_ and runILT_) {
22  return findQualityGEMv2(aLCT, cLCT, GEMInternalCluster());
23  }
24  // ALCT-CLCT matching without a cluster with CCLUT off and ILT on
25  // case when interfacing the GEM-CSC trigger with Run-2 EMTF
26  // not intended for Run-3. temporary intermediate case for CMSSW_12
27  else if (!runCCLUT_ and runILT_) {
28  return findQualityGEMv1(aLCT, cLCT, GEMInternalCluster());
29  }
30  // ALCT-CLCT matching without a cluster with CCLUT off and ILT off
31  // regular Run-1 and Run-2 case
32  else {
33  return findQualityRun2(aLCT, cLCT);
34  }
35 }
37  const CSCCLCTDigi& cLCT,
38  const GEMInternalCluster& cl) const {
39  // preferred for Run-3
40  if (runCCLUT_) {
41  return findQualityGEMv2(aLCT, cLCT, cl);
42  }
43  // not intended for Run-3. temporary intermediate case for CMSSW_12
44  else {
45  return findQualityGEMv1(aLCT, cLCT, cl);
46  }
47 }
48 
50  // preferred for Run-3
51  if (runCCLUT_) {
52  return findQualityGEMv2(aLCT, CSCCLCTDigi(), cl);
53  }
54  // not intended for Run-3. temporary intermediate case for CMSSW_12
55  else {
56  return static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun2::HQ_PATTERN_10);
57  }
58 }
59 
61  // preferred for Run-3
62  if (runCCLUT_) {
63  return findQualityGEMv2(CSCALCTDigi(), cLCT, cl);
64  }
65  // not intended for Run-3. temporary intermediate case for CMSSW_12
66  else {
67  return findQualityGEMv1(cLCT, cl);
68  }
69 }
70 
71 // 4-bit LCT quality number.
72 unsigned LCTQualityAssignment::findQualityRun2(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT) const {
74 
75  // Either ALCT or CLCT is invalid
76  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
77  // No CLCT
78  if (aLCT.isValid() && !(cLCT.isValid()))
80 
81  // No ALCT
82  else if (!(aLCT.isValid()) && cLCT.isValid())
84 
85  // No ALCT and no CLCT
86  else
88  }
89  // Both ALCT and CLCT are valid
90  else {
91  const int pattern(cLCT.getPattern());
92 
93  // Layer-trigger in CLCT
94  if (pattern == 1)
96 
97  // Multi-layer pattern in CLCT
98  else {
99  // ALCT quality is the number of layers hit minus 3.
100  const bool a4(aLCT.getQuality() >= 1);
101 
102  // CLCT quality is the number of layers hit.
103  const bool c4(cLCT.getQuality() >= 4);
104 
105  // quality = 4; "reserved for low-quality muons in future"
106 
107  // marginal anode and cathode
108  if (!a4 && !c4)
110 
111  // HQ anode, but marginal cathode
112  else if (a4 && !c4)
114 
115  // HQ cathode, but marginal anode
116  else if (!a4 && c4)
118 
119  // HQ muon, but accelerator ALCT
120  else if (a4 && c4) {
121  if (aLCT.getAccelerator())
123 
124  else {
125  // quality = 9; "reserved for HQ muons with future patterns
126  // quality = 10; "reserved for HQ muons with future patterns
127 
128  // High quality muons are determined by their CLCT pattern
129  if (pattern == 2 || pattern == 3)
131 
132  else if (pattern == 4 || pattern == 5)
134 
135  else if (pattern == 6 || pattern == 7)
137 
138  else if (pattern == 8 || pattern == 9)
140 
141  else if (pattern == 10)
143 
144  else {
145  edm::LogWarning("LCTQualityAssignment") << "findQualityRun2: Unexpected CLCT pattern id = " << pattern;
147  }
148  }
149  }
150  }
151  }
152  return static_cast<unsigned>(qual);
153 }
154 
155 // 2-bit LCT quality number for Run-3
156 unsigned LCTQualityAssignment::findQualityRun3(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT) const {
158 
159  // Run-3 definition
160  if (!(aLCT.isValid()) and !(cLCT.isValid())) {
162  }
163  // use number of layers on each as indicator
164  else {
165  const bool a4 = (aLCT.getQuality() == 1);
166  const bool a5 = (aLCT.getQuality() == 2);
167  const bool a6 = (aLCT.getQuality() == 3);
168 
169  const bool c4 = (cLCT.getQuality() == 4);
170  const bool c5 = (cLCT.getQuality() == 5);
171  const bool c6 = (cLCT.getQuality() == 6);
172  if (a6 or c6)
173  qual = LCT_QualityRun3::HighQ;
174  else if (a5 or c5)
175  qual = LCT_QualityRun3::MedQ;
176  else if (a4 or c4)
177  qual = LCT_QualityRun3::LowQ;
178  else
180  }
181  return static_cast<unsigned>(qual);
182 }
183 
186 
187  if (!cl.isCoincidence() or !cLCT.isValid())
188  return static_cast<unsigned>(qual);
189 
190  const int pattern(cLCT.getPattern());
191 
192  // High quality muons are determined by their CLCT pattern
193  if (pattern == 2 || pattern == 3)
195 
196  else if (pattern == 4 || pattern == 5)
198 
199  else if (pattern == 6 || pattern == 7)
201 
202  else if (pattern == 8 || pattern == 9)
204 
205  else if (pattern == 10)
207 
208  else {
209  edm::LogWarning("CSCGEMMotherboard") << "findQualityGEMv1: Unexpected CLCT pattern id = " << pattern;
211  }
212 
213  return static_cast<unsigned>(qual);
214 }
215 
217  const CSCCLCTDigi& cLCT,
218  const GEMInternalCluster& cl) const {
220 
221  int gemlayers = 0;
222  if (cl.isValid())
223  gemlayers = 1;
224  if (cl.isCoincidence())
225  gemlayers = 2;
226 
227  // Either ALCT or CLCT is invalid
228  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
229  // No CLCT
230  if (aLCT.isValid() && !(cLCT.isValid()))
232 
233  // No ALCT
234  else if (!(aLCT.isValid()) && cLCT.isValid())
236 
237  // No ALCT and no CLCT
238  else
240  }
241  // Both ALCT and CLCT are valid
242  else {
243  const int pattern(cLCT.getPattern());
244 
245  // Layer-trigger in CLCT
246  if (pattern == 1)
248 
249  // Multi-layer pattern in CLCT
250  else {
251  // ALCT quality is the number of layers hit minus 3.
252  bool a4 = false;
253 
254  // Case of ME11 with GEMs: require 4 layers for ALCT
255  if (isME11_)
256  a4 = aLCT.getQuality() >= 1;
257 
258  // Case of ME21 with GEMs: require 4 layers for ALCT+GEM
259  if (isME21_)
260  a4 = aLCT.getQuality() + gemlayers >= 1;
261 
262  // CLCT quality is the number of layers hit.
263  const bool c4((cLCT.getQuality() >= 4) or (cLCT.getQuality() >= 3 and gemlayers >= 1));
264 
265  // quality = 4; "reserved for low-quality muons in future"
266 
267  // marginal anode and cathode
268  if (!a4 && !c4)
270 
271  // HQ anode, but marginal cathode
272  else if (a4 && !c4)
274 
275  // HQ cathode, but marginal anode
276  else if (!a4 && c4)
278 
279  // HQ muon, but accelerator ALCT
280  else if (a4 && c4) {
281  if (aLCT.getAccelerator())
283 
284  else {
285  // quality = 9; "reserved for HQ muons with future patterns
286  // quality = 10; "reserved for HQ muons with future patterns
287 
288  // High quality muons are determined by their CLCT pattern
289  if (pattern == 2 || pattern == 3)
291 
292  else if (pattern == 4 || pattern == 5)
294 
295  else if (pattern == 6 || pattern == 7)
297 
298  else if (pattern == 8 || pattern == 9)
300 
301  else if (pattern == 10)
303 
304  else {
305  edm::LogWarning("CSCGEMMotherboard") << "findQualityGEMv1: Unexpected CLCT pattern id = " << pattern;
307  }
308  }
309  }
310  }
311  }
312  return static_cast<unsigned>(qual);
313 }
314 
316  const CSCCLCTDigi& cLCT,
317  const GEMInternalCluster& cl) const {
319 
320  const bool aValid(aLCT.isValid());
321  const bool cValid(cLCT.isValid());
322  const bool gValid(cl.isValid());
323  const bool ggValid(cl.isValid() and cl.isCoincidence());
324 
325  // ALCT-CLCT-2GEM
326  if (aValid and cValid and ggValid) {
329  else
331  }
332 
333  // ALCT-CLCT-1GEM
334  else if (aValid and cValid and gValid) {
337  else
339  }
340 
341  // ALCT-CLCT
342  else if (aValid and cValid and !gValid and !ggValid) {
344  }
345 
346  // CLCT-2GEM
347  else if (!aValid and cValid and ggValid) {
349  }
350 
351  // ALCT-2GEM
352  else if (!cValid and aValid and ggValid) {
354  }
355 
356  // at this point we have exhausted all possibilities
357  // only remaing option is an invalid LCT
358  else
360 
361  return static_cast<unsigned>(qual);
362 }
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
unsigned findQualityGEMv1(const CSCCLCTDigi &, const GEMInternalCluster &cl) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
unsigned findQualityRun2(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
unsigned findQualityGEMv2(const CSCALCTDigi &, const CSCCLCTDigi &, const GEMInternalCluster &cl) const
tuple cl
Definition: haddnano.py:49
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
unsigned findQualityRun3(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
unsigned findQuality(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
LCTQualityAssignment(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:56
Log< level::Warning, false > LogWarning
bool isCoincidence() const
uint16_t getAccelerator() const
Definition: CSCALCTDigi.h:53