CMS 3D CMS Logo

HitPattern.cc
Go to the documentation of this file.
10 
12 
14 
15 #include <bitset>
16 
17 using namespace reco;
18 
20  : hitCount(0), beginTrackHits(0), endTrackHits(0), beginInner(0), endInner(0), beginOuter(0), endOuter(0) {
22 }
23 
25  : hitCount(other.hitCount),
26  beginTrackHits(other.beginTrackHits),
27  endTrackHits(other.endTrackHits),
28  beginInner(other.beginInner),
29  endInner(other.endInner),
30  beginOuter(other.beginOuter),
31  endOuter(other.endOuter) {
32  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
33 }
34 
36 
38  if (this == &other) {
39  return *this;
40  }
41 
42  this->hitCount = other.hitCount;
43 
44  this->beginTrackHits = other.beginTrackHits;
45  this->endTrackHits = other.endTrackHits;
46 
47  this->beginInner = other.beginInner;
48  this->endInner = other.endInner;
49 
50  this->beginOuter = other.beginOuter;
51  this->endOuter = other.endOuter;
52 
53  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
54 
55  return *this;
56 }
57 
58 void HitPattern::clear(void) {
59  this->hitCount = 0;
60  this->beginTrackHits = 0;
61  this->endTrackHits = 0;
62  this->beginInner = 0;
63  this->endInner = 0;
64  this->beginOuter = 0;
65  this->endOuter = 0;
66 
67  memset(this->hitPattern, EMPTY_PATTERN, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
68 }
69 
71  return appendHit(*ref, ttopo);
72 }
73 
74 uint16_t HitPattern::encode(const TrackingRecHit& hit, const TrackerTopology& ttopo) {
75  return encode(hit.geographicalId(), hit.getType(), ttopo);
76 }
77 
78 namespace {
79  uint16_t encodeMuonLayer(const DetId& id) {
80  uint16_t detid = id.det();
81  uint16_t subdet = id.subdetId();
82 
83  uint16_t layer = 0x0;
84  if (detid == DetId::Muon) {
85  switch (subdet) {
86  case MuonSubdetId::DT:
87  layer = ((DTLayerId(id.rawId()).station() - 1) << 2);
88  layer |= DTLayerId(id.rawId()).superLayer();
89  break;
90  case MuonSubdetId::CSC:
91  layer = ((CSCDetId(id.rawId()).station() - 1) << 2);
92  layer |= (CSCDetId(id.rawId()).ring() - 1);
93  break;
94  case MuonSubdetId::RPC: {
95  RPCDetId rpcid(id.rawId());
96  layer = ((rpcid.station() - 1) << 2);
97  layer |= (rpcid.station() <= 2) ? ((rpcid.layer() - 1) << 1) : 0x0;
98  layer |= abs(rpcid.region());
99  } break;
100  case MuonSubdetId::GEM: {
101  GEMDetId gemid(id.rawId());
102  layer = ((gemid.station() - 1) << 2);
103  layer |= abs(gemid.layer() - 1);
104  } break;
105  case MuonSubdetId::ME0: {
106  ME0DetId me0id(id.rawId());
107  //layer = ((me0id.roll()-1)<<1) + abs(me0id.layer()-1);
108  //layer = ((me0id.roll()-1)<<1) + abs(me0id.layer());
109  //Only layer information that is meaningful is in the roll/etapartition
110  layer = (me0id.roll());
111  } break;
112  }
113  }
114  return layer;
115  }
116  uint16_t encodeTimingLayer(const DetId& id) {
117  uint16_t detid = id.det();
118  uint16_t subdet = id.subdetId();
119  uint16_t layer = 0x0;
120  if (detid == DetId::Forward && subdet == FastTime) {
121  MTDDetId mtdid(id);
122  switch (mtdid.mtdSubDetector()) {
123  case MTDDetId::BTL:
124  layer = BTLDetId(id).modType();
125  break;
126  case MTDDetId::ETL:
127  layer = ETLDetId(id).mtdRR();
128  break;
129  default:
130  throw cms::Exception("HitPattern") << "Invalid MTD Subdetector " << mtdid.mtdSubDetector() << "!";
131  }
132  } else {
133  throw cms::Exception("HitPattern") << "Invalid DetId for FastTime det= " << detid << " subdet= " << subdet << "!";
134  }
135  return layer;
136  }
137 } // namespace
138 
139 uint16_t HitPattern::encode(const DetId& id, TrackingRecHit::Type hitType, const TrackerTopology& ttopo) {
140  uint16_t detid = id.det();
141  uint16_t subdet = id.subdetId();
142 
143  // adding layer/disk/wheel bits
144  uint16_t layer = 0x0;
145  if (detid == DetId::Tracker) {
146  layer = ttopo.layer(id);
147  } else if (detid == DetId::Muon) {
148  layer = encodeMuonLayer(id);
149  } else if (detid == DetId::Forward && subdet == FastTime) {
150  layer = encodeTimingLayer(id);
151  }
152 
153  // adding mono/stereo bit
154  uint16_t side = 0x0;
155  if (detid == DetId::Tracker) {
156  side = isStereo(id, ttopo);
157  } else if (detid == DetId::Muon || (detid == DetId::Forward && subdet == FastTime)) {
158  side = 0x0;
159  }
160 
161  // juggle the detid around to deal with the fact the bitwidth is larger
162  // DetId::Muon is 2 and DetId::Forward is 6, must map to 0 and 2 respectively
163  if (detid == DetId::Tracker) {
164  detid = TRACKER_HIT;
165  } else if (detid == DetId::Muon) {
166  detid = MUON_HIT; // DetId::Muon is 2 and needs to be reordered to match old encoding where it got masked
167  } else if (detid == DetId::Forward && subdet == FastTime) {
168  detid = MTD_HIT; // since DetId::Forward is some other number, reorder it here
169  }
170 
171  return encode(detid, subdet, layer, side, hitType);
172 }
173 
174 uint16_t HitPattern::encode(uint16_t det, uint16_t subdet, uint16_t layer, uint16_t side, TrackingRecHit::Type hitType) {
176 
177  // adding tracker/muon/mtd detector bits
179 
180  // adding substructure (PXB, PXF, TIB, TID, TOB, TEC, or DT, CSC, RPC,GEM, or BTL, ETL) bits
181  pattern |= (subdet & SubstrMask) << SubstrOffset;
182 
183  // adding layer/disk/wheel/ring/modType bits
184  pattern |= (layer & LayerMask) << LayerOffset;
185 
186  // adding mono/stereo bit
187  pattern |= (side & SideMask) << SideOffset;
188 
189  TrackingRecHit::Type patternHitType =
194  : hitType);
195 
196  pattern |= (patternHitType & HitTypeMask) << HitTypeOffset;
197 
198  return pattern;
199 }
200 
202  return appendHit(hit.geographicalId(), hit.getType(), ttopo);
203 }
204 
205 bool HitPattern::appendHit(const DetId& id, TrackingRecHit::Type hitType, const TrackerTopology& ttopo) {
206  //if HitPattern is full, journey ends no matter what.
207  if
208  UNLIKELY((hitCount == HitPattern::MaxHits)) { return false; }
209 
210  uint16_t pattern = HitPattern::encode(id, hitType, ttopo);
211 
212  return appendHit(pattern, hitType);
213 }
214 
215 bool HitPattern::appendHit(const uint16_t pattern, TrackingRecHit::Type hitType) {
216  //if HitPattern is full, journey ends no matter what.
217  if
218  UNLIKELY((hitCount == HitPattern::MaxHits)) { return false; }
219 
220  switch (hitType) {
224  case TrackingRecHit::bad:
225  // hitCount != endT => we are not inserting T type of hits but of T'
226  // 0 != beginT || 0 != endT => we already have hits of T type
227  // so we already have hits of T in the vector and we don't want to
228  // mess them with T' hits.
229  if
230  UNLIKELY(((hitCount != endTrackHits) && (0 != beginTrackHits || 0 != endTrackHits))) {
231  cms::Exception("HitPattern")
232  << "TRACK_HITS"
233  << " were stored on this object before hits of some other category were inserted "
234  << "but hits of the same category should be inserted in a row. "
235  << "Please rework the code so it inserts all "
236  << "TRACK_HITS"
237  << " in a row.";
238  return false;
239  }
240  return insertTrackHit(pattern);
241  break;
244  if
245  UNLIKELY(((hitCount != endInner) && (0 != beginInner || 0 != endInner))) {
246  cms::Exception("HitPattern")
247  << "MISSING_INNER_HITS"
248  << " were stored on this object before hits of some other category were inserted "
249  << "but hits of the same category should be inserted in a row. "
250  << "Please rework the code so it inserts all "
251  << "MISSING_INNER_HITS"
252  << " in a row.";
253  return false;
254  }
256  break;
259  if
260  UNLIKELY(((hitCount != endOuter) && (0 != beginOuter || 0 != endOuter))) {
261  cms::Exception("HitPattern")
262  << "MISSING_OUTER_HITS"
263  << " were stored on this object before hits of some other category were inserted "
264  << "but hits of the same category should be inserted in a row. "
265  << "Please rework the code so it inserts all "
266  << "MISSING_OUTER_HITS"
267  << " in a row.";
268  return false;
269  }
271  break;
272  }
273 
274  return false;
275 }
276 
277 bool HitPattern::appendTrackerHit(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType) {
278  return appendHit(encode(TRACKER_HIT, subdet, layer, stereo, hitType), hitType);
279 }
280 
282  //if HitPattern is full, journey ends no matter what.
283  if
284  UNLIKELY((hitCount == HitPattern::MaxHits)) { return false; }
285 
286  if
287  UNLIKELY(id.det() != DetId::Muon) {
288  throw cms::Exception("HitPattern")
289  << "Got DetId from det " << id.det()
290  << " that is not Muon in appendMuonHit(), which should only be used for muon hits in the HitPattern IO rule";
291  }
292 
293  uint16_t subdet = id.subdetId();
294  return appendHit(encode(MUON_HIT, subdet, encodeMuonLayer(id), 0, hitType), hitType);
295 }
296 
298  if
299  UNLIKELY((position < 0 || position >= hitCount)) { return HitPattern::EMPTY_PATTERN; }
300  /*
301  Note: you are not taking a consecutive sequence of HIT_LENGTH bits starting from position * HIT_LENGTH
302  as the bit order in the words are reversed.
303  e.g. if position = 0 you take the lowest 12 bits of the first word.
304 
305  I hope this can clarify what is the memory layout of such thing
306 
307  straight 01234567890123456789012345678901 | 23456789012345678901234567890123 | 4567
308  (global) 0 1 2 3 | 3 4 5 6 | 6
309  words [--------------0---------------] | [--------------1---------------] | [---
310  word 01234567890123456789012345678901 | 01234567890123456789012345678901 | 0123
311  (str) 0 1 2 3 | 0 1 2 3 | 0
312  [--------------0---------------] | [--------------1---------------] | [---
313  word 10987654321098765432109876543210 | 10987654321098765432109876543210 | 1098
314  (rev) 32 21 10 0 | 32 21 10 0 | 32
315  reverse 10987654321098765432109876543210 | 32109876543210987654321098765432 | 5432
316  32 21 10 0 | 6 65 54 43 3 9
317 
318  ugly enough, but it's not my fault, I was not even in CMS at that time [gpetrucc]
319  */
320 
321  uint16_t bitEndOffset = (position + 1) * HIT_LENGTH;
322  uint8_t secondWord = (bitEndOffset >> 4);
323  uint8_t secondWordBits = bitEndOffset & (16 - 1); // that is, bitEndOffset % 16
324  if (secondWordBits >= HIT_LENGTH) { // full block is in this word
325  uint8_t lowBitsToTrash = secondWordBits - HIT_LENGTH;
326  uint16_t myResult = (hitPattern[secondWord] >> lowBitsToTrash) & ((1 << HIT_LENGTH) - 1);
327  return myResult;
328  } else {
329  uint8_t firstWordBits = HIT_LENGTH - secondWordBits;
330  uint16_t firstWordBlock = hitPattern[secondWord - 1] >> (16 - firstWordBits);
331  uint16_t secondWordBlock = hitPattern[secondWord] & ((1 << secondWordBits) - 1);
332  uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
333  return myResult;
334  }
335 }
336 
338  for (int i = beginTrackHits; i < endTrackHits; ++i) {
340  bool pixelHitFilter = ((det == 1 && pixelBarrelHitFilter(pattern)) || (det == 2 && pixelEndcapHitFilter(pattern)));
341  if (pixelHitFilter && (getLayer(pattern) == layer) && validHitFilter(pattern)) {
342  return true;
343  }
344  }
345  return false;
346 }
347 
348 int HitPattern::numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const {
349  bool hasMono[SubstrMask + 1][LayerMask + 1];
350  bool hasStereo[SubstrMask + 1][LayerMask + 1];
351  memset(hasMono, 0, sizeof(hasMono));
352  memset(hasStereo, 0, sizeof(hasStereo));
353 
354  // mark which layers have mono/stereo hits
355  for (int i = beginTrackHits; i < endTrackHits; ++i) {
357  uint16_t subStructure = getSubStructure(pattern);
358 
360  if (stripdet != 0 && subStructure != stripdet) {
361  continue;
362  }
363 
364  if (layer != 0 && getSubSubStructure(pattern) != layer) {
365  continue;
366  }
367 
368  switch (getSide(pattern)) {
369  case 0: // mono
370  hasMono[subStructure][getLayer(pattern)] = true;
371  break;
372  case 1: // stereo
373  hasStereo[subStructure][getLayer(pattern)] = true;
374  break;
375  default:;
376  break;
377  }
378  }
379  }
380 
381  // count how many layers have mono and stereo hits
382  int count = 0;
383  for (int i = 0; i < SubstrMask + 1; ++i) {
384  for (int j = 0; j < LayerMask + 1; ++j) {
385  if (hasMono[i][j] && hasStereo[i][j]) {
386  count++;
387  }
388  }
389  }
390  return count;
391 }
392 
394  auto category = TRACK_HITS;
395  std::bitset<128> side[2];
396  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
397  for (int i = range.first; i < range.second; ++i) {
399  if (pattern > maxTrackerWord)
400  continue;
401  if (pattern < minStripWord)
402  continue;
403  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
404  if (hitType != HIT_TYPE::VALID)
405  continue;
406  auto apattern = (pattern - minTrackerWord) >> LayerOffset;
407  // assert(apattern<128);
408  side[getSide(pattern)].set(apattern);
409  }
410  // assert(numberOfValidStripLayersWithMonoAndStereo(0, 0)==int((side[0]&side[1]).count()));
411  return (side[0] & side[1]).count();
412 }
413 
416 }
417 
420 }
421 
424 }
425 
428 }
429 
430 uint32_t HitPattern::getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const {
431  uint16_t tk_substr_layer =
432  (0x1 << SubDetectorOffset) + ((substr & SubstrMask) << SubstrOffset) + ((layer & LayerMask) << LayerOffset);
433 
435 
436  // layer case 0: valid + (missing, off, bad) ==> with measurement
437  // layer case 1: missing + (off, bad) ==> without measurement
438  // layer case 2: off, bad ==> totally off or bad, cannot say much
439  // layer case NULL_RETURN: track outside acceptance or in gap ==> null
440  uint32_t layerCase = NULL_RETURN;
441  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
442  for (int i = range.first; i < range.second; ++i) {
444  if ((pattern & mask) == tk_substr_layer) {
445  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
446  if (hitType < layerCase) {
447  // BAD and INACTIVE as the same type (as INACTIVE)
448  layerCase = (hitType == HIT_TYPE::BAD ? (uint32_t)HIT_TYPE::INACTIVE : hitType);
449  if (layerCase == HIT_TYPE::VALID) {
450  break;
451  }
452  }
453  }
454  }
455  return layerCase;
456 }
457 
458 uint16_t HitPattern::getTrackerMonoStereo(HitCategory category, uint16_t substr, uint16_t layer) const {
459  uint16_t tk_substr_layer =
460  (0x1 << SubDetectorOffset) + ((substr & SubstrMask) << SubstrOffset) + ((layer & LayerMask) << LayerOffset);
462 
463  // 0: neither a valid mono nor a valid stereo hit
464  // MONO: valid mono hit
465  // STEREO: valid stereo hit
466  // MONO | STEREO: both
467  uint16_t monoStereo = 0x0;
468  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
469  for (int i = range.first; i < range.second; ++i) {
471  if ((pattern & mask) == tk_substr_layer) {
472  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
473  if (hitType == HIT_TYPE::VALID) {
474  switch (getSide(pattern)) {
475  case 0: // mono
476  monoStereo |= MONO;
477  break;
478  case 1: // stereo
479  monoStereo |= STEREO;
480  break;
481  }
482  }
483 
484  if (monoStereo == (MONO | STEREO)) {
485  break;
486  }
487  }
488  }
489  return monoStereo;
490 }
491 
493  auto category = TRACK_HITS;
494  std::bitset<128> layerOk;
495  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
496  for (int i = range.first; i < range.second; ++i) {
498  if
499  UNLIKELY(!trackerHitFilter(pattern)) continue;
500  if (pattern > minStripWord)
501  continue;
502  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
503  if (hitType != HIT_TYPE::VALID)
504  continue;
506  // assert(pattern<128);
507  layerOk.set(pattern);
508  }
509  // assert(pixelLayersWithMeasurementOld()==int(layerOk.count()));
510  return layerOk.count();
511 }
512 
514  auto category = TRACK_HITS;
515  std::bitset<128> layerOk;
516  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
517  for (int i = range.first; i < range.second; ++i) {
519  if
520  UNLIKELY(!trackerHitFilter(pattern)) continue;
521  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
522  if (hitType != HIT_TYPE::VALID)
523  continue;
525  // assert(pattern<128);
526  layerOk.set(pattern);
527  }
528  // assert(trackerLayersWithMeasurementOld()==int(layerOk.count()));
529  return layerOk.count();
530 }
531 
533  std::bitset<128> layerOk;
534  std::bitset<128> layerMissed;
535  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
536  for (int i = range.first; i < range.second; ++i) {
538  if
539  UNLIKELY(!trackerHitFilter(pattern)) continue;
540  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
542  // assert(pattern<128);
543  if (hitType == HIT_TYPE::VALID)
544  layerOk.set(pattern);
545  if (hitType == HIT_TYPE::MISSING)
546  layerMissed.set(pattern);
547  }
548  layerMissed &= ~layerOk;
549 
550  // assert(trackerLayersWithoutMeasurementOld(category)==int(layerMissed.count()));
551 
552  return layerMissed.count();
553 }
554 
556  int count = 0;
557  uint16_t NPixBarrel = 4;
558  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
559  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::VALID) {
560  count++;
561  }
562  }
563  return count;
564 }
565 
567  int count = 0;
568  uint16_t NPixForward = 3;
569  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
570  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::VALID) {
571  count++;
572  }
573  }
574  return count;
575 }
576 
578  int count = 0;
579  for (uint16_t layer = 1; layer <= 4; layer++) {
580  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::VALID) {
581  count++;
582  }
583  }
584  return count;
585 }
586 
588  int count = 0;
589  for (uint16_t layer = 1; layer <= 3; layer++) {
590  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::VALID) {
591  count++;
592  }
593  }
594  return count;
595 }
596 
598  int count = 0;
599  for (uint16_t layer = 1; layer <= 6; layer++) {
600  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::VALID) {
601  count++;
602  }
603  }
604  return count;
605 }
606 
608  int count = 0;
609  for (uint16_t layer = 1; layer <= 9; layer++) {
610  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::VALID) {
611  count++;
612  }
613  }
614  return count;
615 }
616 
618  int count = 0;
619  uint16_t NPixBarrel = 4;
620  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
621  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::MISSING) {
622  count++;
623  }
624  }
625  return count;
626 }
627 
629  int count = 0;
630  uint16_t NPixForward = 3;
631  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
632  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::MISSING) {
633  count++;
634  }
635  }
636  return count;
637 }
638 
640  int count = 0;
641  for (uint16_t layer = 1; layer <= 4; layer++) {
642  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::MISSING) {
643  count++;
644  }
645  }
646  return count;
647 }
648 
650  int count = 0;
651  for (uint16_t layer = 1; layer <= 3; layer++) {
652  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::MISSING) {
653  count++;
654  }
655  }
656  return count;
657 }
658 
660  int count = 0;
661  for (uint16_t layer = 1; layer <= 6; layer++) {
662  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::MISSING) {
663  count++;
664  }
665  }
666  return count;
667 }
668 
670  int count = 0;
671  for (uint16_t layer = 1; layer <= 9; layer++) {
672  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::MISSING) {
673  count++;
674  }
675  }
676  return count;
677 }
678 
680  int count = 0;
681  uint16_t NPixBarrel = 4;
682  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
683  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::INACTIVE) {
684  count++;
685  }
686  }
687  return count;
688 }
689 
691  int count = 0;
692  uint16_t NPixForward = 3;
693  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
694  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::INACTIVE) {
695  count++;
696  }
697  }
698  return count;
699 }
700 
702  int count = 0;
703  for (uint16_t layer = 1; layer <= 4; layer++) {
704  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::INACTIVE) {
705  count++;
706  }
707  }
708  return count;
709 }
710 
712  int count = 0;
713  for (uint16_t layer = 1; layer <= 3; layer++) {
714  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::INACTIVE) {
715  count++;
716  }
717  }
718  return count;
719 }
720 
722  int count = 0;
723  for (uint16_t layer = 1; layer <= 6; layer++) {
724  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::INACTIVE) {
725  count++;
726  }
727  }
728  return count;
729 }
730 
732  int count = 0;
733  for (uint16_t layer = 1; layer <= 9; layer++) {
734  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::INACTIVE) {
735  count++;
736  }
737  }
738  return count;
739 }
740 
742  int count = 0;
743  uint16_t NPixBarrel = 4;
744  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
746  count++;
747  }
748  }
749  return count;
750 }
751 
753  int count = 0;
754  uint16_t NPixForward = 3;
755  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
757  count++;
758  }
759  }
760  return count;
761 }
762 
764  int count = 0;
765  for (uint16_t layer = 1; layer <= 4; layer++) {
767  count++;
768  }
769  }
770  return count;
771 }
772 
774  int count = 0;
775  for (uint16_t layer = 1; layer <= 3; layer++) {
777  count++;
778  }
779  }
780  return count;
781 }
782 
784  int count = 0;
785  for (uint16_t layer = 1; layer <= 6; layer++) {
787  count++;
788  }
789  }
790  return count;
791 }
792 
794  int count = 0;
795  for (uint16_t layer = 1; layer <= 9; layer++) {
797  count++;
798  }
799  }
800  return count;
801 }
802 
804  uint16_t pattern = getHitPattern(category, position);
805  stream << "\t";
806  if (muonHitFilter(pattern)) {
807  stream << "muon";
808  } else if (trackerHitFilter(pattern)) {
809  stream << "tracker";
810  } else if (timingHitFilter(pattern)) {
811  stream << "timing";
812  }
813 
814  stream << "\tsubstructure " << getSubStructure(pattern);
815  if (muonHitFilter(pattern)) {
816  stream << "\tstation " << getMuonStation(pattern);
817  if (muonDTHitFilter(pattern)) {
818  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
819  } else if (muonCSCHitFilter(pattern)) {
820  stream << "\tcsc ring " << getCSCRing(pattern);
821  } else if (muonRPCHitFilter(pattern)) {
822  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel") << ", layer " << getRPCLayer(pattern);
823  } else if (muonGEMHitFilter(pattern)) {
824  stream << "\tgem " << (getGEMLayer(pattern) ? "layer1" : "layer2") << ", station " << getGEMStation(pattern);
825  } else if (muonME0HitFilter(pattern)) {
826  stream << "\tme0 ";
827  } else {
828  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure " << getSubStructure(pattern);
829  }
830  } else if (timingHitFilter(pattern)) {
831  stream << "\tdetector " << getSubStructure(pattern);
832  } else {
833  stream << "\tlayer " << getLayer(pattern);
834  }
835  stream << "\thit type " << getHitType(pattern);
836  stream << std::endl;
837 }
838 
839 void HitPattern::print(HitCategory category, std::ostream& stream) const {
840  stream << "HitPattern" << std::endl;
841  for (int i = 0; i < numberOfAllHits(category); ++i) {
843  }
844  std::ios_base::fmtflags flags = stream.flags();
845  stream.setf(std::ios_base::hex, std::ios_base::basefield);
846  stream.setf(std::ios_base::showbase);
847 
848  for (int i = 0; i < this->numberOfAllHits(category); ++i) {
849  stream << getHitPattern(category, i) << std::endl;
850  }
851 
852  stream.flags(flags);
853 }
854 
855 uint16_t HitPattern::isStereo(DetId i, const TrackerTopology& ttopo) {
856  if (i.det() != DetId::Tracker) {
857  return 0;
858  }
859 
860  switch (i.subdetId()) {
863  return 0;
865  return ttopo.tibIsStereo(i);
867  return ttopo.tidIsStereo(i);
869  return ttopo.tobIsStereo(i);
871  return ttopo.tecIsStereo(i);
872  default:
873  return 0;
874  }
875 }
876 
877 int HitPattern::muonStations(int subdet, int hitType) const {
878  int stations[4] = {0, 0, 0, 0};
879  for (int i = beginTrackHits; i < endTrackHits; ++i) {
881  if (muonHitFilter(pattern) && (subdet == 0 || int(getSubStructure(pattern)) == subdet) &&
882  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
883  stations[getMuonStation(pattern) - 1] = 1;
884  }
885  }
886 
887  return stations[0] + stations[1] + stations[2] + stations[3];
888 }
889 
891  int ret = 0;
892  for (int i = beginTrackHits; i < endTrackHits; ++i) {
894  if (muonHitFilter(pattern) && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
895  int stat = getMuonStation(pattern);
896  if (ret == 0 || stat < ret) {
897  ret = stat;
898  }
899  }
900  }
901 
902  return ret;
903 }
904 
906  int ret = 0;
907  for (int i = beginTrackHits; i < endTrackHits; ++i) {
909  if (muonHitFilter(pattern) && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
910  int stat = getMuonStation(pattern);
911  if (ret == 0 || stat > ret) {
912  ret = stat;
913  }
914  }
915  }
916  return ret;
917 }
918 
920  int stations[4] = {0, 0, 0, 0};
921  for (int i = beginTrackHits; i < endTrackHits; ++i) {
923 
925  stations[getMuonStation(pattern) - 1] = 1;
926  }
927  }
928  return stations[0] + stations[1] + stations[2] + stations[3];
929 }
930 
932  int stations[4] = {0, 0, 0, 0};
933  for (int i = beginTrackHits; i < endTrackHits; ++i) {
936  stations[getMuonStation(pattern) - 1] = 1;
937  }
938  }
939  return stations[0] + stations[1] + stations[2] + stations[3];
940 }
941 
943  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
944  for (int i = beginTrackHits; i < endTrackHits; ++i) {
947  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
948  }
949  }
950 
951  return stations[0][0] * stations[0][1] + stations[1][0] * stations[1][1] + stations[2][0] * stations[2][1] +
952  stations[3][0] * stations[3][1];
953 }
954 
955 void HitPattern::insertHit(const uint16_t pattern) {
956  int offset = hitCount * HIT_LENGTH;
957  for (int i = 0; i < HIT_LENGTH; i++) {
958  int pos = offset + i;
959  uint16_t bit = (pattern >> i) & 0x1;
960  //equivalent to hitPattern[pos / 16] += bit << ((offset + i) % 16);
961  hitPattern[pos >> 4] += bit << ((offset + i) & (16 - 1));
962  }
963  hitCount++;
964 }
965 
966 bool HitPattern::insertTrackHit(const uint16_t pattern) {
967  // if begin is 0, this is the first hit of this type being inserted, so
968  // we need to update begin so it points to the correct index, the first
969  // empty index.
970  // unlikely, because it will happen only when inserting
971  // the first hit of this type
972  if
973  UNLIKELY((0 == beginTrackHits && 0 == endTrackHits)) {
975  // before the first hit of this type is inserted, there are no hits
977  }
978 
980  endTrackHits++;
981 
982  return true;
983 }
984 
986  if
987  UNLIKELY((0 == beginInner && 0 == endInner)) {
990  }
991 
993  endInner++;
994 
995  return true;
996 }
997 
999  if
1000  UNLIKELY((0 == beginOuter && 0 == endOuter)) {
1001  beginOuter = hitCount;
1002  endOuter = beginOuter;
1003  }
1004 
1005  insertHit(pattern);
1006  endOuter++;
1007 
1008  return true;
1009 }
reco::HitPattern::appendHit
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:201
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
reco::HitPattern::operator=
HitPattern & operator=(const HitPattern &other)
Definition: HitPattern.cc:37
MuonSubdetId::GEM
static constexpr int GEM
Definition: MuonSubdetId.h:14
Likely.h
reco::HitPattern::getHitPattern
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:530
reco::HitPattern::getSubStructure
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:695
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:30
BTLDetId.h
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
reco::HitPattern::HIT_LENGTH
const static unsigned short HIT_LENGTH
Definition: HitPattern.h:157
mps_fire.i
i
Definition: mps_fire.py:355
reco::HitPattern::LayerOffset
const static unsigned short LayerOffset
Definition: HitPattern.h:448
TrackingRecHit::missing_inner
Definition: TrackingRecHit.h:50
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
reco::HitPattern::beginTrackHits
uint8_t beginTrackHits
Definition: HitPattern.h:493
reco::HitPattern::pixelEndcapLayersWithMeasurement
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:566
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
reco::HitPattern::stripTOBLayersWithMeasurement
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:597
reco::HitPattern::trackerLayersWithoutMeasurement
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:532
TrackerTopology::tobIsStereo
bool tobIsStereo(const DetId &id) const
Definition: TrackerTopology.h:264
reco::HitPattern::stripTIBLayersWithoutMeasurement
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:639
reco::HitPattern::beginInner
uint8_t beginInner
Definition: HitPattern.h:495
reco::HitPattern::muonRPCHitFilter
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:640
reco::HitPattern::numberOfValidTOBLayersWithMonoAndStereo
int numberOfValidTOBLayersWithMonoAndStereo(uint32_t layer=0) const
Definition: HitPattern.cc:414
DTLayerId.h
reco::HitPattern::SideMask
const static unsigned short SideMask
Definition: HitPattern.h:445
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
TrackerTopology
Definition: TrackerTopology.h:16
reco::HitPattern::validHitFilter
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:765
ME0DetId.h
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
RPCDetId
Definition: RPCDetId.h:16
pos
Definition: PixelAliasList.h:18
reco::HitPattern::HitTypeOffset
const static unsigned short HitTypeOffset
Definition: HitPattern.h:440
reco::HitPattern::clear
void clear()
Definition: HitPattern.cc:58
reco::HitPattern::muonHitFilter
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:667
reco::HitPattern::trackerHitFilter
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:663
TrackerTopology::tecIsStereo
bool tecIsStereo(const DetId &id) const
Definition: TrackerTopology.h:265
reco::HitPattern::stripTIBLayersNull
int stripTIBLayersNull() const
Definition: HitPattern.cc:763
reco::HitPattern::getGEMLayer
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:763
reco::HitPattern::MUON_HIT
Definition: HitPattern.h:151
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
reco::HitPattern::muonGEMHitFilter
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:648
reco::HitPattern::HitPattern
HitPattern()
Definition: HitPattern.cc:19
reco::HitPattern::beginOuter
uint8_t beginOuter
Definition: HitPattern.h:497
reco::HitPattern::getCSCRing
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:736
reco::HitPattern::muonCSCHitFilter
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:632
ETLDetId
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
MTDDetId::mtdRR
int mtdRR() const
Definition: MTDDetId.h:64
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
DTSuperLayerId::superLayer
int superLayer() const
Return the superlayer number.
Definition: DTSuperLayerId.h:39
reco::HitPattern::insertExpectedInnerHit
bool insertExpectedInnerHit(const uint16_t pattern)
Definition: HitPattern.cc:985
ETLDetId.h
reco::HitPattern::maxTrackerWord
const static unsigned short maxTrackerWord
Definition: HitPattern.h:460
reco::HitPattern::getRPCLayer
static uint16_t getRPCLayer(uint16_t pattern)
RPC layer: for station 1 and 2, layer = 1(inner) or 2(outer); for station 3, 4 layer is always 0....
Definition: HitPattern.h:738
reco::HitPattern::getHitType
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:725
reco::HitPattern::getSide
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:718
CSCDetId.h
reco::HitPattern::pixelLayersWithMeasurement
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:492
reco::HitPattern::stripTOBLayersWithoutMeasurement
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:659
edm::Ref
Definition: AssociativeIterator.h:58
TrackerTopology::tidIsStereo
bool tidIsStereo(const DetId &id) const
Definition: TrackerTopology.h:267
reco::HitPattern::pixelBarrelLayersWithMeasurement
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:555
DetId
Definition: DetId.h:17
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
reco::HitPattern::minTrackerWord
const static unsigned short minTrackerWord
Definition: HitPattern.h:459
TrackerTopology.h
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
reco::HitPattern
Definition: HitPattern.h:147
TrackingRecHit.h
reco::HitPattern::pixelBarrelLayersNull
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:741
BTLDetId
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0,...
Definition: BTLDetId.h:18
reco::HitPattern::TRACKER_HIT
Definition: HitPattern.h:151
reco::HitPattern::endOuter
uint8_t endOuter
Definition: HitPattern.h:498
reco::HitPattern::encode
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:74
hgcalPlots.stat
stat
Definition: hgcalPlots.py:1111
reco::HitPattern::trackerLayersWithMeasurement
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:513
reco::HitPattern::getTrackerLayerCase
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
reco::HitPattern::getSubSubStructure
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:704
TrackingRecHit::Type
Type
Definition: TrackingRecHit.h:45
reco::HitPattern::stripTIDLayersTotallyOffOrBad
int stripTIDLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:711
reco::HitPattern::print
void print(HitCategory category, std::ostream &stream=std::cout) const
Definition: HitPattern.cc:839
reco::HitPattern::minStripWord
const static unsigned short minStripWord
Definition: HitPattern.h:462
reco::HitPattern::pixelEndcapLayersTotallyOffOrBad
int pixelEndcapLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:690
reco::HitPattern::getGEMStation
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:751
TrackerTopology::tibIsStereo
bool tibIsStereo(const DetId &id) const
Definition: TrackerTopology.h:266
reco::HitPattern::getCategoryIndexRange
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
reco::HitPattern::hasValidHitInPixelLayer
bool hasValidHitInPixelLayer(enum PixelSubdetector::SubDetector, uint16_t layer) const
Definition: HitPattern.cc:337
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
trackingPlots.other
other
Definition: trackingPlots.py:1465
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
reco::HitPattern::pixelBarrelLayersWithoutMeasurement
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:617
reco::HitPattern::insertHit
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:955
DTLayerId
Definition: DTLayerId.h:12
reco::HitPattern::getRPCregion
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:748
reco::HitPattern::SideOffset
const static unsigned short SideOffset
Definition: HitPattern.h:444
TrackingRecHit::inactive_inner
Definition: TrackingRecHit.h:52
PixelSubdetector::SubDetector
SubDetector
Definition: PixelSubdetector.h:11
TrackingRecHit::bad
Definition: TrackingRecHit.h:49
RPCDetId.h
reco::HitPattern::pixelHitFilter
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:573
reco::HitPattern::stripTIBLayersWithMeasurement
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:577
reco::HitPattern::numberOfDTStationsWithBothViews
int numberOfDTStationsWithBothViews() const
Definition: HitPattern.cc:942
reco::HitPattern::getLayer
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:702
reco::HitPattern::printHitPattern
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:803
DetId::Tracker
Definition: DetId.h:25
reco::HitPattern::pixelEndcapHitFilter
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:589
reco::HitPattern::stripTECLayersTotallyOffOrBad
int stripTECLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:731
BTLDetId::modType
int modType() const
Definition: BTLDetId.h:99
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
TrackingRecHit::missing
Definition: TrackingRecHit.h:47
reco::HitPattern::SubstrMask
const static unsigned short SubstrMask
Definition: HitPattern.h:453
GEMDetId
Definition: GEMDetId.h:17
CSCDetId
Definition: CSCDetId.h:26
FastTime
Definition: ForwardSubdetector.h:6
reco::HitPattern::timingHitFilter
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:688
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
reco::HitPattern::numberOfValidTECLayersWithMonoAndStereo
int numberOfValidTECLayersWithMonoAndStereo(uint32_t layer=0) const
Definition: HitPattern.cc:426
TrackingRecHit::inactive_outer
Definition: TrackingRecHit.h:53
reco::HitPattern::EMPTY_PATTERN
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
reco::HitPattern::stripTIDLayersWithoutMeasurement
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:649
TrackingRecHit::missing_outer
Definition: TrackingRecHit.h:51
reco::HitPattern::getMuonStation
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon,...
Definition: HitPattern.h:732
ME0DetId
Definition: ME0DetId.h:16
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
reco::HitPattern::getHitPatternByAbsoluteIndex
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:297
HitPattern.h
reco::HitPattern::SubDetectorMask
const static unsigned short SubDetectorMask
Definition: HitPattern.h:457
reco::HitPattern::LayerMask
const static unsigned short LayerMask
Definition: HitPattern.h:449
reco::HitPattern::isStereo
static uint16_t isStereo(DetId i, const TrackerTopology &ttopo)
Definition: HitPattern.cc:855
TrackingRecHit::valid
Definition: TrackingRecHit.h:46
reco::HitPattern::MONO
Definition: HitPattern.h:149
reco::HitPattern::pixelBarrelLayersTotallyOffOrBad
int pixelBarrelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:679
reco::HitPattern::TRACK_HITS
Definition: HitPattern.h:155
TrackingRecHit
Definition: TrackingRecHit.h:21
reco::HitPattern::ARRAY_LENGTH
const static unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
reco::HitPattern::~HitPattern
~HitPattern()
Definition: HitPattern.cc:35
reco::HitPattern::pixelEndcapLayersNull
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:752
reco::HitPattern::stripTOBLayersTotallyOffOrBad
int stripTOBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:721
MTDDetId::BTL
Definition: MTDDetId.h:27
GEMDetId.h
reco::HitPattern::stripTIDLayersWithMeasurement
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:587
reco::HitPattern::numberOfAllHits
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:773
reco::HitPattern::HitCategory
HitCategory
Definition: HitPattern.h:155
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
reco::HitPattern::muonStations
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:877
reco::HitPattern::appendMuonHit
bool appendMuonHit(const DetId &id, TrackingRecHit::Type hitType)
Definition: HitPattern.cc:281
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
reco::HitPattern::innermostMuonStationWithHits
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:890
MTDDetId::ETL
Definition: MTDDetId.h:27
MTDDetId
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
Exception
Definition: hltDiff.cc:246
reco::HitPattern::appendTrackerHit
bool appendTrackerHit(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType)
Definition: HitPattern.cc:277
reco::HitPattern::STEREO
Definition: HitPattern.h:149
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
reco::HitPattern::HitTypeMask
const static unsigned short HitTypeMask
Definition: HitPattern.h:441
reco::HitPattern::hitCount
uint8_t hitCount
Definition: HitPattern.h:491
reco::HitPattern::pixelEndcapLayersWithoutMeasurement
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:628
reco::HitPattern::MTD_HIT
Definition: HitPattern.h:151
reco::HitPattern::numberOfDTStationsWithRPhiView
int numberOfDTStationsWithRPhiView() const
Definition: HitPattern.cc:919
reco::HitPattern::NULL_RETURN
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
reco::HitPattern::endTrackHits
uint8_t endTrackHits
Definition: HitPattern.h:494
TrackingRecHit::inactive
Definition: TrackingRecHit.h:48
reco::HitPattern::SubstrOffset
const static unsigned short SubstrOffset
Definition: HitPattern.h:452
hcaldqm::constants::BAD
const double BAD
Definition: Constants.h:15
reco::HitPattern::pixelBarrelHitFilter
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
DetId::Muon
Definition: DetId.h:26
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::HitPattern::numberOfValidStripLayersWithMonoAndStereo
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:393
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
reco::HitPattern::numberOfValidTIDLayersWithMonoAndStereo
int numberOfValidTIDLayersWithMonoAndStereo(uint32_t layer=0) const
Definition: HitPattern.cc:422
reco::HitPattern::stripTECLayersWithMeasurement
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:607
reco::HitPattern::outermostMuonStationWithHits
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:905
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
DetId::Forward
Definition: DetId.h:30
reco::HitPattern::insertExpectedOuterHit
bool insertExpectedOuterHit(const uint16_t pattern)
Definition: HitPattern.cc:998
reco::HitPattern::stripTIBLayersTotallyOffOrBad
int stripTIBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:701
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78
reco::HitPattern::SubDetectorOffset
const static unsigned short SubDetectorOffset
Definition: HitPattern.h:456
reco::HitPattern::stripHitFilter
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:597
reco::HitPattern::MaxHits
const static unsigned short MaxHits
Definition: HitPattern.h:158
reco::HitPattern::muonDTHitFilter
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:624
reco::HitPattern::getTrackerMonoStereo
uint16_t getTrackerMonoStereo(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:458
reco::HitPattern::numberOfDTStationsWithRZView
int numberOfDTStationsWithRZView() const
Definition: HitPattern.cc:931
reco::HitPattern::getDTSuperLayer
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:734
HLT_2018_cff.flags
flags
Definition: HLT_2018_cff.py:11758
reco::HitPattern::endInner
uint8_t endInner
Definition: HitPattern.h:496
reco::HitPattern::hitPattern
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:490
reco::HitPattern::numberOfValidTIBLayersWithMonoAndStereo
int numberOfValidTIBLayersWithMonoAndStereo(uint32_t layer=0) const
Definition: HitPattern.cc:418
reco::HitPattern::muonME0HitFilter
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:656
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
reco::HitPattern::stripTECLayersNull
int stripTECLayersNull() const
Definition: HitPattern.cc:793
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
hit
Definition: SiStripHitEffFromCalibTree.cc:88
reco::HitPattern::stripTECLayersWithoutMeasurement
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:669
reco::HitPattern::insertTrackHit
bool insertTrackHit(const uint16_t pattern)
Definition: HitPattern.cc:966
reco::HitPattern::stripTOBLayersNull
int stripTOBLayersNull() const
Definition: HitPattern.cc:783
reco::HitPattern::stripTIDLayersNull
int stripTIDLayersNull() const
Definition: HitPattern.cc:773