CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HitPattern.cc
Go to the documentation of this file.
12 using namespace reco;
13 
14 void HitPattern::set(const TrackingRecHit & hit, unsigned int i) {
15  // ignore the rec hit if the number of hit is larger than the max
16  if (i >= 32 * PatternSize / HitSize) return;
17 
18  // get rec hit det id and rec hit type
19  DetId id = hit.geographicalId();
20  uint32_t detid = id.det();
21  uint32_t hitType = (uint32_t) hit.getType();
22 
23  // init pattern of this hit to 0
24  uint32_t pattern = 0;
25 
26  // adding tracker/muon detector bit
27  pattern += ((detid)&SubDetectorMask)<<SubDetectorOffset;
28 
29  // adding substructure (PXB,PXF,TIB,TID,TOB,TEC, or DT,CSC,RPC) bits
30  uint32_t subdet = id.subdetId();
31  pattern += ((subdet)&SubstrMask)<<SubstrOffset;
32 
33  // adding layer/disk/wheel bits
34  uint32_t layer = 0;
35  if (detid == DetId::Tracker) {
36  if (subdet == PixelSubdetector::PixelBarrel)
37  layer = PXBDetId(id).layer();
38  else if (subdet == PixelSubdetector::PixelEndcap)
39  layer = PXFDetId(id).disk();
40  else if (subdet == StripSubdetector::TIB)
41  layer = TIBDetId(id).layer();
42  else if (subdet == StripSubdetector::TID)
43  layer = TIDDetId(id).wheel();
44  else if (subdet == StripSubdetector::TOB)
45  layer = TOBDetId(id).layer();
46  else if (subdet == StripSubdetector::TEC)
47  layer = TECDetId(id).wheel();
48  } else if (detid == DetId::Muon) {
49  if (subdet == (uint32_t) MuonSubdetId::DT)
50  layer = ((DTLayerId(id.rawId()).station()-1)<<2) + (DTLayerId(id.rawId()).superLayer()-1);
51  else if (subdet == (uint32_t) MuonSubdetId::CSC)
52  layer = ((CSCDetId(id.rawId()).station()-1)<<2) + (CSCDetId(id.rawId()).ring()-1);
53  else if (subdet == (uint32_t) MuonSubdetId::RPC) {
54  RPCDetId rpcid(id.rawId());
55  layer = ((rpcid.station()-1)<<2) + abs(rpcid.region());
56  if (rpcid.station() <= 2) layer += 2*(rpcid.layer()-1);
57  }
58  }
59  pattern += (layer&LayerMask)<<LayerOffset;
60 
61  // adding mono/stereo bit
62  uint32_t side = 0;
63  if (detid == DetId::Tracker) {
64  side = isStereo(id);
65  } else if (detid == DetId::Muon) {
66  side = 0;
67  }
68  pattern += (side&SideMask)<<SideOffset;
69 
70  // adding hit type bits
71  pattern += (hitType&HitTypeMask)<<HitTypeOffset;
72 
73  // set pattern for i-th hit
74  setHitPattern(i, pattern);
75 }
76 
78  int offset = position * HitSize;
79  for (int i=0; i<HitSize; i++) {
80  int pos = offset + i;
81  uint32_t bit = (pattern >> i) & 0x1;
82  hitPattern_[pos / 32] += bit << ((offset + i) % 32);
83  }
84 }
85 
86 uint32_t HitPattern::getHitPattern(int position) const {
87 /* Note: you are not taking a consecutive sequence of HitSize bits starting from position*HitSize
88  as the bit order in the words are reversed.
89  e.g. if position = 0 you take the lowest 10 bits of the first word.
90 
91  I hope this can clarify what is the memory layout of such thing
92 
93  straight 01234567890123456789012345678901 | 23456789012345678901234567890123 | 4567
94  (global) 0 1 2 3 | 3 4 5 6 | 6
95  words [--------------0---------------] | [--------------1---------------] | [---
96  word 01234567890123456789012345678901 | 01234567890123456789012345678901 | 0123
97  (str) 0 1 2 3 | 0 1 2 3 | 0
98  [--------------0---------------] | [--------------1---------------] | [---
99  word 10987654321098765432109876543210 | 10987654321098765432109876543210 | 1098
100  (rev) 32 21 10 0 | 32 21 10 0 | 32
101  reverse 10987654321098765432109876543210 | 32109876543210987654321098765432 | 5432
102  32 21 10 0 | 6 65 54 43 3 9
103 
104  ugly enough, but it's not my fault, I was not even in CMS at that time [gpetrucc] */
105  uint16_t bitEndOffset = (position+1) * HitSize;
106  uint8_t secondWord = (bitEndOffset >> 5);
107  uint8_t secondWordBits = bitEndOffset & (32-1); // that is, bitEndOffset % 32
108  if (secondWordBits >= HitSize) { // full block is in this word
109  uint8_t lowBitsToTrash = secondWordBits - HitSize;
110  uint32_t myResult = (hitPattern_[secondWord] >> lowBitsToTrash) & ((1 << HitSize)-1);
111  return myResult;
112  } else {
113  uint8_t firstWordBits = HitSize - secondWordBits;
114  uint32_t firstWordBlock = hitPattern_[secondWord-1] >> (32-firstWordBits);
115  uint32_t secondWordBlock = hitPattern_[secondWord] & ((1<<secondWordBits)-1);
116  uint32_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
117  return myResult;
118  }
119 }
120 
121 bool HitPattern::trackerHitFilter(uint32_t pattern) const {
122  if (pattern == 0) return false;
123  if (((pattern>>SubDetectorOffset) & SubDetectorMask) == 1) return true;
124  return false;
125 }
126 
127 bool HitPattern::muonHitFilter(uint32_t pattern) const {
128  if (pattern == 0) return false;
129  if (((pattern>>SubDetectorOffset) & SubDetectorMask) == 0) return true;
130  return false;
131 }
132 
133 uint32_t HitPattern::getSubStructure(uint32_t pattern) const {
134  if (pattern == 0) return 999999;
135  return ((pattern >> SubstrOffset) & SubstrMask);
136 }
137 
138 bool HitPattern::pixelHitFilter(uint32_t pattern) const {
139  if (!trackerHitFilter(pattern)) return false;
140  uint32_t substructure = getSubStructure(pattern);
141  if (substructure == PixelSubdetector::PixelBarrel ||
142  substructure == PixelSubdetector::PixelEndcap) return true;
143  return false;
144 }
145 
147  if (!trackerHitFilter(pattern)) return false;
148  uint32_t substructure = getSubStructure(pattern);
149  if (substructure == PixelSubdetector::PixelBarrel) return true;
150  return false;
151 }
152 
154  if (!trackerHitFilter(pattern)) return false;
155  uint32_t substructure = getSubStructure(pattern);
156  if (substructure == PixelSubdetector::PixelEndcap) return true;
157  return false;
158 }
159 
160 bool HitPattern::stripHitFilter(uint32_t pattern) const {
161  if (!trackerHitFilter(pattern)) return false;
162  uint32_t substructure = getSubStructure(pattern);
163  if (substructure == StripSubdetector::TIB ||
164  substructure == StripSubdetector::TID ||
165  substructure == StripSubdetector::TOB ||
166  substructure == StripSubdetector::TEC) return true;
167  return false;
168 }
169 
170 bool HitPattern::stripTIBHitFilter(uint32_t pattern) const {
171  if (!trackerHitFilter(pattern)) return false;
172  uint32_t substructure = getSubStructure(pattern);
173  if (substructure == StripSubdetector::TIB) return true;
174  return false;
175 }
176 
177 bool HitPattern::stripTIDHitFilter(uint32_t pattern) const {
178  if (!trackerHitFilter(pattern)) return false;
179  uint32_t substructure = getSubStructure(pattern);
180  if (substructure == StripSubdetector::TID) return true;
181  return false;
182 }
183 
184 bool HitPattern::stripTOBHitFilter(uint32_t pattern) const {
185  if (!trackerHitFilter(pattern)) return false;
186  uint32_t substructure = getSubStructure(pattern);
187  if (substructure == StripSubdetector::TOB) return true;
188  return false;
189 }
190 
191 bool HitPattern::stripTECHitFilter(uint32_t pattern) const {
192  if (!trackerHitFilter(pattern)) return false;
193  uint32_t substructure = getSubStructure(pattern);
194  if (substructure == StripSubdetector::TEC) return true;
195  return false;
196 }
197 
198 bool HitPattern::muonDTHitFilter(uint32_t pattern) const {
199  if (!muonHitFilter(pattern)) return false;
200  uint32_t substructure = getSubStructure(pattern);
201  if (substructure == (uint32_t) MuonSubdetId::DT) return true;
202  return false;
203 }
204 
205 bool HitPattern::muonCSCHitFilter(uint32_t pattern) const {
206  if (!muonHitFilter(pattern)) return false;
207  uint32_t substructure = getSubStructure(pattern);
208  if (substructure == (uint32_t) MuonSubdetId::CSC) return true;
209  return false;
210 }
211 
212 bool HitPattern::muonRPCHitFilter(uint32_t pattern) const {
213  if (!muonHitFilter(pattern)) return false;
214  uint32_t substructure = getSubStructure(pattern);
215  if (substructure == (uint32_t) MuonSubdetId::RPC) return true;
216  return false;
217 }
218 
219 uint32_t HitPattern::getLayer(uint32_t pattern) const {
220  if (pattern == 0) return 999999;
221  return ((pattern>>LayerOffset) & LayerMask);
222 }
223 
224 uint32_t HitPattern::getSubSubStructure(uint32_t pattern) const {
225  if (pattern == 0) return 999999;
226  return ((pattern>>LayerOffset) & LayerMask);
227 }
228 
229 
230 uint32_t HitPattern::getSide (uint32_t pattern)
231 {
232  if (pattern == 0) return 999999;
233  return (pattern >> SideOffset) & SideMask;
234 }
235 
236 uint32_t HitPattern::getHitType( uint32_t pattern ) const {
237  if (pattern == 0) return 999999;
238  return ((pattern>>HitTypeOffset) & HitTypeMask);
239 }
240 
241 uint32_t HitPattern::getMuonStation(uint32_t pattern) const {
242  return (getSubSubStructure(pattern)>>2) + 1;
243 }
244 
245 uint32_t HitPattern::getDTSuperLayer(uint32_t pattern) const {
246  return (getSubSubStructure(pattern) & 3) + 1;
247 }
248 
249 uint32_t HitPattern::getCSCRing(uint32_t pattern) const {
250  return (getSubSubStructure(pattern) & 3) + 1;
251 }
252 
253 uint32_t HitPattern::getRPCLayer(uint32_t pattern) const {
254  uint32_t sss = getSubSubStructure(pattern), stat = sss >> 2;
255  if (stat <= 1) return ((sss >> 1) & 1) + 1;
256  else return 0;
257 }
258 
259 uint32_t HitPattern::getRPCregion(uint32_t pattern) const {
260  return getSubSubStructure(pattern) & 1;
261 }
262 
263 
264 bool HitPattern::validHitFilter(uint32_t pattern) const {
265  if (getHitType(pattern) == 0) return true;
266  return false;
267 }
268 
269 bool HitPattern::type_1_HitFilter(uint32_t pattern) const {
270  if (getHitType(pattern) == 1) return true;
271  return false;
272 }
273 
274 bool HitPattern::type_2_HitFilter(uint32_t pattern) const {
275  if (getHitType(pattern) == 2) return true;
276  return false;
277 }
278 
279 bool HitPattern::type_3_HitFilter(uint32_t pattern) const {
280  if (getHitType(pattern) == 3) return true;
281  return false;
282 }
283 
285  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
286  uint32_t pattern = getHitPattern(i);
287  if (pixelBarrelHitFilter(pattern)) {
288  if (getLayer(pattern) == 1) {
289  if (validHitFilter(pattern)) {
290  return true;
291  }
292  }
293  }
294  }
295  return false;
296 }
297 
299  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
300  uint32_t pattern = getHitPattern(i);
301  if (pixelEndcapHitFilter(pattern)) {
302  if (getLayer(pattern) == 1) {
303  if (validHitFilter(pattern)) {
304  return true;
305  }
306  }
307  }
308  }
309  return false;
310 }
311 
313  int count = 0;
314  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
315  uint32_t pattern = getHitPattern(i);
316  if (pattern != 0) count++;
317  }
318  return count;
319 }
320 
322  int count = 0;
323  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
324  uint32_t pattern = getHitPattern(i);
325  if (pattern == 0) break;
326  //if (pattern != 0) {
327  if (validHitFilter(pattern)) count++;
328  //}
329  }
330  return count;
331 }
332 
334  int count = 0;
335  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
336  uint32_t pattern = getHitPattern(i);
337  if (pattern != 0) {
338  if (validHitFilter(pattern)) {
339  if (trackerHitFilter(pattern)) count++;
340  }
341  }
342  }
343  return count;
344 }
345 
347  int count = 0;
348  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
349  uint32_t pattern = getHitPattern(i);
350  if (pattern != 0) {
351  if (validHitFilter(pattern)) {
352  if (muonHitFilter(pattern)) count++;
353  }
354  }
355  }
356  return count;
357 }
358 
360  int count = 0;
361  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
362  uint32_t pattern = getHitPattern(i);
363  if (pattern != 0) {
364  if (validHitFilter(pattern)) {
365  if (pixelHitFilter(pattern)) count++;
366  }
367  }
368  }
369  return count;
370 }
371 
373  int count = 0;
374  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
375  uint32_t pattern = getHitPattern(i);
376  if (pattern != 0) {
377  if (validHitFilter(pattern)) {
378  if (pixelBarrelHitFilter(pattern)) count++;
379  }
380  }
381  }
382  return count;
383 }
384 
386  int count = 0;
387  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
388  uint32_t pattern = getHitPattern(i);
389  if (pattern != 0) {
390  if (validHitFilter(pattern)) {
391  if (pixelEndcapHitFilter(pattern)) count++;
392  }
393  }
394  }
395  return count;
396 }
397 
399  int count = 0;
400  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
401  uint32_t pattern = getHitPattern(i);
402  if (pattern != 0) {
403  if (validHitFilter(pattern)) {
404  if (stripHitFilter(pattern)) count++;
405  }
406  }
407  }
408  return count;
409 }
410 
412  int count = 0;
413  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
414  uint32_t pattern = getHitPattern(i);
415  if (pattern != 0) {
416  if (validHitFilter(pattern)) {
417  if (stripTIBHitFilter(pattern)) count++;
418  }
419  }
420  }
421  return count;
422 }
423 
425  int count = 0;
426  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
427  uint32_t pattern = getHitPattern(i);
428  if (pattern != 0) {
429  if (validHitFilter(pattern)) {
430  if (stripTIDHitFilter(pattern)) count++;
431  }
432  }
433  }
434  return count;
435 }
436 
438  int count = 0;
439  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
440  uint32_t pattern = getHitPattern(i);
441  if (pattern != 0) {
442  if (validHitFilter(pattern)) {
443  if (stripTOBHitFilter(pattern)) count++;
444  }
445  }
446  }
447  return count;
448 }
449 
451  int count = 0;
452  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
453  uint32_t pattern = getHitPattern(i);
454  if (pattern != 0) {
455  if (validHitFilter(pattern)) {
456  if (stripTECHitFilter(pattern)) count++;
457  }
458  }
459  }
460  return count;
461 }
462 
464  int count = 0;
465  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
466  uint32_t pattern = getHitPattern(i);
467  if (pattern != 0) {
468  if (validHitFilter(pattern)) {
469  if (muonDTHitFilter(pattern)) count++;
470  }
471  }
472  }
473  return count;
474 }
475 
477  int count = 0;
478  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
479  uint32_t pattern = getHitPattern(i);
480  if (pattern != 0) {
481  if (validHitFilter(pattern)) {
482  if (muonCSCHitFilter(pattern)) count++;
483  }
484  }
485  }
486  return count;
487 }
488 
490  int count = 0;
491  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
492  uint32_t pattern = getHitPattern(i);
493  if (pattern != 0) {
494  if (validHitFilter(pattern)) {
495  if (muonRPCHitFilter(pattern)) count++;
496  }
497  }
498  }
499  return count;
500 }
501 
503  int count = 0;
504  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
505  uint32_t pattern = getHitPattern(i);
506  if (pattern != 0) {
507  if (type_1_HitFilter(pattern)) count++;
508  }
509  }
510  return count;
511 }
512 
514  int count = 0;
515  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
516  uint32_t pattern = getHitPattern(i);
517  if (pattern != 0) {
518  if (type_1_HitFilter(pattern)) {
519  if (trackerHitFilter(pattern)) count++;
520  }
521  }
522  }
523  return count;
524 }
525 
527  int count = 0;
528  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
529  uint32_t pattern = getHitPattern(i);
530  if (pattern != 0) {
531  if (type_1_HitFilter(pattern)) {
532  if (muonHitFilter(pattern)) count++;
533  }
534  }
535  }
536  return count;
537 }
538 
540  int count = 0;
541  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
542  uint32_t pattern = getHitPattern(i);
543  if (pattern != 0) {
544  if (type_1_HitFilter(pattern)) {
545  if (pixelHitFilter(pattern)) count++;
546  }
547  }
548  }
549  return count;
550 }
551 
553  int count = 0;
554  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
555  uint32_t pattern = getHitPattern(i);
556  if (pattern != 0) {
557  if (type_1_HitFilter(pattern)) {
558  if (pixelBarrelHitFilter(pattern)) count++;
559  }
560  }
561  }
562  return count;
563 }
564 
566  int count = 0;
567  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
568  uint32_t pattern = getHitPattern(i);
569  if (pattern != 0) {
570  if (type_1_HitFilter(pattern)) {
571  if (pixelEndcapHitFilter(pattern)) count++;
572  }
573  }
574  }
575  return count;
576 }
577 
579  int count = 0;
580  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
581  uint32_t pattern = getHitPattern(i);
582  if (pattern != 0) {
583  if (type_1_HitFilter(pattern)) {
584  if (stripHitFilter(pattern)) count++;
585  }
586  }
587  }
588  return count;
589 }
590 
592  int count = 0;
593  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
594  uint32_t pattern = getHitPattern(i);
595  if (pattern != 0) {
596  if (type_1_HitFilter(pattern)) {
597  if (stripTIBHitFilter(pattern)) count++;
598  }
599  }
600  }
601  return count;
602 }
603 
605  int count = 0;
606  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
607  uint32_t pattern = getHitPattern(i);
608  if (pattern != 0) {
609  if (type_1_HitFilter(pattern)) {
610  if (stripTIDHitFilter(pattern)) count++;
611  }
612  }
613  }
614  return count;
615 }
616 
618  int count = 0;
619  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
620  uint32_t pattern = getHitPattern(i);
621  if (pattern != 0) {
622  if (type_1_HitFilter(pattern)) {
623  if (stripTOBHitFilter(pattern)) count++;
624  }
625  }
626  }
627  return count;
628 }
629 
631  int count = 0;
632  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
633  uint32_t pattern = getHitPattern(i);
634  if (pattern != 0) {
635  if (type_1_HitFilter(pattern)) {
636  if (stripTECHitFilter(pattern)) count++;
637  }
638  }
639  }
640  return count;
641 }
642 
644  int count = 0;
645  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
646  uint32_t pattern = getHitPattern(i);
647  if (pattern != 0) {
648  if (type_1_HitFilter(pattern)) {
649  if (muonDTHitFilter(pattern)) count++;
650  }
651  }
652  }
653  return count;
654 }
655 
657  int count = 0;
658  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
659  uint32_t pattern = getHitPattern(i);
660  if (pattern != 0) {
661  if (type_1_HitFilter(pattern)) {
662  if (muonCSCHitFilter(pattern)) count++;
663  }
664  }
665  }
666  return count;
667 }
668 
670  int count = 0;
671  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
672  uint32_t pattern = getHitPattern(i);
673  if (pattern != 0) {
674  if (type_1_HitFilter(pattern)) {
675  if (muonRPCHitFilter(pattern)) count++;
676  }
677  }
678  }
679  return count;
680 }
681 
683  int count = 0;
684  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
685  uint32_t pattern = getHitPattern(i);
686  if (pattern != 0) {
687  if (type_3_HitFilter(pattern)) count++;
688  }
689  }
690  return count;
691 }
692 
694  int count = 0;
695  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
696  uint32_t pattern = getHitPattern(i);
697  if (pattern != 0) {
698  if (type_3_HitFilter(pattern)) {
699  if (muonHitFilter(pattern)) count++;
700  }
701  }
702  }
703  return count;
704 }
705 
707  int count = 0;
708  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
709  uint32_t pattern = getHitPattern(i);
710  if (pattern != 0) {
711  if (type_3_HitFilter(pattern)) {
712  if (muonDTHitFilter(pattern)) count++;
713  }
714  }
715  }
716  return count;
717 }
718 
720  int count = 0;
721  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
722  uint32_t pattern = getHitPattern(i);
723  if (pattern != 0) {
724  if (type_3_HitFilter(pattern)) {
725  if (muonCSCHitFilter(pattern)) count++;
726  }
727  }
728  }
729  return count;
730 }
731 
733  int count = 0;
734  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
735  uint32_t pattern = getHitPattern(i);
736  if (pattern != 0) {
737  if (type_3_HitFilter(pattern)) {
738  if (muonRPCHitFilter(pattern)) count++;
739  }
740  }
741  }
742  return count;
743 }
744 
746 {
747  static const int nHits = (PatternSize * 32) / HitSize;
748  bool hasMono[SubstrMask + 1][LayerMask + 1];
749  // printf("sizeof(hasMono) = %d\n", sizeof(hasMono));
750  memset(hasMono, 0, sizeof(hasMono));
751  bool hasStereo[SubstrMask + 1][LayerMask + 1];
752  memset(hasStereo, 0, sizeof(hasStereo));
753  // mark which layers have mono/stereo hits
754  for (int i = 0; i < nHits; i++) {
755  uint32_t pattern = getHitPattern(i);
756  if (pattern != 0) {
757  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
758  switch (getSide(pattern)) {
759  case 0: // mono
760  hasMono[getSubStructure(pattern)][getLayer(pattern)]
761  = true;
762  break;
763  case 1: // stereo
764  hasStereo[getSubStructure(pattern)][getLayer(pattern)]
765  = true;
766  break;
767  default:
768  break;
769  }
770  }
771  }
772  }
773  // count how many layers have mono and stereo hits
774  int count = 0;
775  for (int i = 0; i < SubstrMask + 1; ++i)
776  for (int j = 0; j < LayerMask + 1; ++j)
777  if (hasMono[i][j] && hasStereo[i][j])
778  count++;
779  return count;
780 }
781 
782 uint32_t HitPattern::getTrackerLayerCase(uint32_t substr, uint32_t layer) const
783 {
784  uint32_t tk_substr_layer =
785  (1 << SubDetectorOffset) +
786  ((substr & SubstrMask) << SubstrOffset) +
787  ((layer & LayerMask) << LayerOffset);
788 
789  uint32_t mask =
791  (SubstrMask << SubstrOffset) +
792  (LayerMask << LayerOffset);
793 
794  // crossed
795  // layer case 0: valid + (missing, off, bad) ==> with measurement
796  // layer case 1: missing + (off, bad) ==> without measurement
797  // layer case 2: off, bad ==> totally off or bad, cannot say much
798  // not crossed
799  // layer case 999999: track outside acceptance or in gap ==> null
800 
801  uint32_t layerCase = 999999;
802  for (int i=0; i<(PatternSize * 32) / HitSize; i++)
803  {
804  uint32_t pattern = getHitPattern(i);
805  if (pattern == 0) break;
806  if ((pattern & mask) == tk_substr_layer)
807  {
808  uint32_t hitType = (pattern >> HitTypeOffset) & HitTypeMask; // 0,1,2,3
809  if (hitType < layerCase)
810  {
811  layerCase = hitType;
812  if (hitType == 3) layerCase = 2;
813  }
814  }
815  }
816  return layerCase;
817 }
818 
819 uint32_t HitPattern::getTrackerMonoStereo (uint32_t substr, uint32_t layer) const
820 {
821  uint32_t tk_substr_layer =
822  (1 << SubDetectorOffset) +
823  ((substr & SubstrMask) << SubstrOffset) +
824  ((layer & LayerMask) << LayerOffset);
825 
826  uint32_t mask =
828  (SubstrMask << SubstrOffset) +
829  (LayerMask << LayerOffset);
830 
831  // 0: neither a valid mono nor a valid stereo hit
832  // MONO: valid mono hit
833  // STEREO: valid stereo hit
834  // MONO | STEREO: both
835  uint32_t monoStereo = 0;
836  for (int i=0; i<(PatternSize * 32) / HitSize; i++)
837  {
838  uint32_t pattern = getHitPattern(i);
839  if (pattern == 0) break;
840  if ((pattern & mask) == tk_substr_layer)
841  {
842  uint32_t hitType = (pattern >> HitTypeOffset) & HitTypeMask; // 0,1,2,3
843  if (hitType == 0) { // valid hit
844  switch (getSide(pattern)) {
845  case 0: // mono
846  monoStereo |= MONO;
847  break;
848  case 1: // stereo
849  monoStereo |= STEREO;
850  break;
851  default:
852  break;
853  }
854  }
855  }
856  }
857  return monoStereo;
858 }
859 
861  return pixelLayersWithMeasurement() +
863 }
864 
868 }
869 
875 }
876 
878  int count = 0;
879  uint32_t substr = PixelSubdetector::PixelBarrel;
880  for (uint32_t layer=1; layer<=3; layer++) {
881  if (getTrackerLayerCase(substr, layer) == 0) count++;
882  }
883  return count;
884 }
885 
887  int count = 0;
888  uint32_t substr = PixelSubdetector::PixelEndcap;
889  for (uint32_t layer=1; layer<=2; layer++) {
890  if (getTrackerLayerCase(substr, layer) == 0) count++;
891  }
892  return count;
893 }
894 
896  int count = 0;
897  uint32_t substr = StripSubdetector::TIB;
898  for (uint32_t layer=1; layer<=4; layer++) {
899  if (getTrackerLayerCase(substr, layer) == 0) count++;
900  }
901  return count;
902 }
903 
905  int count = 0;
906  uint32_t substr = StripSubdetector::TID;
907  for (uint32_t layer=1; layer<=3; layer++) {
908  if (getTrackerLayerCase(substr, layer) == 0) count++;
909  }
910  return count;
911 }
912 
914  int count = 0;
915  uint32_t substr = StripSubdetector::TOB;
916  for (uint32_t layer=1; layer<=6; layer++) {
917  if (getTrackerLayerCase(substr, layer) == 0) count++;
918  }
919  return count;
920 }
921 
923  int count = 0;
924  uint32_t substr = StripSubdetector::TEC;
925  for (uint32_t layer=1; layer<=9; layer++) {
926  if (getTrackerLayerCase(substr, layer) == 0) count++;
927  }
928  return count;
929 }
930 
934 }
935 
939 }
940 
946 }
947 
949  int count = 0;
950  uint32_t substr = PixelSubdetector::PixelBarrel;
951  for (uint32_t layer=1; layer<=3; layer++) {
952  if (getTrackerLayerCase(substr, layer) == 1) count++;
953  }
954  return count;
955 }
956 
958  int count = 0;
959  uint32_t substr = PixelSubdetector::PixelEndcap;
960  for (uint32_t layer=1; layer<=2; layer++) {
961  if (getTrackerLayerCase(substr, layer) == 1) count++;
962  }
963  return count;
964 }
965 
967  int count = 0;
968  uint32_t substr = StripSubdetector::TIB;
969  for (uint32_t layer=1; layer<=4; layer++) {
970  if (getTrackerLayerCase(substr, layer) == 1) count++;
971  }
972  return count;
973 }
974 
976  int count = 0;
977  uint32_t substr = StripSubdetector::TID;
978  for (uint32_t layer=1; layer<=3; layer++) {
979  if (getTrackerLayerCase(substr, layer) == 1) count++;
980  }
981  return count;
982 }
983 
985  int count = 0;
986  uint32_t substr = StripSubdetector::TOB;
987  for (uint32_t layer=1; layer<=6; layer++) {
988  if (getTrackerLayerCase(substr, layer) == 1) count++;
989  }
990  return count;
991 }
992 
994  int count = 0;
995  uint32_t substr = StripSubdetector::TEC;
996  for (uint32_t layer=1; layer<=9; layer++) {
997  if (getTrackerLayerCase(substr, layer) == 1) count++;
998  }
999  return count;
1000 }
1001 
1003  return pixelLayersTotallyOffOrBad() +
1005 }
1006 
1010 }
1011 
1013  return stripTIBLayersTotallyOffOrBad() +
1017 }
1018 
1020  int count = 0;
1021  uint32_t substr = PixelSubdetector::PixelBarrel;
1022  for (uint32_t layer=1; layer<=3; layer++) {
1023  if (getTrackerLayerCase(substr, layer) == 2) count++;
1024  }
1025  return count;
1026 }
1027 
1029  int count = 0;
1030  uint32_t substr = PixelSubdetector::PixelEndcap;
1031  for (uint32_t layer=1; layer<=2; layer++) {
1032  if (getTrackerLayerCase(substr, layer) == 2) count++;
1033  }
1034  return count;
1035 }
1036 
1038  int count = 0;
1039  uint32_t substr = StripSubdetector::TIB;
1040  for (uint32_t layer=1; layer<=4; layer++) {
1041  if (getTrackerLayerCase(substr, layer) == 2) count++;
1042  }
1043  return count;
1044 }
1045 
1047  int count = 0;
1048  uint32_t substr = StripSubdetector::TID;
1049  for (uint32_t layer=1; layer<=3; layer++) {
1050  if (getTrackerLayerCase(substr, layer) == 2) count++;
1051  }
1052  return count;
1053 }
1054 
1056  int count = 0;
1057  uint32_t substr = StripSubdetector::TOB;
1058  for (uint32_t layer=1; layer<=6; layer++) {
1059  if (getTrackerLayerCase(substr, layer) == 2) count++;
1060  }
1061  return count;
1062 }
1063 
1065  int count = 0;
1066  uint32_t substr = StripSubdetector::TEC;
1067  for (uint32_t layer=1; layer<=9; layer++) {
1068  if (getTrackerLayerCase(substr, layer) == 2) count++;
1069  }
1070  return count;
1071 }
1072 
1074  return pixelLayersNull() +
1075  stripLayersNull();
1076 }
1077 
1079  return pixelBarrelLayersNull() +
1081 }
1082 
1084  return stripTIBLayersNull() +
1085  stripTIDLayersNull() +
1086  stripTOBLayersNull() +
1088 }
1089 
1091  int count = 0;
1092  uint32_t substr = PixelSubdetector::PixelBarrel;
1093  for (uint32_t layer=1; layer<=3; layer++) {
1094  if (getTrackerLayerCase(substr, layer) == 999999) count++;
1095  }
1096  return count;
1097 }
1098 
1100  int count = 0;
1101  uint32_t substr = PixelSubdetector::PixelEndcap;
1102  for (uint32_t layer=1; layer<=2; layer++) {
1103  if (getTrackerLayerCase(substr, layer) == 999999) count++;
1104  }
1105  return count;
1106 }
1107 
1109  int count = 0;
1110  uint32_t substr = StripSubdetector::TIB;
1111  for (uint32_t layer=1; layer<=4; layer++) {
1112  if (getTrackerLayerCase(substr, layer) == 999999) count++;
1113  }
1114  return count;
1115 }
1116 
1118  int count = 0;
1119  uint32_t substr = StripSubdetector::TID;
1120  for (uint32_t layer=1; layer<=3; layer++) {
1121  if (getTrackerLayerCase(substr, layer) == 999999) count++;
1122  }
1123  return count;
1124 }
1125 
1127  int count = 0;
1128  uint32_t substr = StripSubdetector::TOB;
1129  for (uint32_t layer=1; layer<=6; layer++) {
1130  if (getTrackerLayerCase(substr, layer) == 999999) count++;
1131  }
1132  return count;
1133 }
1134 
1136  int count = 0;
1137  uint32_t substr = StripSubdetector::TEC;
1138  for (uint32_t layer=1; layer<=9; layer++) {
1139  if (getTrackerLayerCase(substr, layer) == 999999) count++;
1140  }
1141  return count;
1142 }
1143 
1144 void HitPattern::printHitPattern (int position, std::ostream &stream) const
1145 {
1146  uint32_t pattern = getHitPattern(position);
1147  stream << "\t";
1148  if (muonHitFilter(pattern))
1149  stream << "muon";
1150  if (trackerHitFilter(pattern))
1151  stream << "tracker";
1152  stream << "\tsubstructure " << getSubStructure(pattern);
1153  if (muonHitFilter(pattern)) {
1154  stream << "\tstation " << getMuonStation(pattern);
1155  if (muonDTHitFilter(pattern)) {
1156  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
1157  } else if (muonCSCHitFilter(pattern)) {
1158  stream << "\tcsc ring " << getCSCRing(pattern);
1159  } else if (muonRPCHitFilter(pattern)) {
1160  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel") << ", layer " << getRPCLayer(pattern);
1161  } else {
1162  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure " << getSubStructure(pattern);
1163  }
1164  } else {
1165  stream << "\tlayer " << getLayer(pattern);
1166  }
1167  stream << "\thit type " << getHitType(pattern);
1168  stream << std::endl;
1169 }
1170 
1171 void HitPattern::print (std::ostream &stream) const
1172 {
1173  stream << "HitPattern" << std::endl;
1174  for (int i = 0; i < numberOfHits(); i++)
1175  printHitPattern(i, stream);
1176  std::ios_base::fmtflags flags = stream.flags();
1177  stream.setf ( std::ios_base::hex, std::ios_base::basefield );
1178  stream.setf ( std::ios_base::showbase );
1179  for (int i = 0; i < numberOfHits(); i++) {
1180  uint32_t pattern = getHitPattern(i);
1181  stream << pattern << std::endl;
1182  }
1183  stream.flags(flags);
1184 }
1185 
1187 {
1188  switch (i.det()) {
1189  case DetId::Tracker:
1190  switch (i.subdetId()) {
1193  return 0;
1194  case StripSubdetector::TIB:
1195  {
1196  TIBDetId id = i;
1197  return id.isStereo();
1198  }
1199  case StripSubdetector::TID:
1200  {
1201  TIDDetId id = i;
1202  return id.isStereo();
1203  }
1204  case StripSubdetector::TOB:
1205  {
1206  TOBDetId id = i;
1207  return id.isStereo();
1208  }
1209  case StripSubdetector::TEC:
1210  {
1211  TECDetId id = i;
1212  return id.isStereo();
1213  }
1214  default:
1215  return 0;
1216  }
1217  break;
1218  default:
1219  return 0;
1220  }
1221 }
1222 
1223 int HitPattern::muonStations(int subdet, int hitType) const {
1224  int stations[4] = { 0,0,0,0 };
1225  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
1226  uint32_t pattern = getHitPattern(i);
1227  if (pattern == 0) break;
1228  if (muonHitFilter(pattern) &&
1229  (subdet == 0 || int(getSubStructure(pattern)) == subdet) &&
1230  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
1231  stations[getMuonStation(pattern)-1] = 1;
1232  }
1233  }
1234  return stations[0]+stations[1]+stations[2]+stations[3];
1235 }
1236 
1249 
1251  int ret = 0;
1252  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
1253  uint32_t pattern = getHitPattern(i);
1254  if (pattern == 0) break;
1255  if (muonHitFilter(pattern) &&
1256  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
1257  int stat = getMuonStation(pattern);
1258  if (ret == 0 || stat < ret) ret = stat;
1259  }
1260  }
1261  return ret;
1262 }
1263 
1265  int ret = 0;
1266  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
1267  uint32_t pattern = getHitPattern(i);
1268  if (pattern == 0) break;
1269  if (muonHitFilter(pattern) &&
1270  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
1271  int stat = getMuonStation(pattern);
1272  if (ret == 0 || stat > ret) ret = stat;
1273  }
1274  }
1275  return ret;
1276 }
1277 
1284 
1286  int stations[4] = { 0,0,0,0 };
1287  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
1288  uint32_t pattern = getHitPattern(i);
1289  if (pattern == 0) break;
1290  if (muonDTHitFilter(pattern) && validHitFilter(pattern) && getDTSuperLayer(pattern) != 2) {
1291  stations[getMuonStation(pattern)-1] = 1;
1292  }
1293  }
1294  return stations[0]+stations[1]+stations[2]+stations[3];
1295 }
1296 
1298  int stations[4] = { 0,0,0,0 };
1299  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
1300  uint32_t pattern = getHitPattern(i);
1301  if (pattern == 0) break;
1302  if (muonDTHitFilter(pattern) && validHitFilter(pattern) && getDTSuperLayer(pattern) == 2) {
1303  stations[getMuonStation(pattern)-1] = 1;
1304  }
1305  }
1306  return stations[0]+stations[1]+stations[2]+stations[3];
1307 }
1308 
1310  int stations[4][2] = { {0,0}, {0,0}, {0,0}, {0,0} };
1311  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
1312  uint32_t pattern = getHitPattern(i);
1313  if (pattern == 0) break;
1314  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
1315  stations[getMuonStation(pattern)-1][getDTSuperLayer(pattern) == 2] = 1;
1316  }
1317  }
1318  return stations[0][0]*stations[0][1] + stations[1][0]*stations[1][1] + stations[2][0]*stations[2][1] + stations[3][0]*stations[3][1];
1319 }
1320 
1321 
1322 
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:913
int cscStationsWithAnyHits() const
Definition: HitPattern.cc:1245
int dtStationsWithAnyHits() const
Definition: HitPattern.cc:1242
int i
Definition: DBlmapReader.cc:9
int numberOfBadMuonRPCHits() const
Definition: HitPattern.cc:732
int rpcStationsWithValidHits() const
Definition: HitPattern.cc:1246
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:1264
int numberOfLostPixelEndcapHits() const
Definition: HitPattern.cc:565
int numberOfValidHits() const
Definition: HitPattern.cc:321
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:1090
int stripTIBLayersNull() const
Definition: HitPattern.cc:1108
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
uint32_t getSubStructure(uint32_t pattern) const
Definition: HitPattern.cc:133
bool muonDTHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:198
static uint32_t isStereo(DetId)
Definition: HitPattern.cc:1186
uint32_t hitPattern_[PatternSize]
Definition: HitPattern.h:337
int dtStationsWithValidHits() const
Definition: HitPattern.cc:1240
int stripLayersNull() const
Definition: HitPattern.cc:1083
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:895
int stripTECLayersNull() const
Definition: HitPattern.cc:1135
int numberOfValidMuonHits() const
Definition: HitPattern.cc:346
static const unsigned short SideOffset
Definition: HitPattern.h:329
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:1223
int numberOfLostMuonHits() const
Definition: HitPattern.cc:526
bool trackerHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:121
static const unsigned short SubstrOffset
Definition: HitPattern.h:321
int muonStationsWithBadHits() const
Definition: HitPattern.cc:1238
int innermostMuonStationWithBadHits() const
Definition: HitPattern.cc:1279
uint32_t getTrackerMonoStereo(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:819
uint32_t getCSCRing(uint32_t pattern) const
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.cc:249
int numberOfDTStationsWithRPhiView() const
Definition: HitPattern.cc:1285
#define abs(x)
Definition: mlp_lapack.h:159
int stripLayersWithoutMeasurement() const
Definition: HitPattern.cc:941
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
int stripTIDLayersWithoutMeasurement() const
Definition: HitPattern.cc:975
bool stripTIBHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:170
int numberOfLostTrackerHits() const
Definition: HitPattern.cc:513
void set(const I &begin, const I &end)
Definition: HitPattern.h:138
uint32_t getLayer(uint32_t pattern) const
Definition: HitPattern.cc:219
void print(std::ostream &stream=std::cout) const
Definition: HitPattern.cc:1171
int rpcStationsWithAnyHits() const
Definition: HitPattern.cc:1248
int outermostMuonStationWithAnyHits() const
Definition: HitPattern.cc:1283
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:865
static const unsigned short PatternSize
Definition: HitPattern.h:311
int trackerLayersWithoutMeasurement() const
Definition: HitPattern.cc:931
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:745
int pixelBarrelLayersWithoutMeasurement() const
Definition: HitPattern.cc:948
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:860
static const unsigned short HitTypeMask
Definition: HitPattern.h:334
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:886
int numberOfValidStripTIDHits() const
Definition: HitPattern.cc:424
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
int stripLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1012
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
int numberOfValidTrackerHits() const
Definition: HitPattern.cc:333
int numberOfLostStripTIDHits() const
Definition: HitPattern.cc:604
int numberOfLostPixelHits() const
Definition: HitPattern.cc:539
bool stripTOBHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:184
bool hasValidHitInFirstPixelEndcap() const
Definition: HitPattern.cc:298
bool type_3_HitFilter(uint32_t pattern) const
Definition: HitPattern.cc:279
int outermostMuonStationWithBadHits() const
Definition: HitPattern.cc:1282
int muonStationsWithAnyHits() const
Definition: HitPattern.cc:1239
int outermostMuonStationWithValidHits() const
Definition: HitPattern.cc:1281
int numberOfLostStripHits() const
Definition: HitPattern.cc:578
static const int CSC
Definition: MuonSubdetId.h:15
int stripTOBLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1055
bool muonRPCHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:212
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.cc:385
int numberOfBadMuonDTHits() const
Definition: HitPattern.cc:706
int rpcStationsWithBadHits() const
Definition: HitPattern.cc:1247
int stripTIDLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1046
int innermostMuonStationWithAnyHits() const
Definition: HitPattern.cc:1280
int numberOfValidStripHits() const
Definition: HitPattern.cc:398
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:904
bool pixelEndcapHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:153
bool muonCSCHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:205
static const unsigned short SubDetectorMask
Definition: HitPattern.h:318
int numberOfLostHits() const
Definition: HitPattern.cc:502
int numberOfValidPixelHits() const
Definition: HitPattern.cc:359
int stripTECLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1064
bool stripHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:160
int numberOfHits() const
Definition: HitPattern.cc:312
int numberOfLostMuonCSCHits() const
Definition: HitPattern.cc:656
int j
Definition: DBlmapReader.cc:9
int stripTIBLayersWithoutMeasurement() const
Definition: HitPattern.cc:966
int dtStationsWithBadHits() const
Definition: HitPattern.cc:1241
int numberOfDTStationsWithRZView() const
Definition: HitPattern.cc:1297
bool pixelBarrelHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:146
int numberOfValidStripTECHits() const
Definition: HitPattern.cc:450
int numberOfValidMuonRPCHits() const
Definition: HitPattern.cc:489
bool type_1_HitFilter(uint32_t pattern) const
Definition: HitPattern.cc:269
int stripTIDLayersNull() const
Definition: HitPattern.cc:1117
unsigned int offset(bool)
int numberOfLostPixelBarrelHits() const
Definition: HitPattern.cc:552
static const unsigned short HitTypeOffset
Definition: HitPattern.h:333
bool validHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:264
bool pixelHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:138
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
int numberOfLostStripTOBHits() const
Definition: HitPattern.cc:617
int numberOfDTStationsWithBothViews() const
Definition: HitPattern.cc:1309
static const unsigned short HitSize
Definition: HitPattern.h:314
int numberOfValidStripTIBHits() const
Definition: HitPattern.cc:411
static uint32_t getSide(uint32_t pattern)
Definition: HitPattern.cc:230
int cscStationsWithBadHits() const
Definition: HitPattern.cc:1244
uint32_t getRPCLayer(uint32_t pattern) const
RPC layer: for station 1 and 2, layer = 1(inner) or 2(outer); for station 3, 4 layer is always 0...
Definition: HitPattern.cc:253
int numberOfValidMuonDTHits() const
Definition: HitPattern.cc:463
bool type_2_HitFilter(uint32_t pattern) const
Definition: HitPattern.cc:274
uint32_t getDTSuperLayer(uint32_t pattern) const
DT superlayer (1-3). Only valid for muon DT patterns, of course.
Definition: HitPattern.cc:245
int layer() const
Definition: RPCDetId.h:110
Definition: DetId.h:20
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:1250
uint32_t getSubSubStructure(uint32_t pattern) const
Definition: HitPattern.cc:224
Type getType() const
static const unsigned short SideMask
Definition: HitPattern.h:330
int trackerLayersNull() const
Definition: HitPattern.cc:1073
int pixelEndcapLayersWithoutMeasurement() const
Definition: HitPattern.cc:957
int cscStationsWithValidHits() const
Definition: HitPattern.cc:1243
int numberOfBadHits() const
Definition: HitPattern.cc:682
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:317
int muonStationsWithValidHits() const
Definition: HitPattern.cc:1237
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:877
int numberOfLostStripTIBHits() const
Definition: HitPattern.cc:591
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
int pixelLayersWithoutMeasurement() const
Definition: HitPattern.cc:936
int stripLayersWithMeasurement() const
Definition: HitPattern.cc:870
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
int numberOfLostMuonDTHits() const
Definition: HitPattern.cc:643
int numberOfValidStripTOBHits() const
Definition: HitPattern.cc:437
int stripTOBLayersNull() const
Definition: HitPattern.cc:1126
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:782
int pixelBarrelLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1019
uint32_t getHitType(uint32_t pattern) const
Definition: HitPattern.cc:236
int numberOfLostMuonRPCHits() const
Definition: HitPattern.cc:669
static const unsigned short SubstrMask
Definition: HitPattern.h:322
static const int RPC
Definition: MuonSubdetId.h:16
static const unsigned short LayerOffset
Definition: HitPattern.h:325
int stripTECLayersWithoutMeasurement() const
Definition: HitPattern.cc:993
int numberOfValidMuonCSCHits() const
Definition: HitPattern.cc:476
int trackerLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1002
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:922
int stripTOBLayersWithoutMeasurement() const
Definition: HitPattern.cc:984
int pixelEndcapLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1028
uint32_t getRPCregion(uint32_t pattern) const
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.cc:259
int numberOfBadMuonHits() const
Definition: HitPattern.cc:693
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.cc:372
static const int DT
Definition: MuonSubdetId.h:14
void printHitPattern(int position, std::ostream &stream) const
Definition: HitPattern.cc:1144
bool hasValidHitInFirstPixelBarrel() const
Definition: HitPattern.cc:284
DetId geographicalId() const
int numberOfLostStripTECHits() const
Definition: HitPattern.cc:630
int stripTIBLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1037
static const unsigned short LayerMask
Definition: HitPattern.h:326
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:86
int pixelLayersTotallyOffOrBad() const
Definition: HitPattern.cc:1007
int pixelLayersNull() const
Definition: HitPattern.cc:1078
uint32_t getMuonStation(uint32_t pattern) const
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.cc:241
bool stripTIDHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:177
bool muonHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:127
bool stripTECHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:191
int numberOfBadMuonCSCHits() const
Definition: HitPattern.cc:719
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:1099
int innermostMuonStationWithValidHits() const
Definition: HitPattern.cc:1278
void setHitPattern(int position, uint32_t pattern)
Definition: HitPattern.cc:77
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98