test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HitPattern.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 #ifndef TrackReco_HitPattern_h
4 #define TrackReco_HitPattern_h
5 
6 //
7 // File: DataFormats/TrackReco/interface/HitPattern.h
8 //
9 // Marcel Vos, INFN Pisa
10 // v1.10 2007/05/08 bellan
11 // Zongru Wan, Kansas State University
12 // Jean-Roch Vlimant
13 // Kevin Burkett
14 // Boris Mangano
15 //
16 // Hit pattern is the summary information of the hits associated to track in
17 // AOD. When RecHits are no longer available, the compact hit pattern should
18 // allow basic track selection based on the hits in various subdetectors.
19 // The hits of a track are saved in unit16_t hitPattern[MaxHits].
20 //
21 // uint16_t
22 // +--------+---------------+---------------------------+-----------------+----------------+
23 // | tk/mu | sub-structure | sub-sub-structure | stereo | hit type |
24 // +--------+---------------+---------------------------+-----------------+----------------+
25 // | 10 | 9 8 7 | 6 5 4 3 | 2 | 1 0 | bit
26 // +--------+---------------+---------------------------+-----------------+----------------|
27 // | tk = 1 | PXB = 1 | layer = 1-3 | | hit type = 0-3 |
28 // | tk = 1 | PXF = 2 | disk = 1-2 | | hit type = 0-3 |
29 // | tk = 1 | TIB = 3 | layer = 1-4 | 0=rphi,1=stereo | hit type = 0-3 |
30 // | tk = 1 | TID = 4 | wheel = 1-3 | 0=rphi,1=stereo | hit type = 0-3 |
31 // | tk = 1 | TOB = 5 | layer = 1-6 | 0=rphi,1=stereo | hit type = 0-3 |
32 // | tk = 1 | TEC = 6 | wheel = 1-9 | 0=rphi,1=stereo | hit type = 0-3 |
33 // | mu = 0 | DT = 1 | 4*(stat-1)+superlayer | | hit type = 0-3 |
34 // | mu = 0 | CSC = 2 | 4*(stat-1)+(ring-1) | | hit type = 0-3 |
35 // | mu = 0 | RPC = 3 | 4*(stat-1)+2*layer+region | | hit type = 0-3 |
36 // | mu = 0 | GEM = 4 | 2*(stat-1)+2*(layer-1) | | hit type = 0-3 |
37 // +--------+---------------+---------------------------+-----------------+----------------+
38 //
39 // hit type, see DataFormats/TrackingRecHit/interface/TrackingRecHit.h
40 // VALID = valid hit = 0
41 // MISSING = detector is good, but no rec hit found = 1
42 // INACTIVE = detector is off, so there was no hope = 2
43 // BAD = there were many bad strips within the ellipse = 3
44 //
45 // It had been shown by Zongru using a 100 GeV muon sample with 5000 events
46 // uniform in eta and phi, the average (maximum) number of tracker hits is
47 // 13 (17) and the average (maximum) number of muon detector hits is about
48 // 26 (50). If the number of hits of a track is larger than 80 then the extra
49 // hits are ignored by hit pattern. The static hit pattern array might be
50 // improved to a dynamic one in the future.
51 //
52 // Because of tracking with/without overlaps and with/without hit-splitting,
53 // the final number of hits per track is pretty "variable". Compared with the
54 // number of valid hits, the number of crossed layers with measurement should
55 // be more robust to discriminate between good and fake track.
56 //
57 // Since 4-bit for sub-sub-structure is not enough to specify a muon layer,
58 // the layer case counting methods are implemented for tracker only. This is
59 // different from the hit counting methods which are implemented for both
60 // tracker and muon detector.
61 //
62 // Given a tracker layer, specified by sub-structure and layer, the method
63 // getTrackerLayerCase(substr, layer) groups all of the hits in the hit pattern
64 // array for the layer together and returns one of the four cases
65 //
66 // crossed
67 // layer case 0: VALID + (MISSING, OFF, BAD) ==> with measurement
68 // layer case 1: MISSING + (OFF, BAD) ==> without measurement
69 // layer case 2: OFF, BAD ==> totally off or bad, cannot say much
70 // not crossed
71 // layer case NULL_RETURN: track outside acceptance or in gap ==> null
72 //
73 // Given a tracker layer, specified by sub-structure and layer, the method
74 // getTrackerMonoStereo(substr, layer) groups all of the valid hits in the hit
75 // pattern array for the layer together and returns
76 //
77 // 0: neither a valid mono nor a valid stereo hit
78 // MONO: valid mono hit
79 // STEREO: valid stereo hit
80 // MONO | STEREO: both
81 //
82 //
83 // Given a track, here is an example usage of hit pattern
84 //
85 // // hit pattern of the track
86 // const reco::HitPattern &p = track->hitPattern();
87 //
88 // // loop over the hits of the track.
89 // for (int i = 0; i < p.numberOfHits(HitPattern::TRACK_HITS); i++) {
90 // uint32_t hit = p.getHitPattern(HitPattern::TRACK_HITS, i);
91 //
92 // // if the hit is valid and in pixel barrel, print out the layer
93 // if (p.validHitFilter(hit) && p.pixelBarrelHitFilter(hit)){
94 // cout << "valid hit found in pixel barrel layer "
95 // << p.getLayer(hit)
96 // << endl;
97 // }
98 //
99 // // expert level: printout the hit in 11-bit binary format
100 // cout << "hit in 11-bit binary format = ";
101 // for (int j = 10; j >= 0; j--){
102 // int bit = (hit >> j) & 0x1;
103 // cout << bit;
104 // }
105 // cout << endl;
106 // }
107 //
108 // //count the number of valid pixel barrel *** hits ***
109 // cout << "number of of valid pixel barrel hits is "
110 // << p.numberOfValidPixelBarrelHits()
111 // << endl;
112 //
113 // //count the number of pixel barrel *** layers *** with measurement
114 // cout << "number of of pixel barrel layers with measurement is "
115 // << p.pixelBarrelLayersWithMeasurement()
116 // << endl;
117 //
118 
126 
127 #include <utility>
128 #include <algorithm>
129 #include <iostream>
130 #include <ostream>
131 #include <memory>
132 
133 class TrackerTopology;
134 
135 namespace test {
136  namespace TestHitPattern {
137  int test();
138  }
139 }
140 
141 namespace reco
142 {
143 
145 {
146 
147 public:
148  enum {
149  MONO = 1,
150  STEREO = 2
151  };
152 
153  enum HIT_TYPE {
154  VALID = 0,
155  MISSING = 1,
156  INACTIVE = 2,
157  BAD = 3
158  };
159 
160  enum HitCategory {
164  };
165  const static unsigned short ARRAY_LENGTH = 50;
166  const static unsigned short HIT_LENGTH = 11;
167  const static unsigned short MaxHits = (8 * sizeof(uint16_t) * ARRAY_LENGTH) / HIT_LENGTH;
168 
169  static const uint32_t NULL_RETURN = 999999;
170  static const uint16_t EMPTY_PATTERN = 0x0;
171 
172  static bool trackerHitFilter(uint16_t pattern);
173  static bool muonHitFilter(uint16_t pattern);
174 
175  static bool validHitFilter(uint16_t pattern);
176  static bool missingHitFilter(uint16_t pattern);
177  static bool inactiveHitFilter(uint16_t pattern);
178  static bool badHitFilter(uint16_t pattern);
179 
180  static bool pixelHitFilter(uint16_t pattern);
181  static bool pixelBarrelHitFilter(uint16_t pattern);
182  static bool pixelEndcapHitFilter(uint16_t pattern);
183  static bool stripHitFilter(uint16_t pattern);
184  static bool stripTIBHitFilter(uint16_t pattern);
185  static bool stripTIDHitFilter(uint16_t pattern);
186  static bool stripTOBHitFilter(uint16_t pattern);
187  static bool stripTECHitFilter(uint16_t pattern);
188 
189  static bool muonDTHitFilter(uint16_t pattern);
190  static bool muonCSCHitFilter(uint16_t pattern);
191  static bool muonRPCHitFilter(uint16_t pattern);
192  static bool muonGEMHitFilter(uint16_t pattern);
193 
194  static uint32_t getHitType(uint16_t pattern);
195 
196  // mono (0) or stereo (1)
197  static uint32_t getSide(uint16_t pattern);
198  static uint32_t getLayer(uint16_t pattern);
199  static uint32_t getSubSubStructure(uint16_t pattern);
200  static uint32_t getSubStructure(uint16_t pattern);
201  static uint32_t getSubDetector(uint16_t pattern);
202 
204  static uint16_t getMuonStation(uint16_t pattern);
205 
207  static uint16_t getDTSuperLayer(uint16_t pattern); // only for DT patterns
208 
210  static uint16_t getCSCRing(uint16_t pattern) ;
211 
213  static uint16_t getRPCLayer(uint16_t pattern) ;
214 
216  static uint16_t getRPCregion(uint16_t pattern);
217 
219  static uint16_t getGEMStation(uint16_t pattern);
220 
222  static uint16_t getGEMLayer(uint16_t pattern);
223 
224  HitPattern();
225 
226  ~HitPattern();
227 
228  HitPattern(const HitPattern &other);
229 
230  HitPattern &operator=(const HitPattern &other);
231 
232  template<typename I>
233  bool appendHits(const I &begin, const I &end, const TrackerTopology& ttopo);
234  bool appendHit(const TrackingRecHit &hit, const TrackerTopology& ttopo);
235  bool appendHit(const TrackingRecHitRef &ref, const TrackerTopology& ttopo);
236  bool appendHit(const DetId &id, TrackingRecHit::Type hitType, const TrackerTopology& ttopo);
237 
244  bool appendTrackerHit(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType);
245 
252  bool appendMuonHit(const DetId& id, TrackingRecHit::Type hitType);
253 
254  // get the pattern of the position-th hit
255  uint16_t getHitPattern(HitCategory category, int position) const;
256 
257  void clear();
258 
259  // print the pattern of the position-th hit
260  void printHitPattern(HitCategory category, int position, std::ostream &stream) const;
261  void print(HitCategory category, std::ostream &stream = std::cout) const;
262 
263  bool hasValidHitInFirstPixelBarrel() const; // has valid hit in PXB layer 1
264  bool hasValidHitInFirstPixelEndcap() const; // has valid hit in PXF layer 1
265 
266  int numberOfHits(HitCategory category) const; // not-null
267  int numberOfValidHits() const; // not-null, valid
268 
269  int numberOfTrackerHits(HitCategory category) const; // not-null, tracker
270  int numberOfValidTrackerHits() const; // not-null, valid, tracker
271  int numberOfValidPixelHits() const; // not-null, valid, pixel
272  int numberOfValidPixelBarrelHits() const; // not-null, valid, pixel PXB
273  int numberOfValidPixelEndcapHits() const; // not-null, valid, pixel PXF
274  int numberOfValidStripHits() const; // not-null, valid, strip
275  int numberOfValidStripTIBHits() const; // not-null, valid, strip TIB
276  int numberOfValidStripTIDHits() const; // not-null, valid, strip TID
277  int numberOfValidStripTOBHits() const; // not-null, valid, strip TOB
278  int numberOfValidStripTECHits() const; // not-null, valid, strip TEC
279 
280  int numberOfLostHits(HitCategory category) const; // not-null, not valid
281  int numberOfLostTrackerHits(HitCategory category) const; // not-null, not valid, tracker
282  int numberOfLostPixelHits(HitCategory category) const; // not-null, not valid, pixel
283  int numberOfLostPixelBarrelHits(HitCategory category) const; // not-null, not valid, pixel PXB
284  int numberOfLostPixelEndcapHits(HitCategory category) const; // not-null, not valid, pixel PXF
285  int numberOfLostStripHits(HitCategory category) const; // not-null, not valid, strip
286  int numberOfLostStripTIBHits(HitCategory category) const; // not-null, not valid, strip TIB
287  int numberOfLostStripTIDHits(HitCategory category) const; // not-null, not valid, strip TID
288  int numberOfLostStripTOBHits(HitCategory category) const; // not-null, not valid, strip TOB
289  int numberOfLostStripTECHits(HitCategory category) const; // not-null, not valid, strip TEC
290 
291  int numberOfMuonHits() const; // not-null, muon
292  int numberOfValidMuonHits() const; // not-null, valid, muon
293  int numberOfValidMuonDTHits() const; // not-null, valid, muon DT
294  int numberOfValidMuonCSCHits() const; // not-null, valid, muon CSC
295  int numberOfValidMuonRPCHits() const; // not-null, valid, muon RPC
296  int numberOfValidMuonGEMHits() const; // not-null, valid, muon GEM
297  int numberOfLostMuonHits() const; // not-null, not valid, muon
298  int numberOfLostMuonDTHits() const; // not-null, not valid, muon DT
299  int numberOfLostMuonCSCHits() const; // not-null, not valid, muon CSC
300  int numberOfLostMuonRPCHits() const; // not-null, not valid, muon RPC
301  int numberOfLostMuonGEMHits() const; // not-null, not valid, muon GEM
302  int numberOfBadHits() const; // not-null, bad (only used in Muon Ch.)
303  int numberOfBadMuonHits() const; // not-null, bad, muon
304  int numberOfBadMuonDTHits() const; // not-null, bad, muon DT
305  int numberOfBadMuonCSCHits() const; // not-null, bad, muon CSC
306  int numberOfBadMuonRPCHits() const; // not-null, bad, muon RPC
307  int numberOfBadMuonGEMHits() const; // not-null, bad, muon GEM
308 
309  int numberOfInactiveHits() const; // not-null, inactive
310  int numberOfInactiveTrackerHits() const; // not-null, inactive, tracker
311 
312  // count strip layers that have non-null, valid mono and stereo hits
313  int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const;
315  int numberOfValidTOBLayersWithMonoAndStereo(uint32_t layer = 0) const;
316  int numberOfValidTIBLayersWithMonoAndStereo(uint32_t layer = 0) const;
317  int numberOfValidTIDLayersWithMonoAndStereo(uint32_t layer = 0) const;
318  int numberOfValidTECLayersWithMonoAndStereo(uint32_t layer = 0) const;
319 
320  uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const;
321  uint16_t getTrackerMonoStereo(HitCategory category, uint16_t substr, uint16_t layer) const;
322 
323  int trackerLayersWithMeasurementOld() const; // case 0: tracker
324  int trackerLayersWithMeasurement() const; // case 0: tracker
325  int pixelLayersWithMeasurementOld() const; // case 0: pixel
326  int pixelLayersWithMeasurement() const; // case 0: pixel
327  int stripLayersWithMeasurement() const; // case 0: strip
328  int pixelBarrelLayersWithMeasurement() const; // case 0: pixel PXB
329  int pixelEndcapLayersWithMeasurement() const; // case 0: pixel PXF
330  int stripTIBLayersWithMeasurement() const; // case 0: strip TIB
331  int stripTIDLayersWithMeasurement() const; // case 0: strip TID
332  int stripTOBLayersWithMeasurement() const; // case 0: strip TOB
333  int stripTECLayersWithMeasurement() const; // case 0: strip TEC
334 
335  int trackerLayersWithoutMeasurement(HitCategory category) const; // case 1: tracker
336  int trackerLayersWithoutMeasurementOld(HitCategory category) const; // case 1: tracker
337  int pixelLayersWithoutMeasurement(HitCategory category) const; // case 1: pixel
338  int stripLayersWithoutMeasurement(HitCategory category) const; // case 1: strip
339  int pixelBarrelLayersWithoutMeasurement(HitCategory category) const; // case 1: pixel PXB
340  int pixelEndcapLayersWithoutMeasurement(HitCategory category) const; // case 1: pixel PXF
341  int stripTIBLayersWithoutMeasurement(HitCategory category) const; // case 1: strip TIB
342  int stripTIDLayersWithoutMeasurement(HitCategory category) const; // case 1: strip TID
343  int stripTOBLayersWithoutMeasurement(HitCategory category) const; // case 1: strip TOB
344  int stripTECLayersWithoutMeasurement(HitCategory category) const; // case 1: strip TEC
345 
346  int trackerLayersTotallyOffOrBad() const; // case 2: tracker
347  int pixelLayersTotallyOffOrBad() const; // case 2: pixel
348  int stripLayersTotallyOffOrBad() const; // case 2: strip
349  int pixelBarrelLayersTotallyOffOrBad() const; // case 2: pixel PXB
350  int pixelEndcapLayersTotallyOffOrBad() const; // case 2: pixel PXF
351  int stripTIBLayersTotallyOffOrBad() const; // case 2: strip TIB
352  int stripTIDLayersTotallyOffOrBad() const; // case 2: strip TID
353  int stripTOBLayersTotallyOffOrBad() const; // case 2: strip TOB
354  int stripTECLayersTotallyOffOrBad() const; // case 2: strip TEC
355 
356  int trackerLayersNull() const; // case NULL_RETURN: tracker
357  int pixelLayersNull() const; // case NULL_RETURN: pixel
358  int stripLayersNull() const; // case NULL_RETURN: strip
359  int pixelBarrelLayersNull() const; // case NULL_RETURN: pixel PXB
360  int pixelEndcapLayersNull() const; // case NULL_RETURN: pixel PXF
361  int stripTIBLayersNull() const; // case NULL_RETURN: strip TIB
362  int stripTIDLayersNull() const; // case NULL_RETURN: strip TID
363  int stripTOBLayersNull() const; // case NULL_RETURN: strip TOB
364  int stripTECLayersNull() const; // case NULL_RETURN: strip TEC
365 
367  int muonStations(int subdet, int hitType) const ;
368 
369  int muonStationsWithValidHits() const;
370  int muonStationsWithBadHits() const;
371  int muonStationsWithAnyHits() const;
372 
373  int dtStationsWithValidHits() const;
374  int dtStationsWithBadHits() const;
375  int dtStationsWithAnyHits() const;
376 
377  int cscStationsWithValidHits() const;
378  int cscStationsWithBadHits() const;
379  int cscStationsWithAnyHits() const;
380 
381  int rpcStationsWithValidHits() const;
382  int rpcStationsWithBadHits() const;
383  int rpcStationsWithAnyHits() const;
384 
385  int gemStationsWithValidHits() const ;
386  int gemStationsWithBadHits() const ;
387  int gemStationsWithAnyHits() const ;
388 
390  int innermostMuonStationWithHits(int hitType) const;
394 
396  int outermostMuonStationWithHits(int hitType) const;
400 
401  int numberOfDTStationsWithRPhiView() const;
402  int numberOfDTStationsWithRZView() const;
404 
405 private:
406 
407  // 3 bits for hit type
408  const static unsigned short HitTypeOffset = 0;
409  const static unsigned short HitTypeMask = 0x3;
410 
411  // 1 bit to identify the side in double-sided detectors
412  const static unsigned short SideOffset = 2;
413  const static unsigned short SideMask = 0x1;
414 
415  // 4 bits to identify the layer/disk/wheel within the substructure
416  const static unsigned short LayerOffset = 3;
417  const static unsigned short LayerMask = 0xF;
418 
419  // 3 bits to identify the tracker/muon detector substructure
420  const static unsigned short SubstrOffset = 7;
421  const static unsigned short SubstrMask = 0x7;
422 
423  // 1 bit to distinguish tracker and muon subsystems
424  const static unsigned short SubDetectorOffset = 10;
425  const static unsigned short SubDetectorMask = 0x1;
426 
427  const static unsigned short minTrackerWord = 1<< SubDetectorOffset;
428  const static unsigned short minPixelWord = minTrackerWord | (1<<SubstrOffset);
429  const static unsigned short minStripWord = minTrackerWord | (3<<SubstrOffset);
430 
431 
432  // detector side for tracker modules (mono/stereo)
433  static uint16_t isStereo(DetId i, const TrackerTopology& ttopo);
434  static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure);
435 
436  static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology& ttopo);
437  static uint16_t encode(const DetId &id, TrackingRecHit::Type hitType, const TrackerTopology& ttopo);
438  static uint16_t encode(uint16_t det, uint16_t subdet, uint16_t layer, uint16_t side, TrackingRecHit::Type hitType);
439 
440  // generic count methods
441  typedef bool filterType(uint16_t);
442 
443  template<typename F>
444  void call(HitCategory category, filterType typeFilter, F f) const;
445 
448 
449  bool insertTrackHit(const uint16_t pattern);
450  bool insertExpectedInnerHit(const uint16_t pattern);
451  bool insertExpectedOuterHit(const uint16_t pattern);
452  void insertHit(const uint16_t pattern);
453  bool appendHit(const uint16_t pattern, TrackingRecHit::Type hitType);
454 
455  uint16_t getHitPatternByAbsoluteIndex(int position) const;
456 
457  std::pair<uint8_t, uint8_t> getCategoryIndexRange(HitCategory category) const;
458 
460  uint8_t hitCount;
461 
462  uint8_t beginTrackHits;
463  uint8_t endTrackHits;
464  uint8_t beginInner;
465  uint8_t endInner;
466  uint8_t beginOuter;
467  uint8_t endOuter;
468 
469  friend int test::TestHitPattern::test();
470 
471  template<int N>
472  friend struct PatternSet;
473 };
474 
475 inline std::pair<uint8_t, uint8_t> HitPattern::getCategoryIndexRange(HitCategory category) const
476 {
477  switch (category) {
478  case TRACK_HITS:
479  return std::pair<uint8_t, uint8_t>(beginTrackHits, endTrackHits);
480  break;
481  case MISSING_INNER_HITS:
482  return std::pair<uint8_t, uint8_t>(beginInner, endInner);
483  break;
484  case MISSING_OUTER_HITS:
485  return std::pair<uint8_t, uint8_t>(beginOuter, endOuter);
486  break;
487  }
488  return std::pair<uint8_t, uint8_t>(-1, -1);
489 }
490 
491 template<typename I>
492 bool HitPattern::appendHits(const I &begin, const I &end, const TrackerTopology& ttopo)
493 {
494  for (I hit = begin; hit != end; hit++) {
495  if unlikely((!appendHit(*hit, ttopo))) {
496  return false;
497  }
498  }
499  return true;
500 }
501 
503 {
504  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
505  if unlikely((position < 0 || (position + range.first) >= range.second)) {
507  }
508 
509  return getHitPatternByAbsoluteIndex(range.first + position);
510 }
511 
512 inline int HitPattern::countHits(HitCategory category, filterType filter) const
513 {
514  int count = 0;
515  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
516  for (int i = range.first; i < range.second; ++i) {
518  ++count;
519  }
520  }
521  return count;
522 }
523 
524 
525 template<typename F>
526 void HitPattern::call(HitCategory category, filterType typeFilter, F f) const
527 {
528  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
529  for (int i = range.first; i < range.second; i++) {
531  // f() return false to ask to stop looping
532  if (typeFilter(pattern) && !f(pattern)) {
533  break;
534  }
535  }
536 }
537 
538 inline int HitPattern::countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
539 {
540  int count = 0;
541  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
542  for (int i = range.first; i < range.second; ++i) {
544  if (typeFilter(pattern) && filter(pattern)) {
545  ++count;
546  }
547  }
548  return count;
549 }
550 
551 inline bool HitPattern::pixelHitFilter(uint16_t pattern)
552 {
553  if unlikely(!trackerHitFilter(pattern)) {
554  return false;
555  }
556 
557  uint32_t substructure = getSubStructure(pattern);
558  return (substructure == PixelSubdetector::PixelBarrel ||
559  substructure == PixelSubdetector::PixelEndcap);
560 }
561 
563 {
564  if unlikely(!trackerHitFilter(pattern)) {
565  return false;
566  }
567 
568  uint32_t substructure = getSubStructure(pattern);
569  return (substructure == PixelSubdetector::PixelBarrel);
570 }
571 
573 {
574  if unlikely(!trackerHitFilter(pattern)) {
575  return false;
576  }
577 
578  uint32_t substructure = getSubStructure(pattern);
579  return (substructure == PixelSubdetector::PixelEndcap);
580 }
581 
582 inline bool HitPattern::stripHitFilter(uint16_t pattern)
583 {
584  return pattern > minStripWord;
585 }
586 
587 
589 {
590  if unlikely(!trackerHitFilter(pattern)) {
591  return false;
592  }
593 
594  return substructure == getSubStructure(pattern);
595 }
596 
598 {
600 }
601 
603 {
605 }
606 
608 {
610 }
611 
613 {
615 }
616 
618 {
619  if unlikely(!muonHitFilter(pattern)) {
620  return false;
621  }
622 
623  uint32_t substructure = getSubStructure(pattern);
624  return (substructure == (uint32_t) MuonSubdetId::DT);
625 }
626 
628 {
629  if unlikely(!muonHitFilter(pattern)) {
630  return false;
631  }
632 
633  uint32_t substructure = getSubStructure(pattern);
634  return (substructure == (uint32_t) MuonSubdetId::CSC);
635 }
636 
638 {
639  if unlikely(!muonHitFilter(pattern)) {
640  return false;
641  }
642 
643  uint32_t substructure = getSubStructure(pattern);
644  return (substructure == (uint32_t) MuonSubdetId::RPC);
645 }
646 
648 {
649  if unlikely(!muonHitFilter(pattern)) {
650  return false;
651  }
652 
653  uint32_t substructure = getSubStructure(pattern);
654  return (substructure == (uint32_t) MuonSubdetId::GEM);
655 }
656 
658 {
659  return pattern > minTrackerWord;
660 }
661 
662 inline bool HitPattern::muonHitFilter(uint16_t pattern)
663 {
664  if unlikely(pattern == HitPattern::EMPTY_PATTERN) {
665  return false;
666  }
667 
668  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 0);
669 }
670 
671 inline uint32_t HitPattern::getSubStructure(uint16_t pattern)
672 {
673  if unlikely(pattern == HitPattern::EMPTY_PATTERN) {
674  return NULL_RETURN;
675  }
676 
677  return ((pattern >> SubstrOffset) & SubstrMask);
678 }
679 
680 inline uint32_t HitPattern::getLayer(uint16_t pattern)
681 {
682  return HitPattern::getSubSubStructure(pattern);
683 }
684 
685 inline uint32_t HitPattern::getSubSubStructure(uint16_t pattern)
686 {
687  if unlikely(pattern == HitPattern::EMPTY_PATTERN) {
688  return NULL_RETURN;
689  }
690 
691  return ((pattern >> LayerOffset) & LayerMask);
692 }
693 
694 inline uint32_t HitPattern::getSubDetector(uint16_t pattern)
695 {
696  if unlikely(pattern == HitPattern::EMPTY_PATTERN) {
697  return NULL_RETURN;
698  }
699 
700  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
701 }
702 
703 
704 inline uint32_t HitPattern::getSide(uint16_t pattern)
705 {
706  if unlikely(pattern == HitPattern::EMPTY_PATTERN) {
707  return NULL_RETURN;
708  }
709 
710  return (pattern >> SideOffset) & SideMask;
711 }
712 
713 inline uint32_t HitPattern::getHitType(uint16_t pattern)
714 {
715  if unlikely(pattern == HitPattern::EMPTY_PATTERN) {
716  return NULL_RETURN;
717  }
718 
719  return ((pattern >> HitTypeOffset) & HitTypeMask);
720 }
721 
722 inline uint16_t HitPattern::getMuonStation(uint16_t pattern)
723 {
724  return (getSubSubStructure(pattern) >> 2) + 1;
725 }
726 
727 inline uint16_t HitPattern::getDTSuperLayer(uint16_t pattern)
728 {
729  return (getSubSubStructure(pattern) & 3);
730 }
731 
732 inline uint16_t HitPattern::getCSCRing(uint16_t pattern)
733 {
734  return (getSubSubStructure(pattern) & 3) + 1;
735 }
736 
737 inline uint16_t HitPattern::getRPCLayer(uint16_t pattern)
738 {
739  uint16_t subSubStructure = getSubSubStructure(pattern);
740  uint16_t stat = subSubStructure >> 2;
741 
742  if likely(stat <= 1) {
743  return ((subSubStructure >> 1) & 1) + 1;
744  }
745 
746  return 0;
747 }
748 
749 inline uint16_t HitPattern::getRPCregion(uint16_t pattern)
750 {
751  return getSubSubStructure(pattern) & 1;
752 }
753 
755 inline uint16_t HitPattern::getGEMStation(uint16_t pattern)
756 {
757  uint16_t sss = getSubSubStructure(pattern), stat = sss >> 1;
758  return stat + 1;
759 }
760 inline uint16_t HitPattern::getGEMLayer(uint16_t pattern)
761 {
762  return (getSubSubStructure(pattern) & 1) + 1;
763 }
764 
765 inline bool HitPattern::validHitFilter(uint16_t pattern)
766 {
767  return getHitType(pattern) == HitPattern::VALID;
768 }
769 
771 {
772  return getHitType(pattern) == HitPattern::MISSING;
773 }
774 
776 {
777  return getHitType(pattern) == HitPattern::INACTIVE;
778 }
779 
780 inline bool HitPattern::badHitFilter(uint16_t pattern)
781 {
782  return getHitType(pattern) == HitPattern::BAD;
783 }
784 
786 {
787  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
788  return range.second - range.first;
789 }
790 
792 {
793  return countHits(category, trackerHitFilter);
794 }
795 
797 {
799 }
800 
802 {
804 }
805 
807 {
809 }
810 
812 {
814 }
815 
817 {
819 }
820 
822 {
824 }
825 
827 {
829 }
830 
832 {
834 }
835 
837 {
839 }
840 
842 {
844 }
845 
847 {
849 }
850 
852 {
854 }
855 
857 {
859 }
860 
862 {
864 }
865 
867 {
869 }
870 
872 {
874 }
875 
877 {
878  return countHits(category, missingHitFilter);
879 }
880 
882 {
884 }
885 
887 {
889 }
890 
892 {
894 }
895 
897 {
899 }
900 
902 {
904 }
905 
907 {
909 }
910 
912 {
914 }
915 
917 {
919 }
920 
922 {
924 }
925 
927 {
929 }
930 
932 {
934 }
935 
937 {
939 }
940 
942 {
944 }
945 
947 {
949 }
950 
951 inline int HitPattern::numberOfBadHits() const
952 {
954 }
955 
957 {
959 }
960 
962 {
964 }
965 
967 {
969 }
970 
972 {
974 }
975 
977 {
979 }
980 
982 {
984 }
985 
987 {
989 }
990 
992 {
994 }
995 
997 {
999 }
1000 
1002 {
1005 }
1006 
1008 {
1009  return pixelLayersWithoutMeasurement(category) +
1011 }
1012 
1014 {
1015  return pixelBarrelLayersWithoutMeasurement(category) +
1017 }
1018 
1020 {
1021  return stripTIBLayersWithoutMeasurement(category) +
1025 }
1026 
1028 {
1029  return pixelLayersTotallyOffOrBad() +
1031 }
1032 
1034 {
1037 }
1038 
1040 {
1045 }
1046 
1048 {
1049  return pixelLayersNull() +
1050  stripLayersNull();
1051 }
1052 
1054 {
1055  return pixelBarrelLayersNull() +
1057 }
1058 
1060 {
1061  return stripTIBLayersNull() +
1062  stripTIDLayersNull() +
1063  stripTOBLayersNull() +
1065 }
1066 
1068 {
1069  return muonStations(0, 0);
1070 }
1071 
1073 {
1074  return muonStations(0, 3);
1075 }
1076 
1078 {
1079  return muonStations(0, -1);
1080 }
1081 
1083 {
1084  return muonStations(1, 0);
1085 }
1086 
1088 {
1089  return muonStations(1, 3);
1090 }
1091 
1093 {
1094  return muonStations(1, -1);
1095 }
1096 
1098 {
1099  return muonStations(2, 0);
1100 }
1101 
1103 {
1104  return muonStations(2, 3);
1105 }
1106 
1108 {
1109  return muonStations(2, -1);
1110 }
1111 
1113 {
1114  return muonStations(3, 0);
1115 }
1116 
1118 {
1119  return muonStations(3, 3);
1120 }
1121 
1123 {
1124  return muonStations(3, -1);
1125 }
1126 
1128 {
1129  return muonStations(4, 0);
1130 }
1131 
1133 {
1134  return muonStations(4, 3);
1135 }
1136 
1138 {
1139  return muonStations(4,-1);
1140 }
1141 
1143 {
1144  return innermostMuonStationWithHits(0);
1145 }
1146 
1148 {
1149  return innermostMuonStationWithHits(3);
1150 }
1151 
1153 {
1154  return innermostMuonStationWithHits(-1);
1155 }
1156 
1158 {
1159  return outermostMuonStationWithHits(0);
1160 }
1161 
1163 {
1164  return outermostMuonStationWithHits(3);
1165 }
1166 
1168 {
1169  return outermostMuonStationWithHits(-1);
1170 }
1171 
1172 #ifndef CMS_NOCXX11 // cint....
1173 
1174 template<int N = HitPattern::MaxHits>
1175 struct PatternSet {
1176  static constexpr int MaxHits = N;
1177  unsigned char hit[N];
1178  unsigned char nhit;
1179 
1180  unsigned char const *begin() const
1181  {
1182  return hit;
1183  }
1184 
1185  unsigned char const *end() const
1186  {
1187  return hit + nhit;
1188  }
1189 
1190  unsigned char *begin()
1191  {
1192  return hit;
1193  }
1194 
1195  unsigned char *end()
1196  {
1197  return hit + nhit;
1198  }
1199 
1200  int size() const
1201  {
1202  return nhit;
1203  }
1204 
1205  unsigned char operator[](int i) const
1206  {
1207  return hit[i];
1208  }
1209 
1210  PatternSet() : nhit(0) {}
1211 
1212  PatternSet(HitPattern::HitCategory category, HitPattern const &hp)
1213  {
1214  fill(category, hp);
1215  }
1216 
1217  void fill(HitPattern::HitCategory category, HitPattern const &hp)
1218  {
1219  int lhit = 0;
1220  auto unpack = [&lhit, this](uint16_t pattern) -> bool {
1221  unsigned char p = 255 & (pattern >> 3);
1222  hit[lhit++] = p;
1223 
1224  // bouble sort
1225  if (lhit > 1) {
1226  for (auto h = hit + lhit - 1; h != hit; --h) {
1227  if ((*(h - 1)) <= p) {
1228  break;
1229  }
1230  (*h) = *(h - 1);
1231  *(h - 1) = p;
1232  }
1233  }
1234  return lhit < MaxHits;
1235  };
1236 
1237  hp.call(category, HitPattern::validHitFilter, unpack);
1238  nhit = lhit;
1239  }
1240 };
1241 
1242 template<int N>
1243 inline PatternSet<N> commonHits(PatternSet<N> const &p1, PatternSet<N> const &p2)
1244 {
1245  PatternSet<N> comm;
1246  comm.nhit = std::set_intersection(p1.begin(), p1.end(), p2.begin(), p2.end(), comm.begin()) - comm.begin();
1247  return comm;
1248 }
1249 #endif // gcc11
1250 
1251 } // namespace reco
1252 
1253 #endif
1254 
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:602
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:732
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:612
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:624
int i
Definition: DBlmapReader.cc:9
int cscStationsWithAnyHits() const
Definition: HitPattern.h:1107
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:680
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:995
int numberOfLostStripTIBHits(HitCategory category) const
Definition: HitPattern.h:911
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:936
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:166
int outermostMuonStationWithValidHits() const
Definition: HitPattern.h:1157
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:165
static const uint32_t NULL_RETURN
Definition: HitPattern.h:169
bool appendHits(const I &begin, const I &end, const TrackerTopology &ttopo)
Definition: HitPattern.h:492
string fill
Definition: lumiContext.py:319
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:762
int numberOfLostStripTOBHits(HitCategory category) const
Definition: HitPattern.h:921
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:551
int stripTIBLayersNull() const
Definition: HitPattern.cc:786
int numberOfInactiveHits() const
Definition: HitPattern.h:981
int gemStationsWithBadHits() const
Definition: HitPattern.h:1132
static uint16_t isStereo(DetId i, const TrackerTopology &ttopo)
Definition: HitPattern.cc:881
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:580
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:780
int stripTECLayersNull() const
Definition: HitPattern.cc:819
static const unsigned short SideOffset
Definition: HitPattern.h:412
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:170
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:904
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the &quot;hit&quot; was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:727
static const unsigned short SubstrOffset
Definition: HitPattern.h:420
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:670
int numberOfValidHits() const
Definition: HitPattern.h:801
int numberOfLostPixelHits(HitCategory category) const
Definition: HitPattern.h:891
int numberOfDTStationsWithRPhiView() const
Definition: HitPattern.cc:952
int numberOfBadHits() const
Definition: HitPattern.h:951
static const int GEM
Definition: MuonSubdetId.h:15
int cscStationsWithValidHits() const
Definition: HitPattern.h:1097
int pixelLayersNull() const
Definition: HitPattern.h:1053
void call(HitCategory category, filterType typeFilter, F f) const
Definition: HitPattern.h:526
HitPattern & operator=(const HitPattern &other)
Definition: HitPattern.cc:49
uint16_t getTrackerMonoStereo(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:458
static const unsigned short MaxHits
Definition: HitPattern.h:167
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:426
int numberOfValidStripHits() const
Definition: HitPattern.h:831
int rpcStationsWithValidHits() const
Definition: HitPattern.h:1112
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:497
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:538
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:386
bool filterType(uint16_t)
Definition: HitPattern.h:441
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:636
int numberOfLostMuonHits() const
Definition: HitPattern.h:886
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:770
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:516
static const unsigned short HitTypeMask
Definition: HitPattern.h:409
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:562
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:568
int numberOfValidStripTOBHits() const
Definition: HitPattern.h:846
#define constexpr
int numberOfValidMuonCSCHits() const
Definition: HitPattern.h:861
int numberOfMuonHits() const
Definition: HitPattern.h:796
bool insertExpectedOuterHit(const uint16_t pattern)
Definition: HitPattern.cc:1039
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:572
int numberOfLostTrackerHits(HitCategory category) const
Definition: HitPattern.h:881
int numberOfLostStripHits(HitCategory category) const
Definition: HitPattern.h:906
int numberOfValidMuonRPCHits() const
Definition: HitPattern.h:866
bool hasValidHitInFirstPixelEndcap() const
Definition: HitPattern.cc:327
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:765
int muonStationsWithBadHits() const
Definition: HitPattern.h:1072
#define unlikely(x)
uint8_t endInner
Definition: HitPattern.h:465
int trackerLayersWithoutMeasurementOld(HitCategory category) const
Definition: HitPattern.h:1007
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:830
int stripLayersNull() const
Definition: HitPattern.h:1059
#define likely(x)
int numberOfLostStripTIDHits(HitCategory category) const
Definition: HitPattern.h:916
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:760
int muonStationsWithValidHits() const
Definition: HitPattern.h:1067
static const int CSC
Definition: MuonSubdetId.h:13
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1013
int stripTOBLayersTotallyOffOrBad() const
Definition: HitPattern.cc:739
int rpcStationsWithBadHits() const
Definition: HitPattern.h:1117
static const unsigned short minTrackerWord
Definition: HitPattern.h:427
int innermostMuonStationWithAnyHits() const
Definition: HitPattern.h:1152
int trackerLayersTotallyOffOrBad() const
Definition: HitPattern.h:1027
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:459
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.h:821
int stripTIDLayersTotallyOffOrBad() const
Definition: HitPattern.cc:728
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:627
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:713
int numberOfBadMuonGEMHits() const
Definition: HitPattern.h:976
int numberOfValidTECLayersWithMonoAndStereo(uint32_t layer=0) const
Definition: HitPattern.cc:421
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:591
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
static const unsigned short SubDetectorMask
Definition: HitPattern.h:425
int numberOfTrackerHits(HitCategory category) const
Definition: HitPattern.h:791
int muonStationsWithAnyHits() const
Definition: HitPattern.h:1077
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:582
int pixelLayersTotallyOffOrBad() const
Definition: HitPattern.h:1033
int stripTECLayersTotallyOffOrBad() const
Definition: HitPattern.cc:751
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1019
int numberOfBadMuonHits() const
Definition: HitPattern.h:956
T operator[](int i) const
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:178
int numberOfValidStripTIDHits() const
Definition: HitPattern.h:841
const std::complex< double > I
Definition: I.h:8
int numberOfDTStationsWithRZView() const
Definition: HitPattern.cc:966
double f[11][100]
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
int numberOfValidStripTECHits() const
Definition: HitPattern.h:851
uint8_t beginInner
Definition: HitPattern.h:464
#define end
Definition: vmac.h:37
int stripTIDLayersNull() const
Definition: HitPattern.cc:797
int numberOfLostMuonRPCHits() const
Definition: HitPattern.h:941
static const unsigned short HitTypeOffset
Definition: HitPattern.h:408
int gemStationsWithAnyHits() const
Definition: HitPattern.h:1137
double p2[4]
Definition: TauolaWrapper.h:90
int numberOfBadMuonRPCHits() const
Definition: HitPattern.h:971
int numberOfValidTIDLayersWithMonoAndStereo(uint32_t layer=0) const
Definition: HitPattern.cc:416
int dtStationsWithValidHits() const
Definition: HitPattern.h:1082
int stripLayersTotallyOffOrBad() const
Definition: HitPattern.h:1039
bool appendTrackerHit(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType)
Definition: HitPattern.cc:254
int cscStationsWithBadHits() const
Definition: HitPattern.h:1102
uint8_t beginTrackHits
Definition: HitPattern.h:462
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:671
int numberOfDTStationsWithBothViews() const
Definition: HitPattern.cc:979
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:775
static const unsigned short minPixelWord
Definition: HitPattern.h:428
int numberOfValidTIBLayersWithMonoAndStereo(uint32_t layer=0) const
Definition: HitPattern.cc:411
int gemStationsWithValidHits() const
Definition: HitPattern.h:1127
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:749
static uint32_t getSubDetector(uint16_t pattern)
Definition: HitPattern.h:694
int dtStationsWithAnyHits() const
Definition: HitPattern.h:1092
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:647
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:755
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:659
int pixelLayersWithMeasurementOld() const
Definition: HitPattern.h:996
Definition: DetId.h:18
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:919
int numberOfInactiveTrackerHits() const
Definition: HitPattern.h:986
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:662
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:657
uint8_t endTrackHits
Definition: HitPattern.h:463
int numberOfLostPixelEndcapHits(HitCategory category) const
Definition: HitPattern.h:901
static const unsigned short SideMask
Definition: HitPattern.h:413
#define N
Definition: blowfish.cc:9
static const unsigned short minStripWord
Definition: HitPattern.h:429
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:475
uint8_t hitCount
Definition: HitPattern.h:460
int innermostMuonStationWithBadHits() const
Definition: HitPattern.h:1147
uint8_t beginOuter
Definition: HitPattern.h:466
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:424
int trackerLayersNull() const
Definition: HitPattern.h:1047
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1001
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:556
int numberOfBadMuonDTHits() const
Definition: HitPattern.h:961
int numberOfLostMuonGEMHits() const
Definition: HitPattern.h:946
int outermostMuonStationWithBadHits() const
Definition: HitPattern.h:1162
int dtStationsWithBadHits() const
Definition: HitPattern.h:1087
int numberOfValidStripTIBHits() const
Definition: HitPattern.h:836
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:607
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:876
int numberOfValidTrackerHits() const
Definition: HitPattern.h:806
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.h:826
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:273
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:704
int numberOfLostPixelBarrelHits(HitCategory category) const
Definition: HitPattern.h:896
int stripTOBLayersNull() const
Definition: HitPattern.cc:808
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:617
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:533
bool insertExpectedInnerHit(const uint16_t pattern)
Definition: HitPattern.cc:1026
int numberOfLostStripTECHits(HitCategory category) const
Definition: HitPattern.h:926
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:597
int numberOfValidMuonGEMHits() const
Definition: HitPattern.h:871
int pixelBarrelLayersTotallyOffOrBad() const
Definition: HitPattern.cc:693
friend struct PatternSet
Definition: HitPattern.h:472
int numberOfLostMuonDTHits() const
Definition: HitPattern.h:931
#define begin
Definition: vmac.h:30
double p1[4]
Definition: TauolaWrapper.h:89
static const unsigned short SubstrMask
Definition: HitPattern.h:421
int numberOfBadMuonCSCHits() const
Definition: HitPattern.h:966
static const int RPC
Definition: MuonSubdetId.h:14
static const unsigned short LayerOffset
Definition: HitPattern.h:416
static int position[264][3]
Definition: ReadPGInfo.cc:509
int numberOfValidMuonDTHits() const
Definition: HitPattern.h:856
bool insertTrackHit(const uint16_t pattern)
Definition: HitPattern.cc:1007
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:613
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:681
int pixelEndcapLayersTotallyOffOrBad() const
Definition: HitPattern.cc:705
int numberOfValidPixelHits() const
Definition: HitPattern.h:816
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:737
tuple cout
Definition: gather_cfg.py:121
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:722
static const int DT
Definition: MuonSubdetId.h:12
void print(HitCategory category, std::ostream &stream=std::cout) const
Definition: HitPattern.cc:864
int numberOfValidTOBLayersWithMonoAndStereo(uint32_t layer=0) const
Definition: HitPattern.cc:406
bool hasValidHitInFirstPixelBarrel() const
Definition: HitPattern.cc:315
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:512
int numberOfValidMuonHits() const
Definition: HitPattern.h:811
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:685
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:502
int stripTIBLayersTotallyOffOrBad() const
Definition: HitPattern.cc:717
static const unsigned short LayerMask
Definition: HitPattern.h:417
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:637
int rpcStationsWithAnyHits() const
Definition: HitPattern.h:1122
uint8_t endOuter
Definition: HitPattern.h:467
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:89
int trackerLayersWithMeasurementOld() const
Definition: HitPattern.h:991
tuple size
Write out results.
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:588
int innermostMuonStationWithValidHits() const
Definition: HitPattern.h:1142
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:785
int numberOfLostMuonCSCHits() const
Definition: HitPattern.h:936
int outermostMuonStationWithAnyHits() const
Definition: HitPattern.h:1167
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:648
bool appendMuonHit(const DetId &id, TrackingRecHit::Type hitType)
Definition: HitPattern.cc:258
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:774