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