CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
reco::HitPattern Class Reference

#include <HitPattern.h>

Public Types

enum  { MONO = 1, STEREO = 2 }
 
enum  HIT_TYPE { VALID = 0, MISSING = 1, INACTIVE = 2, BAD = 3 }
 
enum  HitCategory { TRACK_HITS = 0, MISSING_INNER_HITS = 1, MISSING_OUTER_HITS = 2 }
 

Public Member Functions

bool appendHit (const TrackingRecHit &hit)
 
bool appendHit (const TrackingRecHitRef &ref)
 
bool appendHit (const DetId &id, TrackingRecHit::Type hitType)
 
template<typename I >
bool appendHits (const I &begin, const I &end)
 
void clear ()
 
int cscStationsWithAnyHits () const
 
int cscStationsWithBadHits () const
 
int cscStationsWithValidHits () const
 
int dtStationsWithAnyHits () const
 
int dtStationsWithBadHits () const
 
int dtStationsWithValidHits () const
 
uint16_t getHitPattern (HitCategory category, int position) const
 
uint32_t getTrackerLayerCase (HitCategory category, uint16_t substr, uint16_t layer) const
 
uint16_t getTrackerMonoStereo (HitCategory category, uint16_t substr, uint16_t layer) const
 
bool hasValidHitInFirstPixelBarrel () const
 
bool hasValidHitInFirstPixelEndcap () const
 
 HitPattern ()
 
 HitPattern (const HitPattern &other)
 
int innermostMuonStationWithAnyHits () const
 
int innermostMuonStationWithBadHits () const
 
int innermostMuonStationWithHits (int hitType) const
 hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all More...
 
int innermostMuonStationWithValidHits () const
 
int muonStations (int subdet, int hitType) const
 subdet = 0(all), 1(DT), 2(CSC), 3(RPC); hitType=-1(all), 0=valid, 3=bad More...
 
int muonStationsWithAnyHits () const
 
int muonStationsWithBadHits () const
 
int muonStationsWithValidHits () const
 
int numberOfBadHits () const
 
int numberOfBadMuonCSCHits () const
 
int numberOfBadMuonDTHits () const
 
int numberOfBadMuonHits () const
 
int numberOfBadMuonRPCHits () const
 
int numberOfDTStationsWithBothViews () const
 
int numberOfDTStationsWithRPhiView () const
 
int numberOfDTStationsWithRZView () const
 
int numberOfHits (HitCategory category) const
 
int numberOfInactiveHits () const
 
int numberOfInactiveTrackerHits () const
 
int numberOfLostHits (HitCategory category) const
 
int numberOfLostMuonCSCHits () const
 
int numberOfLostMuonDTHits () const
 
int numberOfLostMuonHits () const
 
int numberOfLostMuonRPCHits () const
 
int numberOfLostPixelBarrelHits (HitCategory category) const
 
int numberOfLostPixelEndcapHits (HitCategory category) const
 
int numberOfLostPixelHits (HitCategory category) const
 
int numberOfLostStripHits (HitCategory category) const
 
int numberOfLostStripTECHits (HitCategory category) const
 
int numberOfLostStripTIBHits (HitCategory category) const
 
int numberOfLostStripTIDHits (HitCategory category) const
 
int numberOfLostStripTOBHits (HitCategory category) const
 
int numberOfLostTrackerHits (HitCategory category) const
 
int numberOfMuonHits () const
 
int numberOfTrackerHits (HitCategory category) const
 
int numberOfValidHits () const
 
int numberOfValidMuonCSCHits () const
 
int numberOfValidMuonDTHits () const
 
int numberOfValidMuonHits () const
 
int numberOfValidMuonRPCHits () const
 
int numberOfValidPixelBarrelHits () const
 
int numberOfValidPixelEndcapHits () const
 
int numberOfValidPixelHits () const
 
int numberOfValidStripHits () const
 
int numberOfValidStripLayersWithMonoAndStereo (uint16_t stripdet, uint16_t layer) const
 
int numberOfValidStripLayersWithMonoAndStereo () const
 
int numberOfValidStripTECHits () const
 
int numberOfValidStripTIBHits () const
 
int numberOfValidStripTIDHits () const
 
int numberOfValidStripTOBHits () const
 
int numberOfValidTECLayersWithMonoAndStereo (uint32_t layer=0) const
 
int numberOfValidTIBLayersWithMonoAndStereo (uint32_t layer=0) const
 
int numberOfValidTIDLayersWithMonoAndStereo (uint32_t layer=0) const
 
int numberOfValidTOBLayersWithMonoAndStereo (uint32_t layer=0) const
 
int numberOfValidTrackerHits () const
 
HitPatternoperator= (const HitPattern &other)
 
int outermostMuonStationWithAnyHits () const
 
int outermostMuonStationWithBadHits () const
 
int outermostMuonStationWithHits (int hitType) const
 hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all More...
 
int outermostMuonStationWithValidHits () const
 
int pixelBarrelLayersNull () const
 
int pixelBarrelLayersTotallyOffOrBad () const
 
int pixelBarrelLayersWithMeasurement () const
 
int pixelBarrelLayersWithoutMeasurement (HitCategory category) const
 
int pixelEndcapLayersNull () const
 
int pixelEndcapLayersTotallyOffOrBad () const
 
int pixelEndcapLayersWithMeasurement () const
 
int pixelEndcapLayersWithoutMeasurement (HitCategory category) const
 
int pixelLayersNull () const
 
int pixelLayersTotallyOffOrBad () const
 
int pixelLayersWithMeasurement () const
 
int pixelLayersWithMeasurementOld () const
 
int pixelLayersWithoutMeasurement (HitCategory category) const
 
void print (HitCategory category, std::ostream &stream=std::cout) const
 
void printHitPattern (HitCategory category, int position, std::ostream &stream) const
 
int rpcStationsWithAnyHits () const
 
int rpcStationsWithBadHits () const
 
int rpcStationsWithValidHits () const
 
int stripLayersNull () const
 
int stripLayersTotallyOffOrBad () const
 
int stripLayersWithMeasurement () const
 
int stripLayersWithoutMeasurement (HitCategory category) const
 
int stripTECLayersNull () const
 
int stripTECLayersTotallyOffOrBad () const
 
int stripTECLayersWithMeasurement () const
 
int stripTECLayersWithoutMeasurement (HitCategory category) const
 
int stripTIBLayersNull () const
 
int stripTIBLayersTotallyOffOrBad () const
 
int stripTIBLayersWithMeasurement () const
 
int stripTIBLayersWithoutMeasurement (HitCategory category) const
 
int stripTIDLayersNull () const
 
int stripTIDLayersTotallyOffOrBad () const
 
int stripTIDLayersWithMeasurement () const
 
int stripTIDLayersWithoutMeasurement (HitCategory category) const
 
int stripTOBLayersNull () const
 
int stripTOBLayersTotallyOffOrBad () const
 
int stripTOBLayersWithMeasurement () const
 
int stripTOBLayersWithoutMeasurement (HitCategory category) const
 
int trackerLayersNull () const
 
int trackerLayersTotallyOffOrBad () const
 
int trackerLayersWithMeasurement () const
 
int trackerLayersWithMeasurementOld () const
 
int trackerLayersWithoutMeasurement (HitCategory category) const
 
int trackerLayersWithoutMeasurementOld (HitCategory category) const
 
 ~HitPattern ()
 

Static Public Member Functions

static bool badHitFilter (uint16_t pattern)
 
static uint16_t getCSCRing (uint16_t pattern)
 CSC ring (1-4). Only valid for muon CSC patterns, of course. More...
 
static uint16_t getDTSuperLayer (uint16_t pattern)
 DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patterns, of course. More...
 
static uint32_t getHitType (uint16_t pattern)
 
static uint32_t getLayer (uint16_t pattern)
 
static uint16_t getMuonStation (uint16_t pattern)
 Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon, of course. More...
 
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. Only valid for muon RPC patterns, of course. More...
 
static uint16_t getRPCregion (uint16_t pattern)
 RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course. More...
 
static uint32_t getSide (uint16_t pattern)
 
static uint32_t getSubDetector (uint16_t pattern)
 
static uint32_t getSubStructure (uint16_t pattern)
 
static uint32_t getSubSubStructure (uint16_t pattern)
 
static bool inactiveHitFilter (uint16_t pattern)
 
static bool missingHitFilter (uint16_t pattern)
 
static bool muonCSCHitFilter (uint16_t pattern)
 
static bool muonDTHitFilter (uint16_t pattern)
 
static bool muonHitFilter (uint16_t pattern)
 
static bool muonRPCHitFilter (uint16_t pattern)
 
static bool pixelBarrelHitFilter (uint16_t pattern)
 
static bool pixelEndcapHitFilter (uint16_t pattern)
 
static bool pixelHitFilter (uint16_t pattern)
 
static bool stripHitFilter (uint16_t pattern)
 
static bool stripTECHitFilter (uint16_t pattern)
 
static bool stripTIBHitFilter (uint16_t pattern)
 
static bool stripTIDHitFilter (uint16_t pattern)
 
static bool stripTOBHitFilter (uint16_t pattern)
 
static bool trackerHitFilter (uint16_t pattern)
 
static bool validHitFilter (uint16_t pattern)
 

Static Public Attributes

static const unsigned short ARRAY_LENGTH = 50
 
static const uint16_t EMPTY_PATTERN = 0x0
 
static const unsigned short HIT_LENGTH = 11
 
static const unsigned short MaxHits = (8 * sizeof(uint16_t) * ARRAY_LENGTH) / HIT_LENGTH
 
static const uint32_t NULL_RETURN = 999999
 

Private Types

typedef bool filterType (uint16_t)
 

Private Member Functions

template<typename F >
void call (HitCategory category, filterType typeFilter, F f) const
 
int countHits (HitCategory category, filterType filter) const
 
int countTypedHits (HitCategory category, filterType typeFilter, filterType filter) const
 
std::pair< uint8_t, uint8_t > getCategoryIndexRange (HitCategory category) const
 
uint16_t getHitPatternByAbsoluteIndex (int position) const
 
bool insertExpectedInnerHit (const uint16_t pattern)
 
bool insertExpectedOuterHit (const uint16_t pattern)
 
void insertHit (const uint16_t pattern)
 
bool insertTrackHit (const uint16_t pattern)
 

Static Private Member Functions

static uint16_t encode (const TrackingRecHit &hit)
 
static uint16_t encode (const DetId &id, TrackingRecHit::Type hitType)
 
static uint16_t isStereo (DetId i)
 
static bool stripSubdetectorHitFilter (uint16_t pattern, StripSubdetector::SubDetector substructure)
 

Private Attributes

uint8_t beginInner
 
uint8_t beginOuter
 
uint8_t beginTrackHits
 
uint8_t endInner
 
uint8_t endOuter
 
uint8_t endTrackHits
 
uint8_t hitCount
 
uint16_t hitPattern [ARRAY_LENGTH]
 

Static Private Attributes

static const unsigned short HitTypeMask = 0x3
 
static const unsigned short HitTypeOffset = 0
 
static const unsigned short LayerMask = 0xF
 
static const unsigned short LayerOffset = 3
 
static const unsigned short minPixelWord = minTrackerWord | (1<<SubstrOffset)
 
static const unsigned short minStripWord = minTrackerWord | (3<<SubstrOffset)
 
static const unsigned short minTrackerWord = 1<< SubDetectorOffset
 
static const unsigned short SideMask = 0x1
 
static const unsigned short SideOffset = 2
 
static const unsigned short SubDetectorMask = 0x1
 
static const unsigned short SubDetectorOffset = 10
 
static const unsigned short SubstrMask = 0x7
 
static const unsigned short SubstrOffset = 7
 

Detailed Description

Definition at line 135 of file HitPattern.h.

Member Typedef Documentation

typedef bool reco::HitPattern::filterType(uint16_t)
private

Definition at line 401 of file HitPattern.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MONO 
STEREO 

Definition at line 139 of file HitPattern.h.

139  {
140  MONO = 1,
141  STEREO = 2
142  };
Enumerator
VALID 
MISSING 
INACTIVE 
BAD 

Definition at line 144 of file HitPattern.h.

Enumerator
TRACK_HITS 
MISSING_INNER_HITS 
MISSING_OUTER_HITS 

Definition at line 151 of file HitPattern.h.

Constructor & Destructor Documentation

HitPattern::HitPattern ( )

Definition at line 17 of file HitPattern.cc.

References ARRAY_LENGTH, EMPTY_PATTERN, and hitPattern.

17  :
18  hitCount(0),
19  beginTrackHits(0),
20  endTrackHits(0),
21  beginInner(0),
22  endInner(0),
23  beginOuter(0),
24  endOuter(0)
25 {
27 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
uint8_t endInner
Definition: HitPattern.h:424
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:418
uint8_t beginInner
Definition: HitPattern.h:423
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint8_t hitCount
Definition: HitPattern.h:419
uint8_t beginOuter
Definition: HitPattern.h:425
uint8_t endOuter
Definition: HitPattern.h:426
HitPattern::~HitPattern ( )

Definition at line 41 of file HitPattern.cc.

42 {
43  ;
44 }
HitPattern::HitPattern ( const HitPattern other)

Definition at line 29 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

29  :
30  hitCount(other.hitCount),
33  beginInner(other.beginInner),
34  endInner(other.endInner),
35  beginOuter(other.beginOuter),
36  endOuter(other.endOuter)
37 {
38  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
39 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
uint8_t endInner
Definition: HitPattern.h:424
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:418
uint8_t beginInner
Definition: HitPattern.h:423
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint8_t hitCount
Definition: HitPattern.h:419
uint8_t beginOuter
Definition: HitPattern.h:425
uint8_t endOuter
Definition: HitPattern.h:426

Member Function Documentation

bool HitPattern::appendHit ( const TrackingRecHit hit)

Definition at line 168 of file HitPattern.cc.

References TrackingRecHit::geographicalId(), and TrackingRecHit::getType().

Referenced by FixTrackHitPattern::analyze(), appendHit(), reco::TrackBase::appendHitPattern(), and appendHits().

169 {
170  return appendHit(hit.geographicalId(), hit.getType());
171 }
Type getType() const
bool appendHit(const TrackingRecHit &hit)
Definition: HitPattern.cc:168
DetId geographicalId() const
bool HitPattern::appendHit ( const TrackingRecHitRef ref)

Definition at line 81 of file HitPattern.cc.

References appendHit().

82 {
83  return appendHit(*ref);
84 }
bool appendHit(const TrackingRecHit &hit)
Definition: HitPattern.cc:168
bool HitPattern::appendHit ( const DetId id,
TrackingRecHit::Type  hitType 
)

Definition at line 173 of file HitPattern.cc.

References TrackingRecHit::bad, beginInner, beginOuter, beginTrackHits, encode(), endInner, endOuter, endTrackHits, edm::hlt::Exception, hitCount, TrackingRecHit::inactive, insertExpectedInnerHit(), insertExpectedOuterHit(), insertTrackHit(), MaxHits, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, chain::pattern, unlikely, and TrackingRecHit::valid.

174 {
175  //if HitPattern is full, journey ends no matter what.
177  return false;
178  }
179 
180  uint16_t pattern = HitPattern::encode(id, hitType);
181 
182  switch (hitType) {
186  case TrackingRecHit::bad:
187  // hitCount != endT => we are not inserting T type of hits but of T'
188  // 0 != beginT || 0 != endT => we already have hits of T type
189  // so we already have hits of T in the vector and we don't want to
190  // mess them with T' hits.
191  if unlikely(((hitCount != endTrackHits) && (0 != beginTrackHits || 0 != endTrackHits))) {
192  cms::Exception("HitPattern")
193  << "TRACK_HITS"
194  << " were stored on this object before hits of some other category were inserted "
195  << "but hits of the same category should be inserted in a row. "
196  << "Please rework the code so it inserts all "
197  << "TRACK_HITS"
198  << " in a row.";
199  return false;
200  }
201  return insertTrackHit(pattern);
202  break;
204  if unlikely(((hitCount != endInner) && (0 != beginInner || 0 != endInner))) {
205  cms::Exception("HitPattern")
206  << "MISSING_INNER_HITS"
207  << " were stored on this object before hits of some other category were inserted "
208  << "but hits of the same category should be inserted in a row. "
209  << "Please rework the code so it inserts all "
210  << "MISSING_INNER_HITS"
211  << " in a row.";
212  return false;
213  }
214  return insertExpectedInnerHit(pattern);
215  break;
217  if unlikely(((hitCount != endOuter) && (0 != beginOuter || 0 != endOuter))) {
218  cms::Exception("HitPattern")
219  << "MISSING_OUTER_HITS"
220  << " were stored on this object before hits of some other category were inserted "
221  << "but hits of the same category should be inserted in a row. "
222  << "Please rework the code so it inserts all "
223  << "MISSING_OUTER_HITS"
224  << " in a row.";
225  return false;
226  }
227  return insertExpectedOuterHit(pattern);
228  break;
229  }
230 
231  return false;
232 }
static const unsigned short MaxHits
Definition: HitPattern.h:158
list pattern
Definition: chain.py:104
static uint16_t encode(const TrackingRecHit &hit)
Definition: HitPattern.cc:86
bool insertExpectedOuterHit(const uint16_t pattern)
Definition: HitPattern.cc:1005
#define unlikely(x)
uint8_t endInner
Definition: HitPattern.h:424
uint8_t beginInner
Definition: HitPattern.h:423
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint8_t hitCount
Definition: HitPattern.h:419
uint8_t beginOuter
Definition: HitPattern.h:425
bool insertExpectedInnerHit(const uint16_t pattern)
Definition: HitPattern.cc:992
bool insertTrackHit(const uint16_t pattern)
Definition: HitPattern.cc:973
uint8_t endOuter
Definition: HitPattern.h:426
template<typename I >
bool reco::HitPattern::appendHits ( const I &  begin,
const I &  end 
)

Definition at line 446 of file HitPattern.h.

References appendHit(), end, Exhume::I, and unlikely.

Referenced by reco::TrackBase::appendHits().

447 {
448  for (I hit = begin; hit != end; hit++) {
449  if unlikely((!appendHit(*hit))) {
450  return false;
451  }
452  }
453  return true;
454 }
#define unlikely(x)
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
bool appendHit(const TrackingRecHit &hit)
Definition: HitPattern.cc:168
bool reco::HitPattern::badHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 713 of file HitPattern.h.

References BAD, and getHitType().

Referenced by numberOfBadHits().

714 {
716 }
list pattern
Definition: chain.py:104
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:657
template<typename F >
void reco::HitPattern::call ( HitCategory  category,
filterType  typeFilter,
F  f 
) const
private

Definition at line 480 of file HitPattern.h.

References f, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), i, and chain::pattern.

481 {
482  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
483  for (int i = range.first; i < range.second; i++) {
485  // f() return false to ask to stop looping
486  if (typeFilter(pattern) && !f(pattern)) {
487  break;
488  }
489  }
490 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
double f[11][100]
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
void HitPattern::clear ( void  )

Definition at line 68 of file HitPattern.cc.

References ARRAY_LENGTH, beginInner, beginOuter, beginTrackHits, EMPTY_PATTERN, endInner, endOuter, endTrackHits, hitCount, and hitPattern.

Referenced by Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), reco::TrackBase::resetHitPattern(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), BeautifulSoup.Tag::setString(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

69 {
70  this->hitCount = 0;
71  this->beginTrackHits = 0;
72  this->endTrackHits = 0;
73  this->beginInner = 0;
74  this->endInner = 0;
75  this->beginOuter = 0;
76  this->endOuter = 0;
77 
78  memset(this->hitPattern, EMPTY_PATTERN, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
79 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
uint8_t endInner
Definition: HitPattern.h:424
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:418
uint8_t beginInner
Definition: HitPattern.h:423
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint8_t hitCount
Definition: HitPattern.h:419
uint8_t beginOuter
Definition: HitPattern.h:425
uint8_t endOuter
Definition: HitPattern.h:426
int reco::HitPattern::countHits ( HitCategory  category,
filterType  filter 
) const
inlineprivate

Definition at line 466 of file HitPattern.h.

References prof2calltree::count, alcazmumu_cfi::filter, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), and i.

Referenced by numberOfBadHits(), numberOfInactiveHits(), numberOfLostHits(), numberOfMuonHits(), numberOfTrackerHits(), and numberOfValidHits().

467 {
468  int count = 0;
469  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
470  for (int i = range.first; i < range.second; ++i) {
472  ++count;
473  }
474  }
475  return count;
476 }
int i
Definition: DBlmapReader.cc:9
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
int reco::HitPattern::countTypedHits ( HitCategory  category,
filterType  typeFilter,
filterType  filter 
) const
inlineprivate

Definition at line 492 of file HitPattern.h.

References prof2calltree::count, alcazmumu_cfi::filter, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), i, and chain::pattern.

Referenced by numberOfBadMuonCSCHits(), numberOfBadMuonDTHits(), numberOfBadMuonHits(), numberOfBadMuonRPCHits(), numberOfInactiveTrackerHits(), numberOfLostMuonCSCHits(), numberOfLostMuonDTHits(), numberOfLostMuonHits(), numberOfLostMuonRPCHits(), numberOfLostPixelBarrelHits(), numberOfLostPixelEndcapHits(), numberOfLostPixelHits(), numberOfLostStripHits(), numberOfLostStripTECHits(), numberOfLostStripTIBHits(), numberOfLostStripTIDHits(), numberOfLostStripTOBHits(), numberOfLostTrackerHits(), numberOfValidMuonCSCHits(), numberOfValidMuonDTHits(), numberOfValidMuonHits(), numberOfValidMuonRPCHits(), numberOfValidPixelBarrelHits(), numberOfValidPixelEndcapHits(), numberOfValidPixelHits(), numberOfValidStripHits(), numberOfValidStripTECHits(), numberOfValidStripTIBHits(), numberOfValidStripTIDHits(), numberOfValidStripTOBHits(), and numberOfValidTrackerHits().

493 {
494  int count = 0;
495  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
496  for (int i = range.first; i < range.second; ++i) {
498  if (typeFilter(pattern) && filter(pattern)) {
499  ++count;
500  }
501  }
502  return count;
503 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
int reco::HitPattern::cscStationsWithAnyHits ( ) const
inline

Definition at line 1025 of file HitPattern.h.

References muonStations().

1026 {
1027  return muonStations(2, -1);
1028 }
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:870
int reco::HitPattern::cscStationsWithBadHits ( ) const
inline

Definition at line 1020 of file HitPattern.h.

References muonStations().

1021 {
1022  return muonStations(2, 3);
1023 }
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:870
int reco::HitPattern::cscStationsWithValidHits ( ) const
inline

Definition at line 1015 of file HitPattern.h.

References muonStations().

1016 {
1017  return muonStations(2, 0);
1018 }
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:870
int reco::HitPattern::dtStationsWithAnyHits ( ) const
inline

Definition at line 1010 of file HitPattern.h.

References muonStations().

1011 {
1012  return muonStations(1, -1);
1013 }
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:870
int reco::HitPattern::dtStationsWithBadHits ( ) const
inline

Definition at line 1005 of file HitPattern.h.

References muonStations().

1006 {
1007  return muonStations(1, 3);
1008 }
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:870
int reco::HitPattern::dtStationsWithValidHits ( ) const
inline

Definition at line 1000 of file HitPattern.h.

References muonStations().

1001 {
1002  return muonStations(1, 0);
1003 }
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:870
uint16_t HitPattern::encode ( const TrackingRecHit hit)
staticprivate

Definition at line 86 of file HitPattern.cc.

References TrackingRecHit::geographicalId(), and TrackingRecHit::getType().

Referenced by appendHit().

87 {
88  return encode(hit.geographicalId(), hit.getType());
89 }
static uint16_t encode(const TrackingRecHit &hit)
Definition: HitPattern.cc:86
Type getType() const
DetId geographicalId() const
uint16_t HitPattern::encode ( const DetId id,
TrackingRecHit::Type  hitType 
)
staticprivate

Definition at line 91 of file HitPattern.cc.

References funct::abs(), MuonSubdetId::CSC, CSCDetId, cond::rpcobgas::detid, PXFDetId::disk(), MuonSubdetId::DT, DTLayerId, EMPTY_PATTERN, HitTypeMask, HitTypeOffset, isStereo(), PXBDetId::layer(), TOBDetId::layer(), TIBDetId::layer(), RPCDetId::layer(), LayerMask, LayerOffset, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, DetId::Muon, chain::pattern, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, RPCDetId::region(), MuonSubdetId::RPC, SideMask, SideOffset, RPCDetId::station(), SubDetectorMask, SubDetectorOffset, SubstrMask, SubstrOffset, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, DetId::Tracker, TIDDetId::wheel(), and TECDetId::wheel().

92 {
94 
95  uint16_t detid = id.det();
96 
97  // adding tracker/muon detector bit
98  pattern |= (detid & SubDetectorMask) << SubDetectorOffset;
99 
100  // adding substructure (PXB, PXF, TIB, TID, TOB, TEC, or DT, CSC, RPC) bits
101  uint16_t subdet = id.subdetId();
102  pattern |= (subdet & SubstrMask) << SubstrOffset;
103 
104  // adding layer/disk/wheel bits
105  uint16_t layer = 0x0;
106  if (detid == DetId::Tracker) {
107  switch (subdet) {
109  layer = PXBDetId(id).layer();
110  break;
112  layer = PXFDetId(id).disk();
113  break;
115  layer = TIBDetId(id).layer();
116  break;
118  layer = TIDDetId(id).wheel();
119  break;
121  layer = TOBDetId(id).layer();
122  break;
124  layer = TECDetId(id).wheel();
125  break;
126  }
127  } else if (detid == DetId::Muon) {
128  switch (subdet) {
129  case MuonSubdetId::DT:
130  layer = ((DTLayerId(id.rawId()).station() - 1) << 2);
131  layer |= DTLayerId(id.rawId()).superLayer();
132  break;
133  case MuonSubdetId::CSC:
134  layer = ((CSCDetId(id.rawId()).station() - 1) << 2);
135  layer |= (CSCDetId(id.rawId()).ring() - 1);
136  break;
137  case MuonSubdetId::RPC:
138  {
139  RPCDetId rpcid(id.rawId());
140  layer = ((rpcid.station() - 1) << 2);
141  layer |= (rpcid.station() <= 2) ? ((rpcid.layer() - 1) << 1) : 0x0;
142  layer |= abs(rpcid.region());
143  }
144  break;
145  }
146  }
147 
148  pattern |= (layer & LayerMask) << LayerOffset;
149 
150  // adding mono/stereo bit
151  uint16_t side = 0x0;
152  if (detid == DetId::Tracker) {
153  side = isStereo(id);
154  } else if (detid == DetId::Muon) {
155  side = 0x0;
156  }
157 
158  pattern |= (side & SideMask) << SideOffset;
159 
160  TrackingRecHit::Type patternHitType = (hitType == TrackingRecHit::missing_inner ||
162 
163  pattern |= (patternHitType & HitTypeMask) << HitTypeOffset;
164 
165  return pattern;
166 }
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
static const unsigned short SideOffset
Definition: HitPattern.h:373
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short SubstrOffset
Definition: HitPattern.h:381
list pattern
Definition: chain.py:104
static const unsigned short HitTypeMask
Definition: HitPattern.h:370
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
static const int CSC
Definition: MuonSubdetId.h:13
static const unsigned short SubDetectorMask
Definition: HitPattern.h:386
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const unsigned short HitTypeOffset
Definition: HitPattern.h:369
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
static const unsigned short SideMask
Definition: HitPattern.h:374
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:385
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
static const unsigned short SubstrMask
Definition: HitPattern.h:382
static const int RPC
Definition: MuonSubdetId.h:14
static uint16_t isStereo(DetId i)
Definition: HitPattern.cc:839
static const unsigned short LayerOffset
Definition: HitPattern.h:377
static const int DT
Definition: MuonSubdetId.h:12
static const unsigned short LayerMask
Definition: HitPattern.h:378
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
std::pair< uint8_t, uint8_t > reco::HitPattern::getCategoryIndexRange ( HitCategory  category) const
inlineprivate

Definition at line 429 of file HitPattern.h.

References beginInner, beginOuter, beginTrackHits, endInner, endOuter, endTrackHits, MISSING_INNER_HITS, MISSING_OUTER_HITS, and TRACK_HITS.

Referenced by call(), countHits(), countTypedHits(), getHitPattern(), getTrackerLayerCase(), getTrackerMonoStereo(), numberOfHits(), numberOfValidStripLayersWithMonoAndStereo(), pixelLayersWithMeasurement(), trackerLayersWithMeasurement(), and trackerLayersWithoutMeasurement().

430 {
431  switch (category) {
432  case TRACK_HITS:
433  return std::pair<uint8_t, uint8_t>(beginTrackHits, endTrackHits);
434  break;
435  case MISSING_INNER_HITS:
436  return std::pair<uint8_t, uint8_t>(beginInner, endInner);
437  break;
438  case MISSING_OUTER_HITS:
439  return std::pair<uint8_t, uint8_t>(beginOuter, endOuter);
440  break;
441  }
442  return std::pair<uint8_t, uint8_t>(-1, -1);
443 }
uint8_t endInner
Definition: HitPattern.h:424
uint8_t beginInner
Definition: HitPattern.h:423
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint8_t beginOuter
Definition: HitPattern.h:425
uint8_t endOuter
Definition: HitPattern.h:426
uint16_t reco::HitPattern::getCSCRing ( uint16_t  pattern)
inlinestatic

CSC ring (1-4). Only valid for muon CSC patterns, of course.

Definition at line 676 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

677 {
678  return (getSubSubStructure(pattern) & 3) + 1;
679 }
list pattern
Definition: chain.py:104
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:629
uint16_t reco::HitPattern::getDTSuperLayer ( uint16_t  pattern)
inlinestatic

DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patterns, of course.

Definition at line 671 of file HitPattern.h.

References getSubSubStructure().

Referenced by numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), and printHitPattern().

672 {
673  return (getSubSubStructure(pattern) & 3);
674 }
list pattern
Definition: chain.py:104
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:629
uint16_t reco::HitPattern::getHitPattern ( HitCategory  category,
int  position 
) const
inline

Definition at line 456 of file HitPattern.h.

References EMPTY_PATTERN, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), and unlikely.

Referenced by CheckHitPattern::analyze(), PFCheckHitPattern::analyze(), FixTrackHitPattern::analyze(), GetTrackTrajInfo::analyze(), GsfElectronAlgo::ElectronData::checkCtfTrack(), OniaPhotonConversionProducer::foundCompatibleInnerHits(), GsfElectronCoreBaseProducer::getCtfTrackRef(), index_to_hitpattern(), PFElecTkProducer::isInnerMost(), FWTrackResidualDetailView::prepareData(), reco::TrackResiduals::print(), CheckHitPattern::print(), PFCheckHitPattern::print(), print(), printHitPattern(), FWConvTrackHitsDetailView::setTextInfo(), TrackMaker::SetVars(), EgAmbiguityTools::sharedDets(), EgAmbiguityTools::sharedHits(), QcdUeDQM::trackSelection(), and SiStripMonitorTrack::trackStudyFromTrack().

457 {
458  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
459  if unlikely((position < 0 || (position + range.first) >= range.second)) {
461  }
462 
463  return getHitPatternByAbsoluteIndex(range.first + position);
464 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
#define unlikely(x)
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static int position[264][3]
Definition: ReadPGInfo.cc:509
uint16_t HitPattern::getHitPatternByAbsoluteIndex ( int  position) const
private

Definition at line 234 of file HitPattern.cc.

References EMPTY_PATTERN, HIT_LENGTH, hitCount, hitPattern, and unlikely.

Referenced by call(), countHits(), countTypedHits(), getHitPattern(), getTrackerLayerCase(), getTrackerMonoStereo(), hasValidHitInFirstPixelBarrel(), hasValidHitInFirstPixelEndcap(), innermostMuonStationWithHits(), muonStations(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), numberOfValidStripLayersWithMonoAndStereo(), outermostMuonStationWithHits(), pixelLayersWithMeasurement(), trackerLayersWithMeasurement(), and trackerLayersWithoutMeasurement().

235 {
236  if unlikely((position < 0 || position >= hitCount)) {
238  }
239  /*
240  Note: you are not taking a consecutive sequence of HIT_LENGTH bits starting from position * HIT_LENGTH
241  as the bit order in the words are reversed.
242  e.g. if position = 0 you take the lowest 10 bits of the first word.
243 
244  I hope this can clarify what is the memory layout of such thing
245 
246  straight 01234567890123456789012345678901 | 23456789012345678901234567890123 | 4567
247  (global) 0 1 2 3 | 3 4 5 6 | 6
248  words [--------------0---------------] | [--------------1---------------] | [---
249  word 01234567890123456789012345678901 | 01234567890123456789012345678901 | 0123
250  (str) 0 1 2 3 | 0 1 2 3 | 0
251  [--------------0---------------] | [--------------1---------------] | [---
252  word 10987654321098765432109876543210 | 10987654321098765432109876543210 | 1098
253  (rev) 32 21 10 0 | 32 21 10 0 | 32
254  reverse 10987654321098765432109876543210 | 32109876543210987654321098765432 | 5432
255  32 21 10 0 | 6 65 54 43 3 9
256 
257  ugly enough, but it's not my fault, I was not even in CMS at that time [gpetrucc]
258  */
259 
260  uint16_t bitEndOffset = (position + 1) * HIT_LENGTH;
261  uint8_t secondWord = (bitEndOffset >> 4);
262  uint8_t secondWordBits = bitEndOffset & (16 - 1); // that is, bitEndOffset % 16
263  if (secondWordBits >= HIT_LENGTH) { // full block is in this word
264  uint8_t lowBitsToTrash = secondWordBits - HIT_LENGTH;
265  uint16_t myResult = (hitPattern[secondWord] >> lowBitsToTrash) & ((1 << HIT_LENGTH) - 1);
266  return myResult;
267  } else {
268  uint8_t firstWordBits = HIT_LENGTH - secondWordBits;
269  uint16_t firstWordBlock = hitPattern[secondWord - 1] >> (16 - firstWordBits);
270  uint16_t secondWordBlock = hitPattern[secondWord] & ((1 << secondWordBits) - 1);
271  uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
272  return myResult;
273  }
274 }
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:157
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
#define unlikely(x)
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:418
uint8_t hitCount
Definition: HitPattern.h:419
static int position[264][3]
Definition: ReadPGInfo.cc:509
uint32_t reco::HitPattern::getHitType ( uint16_t  pattern)
inlinestatic

Definition at line 657 of file HitPattern.h.

References EMPTY_PATTERN, HitTypeMask, HitTypeOffset, NULL_RETURN, and unlikely.

Referenced by FixTrackHitPattern::analyze(), badHitFilter(), inactiveHitFilter(), innermostMuonStationWithHits(), missingHitFilter(), muonStations(), outermostMuonStationWithHits(), CheckHitPattern::print(), PFCheckHitPattern::print(), printHitPattern(), and validHitFilter().

658 {
660  return NULL_RETURN;
661  }
662 
663  return ((pattern >> HitTypeOffset) & HitTypeMask);
664 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
list pattern
Definition: chain.py:104
static const unsigned short HitTypeMask
Definition: HitPattern.h:370
#define unlikely(x)
static const unsigned short HitTypeOffset
Definition: HitPattern.h:369
uint32_t reco::HitPattern::getLayer ( uint16_t  pattern)
inlinestatic
uint16_t reco::HitPattern::getMuonStation ( uint16_t  pattern)
inlinestatic

Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon, of course.

Definition at line 666 of file HitPattern.h.

References getSubSubStructure().

Referenced by innermostMuonStationWithHits(), muonStations(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), outermostMuonStationWithHits(), and printHitPattern().

667 {
668  return (getSubSubStructure(pattern) >> 2) + 1;
669 }
list pattern
Definition: chain.py:104
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:629
uint16_t reco::HitPattern::getRPCLayer ( uint16_t  pattern)
inlinestatic

RPC layer: for station 1 and 2, layer = 1(inner) or 2(outer); for station 3, 4 layer is always 0. Only valid for muon RPC patterns, of course.

Definition at line 681 of file HitPattern.h.

References getSubSubStructure(), and likely.

Referenced by printHitPattern().

682 {
683  uint16_t subSubStructure = getSubSubStructure(pattern);
684  uint16_t stat = subSubStructure >> 2;
685 
686  if likely(stat <= 1) {
687  return ((subSubStructure >> 1) & 1) + 1;
688  }
689 
690  return 0;
691 }
list pattern
Definition: chain.py:104
#define likely(x)
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:629
uint16_t reco::HitPattern::getRPCregion ( uint16_t  pattern)
inlinestatic

RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.

Definition at line 693 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

694 {
695  return getSubSubStructure(pattern) & 1;
696 }
list pattern
Definition: chain.py:104
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:629
uint32_t reco::HitPattern::getSide ( uint16_t  pattern)
inlinestatic

Definition at line 648 of file HitPattern.h.

References EMPTY_PATTERN, NULL_RETURN, SideMask, SideOffset, and unlikely.

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

649 {
651  return NULL_RETURN;
652  }
653 
654  return (pattern >> SideOffset) & SideMask;
655 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const unsigned short SideOffset
Definition: HitPattern.h:373
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
list pattern
Definition: chain.py:104
#define unlikely(x)
static const unsigned short SideMask
Definition: HitPattern.h:374
uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 638 of file HitPattern.h.

References EMPTY_PATTERN, NULL_RETURN, SubDetectorMask, SubDetectorOffset, and unlikely.

639 {
641  return NULL_RETURN;
642  }
643 
644  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
645 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
list pattern
Definition: chain.py:104
#define unlikely(x)
static const unsigned short SubDetectorMask
Definition: HitPattern.h:386
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:385
uint32_t reco::HitPattern::getSubStructure ( uint16_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getSubSubStructure ( uint16_t  pattern)
inlinestatic

Definition at line 629 of file HitPattern.h.

References EMPTY_PATTERN, LayerMask, LayerOffset, NULL_RETURN, and unlikely.

Referenced by getCSCRing(), getDTSuperLayer(), getLayer(), getMuonStation(), getRPCLayer(), getRPCregion(), and numberOfValidStripLayersWithMonoAndStereo().

630 {
632  return NULL_RETURN;
633  }
634 
635  return ((pattern >> LayerOffset) & LayerMask);
636 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
list pattern
Definition: chain.py:104
#define unlikely(x)
static const unsigned short LayerOffset
Definition: HitPattern.h:377
static const unsigned short LayerMask
Definition: HitPattern.h:378
uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 387 of file HitPattern.cc.

References pat::BAD, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, i, LayerMask, LayerOffset, NULL_RETURN, chain::pattern, SubDetectorMask, SubDetectorOffset, SubstrMask, and SubstrOffset.

Referenced by pixelBarrelLayersNull(), pixelBarrelLayersTotallyOffOrBad(), pixelBarrelLayersWithMeasurement(), pixelBarrelLayersWithoutMeasurement(), pixelEndcapLayersNull(), pixelEndcapLayersTotallyOffOrBad(), pixelEndcapLayersWithMeasurement(), pixelEndcapLayersWithoutMeasurement(), stripTECLayersNull(), stripTECLayersTotallyOffOrBad(), stripTECLayersWithMeasurement(), stripTECLayersWithoutMeasurement(), stripTIBLayersNull(), stripTIBLayersTotallyOffOrBad(), stripTIBLayersWithMeasurement(), stripTIBLayersWithoutMeasurement(), stripTIDLayersNull(), stripTIDLayersTotallyOffOrBad(), stripTIDLayersWithMeasurement(), stripTIDLayersWithoutMeasurement(), stripTOBLayersNull(), stripTOBLayersTotallyOffOrBad(), stripTOBLayersWithMeasurement(), and stripTOBLayersWithoutMeasurement().

388 {
389  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
390  + ((substr & SubstrMask) << SubstrOffset)
391  + ((layer & LayerMask) << LayerOffset);
392 
393  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
394  + (SubstrMask << SubstrOffset)
395  + (LayerMask << LayerOffset);
396 
397  // layer case 0: valid + (missing, off, bad) ==> with measurement
398  // layer case 1: missing + (off, bad) ==> without measurement
399  // layer case 2: off, bad ==> totally off or bad, cannot say much
400  // layer case NULL_RETURN: track outside acceptance or in gap ==> null
401  uint32_t layerCase = NULL_RETURN;
402  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
403  for (int i = range.first; i < range.second; ++i) {
405  if ((pattern & mask) == tk_substr_layer) {
406  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
407  if (hitType < layerCase) {
408  // BAD and INACTIVE as the same type (as INACTIVE)
409  layerCase = (hitType == HIT_TYPE::BAD ? HIT_TYPE::INACTIVE : hitType);
410  if (layerCase == HIT_TYPE::VALID) {
411  break;
412  }
413  }
414  }
415  }
416  return layerCase;
417 }
int i
Definition: DBlmapReader.cc:9
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const unsigned short SubstrOffset
Definition: HitPattern.h:381
list pattern
Definition: chain.py:104
static const unsigned short HitTypeMask
Definition: HitPattern.h:370
1: Failed selection (without additional info)
Definition: ParticleCode.h:34
static const unsigned short SubDetectorMask
Definition: HitPattern.h:386
static const unsigned short HitTypeOffset
Definition: HitPattern.h:369
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:385
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static const unsigned short SubstrMask
Definition: HitPattern.h:382
static const unsigned short LayerOffset
Definition: HitPattern.h:377
static const unsigned short LayerMask
Definition: HitPattern.h:378
uint16_t HitPattern::getTrackerMonoStereo ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 419 of file HitPattern.cc.

References getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), getSide(), HitTypeMask, HitTypeOffset, i, LayerMask, LayerOffset, MONO, chain::pattern, STEREO, SubDetectorMask, SubDetectorOffset, SubstrMask, and SubstrOffset.

Referenced by OniaPhotonConversionProducer::foundCompatibleInnerHits().

420 {
421  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
422  + ((substr & SubstrMask) << SubstrOffset)
423  + ((layer & LayerMask) << LayerOffset);
424  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
425  + (SubstrMask << SubstrOffset)
426  + (LayerMask << LayerOffset);
427 
428  // 0: neither a valid mono nor a valid stereo hit
429  // MONO: valid mono hit
430  // STEREO: valid stereo hit
431  // MONO | STEREO: both
432  uint16_t monoStereo = 0x0;
433  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
434  for (int i = range.first; i < range.second; ++i) {
436  if ((pattern & mask) == tk_substr_layer) {
437  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
438  if (hitType == HIT_TYPE::VALID) {
439  switch (getSide(pattern)) {
440  case 0: // mono
441  monoStereo |= MONO;
442  break;
443  case 1: // stereo
444  monoStereo |= STEREO;
445  break;
446  }
447  }
448 
449  if (monoStereo == (MONO | STEREO)) {
450  break;
451  }
452  }
453  }
454  return monoStereo;
455 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short SubstrOffset
Definition: HitPattern.h:381
list pattern
Definition: chain.py:104
static const unsigned short HitTypeMask
Definition: HitPattern.h:370
static const unsigned short SubDetectorMask
Definition: HitPattern.h:386
static const unsigned short HitTypeOffset
Definition: HitPattern.h:369
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:385
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:648
static const unsigned short SubstrMask
Definition: HitPattern.h:382
static const unsigned short LayerOffset
Definition: HitPattern.h:377
static const unsigned short LayerMask
Definition: HitPattern.h:378
bool HitPattern::hasValidHitInFirstPixelBarrel ( ) const

Definition at line 276 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getLayer(), i, chain::pattern, pixelBarrelHitFilter(), and validHitFilter().

Referenced by PackedCandidateTrackValidator::analyze(), TrackClassFilter::operator()(), and pat::PATPackedCandidateProducer::produce().

277 {
278  for (int i = beginTrackHits; i < endTrackHits; ++i) {
280  if (pixelBarrelHitFilter(pattern) && (getLayer(pattern) == 1)
281  && validHitFilter(pattern)) {
282  return true;
283  }
284  }
285  return false;
286 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:624
list pattern
Definition: chain.py:104
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:516
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
bool HitPattern::hasValidHitInFirstPixelEndcap ( ) const

Definition at line 288 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getLayer(), i, chain::pattern, pixelEndcapHitFilter(), and validHitFilter().

289 {
290  for (int i = beginTrackHits; i < endTrackHits; ++i) {
292  if (pixelEndcapHitFilter(pattern) && (getLayer(pattern) == 1)
293  && validHitFilter(pattern)) {
294  return true;
295  }
296  }
297  return false;
298 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:624
list pattern
Definition: chain.py:104
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:526
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
bool reco::HitPattern::inactiveHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1055 of file HitPattern.h.

References innermostMuonStationWithHits().

1056 {
1057  return innermostMuonStationWithHits(-1);
1058 }
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:885
int reco::HitPattern::innermostMuonStationWithBadHits ( ) const
inline

Definition at line 1050 of file HitPattern.h.

References innermostMuonStationWithHits().

1051 {
1052  return innermostMuonStationWithHits(3);
1053 }
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:885
int HitPattern::innermostMuonStationWithHits ( int  hitType) const

hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all

Definition at line 885 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getHitType(), getMuonStation(), i, muonHitFilter(), chain::pattern, and run_regression::ret.

Referenced by innermostMuonStationWithAnyHits(), innermostMuonStationWithBadHits(), and innermostMuonStationWithValidHits().

886 {
887  int ret = 0;
888  for (int i = beginTrackHits; i < endTrackHits; ++i) {
890  if (muonHitFilter(pattern)
891  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
892  int stat = getMuonStation(pattern);
893  if (ret == 0 || stat < ret) {
894  ret = stat;
895  }
896  }
897  }
898 
899  return ret;
900 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:657
uint8_t beginTrackHits
Definition: HitPattern.h:421
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
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:666
int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 1045 of file HitPattern.h.

References innermostMuonStationWithHits().

1046 {
1047  return innermostMuonStationWithHits(0);
1048 }
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:885
bool HitPattern::insertExpectedInnerHit ( const uint16_t  pattern)
private

Definition at line 992 of file HitPattern.cc.

References beginInner, endInner, hitCount, insertHit(), and unlikely.

Referenced by appendHit().

993 {
994  if unlikely((0 == beginInner && 0 == endInner)) {
997  }
998 
1000  endInner++;
1001 
1002  return true;
1003 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:961
list pattern
Definition: chain.py:104
#define unlikely(x)
uint8_t endInner
Definition: HitPattern.h:424
uint8_t beginInner
Definition: HitPattern.h:423
uint8_t hitCount
Definition: HitPattern.h:419
bool HitPattern::insertExpectedOuterHit ( const uint16_t  pattern)
private

Definition at line 1005 of file HitPattern.cc.

References beginOuter, endOuter, hitCount, insertHit(), and unlikely.

Referenced by appendHit().

1006 {
1007  if unlikely((0 == beginOuter && 0 == endOuter)) {
1008  beginOuter = hitCount;
1009  endOuter = beginOuter;
1010  }
1011 
1012  insertHit(pattern);
1013  endOuter++;
1014 
1015  return true;
1016 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:961
list pattern
Definition: chain.py:104
#define unlikely(x)
uint8_t hitCount
Definition: HitPattern.h:419
uint8_t beginOuter
Definition: HitPattern.h:425
uint8_t endOuter
Definition: HitPattern.h:426
void HitPattern::insertHit ( const uint16_t  pattern)
private

Definition at line 961 of file HitPattern.cc.

References HIT_LENGTH, hitCount, hitPattern, i, and hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by insertExpectedInnerHit(), insertExpectedOuterHit(), and insertTrackHit().

962 {
963  int offset = hitCount * HIT_LENGTH;
964  for (int i = 0; i < HIT_LENGTH; i++) {
965  int pos = offset + i;
966  uint16_t bit = (pattern >> i) & 0x1;
967  //equivalent to hitPattern[pos / 16] += bit << ((offset + i) % 16);
968  hitPattern[pos >> 4] += bit << ((offset + i) & (16 - 1));
969  }
970  hitCount++;
971 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:157
list pattern
Definition: chain.py:104
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:418
uint8_t hitCount
Definition: HitPattern.h:419
bool HitPattern::insertTrackHit ( const uint16_t  pattern)
private

Definition at line 973 of file HitPattern.cc.

References beginTrackHits, endTrackHits, hitCount, insertHit(), and unlikely.

Referenced by appendHit().

974 {
975  // if begin is 0, this is the first hit of this type being inserted, so
976  // we need to update begin so it points to the correct index, the first
977  // empty index.
978  // unlikely, because it will happen only when inserting
979  // the first hit of this type
980  if unlikely((0 == beginTrackHits && 0 == endTrackHits)) {
982  // before the first hit of this type is inserted, there are no hits
984  }
985 
987  endTrackHits++;
988 
989  return true;
990 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:961
list pattern
Definition: chain.py:104
#define unlikely(x)
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint8_t hitCount
Definition: HitPattern.h:419
uint16_t HitPattern::isStereo ( DetId  i)
staticprivate

Definition at line 839 of file HitPattern.cc.

References DetId::det(), i, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, and DetId::Tracker.

Referenced by encode().

840 {
841  if (i.det() != DetId::Tracker) {
842  return 0;
843  }
844 
845  switch (i.subdetId()) {
848  return 0;
849  case StripSubdetector::TIB: {
850  TIBDetId id = i;
851  return id.isStereo();
852  }
853  case StripSubdetector::TID: {
854  TIDDetId id = i;
855  return id.isStereo();
856  }
857  case StripSubdetector::TOB: {
858  TOBDetId id = i;
859  return id.isStereo();
860  }
861  case StripSubdetector::TEC: {
862  TECDetId id = i;
863  return id.isStereo();
864  }
865  default:
866  return 0;
867  }
868 }
int i
Definition: DBlmapReader.cc:9
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
bool reco::HitPattern::missingHitFilter ( uint16_t  pattern)
inlinestatic
bool reco::HitPattern::muonCSCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 581 of file HitPattern.h.

References MuonSubdetId::CSC, getSubStructure(), muonHitFilter(), and unlikely.

Referenced by numberOfBadMuonCSCHits(), numberOfLostMuonCSCHits(), numberOfValidMuonCSCHits(), and printHitPattern().

582 {
584  return false;
585  }
586 
587  uint32_t substructure = getSubStructure(pattern);
588  return (substructure == (uint32_t) MuonSubdetId::CSC);
589 }
list pattern
Definition: chain.py:104
#define unlikely(x)
static const int CSC
Definition: MuonSubdetId.h:13
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
bool reco::HitPattern::muonDTHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 571 of file HitPattern.h.

References MuonSubdetId::DT, getSubStructure(), muonHitFilter(), and unlikely.

Referenced by numberOfBadMuonDTHits(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), numberOfLostMuonDTHits(), numberOfValidMuonDTHits(), and printHitPattern().

572 {
574  return false;
575  }
576 
577  uint32_t substructure = getSubStructure(pattern);
578  return (substructure == (uint32_t) MuonSubdetId::DT);
579 }
list pattern
Definition: chain.py:104
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
static const int DT
Definition: MuonSubdetId.h:12
bool reco::HitPattern::muonHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 606 of file HitPattern.h.

References EMPTY_PATTERN, SubDetectorMask, SubDetectorOffset, and unlikely.

Referenced by innermostMuonStationWithHits(), muonCSCHitFilter(), muonDTHitFilter(), muonRPCHitFilter(), muonStations(), numberOfBadMuonHits(), numberOfLostMuonHits(), numberOfMuonHits(), numberOfValidMuonHits(), outermostMuonStationWithHits(), and printHitPattern().

607 {
609  return false;
610  }
611 
612  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 0);
613 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
list pattern
Definition: chain.py:104
#define unlikely(x)
static const unsigned short SubDetectorMask
Definition: HitPattern.h:386
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:385
bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 591 of file HitPattern.h.

References getSubStructure(), muonHitFilter(), MuonSubdetId::RPC, and unlikely.

Referenced by numberOfBadMuonRPCHits(), numberOfLostMuonRPCHits(), numberOfValidMuonRPCHits(), and printHitPattern().

592 {
594  return false;
595  }
596 
597  uint32_t substructure = getSubStructure(pattern);
598  return (substructure == (uint32_t) MuonSubdetId::RPC);
599 }
list pattern
Definition: chain.py:104
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
static const int RPC
Definition: MuonSubdetId.h:14
int HitPattern::muonStations ( int  subdet,
int  hitType 
) const

subdet = 0(all), 1(DT), 2(CSC), 3(RPC); hitType=-1(all), 0=valid, 3=bad

Definition at line 870 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getHitType(), getMuonStation(), getSubStructure(), i, muonHitFilter(), chain::pattern, and mergeVDriftHistosByStation::stations.

Referenced by cscStationsWithAnyHits(), cscStationsWithBadHits(), cscStationsWithValidHits(), dtStationsWithAnyHits(), dtStationsWithBadHits(), dtStationsWithValidHits(), muonStationsWithAnyHits(), muonStationsWithBadHits(), muonStationsWithValidHits(), rpcStationsWithAnyHits(), rpcStationsWithBadHits(), and rpcStationsWithValidHits().

871 {
872  int stations[4] = {0, 0, 0, 0};
873  for (int i = beginTrackHits; i < endTrackHits; ++i) {
875  if (muonHitFilter(pattern)
876  && (subdet == 0 || int(getSubStructure(pattern)) == subdet)
877  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
878  stations[getMuonStation(pattern) - 1] = 1;
879  }
880  }
881 
882  return stations[0] + stations[1] + stations[2] + stations[3];
883 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:657
uint8_t beginTrackHits
Definition: HitPattern.h:421
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
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:666
int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 995 of file HitPattern.h.

References muonStations().

996 {
997  return muonStations(0, -1);
998 }
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:870
int reco::HitPattern::muonStationsWithBadHits ( ) const
inline

Definition at line 990 of file HitPattern.h.

References muonStations().

991 {
992  return muonStations(0, 3);
993 }
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:870
int reco::HitPattern::muonStationsWithValidHits ( ) const
inline

Definition at line 985 of file HitPattern.h.

References muonStations().

986 {
987  return muonStations(0, 0);
988 }
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:870
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 874 of file HitPattern.h.

References badHitFilter(), countHits(), and TRACK_HITS.

875 {
877 }
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:713
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:466
int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 889 of file HitPattern.h.

References countTypedHits(), inactiveHitFilter(), muonCSCHitFilter(), and TRACK_HITS.

890 {
892 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:708
int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 884 of file HitPattern.h.

References countTypedHits(), inactiveHitFilter(), muonDTHitFilter(), and TRACK_HITS.

885 {
887 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:708
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:571
int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 879 of file HitPattern.h.

References countTypedHits(), inactiveHitFilter(), muonHitFilter(), and TRACK_HITS.

880 {
882 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:708
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 894 of file HitPattern.h.

References countTypedHits(), inactiveHitFilter(), muonRPCHitFilter(), and TRACK_HITS.

895 {
897 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:708
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:591
int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 945 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getDTSuperLayer(), getHitPatternByAbsoluteIndex(), getMuonStation(), i, muonDTHitFilter(), chain::pattern, mergeVDriftHistosByStation::stations, and validHitFilter().

946 {
947  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
948  for (int i = beginTrackHits; i < endTrackHits; ++i) {
950  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
951  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
952  }
953  }
954 
955  return stations[0][0] * stations[0][1]
956  + stations[1][0] * stations[1][1]
957  + stations[2][0] * stations[2][1]
958  + stations[3][0] * stations[3][1];
959 }
int i
Definition: DBlmapReader.cc:9
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:671
list pattern
Definition: chain.py:104
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:571
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:666
int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 918 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getDTSuperLayer(), getHitPatternByAbsoluteIndex(), getMuonStation(), i, muonDTHitFilter(), chain::pattern, mergeVDriftHistosByStation::stations, and validHitFilter().

919 {
920  int stations[4] = {0, 0, 0, 0};
921  for (int i = beginTrackHits; i < endTrackHits; ++i) {
923 
924  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
925  && getDTSuperLayer(pattern) != 2) {
926  stations[getMuonStation(pattern) - 1] = 1;
927  }
928  }
929  return stations[0] + stations[1] + stations[2] + stations[3];
930 }
int i
Definition: DBlmapReader.cc:9
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:671
list pattern
Definition: chain.py:104
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:571
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:666
int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 932 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getDTSuperLayer(), getHitPatternByAbsoluteIndex(), getMuonStation(), i, muonDTHitFilter(), chain::pattern, mergeVDriftHistosByStation::stations, and validHitFilter().

933 {
934  int stations[4] = {0, 0, 0, 0};
935  for (int i = beginTrackHits; i < endTrackHits; ++i) {
937  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
938  && getDTSuperLayer(pattern) == 2) {
939  stations[getMuonStation(pattern) - 1] = 1;
940  }
941  }
942  return stations[0] + stations[1] + stations[2] + stations[3];
943 }
int i
Definition: DBlmapReader.cc:9
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:671
list pattern
Definition: chain.py:104
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:571
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:666
int reco::HitPattern::numberOfHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 899 of file HitPattern.h.

References countHits(), inactiveHitFilter(), and TRACK_HITS.

900 {
902 }
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:708
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:466
int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 904 of file HitPattern.h.

References countTypedHits(), inactiveHitFilter(), TRACK_HITS, and trackerHitFilter().

905 {
907 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:708
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
int reco::HitPattern::numberOfLostHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 864 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), muonCSCHitFilter(), and TRACK_HITS.

865 {
867 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 859 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), muonDTHitFilter(), and TRACK_HITS.

860 {
862 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:571
int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 814 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), muonHitFilter(), and TRACK_HITS.

815 {
817 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 869 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), muonRPCHitFilter(), and TRACK_HITS.

870 {
872 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:591
int reco::HitPattern::numberOfLostPixelBarrelHits ( HitCategory  category) const
inline

Definition at line 824 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and pixelBarrelHitFilter().

825 {
827 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:516
int reco::HitPattern::numberOfLostPixelEndcapHits ( HitCategory  category) const
inline

Definition at line 829 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and pixelEndcapHitFilter().

830 {
832 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:526
int reco::HitPattern::numberOfLostPixelHits ( HitCategory  category) const
inline

Definition at line 819 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and pixelHitFilter().

820 {
822 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:505
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
int reco::HitPattern::numberOfLostStripHits ( HitCategory  category) const
inline

Definition at line 834 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and stripHitFilter().

835 {
837 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:536
int reco::HitPattern::numberOfLostStripTECHits ( HitCategory  category) const
inline

Definition at line 854 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and stripTECHitFilter().

855 {
857 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:566
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
int reco::HitPattern::numberOfLostStripTIBHits ( HitCategory  category) const
inline

Definition at line 839 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and stripTIBHitFilter().

840 {
842 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:551
int reco::HitPattern::numberOfLostStripTIDHits ( HitCategory  category) const
inline

Definition at line 844 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and stripTIDHitFilter().

845 {
847 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:556
int reco::HitPattern::numberOfLostStripTOBHits ( HitCategory  category) const
inline

Definition at line 849 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and stripTOBHitFilter().

850 {
852 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:561
int reco::HitPattern::numberOfLostTrackerHits ( HitCategory  category) const
inline

Definition at line 809 of file HitPattern.h.

References countTypedHits(), missingHitFilter(), and trackerHitFilter().

Referenced by MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), MultiTrackSelector::select(), HIMultiTrackSelector::select(), and reco::TrackBase::validFraction().

810 {
812 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:703
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 729 of file HitPattern.h.

References countHits(), muonHitFilter(), and TRACK_HITS.

730 {
732 }
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:466
int reco::HitPattern::numberOfTrackerHits ( HitCategory  category) const
inline

Definition at line 724 of file HitPattern.h.

References countHits(), and trackerHitFilter().

725 {
727 }
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:466
int reco::HitPattern::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 794 of file HitPattern.h.

References countTypedHits(), muonCSCHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by MuonTrackValidator::analyze().

795 {
797 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 789 of file HitPattern.h.

References countTypedHits(), muonDTHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by MuonTrackValidator::analyze().

790 {
792 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:571
int reco::HitPattern::numberOfValidMuonHits ( ) const
inline

Definition at line 744 of file HitPattern.h.

References countTypedHits(), muonHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by HLTMuonL3PreFilter::hltFilter(), BPhysicsOniaDQM::selGlobalMuon(), MuScleFitMuonSelector::selGlobalMuon(), and MuScleFit::selGlobalMuon().

745 {
747 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 799 of file HitPattern.h.

References countTypedHits(), muonRPCHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by MuonTrackValidator::analyze().

800 {
802 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:591
int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelHits ( ) const
inline

Definition at line 749 of file HitPattern.h.

References countTypedHits(), pixelHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by PackedCandidateTrackValidator::analyze(), TrackTypeMonitor::analyze(), StandaloneTrackMonitor::analyze(), CheckHitPattern::analyze(), IPTagPlotter< Container, Base >::analyzeTag(), PFRecoTauDiscriminationByHPSSelection::discriminate(), ZtoMMEventSelector::filter(), ZtoEEEventSelector::filter(), WtoLNuSelector::filter(), reco::tau::RecoTauQualityCuts::filterTrack_(), HLTTrackWithHits::hltFilter(), reco::TrackSelector::operator()(), TrackClassFilter::operator()(), RecoTrackSelectorBase::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), reco::tau::RecoTauPiZeroStripPlugin3::operator()(), pat::PATLostTracks::produce(), TrackListMerger::produce(), IPProducer< Container, Base, Helper >::produce(), pat::PackedCandidate::setTrackProperties(), TrackMaker::SetVars(), TrackWithVertexSelector::testTrack(), TrackVertexArbitration< VTX >::trackFilterArbitrator(), and reco::tau::qcuts::trkPixelHits().

750 {
752 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:505
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
int reco::HitPattern::numberOfValidStripHits ( ) const
inline

Definition at line 764 of file HitPattern.h.

References countTypedHits(), stripHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by TrackTypeMonitor::analyze(), StandaloneTrackMonitor::analyze(), ZtoMMEventSelector::filter(), ZtoEEEventSelector::filter(), and WtoLNuSelector::filter().

765 {
767 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:536
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

Definition at line 300 of file HitPattern.cc.

References beginTrackHits, prof2calltree::count, endTrackHits, getHitPatternByAbsoluteIndex(), getLayer(), getSide(), getSubStructure(), getSubSubStructure(), i, j, LayerMask, chain::pattern, stripHitFilter(), SubstrMask, and validHitFilter().

Referenced by MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), RecoTrackSelectorBase::operator()(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), CosmicTrackSelector::select(), MultiTrackSelector::select(), HIMultiTrackSelector::select(), and QcdUeDQM::trackSelection().

301 {
302  bool hasMono[SubstrMask + 1][LayerMask + 1];
303  bool hasStereo[SubstrMask + 1][LayerMask + 1];
304  memset(hasMono, 0, sizeof(hasMono));
305  memset(hasStereo, 0, sizeof(hasStereo));
306 
307  // mark which layers have mono/stereo hits
308  for (int i = beginTrackHits; i < endTrackHits; ++i) {
310  uint16_t subStructure = getSubStructure(pattern);
311 
312  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
313  if (stripdet != 0 && subStructure != stripdet) {
314  continue;
315  }
316 
317  if (layer != 0 && getSubSubStructure(pattern) != layer) {
318  continue;
319  }
320 
321  switch (getSide(pattern)) {
322  case 0: // mono
323  hasMono[subStructure][getLayer(pattern)] = true;
324  break;
325  case 1: // stereo
326  hasStereo[subStructure][getLayer(pattern)] = true;
327  break;
328  default:
329  ;
330  break;
331  }
332  }
333  }
334 
335  // count how many layers have mono and stereo hits
336  int count = 0;
337  for (int i = 0; i < SubstrMask + 1; ++i) {
338  for (int j = 0; j < LayerMask + 1; ++j) {
339  if (hasMono[i][j] && hasStereo[i][j]) {
340  count++;
341  }
342  }
343  }
344  return count;
345 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:624
list pattern
Definition: chain.py:104
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:536
int j
Definition: DBlmapReader.cc:9
uint8_t beginTrackHits
Definition: HitPattern.h:421
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:648
static const unsigned short SubstrMask
Definition: HitPattern.h:382
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:629
static const unsigned short LayerMask
Definition: HitPattern.h:378
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( ) const

Definition at line 347 of file HitPattern.cc.

References python.rootplot.argparse::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), getSide(), HitTypeMask, HitTypeOffset, i, LayerOffset, minStripWord, minTrackerWord, chain::pattern, and TRACK_HITS.

Referenced by numberOfValidTECLayersWithMonoAndStereo(), numberOfValidTIBLayersWithMonoAndStereo(), numberOfValidTIDLayersWithMonoAndStereo(), and numberOfValidTOBLayersWithMonoAndStereo().

348 {
349  auto category = TRACK_HITS;
350  std::bitset<128> side[2];
351  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
352  for (int i = range.first; i < range.second; ++i) {
354  if (pattern<minStripWord) continue;
355  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
356  if (hitType != HIT_TYPE::VALID) continue;
357  auto apattern = (pattern-minTrackerWord) >> LayerOffset;
358  // assert(apattern<128);
359  side[getSide(pattern)].set(apattern);
360  }
361  // assert(numberOfValidStripLayersWithMonoAndStereo(0, 0)==int((side[0]&side[1]).count()));
362  return (side[0]&side[1]).count();
363 
364 
365 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
static const unsigned short HitTypeMask
Definition: HitPattern.h:370
static const unsigned short minTrackerWord
Definition: HitPattern.h:388
static const unsigned short HitTypeOffset
Definition: HitPattern.h:369
static const unsigned short minStripWord
Definition: HitPattern.h:390
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:648
static const unsigned short LayerOffset
Definition: HitPattern.h:377
int reco::HitPattern::numberOfValidStripTECHits ( ) const
inline

Definition at line 784 of file HitPattern.h.

References countTypedHits(), stripTECHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by PatTrackAnalyzer::analyze(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), TrackAnalyzer::fillHistosForTrackerSpecific(), and HIPAlignmentAlgorithm::run().

785 {
787 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:566
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline

Definition at line 769 of file HitPattern.h.

References countTypedHits(), stripTIBHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by PatTrackAnalyzer::analyze(), CheckHitPattern::analyze(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), TrackAnalyzer::fillHistosForTrackerSpecific(), and HIPAlignmentAlgorithm::run().

770 {
772 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:551
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 774 of file HitPattern.h.

References countTypedHits(), stripTIDHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by PatTrackAnalyzer::analyze(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), TrackAnalyzer::fillHistosForTrackerSpecific(), and HIPAlignmentAlgorithm::run().

775 {
777 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:556
int reco::HitPattern::numberOfValidStripTOBHits ( ) const
inline

Definition at line 779 of file HitPattern.h.

References countTypedHits(), stripTOBHitFilter(), TRACK_HITS, and validHitFilter().

Referenced by PatTrackAnalyzer::analyze(), CheckHitPattern::analyze(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), TrackAnalyzer::fillHistosForTrackerSpecific(), and HIPAlignmentAlgorithm::run().

780 {
782 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:492
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:561
int HitPattern::numberOfValidTECLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int HitPattern::numberOfValidTIBLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int HitPattern::numberOfValidTIDLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int HitPattern::numberOfValidTOBLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int reco::HitPattern::numberOfValidTrackerHits ( ) const
inline
HitPattern & HitPattern::operator= ( const HitPattern other)

Definition at line 46 of file HitPattern.cc.

References ARRAY_LENGTH, beginInner, beginOuter, beginTrackHits, endInner, endOuter, endTrackHits, hitCount, and hitPattern.

47 {
48  if (this == &other) {
49  return *this;
50  }
51 
52  this->hitCount = other.hitCount;
53 
54  this->beginTrackHits = other.beginTrackHits;
55  this->endTrackHits = other.endTrackHits;
56 
57  this->beginInner = other.beginInner;
58  this->endInner = other.endInner;
59 
60  this->beginOuter = other.beginOuter;
61  this->endOuter = other.endOuter;
62 
63  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
64 
65  return *this;
66 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
uint8_t endInner
Definition: HitPattern.h:424
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:418
uint8_t beginInner
Definition: HitPattern.h:423
uint8_t beginTrackHits
Definition: HitPattern.h:421
uint8_t endTrackHits
Definition: HitPattern.h:422
uint8_t hitCount
Definition: HitPattern.h:419
uint8_t beginOuter
Definition: HitPattern.h:425
uint8_t endOuter
Definition: HitPattern.h:426
int reco::HitPattern::outermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1070 of file HitPattern.h.

References outermostMuonStationWithHits().

1071 {
1072  return outermostMuonStationWithHits(-1);
1073 }
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:902
int reco::HitPattern::outermostMuonStationWithBadHits ( ) const
inline

Definition at line 1065 of file HitPattern.h.

References outermostMuonStationWithHits().

1066 {
1067  return outermostMuonStationWithHits(3);
1068 }
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:902
int HitPattern::outermostMuonStationWithHits ( int  hitType) const

hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all

Definition at line 902 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getHitType(), getMuonStation(), i, muonHitFilter(), chain::pattern, and run_regression::ret.

Referenced by outermostMuonStationWithAnyHits(), outermostMuonStationWithBadHits(), and outermostMuonStationWithValidHits().

903 {
904  int ret = 0;
905  for (int i = beginTrackHits; i < endTrackHits; ++i) {
907  if (muonHitFilter(pattern) &&
908  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
909  int stat = getMuonStation(pattern);
910  if (ret == 0 || stat > ret) {
911  ret = stat;
912  }
913  }
914  }
915  return ret;
916 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:657
uint8_t beginTrackHits
Definition: HitPattern.h:421
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
uint8_t endTrackHits
Definition: HitPattern.h:422
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
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:666
int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 1060 of file HitPattern.h.

References outermostMuonStationWithHits().

1061 {
1062  return outermostMuonStationWithHits(0);
1063 }
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:902
bool reco::HitPattern::pixelBarrelHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 516 of file HitPattern.h.

References getSubStructure(), PixelSubdetector::PixelBarrel, trackerHitFilter(), and unlikely.

Referenced by hasValidHitInFirstPixelBarrel(), numberOfLostPixelBarrelHits(), numberOfValidPixelBarrelHits(), and SiStripMonitorTrack::trackStudyFromTrack().

517 {
519  return false;
520  }
521 
522  uint32_t substructure = getSubStructure(pattern);
523  return (substructure == PixelSubdetector::PixelBarrel);
524 }
list pattern
Definition: chain.py:104
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 723 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), NULL_RETURN, PixelSubdetector::PixelBarrel, and TRACK_HITS.

Referenced by pixelLayersNull().

724 {
725  int count = 0;
726  uint16_t NPixBarrel = 4;
727  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
729  count++;
730  }
731  }
732  return count;
733 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::pixelBarrelLayersTotallyOffOrBad ( ) const

Definition at line 654 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), PixelSubdetector::PixelBarrel, and TRACK_HITS.

Referenced by pixelLayersTotallyOffOrBad().

655 {
656  int count = 0;
657  uint16_t NPixBarrel = 4;
658  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
659  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::INACTIVE) {
660  count++;
661  }
662  }
663  return count;
664 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::pixelBarrelLayersWithMeasurement ( ) const

Definition at line 517 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), PixelSubdetector::PixelBarrel, and TRACK_HITS.

Referenced by TrackAnalyzer::fillHistosForTrackerSpecific(), pixelLayersWithMeasurementOld(), IsolatedTracksNxN::printTrack(), and BeamFitter::readEvent().

518 {
519  int count = 0;
520  uint16_t NPixBarrel = 4;
521  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
522  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::VALID) {
523  count++;
524  }
525  }
526  return count;
527 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::pixelBarrelLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 585 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), and PixelSubdetector::PixelBarrel.

Referenced by pixelLayersWithoutMeasurement().

586 {
587  int count = 0;
588  uint16_t NPixBarrel = 4;
589  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
590  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::MISSING) {
591  count++;
592  }
593  }
594  return count;
595 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
bool reco::HitPattern::pixelEndcapHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 526 of file HitPattern.h.

References getSubStructure(), PixelSubdetector::PixelEndcap, trackerHitFilter(), and unlikely.

Referenced by hasValidHitInFirstPixelEndcap(), numberOfLostPixelEndcapHits(), and numberOfValidPixelEndcapHits().

527 {
529  return false;
530  }
531 
532  uint32_t substructure = getSubStructure(pattern);
533  return (substructure == PixelSubdetector::PixelEndcap);
534 }
list pattern
Definition: chain.py:104
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 735 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), NULL_RETURN, PixelSubdetector::PixelEndcap, and TRACK_HITS.

Referenced by pixelLayersNull().

736 {
737  int count = 0;
738  uint16_t NPixForward = 3;
739  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
741  count++;
742  }
743  }
744  return count;
745 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::pixelEndcapLayersTotallyOffOrBad ( ) const

Definition at line 666 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), PixelSubdetector::PixelEndcap, and TRACK_HITS.

Referenced by pixelLayersTotallyOffOrBad().

667 {
668  int count = 0;
669  uint16_t NPixForward = 3;
670  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
671  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::INACTIVE) {
672  count++;
673  }
674  }
675  return count;
676 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::pixelEndcapLayersWithMeasurement ( ) const

Definition at line 529 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), PixelSubdetector::PixelEndcap, and TRACK_HITS.

Referenced by TrackAnalyzer::fillHistosForTrackerSpecific(), pixelLayersWithMeasurementOld(), IsolatedTracksNxN::printTrack(), and BeamFitter::readEvent().

530 {
531  int count = 0;
532  uint16_t NPixForward = 3;
533  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
534  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::VALID) {
535  count++;
536  }
537  }
538  return count;
539 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::pixelEndcapLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 597 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), and PixelSubdetector::PixelEndcap.

Referenced by pixelLayersWithoutMeasurement().

598 {
599  int count = 0;
600  uint16_t NPixForward = 3;
601  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
602  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::MISSING) {
603  count++;
604  }
605  }
606  return count;
607 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
bool reco::HitPattern::pixelHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 505 of file HitPattern.h.

References getSubStructure(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, trackerHitFilter(), and unlikely.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef(), numberOfLostPixelHits(), numberOfValidPixelHits(), FWConvTrackHitsDetailView::setTextInfo(), TrackMaker::SetVars(), and QcdUeDQM::trackSelection().

506 {
508  return false;
509  }
510 
511  uint32_t substructure = getSubStructure(pattern);
512  return (substructure == PixelSubdetector::PixelBarrel ||
513  substructure == PixelSubdetector::PixelEndcap);
514 }
list pattern
Definition: chain.py:104
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 971 of file HitPattern.h.

References pixelBarrelLayersNull(), and pixelEndcapLayersNull().

Referenced by trackerLayersNull().

972 {
973  return pixelBarrelLayersNull() +
975 }
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:723
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:735
int reco::HitPattern::pixelLayersTotallyOffOrBad ( ) const
inline

Definition at line 951 of file HitPattern.h.

References pixelBarrelLayersTotallyOffOrBad(), and pixelEndcapLayersTotallyOffOrBad().

Referenced by trackerLayersTotallyOffOrBad().

952 {
955 }
int pixelBarrelLayersTotallyOffOrBad() const
Definition: HitPattern.cc:654
int pixelEndcapLayersTotallyOffOrBad() const
Definition: HitPattern.cc:666
int HitPattern::pixelLayersWithMeasurement ( ) const

Definition at line 458 of file HitPattern.cc.

References python.rootplot.argparse::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, i, LayerOffset, minStripWord, minTrackerWord, chain::pattern, TRACK_HITS, trackerHitFilter(), and unlikely.

Referenced by StandaloneTrackMonitor::analyze(), MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), TrackFilterForPVFinding::operator()(), GhostTrackComputer::operator()(), RecoTrackSelectorBase::operator()(), IsolatedTracksNxN::printTrack(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), BeamFitter::readEvent(), CosmicTrackSelector::select(), MultiTrackSelector::select(), HIMultiTrackSelector::select(), BPhysicsOniaDQM::selGlobalMuon(), MuScleFitMuonSelector::selGlobalMuon(), MuScleFit::selGlobalMuon(), BPhysicsOniaDQM::selTrackerMuon(), MuScleFitMuonSelector::selTrackerMuon(), MuScleFit::selTrackerMuon(), trackerLayersWithMeasurementOld(), and QcdUeDQM::trackSelection().

458  {
459  auto category = TRACK_HITS;
460  std::bitset<128> layerOk;
461  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
462  for (int i = range.first; i < range.second; ++i) {
464  if unlikely(!trackerHitFilter(pattern)) continue;
465  if (pattern>minStripWord) continue;
466  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
467  if (hitType != HIT_TYPE::VALID) continue;
469  // assert(pattern<128);
470  layerOk.set(pattern);
471  }
472  // assert(pixelLayersWithMeasurementOld()==int(layerOk.count()));
473  return layerOk.count();
474 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
static const unsigned short HitTypeMask
Definition: HitPattern.h:370
return((rh^lh)&mask)
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:388
static const unsigned short HitTypeOffset
Definition: HitPattern.h:369
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
static const unsigned short minStripWord
Definition: HitPattern.h:390
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static const unsigned short LayerOffset
Definition: HitPattern.h:377
if(conf.exists("allCellsPositionCalc"))
int reco::HitPattern::pixelLayersWithMeasurementOld ( ) const
inline

Definition at line 914 of file HitPattern.h.

References pixelBarrelLayersWithMeasurement(), and pixelEndcapLayersWithMeasurement().

915 {
917 }
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:529
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:517
int reco::HitPattern::pixelLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 931 of file HitPattern.h.

References pixelBarrelLayersWithoutMeasurement(), and pixelEndcapLayersWithoutMeasurement().

Referenced by trackerLayersWithoutMeasurementOld().

932 {
935 }
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:585
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:597
void HitPattern::print ( HitCategory  category,
std::ostream &  stream = std::cout 
) const

Definition at line 822 of file HitPattern.cc.

References flags, getHitPattern(), i, numberOfHits(), and printHitPattern().

823 {
824  stream << "HitPattern" << std::endl;
825  for (int i = 0; i < numberOfHits(category); ++i) {
826  printHitPattern(category, i, stream);
827  }
828  std::ios_base::fmtflags flags = stream.flags();
829  stream.setf(std::ios_base::hex, std::ios_base::basefield);
830  stream.setf(std::ios_base::showbase);
831 
832  for (int i = 0; i < this->numberOfHits(category); ++i) {
833  stream << getHitPattern(category, i) << std::endl;
834  }
835 
836  stream.flags(flags);
837 }
int i
Definition: DBlmapReader.cc:9
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:791
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:456
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:718
void HitPattern::printHitPattern ( HitCategory  category,
int  position,
std::ostream &  stream 
) const

Definition at line 791 of file HitPattern.cc.

References getCSCRing(), getDTSuperLayer(), getHitPattern(), getHitType(), getLayer(), getMuonStation(), getRPCLayer(), getRPCregion(), getSubStructure(), muonCSCHitFilter(), muonDTHitFilter(), muonHitFilter(), muonRPCHitFilter(), chain::pattern, and trackerHitFilter().

Referenced by spr::goodTrack(), print(), IsolatedTracksCone::printTrack(), and IsolatedTracksNxN::printTrack().

792 {
793  uint16_t pattern = getHitPattern(category, position);
794  stream << "\t";
795  if (muonHitFilter(pattern)) {
796  stream << "muon";
797  } else if (trackerHitFilter(pattern)) {
798  stream << "tracker";
799  }
800 
801  stream << "\tsubstructure " << getSubStructure(pattern);
802  if (muonHitFilter(pattern)) {
803  stream << "\tstation " << getMuonStation(pattern);
804  if (muonDTHitFilter(pattern)) {
805  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
806  } else if (muonCSCHitFilter(pattern)) {
807  stream << "\tcsc ring " << getCSCRing(pattern);
808  } else if (muonRPCHitFilter(pattern)) {
809  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel")
810  << ", layer " << getRPCLayer(pattern);
811  } else {
812  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure "
813  << getSubStructure(pattern);
814  }
815  } else {
816  stream << "\tlayer " << getLayer(pattern);
817  }
818  stream << "\thit type " << getHitType(pattern);
819  stream << std::endl;
820 }
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:676
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:624
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:671
list pattern
Definition: chain.py:104
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:657
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:693
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:606
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:571
static int position[264][3]
Definition: ReadPGInfo.cc:509
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:681
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:666
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:456
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:591
int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 1040 of file HitPattern.h.

References muonStations().

1041 {
1042  return muonStations(3, -1);
1043 }
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:870
int reco::HitPattern::rpcStationsWithBadHits ( ) const
inline

Definition at line 1035 of file HitPattern.h.

References muonStations().

1036 {
1037  return muonStations(3, 3);
1038 }
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:870
int reco::HitPattern::rpcStationsWithValidHits ( ) const
inline

Definition at line 1030 of file HitPattern.h.

References muonStations().

1031 {
1032  return muonStations(3, 0);
1033 }
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:870
bool reco::HitPattern::stripHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 536 of file HitPattern.h.

References minStripWord.

Referenced by numberOfLostStripHits(), numberOfValidStripHits(), numberOfValidStripLayersWithMonoAndStereo(), FWConvTrackHitsDetailView::setTextInfo(), and TrackMaker::SetVars().

537 {
538  return pattern > minStripWord;
539 }
list pattern
Definition: chain.py:104
static const unsigned short minStripWord
Definition: HitPattern.h:390
int reco::HitPattern::stripLayersNull ( ) const
inline

Definition at line 977 of file HitPattern.h.

References stripTECLayersNull(), stripTIBLayersNull(), stripTIDLayersNull(), and stripTOBLayersNull().

Referenced by trackerLayersNull().

978 {
979  return stripTIBLayersNull() +
983 }
int stripTIBLayersNull() const
Definition: HitPattern.cc:747
int stripTECLayersNull() const
Definition: HitPattern.cc:780
int stripTIDLayersNull() const
Definition: HitPattern.cc:758
int stripTOBLayersNull() const
Definition: HitPattern.cc:769
int reco::HitPattern::stripLayersTotallyOffOrBad ( ) const
inline
int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline
int reco::HitPattern::stripLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 937 of file HitPattern.h.

References stripTECLayersWithoutMeasurement(), stripTIBLayersWithoutMeasurement(), stripTIDLayersWithoutMeasurement(), and stripTOBLayersWithoutMeasurement().

Referenced by trackerLayersWithoutMeasurementOld().

938 {
943 }
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:631
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:620
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:642
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:609
bool reco::HitPattern::stripSubdetectorHitFilter ( uint16_t  pattern,
StripSubdetector::SubDetector  substructure 
)
inlinestaticprivate

Definition at line 542 of file HitPattern.h.

References getSubStructure(), trackerHitFilter(), and unlikely.

Referenced by stripTECHitFilter(), stripTIBHitFilter(), stripTIDHitFilter(), and stripTOBHitFilter().

543 {
545  return false;
546  }
547 
548  return substructure == getSubStructure(pattern);
549 }
list pattern
Definition: chain.py:104
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:615
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
bool reco::HitPattern::stripTECHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 566 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TEC.

Referenced by numberOfLostStripTECHits(), and numberOfValidStripTECHits().

567 {
569 }
list pattern
Definition: chain.py:104
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:542
int HitPattern::stripTECLayersNull ( ) const

Definition at line 780 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), NULL_RETURN, StripSubdetector::TEC, and TRACK_HITS.

Referenced by stripLayersNull().

781 {
782  int count = 0;
783  for (uint16_t layer = 1; layer <= 9; layer++) {
785  count++;
786  }
787  }
788  return count;
789 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTECLayersTotallyOffOrBad ( ) const

Definition at line 712 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), StripSubdetector::TEC, and TRACK_HITS.

Referenced by stripLayersTotallyOffOrBad().

713 {
714  int count = 0;
715  for (uint16_t layer = 1; layer <= 9; layer++) {
716  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::INACTIVE) {
717  count++;
718  }
719  }
720  return count;
721 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTECLayersWithMeasurement ( ) const

Definition at line 574 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), StripSubdetector::TEC, and TRACK_HITS.

Referenced by IsolatedTracksNxN::analyze(), TrackAnalyzer::fillHistosForTrackerSpecific(), spr::goodTrack(), IsolatedTracksNxN::printTrack(), BeamFitter::readEvent(), and stripLayersWithMeasurement().

575 {
576  int count = 0;
577  for (uint16_t layer = 1; layer <= 9; layer++) {
578  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::VALID) {
579  count++;
580  }
581  }
582  return count;
583 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTECLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 642 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), and StripSubdetector::TEC.

Referenced by IsolatedTracksNxN::analyze(), and stripLayersWithoutMeasurement().

643 {
644  int count = 0;
645  for (uint16_t layer = 1; layer <= 9; layer++) {
646  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::MISSING) {
647  count++;
648  }
649  }
650  return count;
651 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
bool reco::HitPattern::stripTIBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 551 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TIB.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef(), numberOfLostStripTIBHits(), and numberOfValidStripTIBHits().

552 {
554 }
list pattern
Definition: chain.py:104
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:542
int HitPattern::stripTIBLayersNull ( ) const

Definition at line 747 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), NULL_RETURN, StripSubdetector::TIB, and TRACK_HITS.

Referenced by stripLayersNull().

748 {
749  int count = 0;
750  for (uint16_t layer = 1; layer <= 4; layer++) {
752  count++;
753  }
754  }
755  return count;
756 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTIBLayersTotallyOffOrBad ( ) const

Definition at line 678 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), StripSubdetector::TIB, and TRACK_HITS.

Referenced by stripLayersTotallyOffOrBad().

679 {
680  int count = 0;
681  for (uint16_t layer = 1; layer <= 4; layer++) {
682  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::INACTIVE) {
683  count++;
684  }
685  }
686  return count;
687 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTIBLayersWithMeasurement ( ) const

Definition at line 541 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), StripSubdetector::TIB, and TRACK_HITS.

Referenced by IsolatedTracksNxN::analyze(), TrackAnalyzer::fillHistosForTrackerSpecific(), IsolatedTracksNxN::printTrack(), BeamFitter::readEvent(), and stripLayersWithMeasurement().

542 {
543  int count = 0;
544  for (uint16_t layer = 1; layer <= 4; layer++) {
545  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::VALID) {
546  count++;
547  }
548  }
549  return count;
550 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTIBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 609 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), and StripSubdetector::TIB.

Referenced by IsolatedTracksNxN::analyze(), and stripLayersWithoutMeasurement().

610 {
611  int count = 0;
612  for (uint16_t layer = 1; layer <= 4; layer++) {
613  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::MISSING) {
614  count++;
615  }
616  }
617  return count;
618 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
bool reco::HitPattern::stripTIDHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 556 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TID.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef(), numberOfLostStripTIDHits(), and numberOfValidStripTIDHits().

557 {
559 }
list pattern
Definition: chain.py:104
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:542
int HitPattern::stripTIDLayersNull ( ) const

Definition at line 758 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), NULL_RETURN, StripSubdetector::TID, and TRACK_HITS.

Referenced by stripLayersNull().

759 {
760  int count = 0;
761  for (uint16_t layer = 1; layer <= 3; layer++) {
763  count++;
764  }
765  }
766  return count;
767 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTIDLayersTotallyOffOrBad ( ) const

Definition at line 689 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), StripSubdetector::TID, and TRACK_HITS.

Referenced by stripLayersTotallyOffOrBad().

690 {
691  int count = 0;
692  for (uint16_t layer = 1; layer <= 3; layer++) {
693  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::INACTIVE) {
694  count++;
695  }
696  }
697  return count;
698 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTIDLayersWithMeasurement ( ) const

Definition at line 552 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), StripSubdetector::TID, and TRACK_HITS.

Referenced by IsolatedTracksNxN::analyze(), TrackAnalyzer::fillHistosForTrackerSpecific(), IsolatedTracksNxN::printTrack(), BeamFitter::readEvent(), and stripLayersWithMeasurement().

553 {
554  int count = 0;
555  for (uint16_t layer = 1; layer <= 3; layer++) {
556  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::VALID) {
557  count++;
558  }
559  }
560  return count;
561 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTIDLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 620 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), and StripSubdetector::TID.

Referenced by IsolatedTracksNxN::analyze(), and stripLayersWithoutMeasurement().

621 {
622  int count = 0;
623  for (uint16_t layer = 1; layer <= 3; layer++) {
624  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::MISSING) {
625  count++;
626  }
627  }
628  return count;
629 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
bool reco::HitPattern::stripTOBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 561 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TOB.

Referenced by numberOfLostStripTOBHits(), and numberOfValidStripTOBHits().

562 {
564 }
list pattern
Definition: chain.py:104
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:542
int HitPattern::stripTOBLayersNull ( ) const

Definition at line 769 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), NULL_RETURN, StripSubdetector::TOB, and TRACK_HITS.

Referenced by stripLayersNull().

770 {
771  int count = 0;
772  for (uint16_t layer = 1; layer <= 6; layer++) {
774  count++;
775  }
776  }
777  return count;
778 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTOBLayersTotallyOffOrBad ( ) const

Definition at line 700 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), StripSubdetector::TOB, and TRACK_HITS.

Referenced by stripLayersTotallyOffOrBad().

701 {
702  int count = 0;
703  for (uint16_t layer = 1; layer <= 6; layer++) {
704 
705  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::INACTIVE) {
706  count++;
707  }
708  }
709  return count;
710 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTOBLayersWithMeasurement ( ) const

Definition at line 563 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), StripSubdetector::TOB, and TRACK_HITS.

Referenced by IsolatedTracksNxN::analyze(), TrackAnalyzer::fillHistosForTrackerSpecific(), spr::goodTrack(), IsolatedTracksNxN::printTrack(), BeamFitter::readEvent(), and stripLayersWithMeasurement().

564 {
565  int count = 0;
566  for (uint16_t layer = 1; layer <= 6; layer++) {
567  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::VALID) {
568  count++;
569  }
570  }
571  return count;
572 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
int HitPattern::stripTOBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 631 of file HitPattern.cc.

References prof2calltree::count, getTrackerLayerCase(), and StripSubdetector::TOB.

Referenced by IsolatedTracksNxN::analyze(), and stripLayersWithoutMeasurement().

632 {
633  int count = 0;
634  for (uint16_t layer = 1; layer <= 6; layer++) {
635  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::MISSING) {
636  count++;
637  }
638  }
639  return count;
640 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:387
bool reco::HitPattern::trackerHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 965 of file HitPattern.h.

References pixelLayersNull(), and stripLayersNull().

966 {
967  return pixelLayersNull() +
968  stripLayersNull();
969 }
int pixelLayersNull() const
Definition: HitPattern.h:971
int stripLayersNull() const
Definition: HitPattern.h:977
int reco::HitPattern::trackerLayersTotallyOffOrBad ( ) const
inline

Definition at line 945 of file HitPattern.h.

References pixelLayersTotallyOffOrBad(), and stripLayersTotallyOffOrBad().

946 {
947  return pixelLayersTotallyOffOrBad() +
949 }
int pixelLayersTotallyOffOrBad() const
Definition: HitPattern.h:951
int stripLayersTotallyOffOrBad() const
Definition: HitPattern.h:957
int HitPattern::trackerLayersWithMeasurement ( ) const

Definition at line 477 of file HitPattern.cc.

References python.rootplot.argparse::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, i, LayerOffset, minTrackerWord, chain::pattern, TRACK_HITS, trackerHitFilter(), and unlikely.

Referenced by StandaloneTrackMonitor::analyze(), TrackAnalyzer::analyze(), IsolatedTracksCone::analyze(), IsolatedTracksNxN::analyze(), spr::coneChargeIsolation(), MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), TrackAnalyzer::fillHistosForState(), spr::goodTrack(), cms::MuonTCMETValueMapProducer::nLayers(), GhostTrackComputer::operator()(), TrackFilterForPVFinding::operator()(), RecoTrackSelectorBase::operator()(), IsolatedTracksNxN::printTrack(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), HITrackClusterRemover::produce(), BeamFitter::readEvent(), CosmicTrackSelector::select(), TrackMultiSelector::select(), MultiTrackSelector::select(), HIMultiTrackSelector::select(), TrackVertexArbitration< VTX >::trackFilterArbitrator(), and QcdUeDQM::trackSelection().

477  {
478  auto category = TRACK_HITS;
479  std::bitset<128> layerOk;
480  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
481  for (int i = range.first; i < range.second; ++i) {
483  if unlikely(!trackerHitFilter(pattern)) continue;
484  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
485  if (hitType != HIT_TYPE::VALID) continue;
487  // assert(pattern<128);
488  layerOk.set(pattern);
489  }
490  // assert(trackerLayersWithMeasurementOld()==int(layerOk.count()));
491  return layerOk.count();
492 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
static const unsigned short HitTypeMask
Definition: HitPattern.h:370
return((rh^lh)&mask)
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:388
static const unsigned short HitTypeOffset
Definition: HitPattern.h:369
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static const unsigned short LayerOffset
Definition: HitPattern.h:377
if(conf.exists("allCellsPositionCalc"))
int reco::HitPattern::trackerLayersWithMeasurementOld ( ) const
inline

Definition at line 909 of file HitPattern.h.

References pixelLayersWithMeasurement(), and stripLayersWithMeasurement().

910 {
912 }
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:458
int stripLayersWithMeasurement() const
Definition: HitPattern.h:919
int HitPattern::trackerLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 494 of file HitPattern.cc.

References getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, i, LayerOffset, minTrackerWord, chain::pattern, trackerHitFilter(), and unlikely.

Referenced by spr::goodTrack(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), CosmicTrackSelector::select(), MultiTrackSelector::select(), and HIMultiTrackSelector::select().

494  {
495  std::bitset<128> layerOk;
496  std::bitset<128> layerMissed;
497  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
498  for (int i = range.first; i < range.second; ++i) {
500  if unlikely(!trackerHitFilter(pattern)) continue;
501  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
503  // assert(pattern<128);
504  if (hitType == HIT_TYPE::VALID) layerOk.set(pattern);
505  if (hitType == HIT_TYPE::MISSING) layerMissed.set(pattern);
506  }
507  layerMissed &= ~layerOk;
508 
509  // assert(trackerLayersWithoutMeasurementOld(category)==int(layerMissed.count()));
510 
511  return layerMissed.count();
512 
513 
514 }
int i
Definition: DBlmapReader.cc:9
list pattern
Definition: chain.py:104
static const unsigned short HitTypeMask
Definition: HitPattern.h:370
return((rh^lh)&mask)
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:388
static const unsigned short HitTypeOffset
Definition: HitPattern.h:369
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:601
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:429
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:234
static const unsigned short LayerOffset
Definition: HitPattern.h:377
if(conf.exists("allCellsPositionCalc"))
int reco::HitPattern::trackerLayersWithoutMeasurementOld ( HitCategory  category) const
inline

Definition at line 925 of file HitPattern.h.

References pixelLayersWithoutMeasurement(), and stripLayersWithoutMeasurement().

926 {
929 }
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:931
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:937
bool reco::HitPattern::validHitFilter ( uint16_t  pattern)
inlinestatic

Member Data Documentation

const unsigned short reco::HitPattern::ARRAY_LENGTH = 50
static

Definition at line 156 of file HitPattern.h.

Referenced by clear(), HitPattern(), and operator=().

uint8_t reco::HitPattern::beginInner
private
uint8_t reco::HitPattern::beginOuter
private
uint8_t reco::HitPattern::beginTrackHits
private
const uint16_t reco::HitPattern::EMPTY_PATTERN = 0x0
static
uint8_t reco::HitPattern::endInner
private
uint8_t reco::HitPattern::endOuter
private
uint8_t reco::HitPattern::endTrackHits
private
const unsigned short reco::HitPattern::HIT_LENGTH = 11
static

Definition at line 157 of file HitPattern.h.

Referenced by getHitPatternByAbsoluteIndex(), and insertHit().

uint8_t reco::HitPattern::hitCount
private
uint16_t reco::HitPattern::hitPattern[ARRAY_LENGTH]
private
const unsigned short reco::HitPattern::HitTypeMask = 0x3
staticprivate
const unsigned short reco::HitPattern::HitTypeOffset = 0
staticprivate
const unsigned short reco::HitPattern::LayerMask = 0xF
staticprivate
const unsigned short reco::HitPattern::LayerOffset = 3
staticprivate
const unsigned short reco::HitPattern::MaxHits = (8 * sizeof(uint16_t) * ARRAY_LENGTH) / HIT_LENGTH
static

Definition at line 158 of file HitPattern.h.

Referenced by appendHit().

const unsigned short reco::HitPattern::minPixelWord = minTrackerWord | (1<<SubstrOffset)
staticprivate

Definition at line 389 of file HitPattern.h.

const unsigned short reco::HitPattern::minStripWord = minTrackerWord | (3<<SubstrOffset)
staticprivate
const unsigned short reco::HitPattern::minTrackerWord = 1<< SubDetectorOffset
staticprivate
const uint32_t reco::HitPattern::NULL_RETURN = 999999
static
const unsigned short reco::HitPattern::SideMask = 0x1
staticprivate

Definition at line 374 of file HitPattern.h.

Referenced by encode(), and getSide().

const unsigned short reco::HitPattern::SideOffset = 2
staticprivate

Definition at line 373 of file HitPattern.h.

Referenced by encode(), and getSide().

const unsigned short reco::HitPattern::SubDetectorMask = 0x1
staticprivate
const unsigned short reco::HitPattern::SubDetectorOffset = 10
staticprivate
const unsigned short reco::HitPattern::SubstrMask = 0x7
staticprivate
const unsigned short reco::HitPattern::SubstrOffset = 7
staticprivate

Definition at line 381 of file HitPattern.h.

Referenced by encode(), getSubStructure(), getTrackerLayerCase(), and getTrackerMonoStereo().