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 
15 uint32_t HitPattern::encode(DetId id, uint32_t hitType, unsigned int i){
16 
17  // ignore the rec hit if the number of hit is larger than the max
18  if (i >= 32 * PatternSize / HitSize) return 0;
19 
20  // get rec hit det id and rec hit type
21  uint32_t detid = id.det();
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();
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  return pattern;
74 }
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 
87 
88  // get rec hit det id and rec hit type
89  DetId id = hit.geographicalId();
90  uint32_t detid = id.det();
91  uint32_t subdet = id.subdetId();
92 
93  std::vector<const TrackingRecHit*> hits;
94 
95 
96  if (detid == DetId::Tracker)
97  hits.push_back(&hit);
98 
99  if (detid == DetId::Muon) {
100 
101  if (subdet == (uint32_t) MuonSubdetId::DT){
102 
103  // DT rechit (granularity 2)
104  if(hit.dimension() == 1)
105  hits.push_back(&hit);
106 
107  // 4D segment (granularity 0)
108  else if(hit.dimension() > 1){ // Both 2 and 4 dim cases. MB4s have 2D, but formatted in 4D segments
109  std::vector<const TrackingRecHit*> seg2D = hit.recHits(); // 4D --> 2D
110  // load 1D hits (2D --> 1D)
111  for(std::vector<const TrackingRecHit*>::const_iterator it = seg2D.begin(); it != seg2D.end(); ++it){
112  std::vector<const TrackingRecHit*> hits1D = (*it)->recHits();
113  copy(hits1D.begin(),hits1D.end(),back_inserter(hits));
114  }
115  }
116  }
117 
118  else if (subdet == (uint32_t) MuonSubdetId::CSC){
119 
120  // CSC rechit (granularity 2)
121  if(hit.dimension() == 2)
122  hits.push_back(&hit);
123 
124  // 4D segment (granularity 0)
125  if(hit.dimension() == 4)
126  hits = hit.recHits(); // load 2D hits (4D --> 1D)
127  }
128 
129  else if (subdet == (uint32_t) MuonSubdetId::RPC) {
130  hits.push_back(&hit);
131  }
132  }
133 
134  unsigned int i = numberOfHits();
135  for(std::vector<const TrackingRecHit*>::const_iterator it = hits.begin(); it != hits.end(); ++it)
136  set(**it,i++);
137 
138 
139 }
140 
141 
142 uint32_t HitPattern::getHitPattern(int position) const {
143 /* Note: you are not taking a consecutive sequence of HitSize bits starting from position*HitSize
144  as the bit order in the words are reversed.
145  e.g. if position = 0 you take the lowest 10 bits of the first word.
146 
147  I hope this can clarify what is the memory layout of such thing
148 
149  straight 01234567890123456789012345678901 | 23456789012345678901234567890123 | 4567
150  (global) 0 1 2 3 | 3 4 5 6 | 6
151  words [--------------0---------------] | [--------------1---------------] | [---
152  word 01234567890123456789012345678901 | 01234567890123456789012345678901 | 0123
153  (str) 0 1 2 3 | 0 1 2 3 | 0
154  [--------------0---------------] | [--------------1---------------] | [---
155  word 10987654321098765432109876543210 | 10987654321098765432109876543210 | 1098
156  (rev) 32 21 10 0 | 32 21 10 0 | 32
157  reverse 10987654321098765432109876543210 | 32109876543210987654321098765432 | 5432
158  32 21 10 0 | 6 65 54 43 3 9
159 
160  ugly enough, but it's not my fault, I was not even in CMS at that time [gpetrucc] */
161  uint16_t bitEndOffset = (position+1) * HitSize;
162  uint8_t secondWord = (bitEndOffset >> 5);
163  uint8_t secondWordBits = bitEndOffset & (32-1); // that is, bitEndOffset % 32
164  if (secondWordBits >= HitSize) { // full block is in this word
165  uint8_t lowBitsToTrash = secondWordBits - HitSize;
166  uint32_t myResult = (hitPattern_[secondWord] >> lowBitsToTrash) & ((1 << HitSize)-1);
167  return myResult;
168  } else {
169  uint8_t firstWordBits = HitSize - secondWordBits;
170  uint32_t firstWordBlock = hitPattern_[secondWord-1] >> (32-firstWordBits);
171  uint32_t secondWordBlock = hitPattern_[secondWord] & ((1<<secondWordBits)-1);
172  uint32_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
173  return myResult;
174  }
175 }
176 
177 
178 
179 
180 
182  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
183  uint32_t pattern = getHitPattern(i);
184  if (pattern == 0) break;
185  if (pixelBarrelHitFilter(pattern)) {
186  if (getLayer(pattern) == 1) {
187  if (validHitFilter(pattern)) {
188  return true;
189  }
190  }
191  }
192  }
193  return false;
194 }
195 
197  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
198  uint32_t pattern = getHitPattern(i);
199  if (pattern == 0) break;
200  if (pixelEndcapHitFilter(pattern)) {
201  if (getLayer(pattern) == 1) {
202  if (validHitFilter(pattern)) {
203  return true;
204  }
205  }
206  }
207  }
208  return false;
209 }
210 
212  int count = 0;
213  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
214  uint32_t pattern = getHitPattern(i);
215  if (pattern == 0) break;
216  ++count;
217  }
218  return count;
219 }
220 
221 int HitPattern::numberOfValidStripLayersWithMonoAndStereo (uint32_t stripdet, uint32_t layer) const {
222  static const int nHits = (PatternSize * 32) / HitSize;
223  bool hasMono[SubstrMask + 1][LayerMask + 1];
224  // printf("sizeof(hasMono) = %d\n", sizeof(hasMono));
225  memset(hasMono, 0, sizeof(hasMono));
226  bool hasStereo[SubstrMask + 1][LayerMask + 1];
227  memset(hasStereo, 0, sizeof(hasStereo));
228  // mark which layers have mono/stereo hits
229  for (int i = 0; i < nHits; i++) {
230  uint32_t pattern = getHitPattern(i);
231  if (pattern == 0) break;
232  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
233  if (stripdet!=0 && getSubStructure(pattern)!=stripdet) continue;
234  if (layer!=0 && getSubSubStructure(pattern)!=layer) continue;
235  switch (getSide(pattern)) {
236  case 0: // mono
237  hasMono[getSubStructure(pattern)][getLayer(pattern)]
238  = true;
239  break;
240  case 1: // stereo
241  hasStereo[getSubStructure(pattern)][getLayer(pattern)]
242  = true;
243  break;
244  default:
245  break;
246  }
247  }
248 
249  }
250  // count how many layers have mono and stereo hits
251  int count = 0;
252  for (int i = 0; i < SubstrMask + 1; ++i)
253  for (int j = 0; j < LayerMask + 1; ++j)
254  if (hasMono[i][j] && hasStereo[i][j])
255  count++;
256  return count;
257 }
258 
259 uint32_t HitPattern::getTrackerLayerCase(uint32_t substr, uint32_t layer) const {
260  uint32_t tk_substr_layer =
261  (1 << SubDetectorOffset) +
262  ((substr & SubstrMask) << SubstrOffset) +
263  ((layer & LayerMask) << LayerOffset);
264 
265  uint32_t mask =
267  (SubstrMask << SubstrOffset) +
268  (LayerMask << LayerOffset);
269 
270  // crossed
271  // layer case 0: valid + (missing, off, bad) ==> with measurement
272  // layer case 1: missing + (off, bad) ==> without measurement
273  // layer case 2: off, bad ==> totally off or bad, cannot say much
274  // not crossed
275  // layer case 999999: track outside acceptance or in gap ==> null
276 
277  uint32_t layerCase = 999999;
278  for (int i=0; i<(PatternSize * 32) / HitSize; i++)
279  {
280  uint32_t pattern = getHitPattern(i);
281  if (pattern == 0) break;
282  if ((pattern & mask) == tk_substr_layer) {
283  uint32_t hitType = (pattern >> HitTypeOffset) & HitTypeMask; // 0,1,2,3
284  if (hitType < layerCase) {
285  layerCase = hitType;
286  if (hitType == 3) layerCase = 2;
287  }
288  }
289  }
290  return layerCase;
291 }
292 
293 uint32_t HitPattern::getTrackerMonoStereo (uint32_t substr, uint32_t layer) const
294 {
295  uint32_t tk_substr_layer =
296  (1 << SubDetectorOffset) +
297  ((substr & SubstrMask) << SubstrOffset) +
298  ((layer & LayerMask) << LayerOffset);
299 
300  uint32_t mask =
302  (SubstrMask << SubstrOffset) +
303  (LayerMask << LayerOffset);
304 
305  // 0: neither a valid mono nor a valid stereo hit
306  // MONO: valid mono hit
307  // STEREO: valid stereo hit
308  // MONO | STEREO: both
309  uint32_t monoStereo = 0;
310  for (int i=0; i<(PatternSize * 32) / HitSize; i++)
311  {
312  uint32_t pattern = getHitPattern(i);
313  if (pattern == 0) break;
314  if ((pattern & mask) == tk_substr_layer)
315  {
316  uint32_t hitType = (pattern >> HitTypeOffset) & HitTypeMask; // 0,1,2,3
317  if (hitType == 0) { // valid hit
318  switch (getSide(pattern)) {
319  case 0: // mono
320  monoStereo |= MONO;
321  break;
322  case 1: // stereo
323  monoStereo |= STEREO;
324  break;
325  default:
326  break;
327  }
328  }
329  }
330  }
331  return monoStereo;
332 }
333 
334 
335 
337  int count = 0;
338  uint32_t substr = PixelSubdetector::PixelBarrel;
339  uint32_t NPixBarrel = 4;
340  for (uint32_t layer=1; layer<=NPixBarrel; layer++) {
341  if (getTrackerLayerCase(substr, layer) == 0) count++;
342  }
343  return count;
344 }
345 
347  int count = 0;
348  uint32_t substr = PixelSubdetector::PixelEndcap;
349  uint32_t NPixForward = 3;
350  for (uint32_t layer=1; layer<=NPixForward; layer++) {
351  if (getTrackerLayerCase(substr, layer) == 0) count++;
352  }
353  return count;
354 }
355 
357  int count = 0;
358  uint32_t substr = StripSubdetector::TIB;
359  for (uint32_t layer=1; layer<=4; layer++) {
360  if (getTrackerLayerCase(substr, layer) == 0) count++;
361  }
362  return count;
363 }
364 
366  int count = 0;
367  uint32_t substr = StripSubdetector::TID;
368  for (uint32_t layer=1; layer<=3; layer++) {
369  if (getTrackerLayerCase(substr, layer) == 0) count++;
370  }
371  return count;
372 }
373 
375  int count = 0;
376  uint32_t substr = StripSubdetector::TOB;
377  for (uint32_t layer=1; layer<=6; layer++) {
378  if (getTrackerLayerCase(substr, layer) == 0) count++;
379  }
380  return count;
381 }
382 
384  int count = 0;
385  uint32_t substr = StripSubdetector::TEC;
386  for (uint32_t layer=1; layer<=9; layer++) {
387  if (getTrackerLayerCase(substr, layer) == 0) count++;
388  }
389  return count;
390 }
391 
392 
394  int count = 0;
395  uint32_t substr = PixelSubdetector::PixelBarrel;
396  uint32_t NPixBarrel = 4;
397  for (uint32_t layer=1; layer<=NPixBarrel; layer++) {
398  if (getTrackerLayerCase(substr, layer) == 1) count++;
399  }
400  return count;
401 }
402 
404  int count = 0;
405  uint32_t substr = PixelSubdetector::PixelEndcap;
406  uint32_t NPixForward = 3;
407  for (uint32_t layer=1; layer<=NPixForward; layer++) {
408  if (getTrackerLayerCase(substr, layer) == 1) count++;
409  }
410  return count;
411 }
412 
414  int count = 0;
415  uint32_t substr = StripSubdetector::TIB;
416  for (uint32_t layer=1; layer<=4; layer++) {
417  if (getTrackerLayerCase(substr, layer) == 1) count++;
418  }
419  return count;
420 }
421 
423  int count = 0;
424  uint32_t substr = StripSubdetector::TID;
425  for (uint32_t layer=1; layer<=3; layer++) {
426  if (getTrackerLayerCase(substr, layer) == 1) count++;
427  }
428  return count;
429 }
430 
432  int count = 0;
433  uint32_t substr = StripSubdetector::TOB;
434  for (uint32_t layer=1; layer<=6; layer++) {
435  if (getTrackerLayerCase(substr, layer) == 1) count++;
436  }
437  return count;
438 }
439 
441  int count = 0;
442  uint32_t substr = StripSubdetector::TEC;
443  for (uint32_t layer=1; layer<=9; layer++) {
444  if (getTrackerLayerCase(substr, layer) == 1) count++;
445  }
446  return count;
447 }
448 
449 
451  int count = 0;
452  uint32_t substr = PixelSubdetector::PixelBarrel;
453  uint32_t NPixBarrel = 4;
454  for (uint32_t layer=1; layer<=NPixBarrel; layer++) {
455  if (getTrackerLayerCase(substr, layer) == 2) count++;
456  }
457  return count;
458 }
459 
461  int count = 0;
462  uint32_t substr = PixelSubdetector::PixelEndcap;
463  uint32_t NPixForward = 3;
464  for (uint32_t layer=1; layer<=NPixForward; layer++) {
465  if (getTrackerLayerCase(substr, layer) == 2) count++;
466  }
467  return count;
468 }
469 
471  int count = 0;
472  uint32_t substr = StripSubdetector::TIB;
473  for (uint32_t layer=1; layer<=4; layer++) {
474  if (getTrackerLayerCase(substr, layer) == 2) count++;
475  }
476  return count;
477 }
478 
480  int count = 0;
481  uint32_t substr = StripSubdetector::TID;
482  for (uint32_t layer=1; layer<=3; layer++) {
483  if (getTrackerLayerCase(substr, layer) == 2) count++;
484  }
485  return count;
486 }
487 
489  int count = 0;
490  uint32_t substr = StripSubdetector::TOB;
491  for (uint32_t layer=1; layer<=6; layer++) {
492  if (getTrackerLayerCase(substr, layer) == 2) count++;
493  }
494  return count;
495 }
496 
498  int count = 0;
499  uint32_t substr = StripSubdetector::TEC;
500  for (uint32_t layer=1; layer<=9; layer++) {
501  if (getTrackerLayerCase(substr, layer) == 2) count++;
502  }
503  return count;
504 }
505 
506 
508  int count = 0;
509  uint32_t substr = PixelSubdetector::PixelBarrel;
510  uint32_t NPixBarrel = 4;
511  for (uint32_t layer=1; layer<=NPixBarrel; layer++) {
512  if (getTrackerLayerCase(substr, layer) == 999999) count++;
513  }
514  return count;
515 }
516 
518  int count = 0;
519  uint32_t substr = PixelSubdetector::PixelEndcap;
520  uint32_t NPixForward = 3;
521  for (uint32_t layer=1; layer<=NPixForward; layer++) {
522  if (getTrackerLayerCase(substr, layer) == 999999) count++;
523  }
524  return count;
525 }
526 
528  int count = 0;
529  uint32_t substr = StripSubdetector::TIB;
530  for (uint32_t layer=1; layer<=4; layer++) {
531  if (getTrackerLayerCase(substr, layer) == 999999) count++;
532  }
533  return count;
534 }
535 
537  int count = 0;
538  uint32_t substr = StripSubdetector::TID;
539  for (uint32_t layer=1; layer<=3; layer++) {
540  if (getTrackerLayerCase(substr, layer) == 999999) count++;
541  }
542  return count;
543 }
544 
546  int count = 0;
547  uint32_t substr = StripSubdetector::TOB;
548  for (uint32_t layer=1; layer<=6; layer++) {
549  if (getTrackerLayerCase(substr, layer) == 999999) count++;
550  }
551  return count;
552 }
553 
555  int count = 0;
556  uint32_t substr = StripSubdetector::TEC;
557  for (uint32_t layer=1; layer<=9; layer++) {
558  if (getTrackerLayerCase(substr, layer) == 999999) count++;
559  }
560  return count;
561 }
562 
563 void HitPattern::printHitPattern (int position, std::ostream &stream) const
564 {
565  uint32_t pattern = getHitPattern(position);
566  stream << "\t";
567  if (muonHitFilter(pattern))
568  stream << "muon";
569  if (trackerHitFilter(pattern))
570  stream << "tracker";
571  stream << "\tsubstructure " << getSubStructure(pattern);
572  if (muonHitFilter(pattern)) {
573  stream << "\tstation " << getMuonStation(pattern);
574  if (muonDTHitFilter(pattern)) {
575  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
576  } else if (muonCSCHitFilter(pattern)) {
577  stream << "\tcsc ring " << getCSCRing(pattern);
578  } else if (muonRPCHitFilter(pattern)) {
579  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel") << ", layer " << getRPCLayer(pattern);
580  } else {
581  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure " << getSubStructure(pattern);
582  }
583  } else {
584  stream << "\tlayer " << getLayer(pattern);
585  }
586  stream << "\thit type " << getHitType(pattern);
587  stream << std::endl;
588 }
589 
590 void HitPattern::print (std::ostream &stream) const
591 {
592  stream << "HitPattern" << std::endl;
593  for (int i = 0; i < numberOfHits(); i++)
594  printHitPattern(i, stream);
595  std::ios_base::fmtflags flags = stream.flags();
596  stream.setf ( std::ios_base::hex, std::ios_base::basefield );
597  stream.setf ( std::ios_base::showbase );
598  for (int i = 0; i < numberOfHits(); i++) {
599  uint32_t pattern = getHitPattern(i);
600  stream << pattern << std::endl;
601  }
602  stream.flags(flags);
603 }
604 
606 {
607  switch (i.det()) {
608  case DetId::Tracker:
609  switch (i.subdetId()) {
612  return 0;
614  {
615  TIBDetId id = i;
616  return id.isStereo();
617  }
619  {
620  TIDDetId id = i;
621  return id.isStereo();
622  }
624  {
625  TOBDetId id = i;
626  return id.isStereo();
627  }
629  {
630  TECDetId id = i;
631  return id.isStereo();
632  }
633  default:
634  return 0;
635  }
636  break;
637  default:
638  return 0;
639  }
640 }
641 
642 int HitPattern::muonStations(int subdet, int hitType) const {
643  int stations[4] = { 0,0,0,0 };
644  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
645  uint32_t pattern = getHitPattern(i);
646  if (pattern == 0) break;
647  if (muonHitFilter(pattern) &&
648  (subdet == 0 || int(getSubStructure(pattern)) == subdet) &&
649  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
650  stations[getMuonStation(pattern)-1] = 1;
651  }
652  }
653  return stations[0]+stations[1]+stations[2]+stations[3];
654 }
655 
656 
658  int ret = 0;
659  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
660  uint32_t pattern = getHitPattern(i);
661  if (pattern == 0) break;
662  if (muonHitFilter(pattern) &&
663  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
664  int stat = getMuonStation(pattern);
665  if (ret == 0 || stat < ret) ret = stat;
666  }
667  }
668  return ret;
669 }
670 
672  int ret = 0;
673  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
674  uint32_t pattern = getHitPattern(i);
675  if (pattern == 0) break;
676  if (muonHitFilter(pattern) &&
677  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
678  int stat = getMuonStation(pattern);
679  if (ret == 0 || stat > ret) ret = stat;
680  }
681  }
682  return ret;
683 }
684 
685 
687  int stations[4] = { 0,0,0,0 };
688  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
689  uint32_t pattern = getHitPattern(i);
690  if (pattern == 0) break;
691  if (muonDTHitFilter(pattern) && validHitFilter(pattern) && getDTSuperLayer(pattern) != 2) {
692  stations[getMuonStation(pattern)-1] = 1;
693  }
694  }
695  return stations[0]+stations[1]+stations[2]+stations[3];
696 }
697 
699  int stations[4] = { 0,0,0,0 };
700  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
701  uint32_t pattern = getHitPattern(i);
702  if (pattern == 0) break;
703  if (muonDTHitFilter(pattern) && validHitFilter(pattern) && getDTSuperLayer(pattern) == 2) {
704  stations[getMuonStation(pattern)-1] = 1;
705  }
706  }
707  return stations[0]+stations[1]+stations[2]+stations[3];
708 }
709 
711  int stations[4][2] = { {0,0}, {0,0}, {0,0}, {0,0} };
712  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
713  uint32_t pattern = getHitPattern(i);
714  if (pattern == 0) break;
715  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
716  stations[getMuonStation(pattern)-1][getDTSuperLayer(pattern) == 2] = 1;
717  }
718  }
719  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];
720 }
721 
722 
723 
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:374
int i
Definition: DBlmapReader.cc:9
virtual int dimension() const =0
static uint32_t getRPCLayer(uint32_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:553
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:671
static uint32_t getDTSuperLayer(uint32_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:545
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:507
int stripTIBLayersNull() const
Definition: HitPattern.cc:527
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
static uint32_t getLayer(uint32_t pattern)
Definition: HitPattern.h:520
void appendHit(const TrackingRecHit &hit)
Definition: HitPattern.cc:86
static uint32_t isStereo(DetId)
Definition: HitPattern.cc:605
static uint32_t getCSCRing(uint32_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:549
uint32_t hitPattern_[PatternSize]
Definition: HitPattern.h:400
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:356
int stripTECLayersNull() const
Definition: HitPattern.cc:554
static const unsigned short SideOffset
Definition: HitPattern.h:392
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:642
static uint32_t getSubSubStructure(uint32_t pattern)
Definition: HitPattern.h:525
static bool muonDTHitFilter(uint32_t pattern)
Definition: HitPattern.h:479
static const unsigned short SubstrOffset
Definition: HitPattern.h:384
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:501
uint32_t getTrackerMonoStereo(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:293
int numberOfDTStationsWithRPhiView() const
Definition: HitPattern.cc:686
static uint32_t getHitType(uint32_t pattern)
Definition: HitPattern.h:536
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
int stripTIDLayersWithoutMeasurement() const
Definition: HitPattern.cc:422
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.h:541
void set(const I &begin, const I &end)
Definition: HitPattern.h:152
void print(std::ostream &stream=std::cout) const
Definition: HitPattern.cc:590
static const unsigned short PatternSize
Definition: HitPattern.h:129
int pixelBarrelLayersWithoutMeasurement() const
Definition: HitPattern.cc:393
static const unsigned short HitTypeMask
Definition: HitPattern.h:397
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:346
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
bool hasValidHitInFirstPixelEndcap() const
Definition: HitPattern.cc:196
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:507
static const int CSC
Definition: MuonSubdetId.h:13
int stripTOBLayersTotallyOffOrBad() const
Definition: HitPattern.cc:488
int stripTIDLayersTotallyOffOrBad() const
Definition: HitPattern.cc:479
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:365
static const unsigned short SubDetectorMask
Definition: HitPattern.h:381
int stripTECLayersTotallyOffOrBad() const
Definition: HitPattern.cc:497
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int numberOfHits() const
Definition: HitPattern.cc:211
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:514
int j
Definition: DBlmapReader.cc:9
int stripTIBLayersWithoutMeasurement() const
Definition: HitPattern.cc:413
int numberOfDTStationsWithRZView() const
Definition: HitPattern.cc:698
static bool muonRPCHitFilter(uint32_t pattern)
Definition: HitPattern.h:493
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:564
int stripTIDLayersNull() const
Definition: HitPattern.cc:536
unsigned int offset(bool)
static const unsigned short HitTypeOffset
Definition: HitPattern.h:396
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
int numberOfDTStationsWithBothViews() const
Definition: HitPattern.cc:710
static const unsigned short HitSize
Definition: HitPattern.h:132
static uint32_t getSide(uint32_t pattern)
Definition: HitPattern.h:531
int layer() const
Definition: RPCDetId.h:108
Definition: DetId.h:18
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:657
static const unsigned short SideMask
Definition: HitPattern.h:393
int pixelEndcapLayersWithoutMeasurement() const
Definition: HitPattern.cc:403
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:380
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:336
static uint32_t getRPCregion(uint32_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:559
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
int stripTOBLayersNull() const
Definition: HitPattern.cc:545
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:259
int pixelBarrelLayersTotallyOffOrBad() const
Definition: HitPattern.cc:450
static const unsigned short SubstrMask
Definition: HitPattern.h:385
static const int RPC
Definition: MuonSubdetId.h:14
static const unsigned short LayerOffset
Definition: HitPattern.h:388
int stripTECLayersWithoutMeasurement() const
Definition: HitPattern.cc:440
static bool stripHitFilter(uint32_t pattern)
Definition: HitPattern.h:441
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:383
int stripTOBLayersWithoutMeasurement() const
Definition: HitPattern.cc:431
int pixelEndcapLayersTotallyOffOrBad() const
Definition: HitPattern.cc:460
static bool pixelEndcapHitFilter(uint32_t pattern)
Definition: HitPattern.h:434
static bool muonCSCHitFilter(uint32_t pattern)
Definition: HitPattern.h:486
static const int DT
Definition: MuonSubdetId.h:12
void printHitPattern(int position, std::ostream &stream) const
Definition: HitPattern.cc:563
bool hasValidHitInFirstPixelBarrel() const
Definition: HitPattern.cc:181
DetId geographicalId() const
int stripTIBLayersTotallyOffOrBad() const
Definition: HitPattern.cc:470
static const unsigned short LayerMask
Definition: HitPattern.h:389
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:142
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.h:290
static bool pixelBarrelHitFilter(uint32_t pattern)
Definition: HitPattern.h:427
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:517
void setHitPattern(int position, uint32_t pattern)
Definition: HitPattern.cc:77
uint32_t encode(const TrackingRecHit &hit, unsigned int i)
Definition: HitPattern.h:412
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96