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 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 trackerLayersWithoutMeasurement (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 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 393 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 15 of file HitPattern.cc.

References ARRAY_LENGTH, EMPTY_PATTERN, and hitPattern.

15  :
16  hitCount(0),
17  beginTrackHits(0),
18  endTrackHits(0),
19  beginInner(0),
20  endInner(0),
21  beginOuter(0),
22  endOuter(0)
23 {
25 }
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:416
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:410
uint8_t beginInner
Definition: HitPattern.h:415
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint8_t hitCount
Definition: HitPattern.h:411
uint8_t beginOuter
Definition: HitPattern.h:417
uint8_t endOuter
Definition: HitPattern.h:418
HitPattern::~HitPattern ( )

Definition at line 39 of file HitPattern.cc.

40 {
41  ;
42 }
HitPattern::HitPattern ( const HitPattern other)

Definition at line 27 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

27  :
28  hitCount(other.hitCount),
31  beginInner(other.beginInner),
32  endInner(other.endInner),
33  beginOuter(other.beginOuter),
34  endOuter(other.endOuter)
35 {
36  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
37 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
uint8_t endInner
Definition: HitPattern.h:416
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:410
uint8_t beginInner
Definition: HitPattern.h:415
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint8_t hitCount
Definition: HitPattern.h:411
uint8_t beginOuter
Definition: HitPattern.h:417
uint8_t endOuter
Definition: HitPattern.h:418

Member Function Documentation

bool HitPattern::appendHit ( const TrackingRecHit hit)

Definition at line 166 of file HitPattern.cc.

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

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

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

Definition at line 79 of file HitPattern.cc.

References appendHit().

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

Definition at line 171 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, listBenchmarks::pattern, unlikely, and TrackingRecHit::valid.

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

Definition at line 438 of file HitPattern.h.

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

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

439 {
440  for (I hit = begin; hit != end; hit++) {
441  if unlikely((!appendHit(*hit))) {
442  return false;
443  }
444  }
445  return true;
446 }
#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:166
bool reco::HitPattern::badHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 716 of file HitPattern.h.

References BAD, and getHitType().

Referenced by numberOfBadHits().

717 {
719 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:660
template<typename F >
void reco::HitPattern::call ( HitCategory  category,
filterType  typeFilter,
F  f 
) const
private

Definition at line 472 of file HitPattern.h.

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

473 {
474  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
475  for (int i = range.first; i < range.second; i++) {
477  // f() return false to ask to stop looping
478  if (typeFilter(pattern) && !f(pattern)) {
479  break;
480  }
481  }
482 }
int i
Definition: DBlmapReader.cc:9
double f[11][100]
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:421
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
void HitPattern::clear ( void  )

Definition at line 66 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().

67 {
68  this->hitCount = 0;
69  this->beginTrackHits = 0;
70  this->endTrackHits = 0;
71  this->beginInner = 0;
72  this->endInner = 0;
73  this->beginOuter = 0;
74  this->endOuter = 0;
75 
76  memset(this->hitPattern, EMPTY_PATTERN, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
77 }
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:416
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:410
uint8_t beginInner
Definition: HitPattern.h:415
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint8_t hitCount
Definition: HitPattern.h:411
uint8_t beginOuter
Definition: HitPattern.h:417
uint8_t endOuter
Definition: HitPattern.h:418
int reco::HitPattern::countHits ( HitCategory  category,
filterType  filter 
) const
inlineprivate

Definition at line 458 of file HitPattern.h.

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

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

459 {
460  int count = 0;
461  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
462  for (int i = range.first; i < range.second; ++i) {
464  ++count;
465  }
466  }
467  return count;
468 }
int i
Definition: DBlmapReader.cc:9
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:421
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
int reco::HitPattern::countTypedHits ( HitCategory  category,
filterType  typeFilter,
filterType  filter 
) const
inlineprivate

Definition at line 484 of file HitPattern.h.

References prof2calltree::count, alcazmumu_cfi::filter, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), i, and listBenchmarks::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().

485 {
486  int count = 0;
487  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
488  for (int i = range.first; i < range.second; ++i) {
490  if (typeFilter(pattern) && filter(pattern)) {
491  ++count;
492  }
493  }
494  return count;
495 }
int i
Definition: DBlmapReader.cc:9
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:421
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
int reco::HitPattern::cscStationsWithAnyHits ( ) const
inline

Definition at line 1028 of file HitPattern.h.

References muonStations().

1029 {
1030  return muonStations(2, -1);
1031 }
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:793
int reco::HitPattern::cscStationsWithBadHits ( ) const
inline

Definition at line 1023 of file HitPattern.h.

References muonStations().

1024 {
1025  return muonStations(2, 3);
1026 }
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:793
int reco::HitPattern::cscStationsWithValidHits ( ) const
inline

Definition at line 1018 of file HitPattern.h.

References muonStations().

1019 {
1020  return muonStations(2, 0);
1021 }
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:793
int reco::HitPattern::dtStationsWithAnyHits ( ) const
inline

Definition at line 1013 of file HitPattern.h.

References muonStations().

1014 {
1015  return muonStations(1, -1);
1016 }
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:793
int reco::HitPattern::dtStationsWithBadHits ( ) const
inline

Definition at line 1008 of file HitPattern.h.

References muonStations().

1009 {
1010  return muonStations(1, 3);
1011 }
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:793
int reco::HitPattern::dtStationsWithValidHits ( ) const
inline

Definition at line 1003 of file HitPattern.h.

References muonStations().

1004 {
1005  return muonStations(1, 0);
1006 }
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:793
uint16_t HitPattern::encode ( const TrackingRecHit hit)
staticprivate

Definition at line 84 of file HitPattern.cc.

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

Referenced by appendHit().

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

Definition at line 89 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, listBenchmarks::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().

90 {
92 
93  uint16_t detid = id.det();
94 
95  // adding tracker/muon detector bit
96  pattern |= (detid & SubDetectorMask) << SubDetectorOffset;
97 
98  // adding substructure (PXB, PXF, TIB, TID, TOB, TEC, or DT, CSC, RPC) bits
99  uint16_t subdet = id.subdetId();
100  pattern |= (subdet & SubstrMask) << SubstrOffset;
101 
102  // adding layer/disk/wheel bits
103  uint16_t layer = 0x0;
104  if (detid == DetId::Tracker) {
105  switch (subdet) {
107  layer = PXBDetId(id).layer();
108  break;
110  layer = PXFDetId(id).disk();
111  break;
113  layer = TIBDetId(id).layer();
114  break;
116  layer = TIDDetId(id).wheel();
117  break;
119  layer = TOBDetId(id).layer();
120  break;
122  layer = TECDetId(id).wheel();
123  break;
124  }
125  } else if (detid == DetId::Muon) {
126  switch (subdet) {
127  case MuonSubdetId::DT:
128  layer = ((DTLayerId(id.rawId()).station() - 1) << 2);
129  layer |= DTLayerId(id.rawId()).superLayer();
130  break;
131  case MuonSubdetId::CSC:
132  layer = ((CSCDetId(id.rawId()).station() - 1) << 2);
133  layer |= (CSCDetId(id.rawId()).ring() - 1);
134  break;
135  case MuonSubdetId::RPC:
136  {
137  RPCDetId rpcid(id.rawId());
138  layer = ((rpcid.station() - 1) << 2);
139  layer |= (rpcid.station() <= 2) ? ((rpcid.layer() - 1) << 1) : 0x0;
140  layer |= abs(rpcid.region());
141  }
142  break;
143  }
144  }
145 
146  pattern |= (layer & LayerMask) << LayerOffset;
147 
148  // adding mono/stereo bit
149  uint16_t side = 0x0;
150  if (detid == DetId::Tracker) {
151  side = isStereo(id);
152  } else if (detid == DetId::Muon) {
153  side = 0x0;
154  }
155 
156  pattern |= (side & SideMask) << SideOffset;
157 
158  TrackingRecHit::Type patternHitType = (hitType == TrackingRecHit::missing_inner ||
160 
161  pattern |= (patternHitType & HitTypeMask) << HitTypeOffset;
162 
163  return pattern;
164 }
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
static const unsigned short SideOffset
Definition: HitPattern.h:370
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short SubstrOffset
Definition: HitPattern.h:378
static const unsigned short HitTypeMask
Definition: HitPattern.h:367
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:383
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const unsigned short HitTypeOffset
Definition: HitPattern.h:366
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
static const unsigned short SideMask
Definition: HitPattern.h:371
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:382
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:379
static const int RPC
Definition: MuonSubdetId.h:14
static uint16_t isStereo(DetId i)
Definition: HitPattern.cc:762
static const unsigned short LayerOffset
Definition: HitPattern.h:374
static const int DT
Definition: MuonSubdetId.h:12
static const unsigned short LayerMask
Definition: HitPattern.h:375
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 421 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(), and numberOfHits().

422 {
423  switch (category) {
424  case TRACK_HITS:
425  return std::pair<uint8_t, uint8_t>(beginTrackHits, endTrackHits);
426  break;
427  case MISSING_INNER_HITS:
428  return std::pair<uint8_t, uint8_t>(beginInner, endInner);
429  break;
430  case MISSING_OUTER_HITS:
431  return std::pair<uint8_t, uint8_t>(beginOuter, endOuter);
432  break;
433  }
434  return std::pair<uint8_t, uint8_t>(-1, -1);
435 }
uint8_t endInner
Definition: HitPattern.h:416
uint8_t beginInner
Definition: HitPattern.h:415
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint8_t beginOuter
Definition: HitPattern.h:417
uint8_t endOuter
Definition: HitPattern.h:418
uint16_t reco::HitPattern::getCSCRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 679 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

680 {
681  return (getSubSubStructure(pattern) & 3) + 1;
682 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:632
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 674 of file HitPattern.h.

References getSubSubStructure().

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

675 {
676  return (getSubSubStructure(pattern) & 3);
677 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:632
uint16_t reco::HitPattern::getHitPattern ( HitCategory  category,
int  position 
) const
inline

Definition at line 448 of file HitPattern.h.

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

Referenced by CheckHitPattern::analyze(), PFCheckHitPattern::analyze(), FixTrackHitPattern::analyze(), GetTrackTrajInfo::analyze(), GsfElectronAlgo::ElectronData::checkCtfTrack(), 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().

449 {
450  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
451  if unlikely((position < 0 || (position + range.first) >= range.second)) {
453  }
454 
455  return getHitPatternByAbsoluteIndex(range.first + position);
456 }
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:421
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
static int position[264][3]
Definition: ReadPGInfo.cc:509
uint16_t HitPattern::getHitPatternByAbsoluteIndex ( int  position) const
private

Definition at line 232 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(), and outermostMuonStationWithHits().

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

Definition at line 660 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().

661 {
663  return NULL_RETURN;
664  }
665 
666  return ((pattern >> HitTypeOffset) & HitTypeMask);
667 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short HitTypeMask
Definition: HitPattern.h:367
#define unlikely(x)
static const unsigned short HitTypeOffset
Definition: HitPattern.h:366
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 669 of file HitPattern.h.

References getSubSubStructure().

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

670 {
671  return (getSubSubStructure(pattern) >> 2) + 1;
672 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:632
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 684 of file HitPattern.h.

References getSubSubStructure(), and likely.

Referenced by printHitPattern().

685 {
686  uint16_t subSubStructure = getSubSubStructure(pattern);
687  uint16_t stat = subSubStructure >> 2;
688 
689  if likely(stat <= 1) {
690  return ((subSubStructure >> 1) & 1) + 1;
691  }
692 
693  return 0;
694 }
#define likely(x)
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:632
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 696 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

697 {
698  return getSubSubStructure(pattern) & 1;
699 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:632
uint32_t reco::HitPattern::getSide ( uint16_t  pattern)
inlinestatic

Definition at line 651 of file HitPattern.h.

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

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

652 {
654  return NULL_RETURN;
655  }
656 
657  return (pattern >> SideOffset) & SideMask;
658 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const unsigned short SideOffset
Definition: HitPattern.h:370
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
#define unlikely(x)
static const unsigned short SideMask
Definition: HitPattern.h:371
uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 641 of file HitPattern.h.

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

642 {
644  return NULL_RETURN;
645  }
646 
647  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
648 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
#define unlikely(x)
static const unsigned short SubDetectorMask
Definition: HitPattern.h:383
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:382
uint32_t reco::HitPattern::getSubStructure ( uint16_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getSubSubStructure ( uint16_t  pattern)
inlinestatic

Definition at line 632 of file HitPattern.h.

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

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

633 {
635  return NULL_RETURN;
636  }
637 
638  return ((pattern >> LayerOffset) & LayerMask);
639 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
#define unlikely(x)
static const unsigned short LayerOffset
Definition: HitPattern.h:374
static const unsigned short LayerMask
Definition: HitPattern.h:375
uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 370 of file HitPattern.cc.

References pat::BAD, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, i, LayerMask, LayerOffset, NULL_RETURN, listBenchmarks::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().

371 {
372  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
373  + ((substr & SubstrMask) << SubstrOffset)
374  + ((layer & LayerMask) << LayerOffset);
375 
376  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
377  + (SubstrMask << SubstrOffset)
378  + (LayerMask << LayerOffset);
379 
380  // layer case 0: valid + (missing, off, bad) ==> with measurement
381  // layer case 1: missing + (off, bad) ==> without measurement
382  // layer case 2: off, bad ==> totally off or bad, cannot say much
383  // layer case NULL_RETURN: track outside acceptance or in gap ==> null
384  uint32_t layerCase = NULL_RETURN;
385  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
386  for (int i = range.first; i < range.second; ++i) {
388  if ((pattern & mask) == tk_substr_layer) {
389  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
390  if (hitType < layerCase) {
391  // BAD and INACTIVE as the same type (as INACTIVE)
392  layerCase = (hitType == HIT_TYPE::BAD ? HIT_TYPE::INACTIVE : hitType);
393  if (layerCase == HIT_TYPE::VALID) {
394  break;
395  }
396  }
397  }
398  }
399  return layerCase;
400 }
int i
Definition: DBlmapReader.cc:9
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const unsigned short SubstrOffset
Definition: HitPattern.h:378
static const unsigned short HitTypeMask
Definition: HitPattern.h:367
1: Failed selection (without additional info)
Definition: ParticleCode.h:34
static const unsigned short SubDetectorMask
Definition: HitPattern.h:383
static const unsigned short HitTypeOffset
Definition: HitPattern.h:366
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:421
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:382
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
static const unsigned short SubstrMask
Definition: HitPattern.h:379
static const unsigned short LayerOffset
Definition: HitPattern.h:374
static const unsigned short LayerMask
Definition: HitPattern.h:375
uint16_t HitPattern::getTrackerMonoStereo ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 402 of file HitPattern.cc.

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

403 {
404  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
405  + ((substr & SubstrMask) << SubstrOffset)
406  + ((layer & LayerMask) << LayerOffset);
407  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
408  + (SubstrMask << SubstrOffset)
409  + (LayerMask << LayerOffset);
410 
411  // 0: neither a valid mono nor a valid stereo hit
412  // MONO: valid mono hit
413  // STEREO: valid stereo hit
414  // MONO | STEREO: both
415  uint16_t monoStereo = 0x0;
416  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
417  for (int i = range.first; i < range.second; ++i) {
419  if ((pattern & mask) == tk_substr_layer) {
420  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
421  if (hitType == HIT_TYPE::VALID) {
422  switch (getSide(pattern)) {
423  case 0: // mono
424  monoStereo |= MONO;
425  break;
426  case 1: // stereo
427  monoStereo |= STEREO;
428  break;
429  }
430  }
431 
432  if (monoStereo == (MONO | STEREO)) {
433  break;
434  }
435  }
436  }
437  return monoStereo;
438 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short SubstrOffset
Definition: HitPattern.h:378
static const unsigned short HitTypeMask
Definition: HitPattern.h:367
static const unsigned short SubDetectorMask
Definition: HitPattern.h:383
static const unsigned short HitTypeOffset
Definition: HitPattern.h:366
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:421
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:382
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:651
static const unsigned short SubstrMask
Definition: HitPattern.h:379
static const unsigned short LayerOffset
Definition: HitPattern.h:374
static const unsigned short LayerMask
Definition: HitPattern.h:375
bool HitPattern::hasValidHitInFirstPixelBarrel ( ) const

Definition at line 274 of file HitPattern.cc.

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

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

275 {
276  for (int i = beginTrackHits; i < endTrackHits; ++i) {
278  if (pixelBarrelHitFilter(pattern) && (getLayer(pattern) == 1)
279  && validHitFilter(pattern)) {
280  return true;
281  }
282  }
283  return false;
284 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:627
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:508
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
bool HitPattern::hasValidHitInFirstPixelEndcap ( ) const

Definition at line 286 of file HitPattern.cc.

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

287 {
288  for (int i = beginTrackHits; i < endTrackHits; ++i) {
290  if (pixelEndcapHitFilter(pattern) && (getLayer(pattern) == 1)
291  && validHitFilter(pattern)) {
292  return true;
293  }
294  }
295  return false;
296 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:627
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:518
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
bool reco::HitPattern::inactiveHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1058 of file HitPattern.h.

References innermostMuonStationWithHits().

1059 {
1060  return innermostMuonStationWithHits(-1);
1061 }
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:808
int reco::HitPattern::innermostMuonStationWithBadHits ( ) const
inline

Definition at line 1053 of file HitPattern.h.

References innermostMuonStationWithHits().

1054 {
1055  return innermostMuonStationWithHits(3);
1056 }
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:808
int HitPattern::innermostMuonStationWithHits ( int  hitType) const

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

Definition at line 808 of file HitPattern.cc.

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

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

809 {
810  int ret = 0;
811  for (int i = beginTrackHits; i < endTrackHits; ++i) {
813  if (muonHitFilter(pattern)
814  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
815  int stat = getMuonStation(pattern);
816  if (ret == 0 || stat < ret) {
817  ret = stat;
818  }
819  }
820  }
821 
822  return ret;
823 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:660
uint8_t beginTrackHits
Definition: HitPattern.h:413
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
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:669
int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 1048 of file HitPattern.h.

References innermostMuonStationWithHits().

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

Definition at line 915 of file HitPattern.cc.

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

Referenced by appendHit().

916 {
917  if unlikely((0 == beginInner && 0 == endInner)) {
920  }
921 
923  endInner++;
924 
925  return true;
926 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:884
#define unlikely(x)
uint8_t endInner
Definition: HitPattern.h:416
uint8_t beginInner
Definition: HitPattern.h:415
uint8_t hitCount
Definition: HitPattern.h:411
bool HitPattern::insertExpectedOuterHit ( const uint16_t  pattern)
private

Definition at line 928 of file HitPattern.cc.

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

Referenced by appendHit().

929 {
930  if unlikely((0 == beginOuter && 0 == endOuter)) {
933  }
934 
936  endOuter++;
937 
938  return true;
939 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:884
#define unlikely(x)
uint8_t hitCount
Definition: HitPattern.h:411
uint8_t beginOuter
Definition: HitPattern.h:417
uint8_t endOuter
Definition: HitPattern.h:418
void HitPattern::insertHit ( const uint16_t  pattern)
private

Definition at line 884 of file HitPattern.cc.

References HIT_LENGTH, hitCount, hitPattern, i, and evf::evtn::offset().

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

885 {
886  int offset = hitCount * HIT_LENGTH;
887  for (int i = 0; i < HIT_LENGTH; i++) {
888  int pos = offset + i;
889  uint16_t bit = (pattern >> i) & 0x1;
890  //equivalent to hitPattern[pos / 16] += bit << ((offset + i) % 16);
891  hitPattern[pos >> 4] += bit << ((offset + i) & (16 - 1));
892  }
893  hitCount++;
894 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:157
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:410
unsigned int offset(bool)
uint8_t hitCount
Definition: HitPattern.h:411
bool HitPattern::insertTrackHit ( const uint16_t  pattern)
private

Definition at line 896 of file HitPattern.cc.

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

Referenced by appendHit().

897 {
898  // if begin is 0, this is the first hit of this type being inserted, so
899  // we need to update begin so it points to the correct index, the first
900  // empty index.
901  // unlikely, because it will happen only when inserting
902  // the first hit of this type
903  if unlikely((0 == beginTrackHits && 0 == endTrackHits)) {
905  // before the first hit of this type is inserted, there are no hits
907  }
908 
910  endTrackHits++;
911 
912  return true;
913 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:884
#define unlikely(x)
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint8_t hitCount
Definition: HitPattern.h:411
uint16_t HitPattern::isStereo ( DetId  i)
staticprivate

Definition at line 762 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().

763 {
764  if (i.det() != DetId::Tracker) {
765  return 0;
766  }
767 
768  switch (i.subdetId()) {
771  return 0;
772  case StripSubdetector::TIB: {
773  TIBDetId id = i;
774  return id.isStereo();
775  }
776  case StripSubdetector::TID: {
777  TIDDetId id = i;
778  return id.isStereo();
779  }
780  case StripSubdetector::TOB: {
781  TOBDetId id = i;
782  return id.isStereo();
783  }
784  case StripSubdetector::TEC: {
785  TECDetId id = i;
786  return id.isStereo();
787  }
788  default:
789  return 0;
790  }
791 }
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 580 of file HitPattern.h.

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

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

581 {
583  return false;
584  }
585 
586  uint32_t substructure = getSubStructure(pattern);
587  return (substructure == (uint32_t) MuonSubdetId::CSC);
588 }
#define unlikely(x)
static const int CSC
Definition: MuonSubdetId.h:13
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
bool reco::HitPattern::muonDTHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 570 of file HitPattern.h.

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

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

571 {
573  return false;
574  }
575 
576  uint32_t substructure = getSubStructure(pattern);
577  return (substructure == (uint32_t) MuonSubdetId::DT);
578 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
static const int DT
Definition: MuonSubdetId.h:12
bool reco::HitPattern::muonHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 609 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().

610 {
612  return false;
613  }
614 
615  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 0);
616 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
#define unlikely(x)
static const unsigned short SubDetectorMask
Definition: HitPattern.h:383
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:382
bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 590 of file HitPattern.h.

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

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

591 {
593  return false;
594  }
595 
596  uint32_t substructure = getSubStructure(pattern);
597  return (substructure == (uint32_t) MuonSubdetId::RPC);
598 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
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 793 of file HitPattern.cc.

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

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

794 {
795  int stations[4] = {0, 0, 0, 0};
796  for (int i = beginTrackHits; i < endTrackHits; ++i) {
798  if (muonHitFilter(pattern)
799  && (subdet == 0 || int(getSubStructure(pattern)) == subdet)
800  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
801  stations[getMuonStation(pattern) - 1] = 1;
802  }
803  }
804 
805  return stations[0] + stations[1] + stations[2] + stations[3];
806 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:660
uint8_t beginTrackHits
Definition: HitPattern.h:413
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
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:669
int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 998 of file HitPattern.h.

References muonStations().

999 {
1000  return muonStations(0, -1);
1001 }
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:793
int reco::HitPattern::muonStationsWithBadHits ( ) const
inline

Definition at line 993 of file HitPattern.h.

References muonStations().

994 {
995  return muonStations(0, 3);
996 }
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:793
int reco::HitPattern::muonStationsWithValidHits ( ) const
inline

Definition at line 988 of file HitPattern.h.

References muonStations().

989 {
990  return muonStations(0, 0);
991 }
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:793
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 877 of file HitPattern.h.

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

878 {
880 }
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:716
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:458
int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 892 of file HitPattern.h.

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

893 {
895 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:580
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:711
int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 887 of file HitPattern.h.

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

888 {
890 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:711
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:570
int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 882 of file HitPattern.h.

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

883 {
885 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:711
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 897 of file HitPattern.h.

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

898 {
900 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:711
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:590
int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 868 of file HitPattern.cc.

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

869 {
870  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
871  for (int i = beginTrackHits; i < endTrackHits; ++i) {
873  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
874  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
875  }
876  }
877 
878  return stations[0][0] * stations[0][1]
879  + stations[1][0] * stations[1][1]
880  + stations[2][0] * stations[2][1]
881  + stations[3][0] * stations[3][1];
882 }
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:674
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:570
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:669
int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 841 of file HitPattern.cc.

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

842 {
843  int stations[4] = {0, 0, 0, 0};
844  for (int i = beginTrackHits; i < endTrackHits; ++i) {
846 
847  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
848  && getDTSuperLayer(pattern) != 2) {
849  stations[getMuonStation(pattern) - 1] = 1;
850  }
851  }
852  return stations[0] + stations[1] + stations[2] + stations[3];
853 }
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:674
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:570
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:669
int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 855 of file HitPattern.cc.

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

856 {
857  int stations[4] = {0, 0, 0, 0};
858  for (int i = beginTrackHits; i < endTrackHits; ++i) {
860  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
861  && getDTSuperLayer(pattern) == 2) {
862  stations[getMuonStation(pattern) - 1] = 1;
863  }
864  }
865  return stations[0] + stations[1] + stations[2] + stations[3];
866 }
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:674
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:570
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:669
int reco::HitPattern::numberOfHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 902 of file HitPattern.h.

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

903 {
905 }
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:711
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:458
int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 907 of file HitPattern.h.

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

908 {
910 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:711
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
int reco::HitPattern::numberOfLostHits ( HitCategory  category) const
inline

Definition at line 807 of file HitPattern.h.

References countHits(), and missingHitFilter().

Referenced by reco::TransientTrack::numberOfLostHits(), reco::TrackBase::numberOfLostHits(), pat::PATPackedCandidateProducer::produce(), and DuplicateTrackMerger::produce().

808 {
810 }
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:458
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 867 of file HitPattern.h.

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

868 {
870 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:580
int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 862 of file HitPattern.h.

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

863 {
865 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:570
int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 817 of file HitPattern.h.

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

818 {
820 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 872 of file HitPattern.h.

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

873 {
875 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:590
int reco::HitPattern::numberOfLostPixelBarrelHits ( HitCategory  category) const
inline

Definition at line 827 of file HitPattern.h.

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

828 {
830 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:508
int reco::HitPattern::numberOfLostPixelEndcapHits ( HitCategory  category) const
inline

Definition at line 832 of file HitPattern.h.

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

833 {
835 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:518
int reco::HitPattern::numberOfLostPixelHits ( HitCategory  category) const
inline

Definition at line 822 of file HitPattern.h.

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

823 {
825 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:497
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
int reco::HitPattern::numberOfLostStripHits ( HitCategory  category) const
inline

Definition at line 837 of file HitPattern.h.

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

838 {
840 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:528
int reco::HitPattern::numberOfLostStripTECHits ( HitCategory  category) const
inline

Definition at line 857 of file HitPattern.h.

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

858 {
860 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:565
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
int reco::HitPattern::numberOfLostStripTIBHits ( HitCategory  category) const
inline

Definition at line 842 of file HitPattern.h.

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

843 {
845 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:550
int reco::HitPattern::numberOfLostStripTIDHits ( HitCategory  category) const
inline

Definition at line 847 of file HitPattern.h.

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

848 {
850 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:555
int reco::HitPattern::numberOfLostStripTOBHits ( HitCategory  category) const
inline

Definition at line 852 of file HitPattern.h.

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

853 {
855 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:560
int reco::HitPattern::numberOfLostTrackerHits ( HitCategory  category) const
inline

Definition at line 812 of file HitPattern.h.

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

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

813 {
815 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:706
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 732 of file HitPattern.h.

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

733 {
735 }
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:458
int reco::HitPattern::numberOfTrackerHits ( HitCategory  category) const
inline

Definition at line 727 of file HitPattern.h.

References countHits(), and trackerHitFilter().

728 {
730 }
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:458
int reco::HitPattern::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 797 of file HitPattern.h.

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

Referenced by MuonTrackValidator::analyze().

798 {
800 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:580
int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 792 of file HitPattern.h.

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

Referenced by MuonTrackValidator::analyze().

793 {
795 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:570
int reco::HitPattern::numberOfValidMuonHits ( ) const
inline

Definition at line 747 of file HitPattern.h.

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

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

748 {
750 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 802 of file HitPattern.h.

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

Referenced by MuonTrackValidator::analyze().

803 {
805 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:590
int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelHits ( ) const
inline
int reco::HitPattern::numberOfValidStripHits ( ) const
inline

Definition at line 767 of file HitPattern.h.

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

768 {
770 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:528
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

Definition at line 298 of file HitPattern.cc.

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

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

299 {
300  bool hasMono[SubstrMask + 1][LayerMask + 1];
301  bool hasStereo[SubstrMask + 1][LayerMask + 1];
302  memset(hasMono, 0, sizeof(hasMono));
303  memset(hasStereo, 0, sizeof(hasStereo));
304 
305  // mark which layers have mono/stereo hits
306  for (int i = beginTrackHits; i < endTrackHits; ++i) {
308  uint16_t subStructure = getSubStructure(pattern);
309 
310  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
311  if (stripdet != 0 && subStructure != stripdet) {
312  continue;
313  }
314 
315  if (layer != 0 && getSubSubStructure(pattern) != layer) {
316  continue;
317  }
318 
319  switch (getSide(pattern)) {
320  case 0: // mono
321  hasMono[subStructure][getLayer(pattern)] = true;
322  break;
323  case 1: // stereo
324  hasStereo[subStructure][getLayer(pattern)] = true;
325  break;
326  default:
327  ;
328  break;
329  }
330  }
331  }
332 
333  // count how many layers have mono and stereo hits
334  int count = 0;
335  for (int i = 0; i < SubstrMask + 1; ++i) {
336  for (int j = 0; j < LayerMask + 1; ++j) {
337  if (hasMono[i][j] && hasStereo[i][j]) {
338  count++;
339  }
340  }
341  }
342  return count;
343 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:627
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:528
int j
Definition: DBlmapReader.cc:9
uint8_t beginTrackHits
Definition: HitPattern.h:413
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:651
static const unsigned short SubstrMask
Definition: HitPattern.h:379
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:632
static const unsigned short LayerMask
Definition: HitPattern.h:375
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( ) const
int reco::HitPattern::numberOfValidStripTECHits ( ) const
inline

Definition at line 787 of file HitPattern.h.

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

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

788 {
790 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:565
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline

Definition at line 772 of file HitPattern.h.

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

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

773 {
775 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:550
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 777 of file HitPattern.h.

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

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

778 {
780 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:555
int reco::HitPattern::numberOfValidStripTOBHits ( ) const
inline

Definition at line 782 of file HitPattern.h.

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

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

783 {
785 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:560
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

Definition at line 742 of file HitPattern.h.

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

Referenced by CSCSkim::doBFieldStudySelection(), PFMuonAlgo::isTrackerTightMuon(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), PFMuonAlgo::printMuonProperties(), and reco::TrackBase::validFraction().

743 {
745 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:484
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:701
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
HitPattern & HitPattern::operator= ( const HitPattern other)

Definition at line 44 of file HitPattern.cc.

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

45 {
46  if (this == &other) {
47  return *this;
48  }
49 
50  this->hitCount = other.hitCount;
51 
52  this->beginTrackHits = other.beginTrackHits;
53  this->endTrackHits = other.endTrackHits;
54 
55  this->beginInner = other.beginInner;
56  this->endInner = other.endInner;
57 
58  this->beginOuter = other.beginOuter;
59  this->endOuter = other.endOuter;
60 
61  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
62 
63  return *this;
64 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
uint8_t endInner
Definition: HitPattern.h:416
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:410
uint8_t beginInner
Definition: HitPattern.h:415
uint8_t beginTrackHits
Definition: HitPattern.h:413
uint8_t endTrackHits
Definition: HitPattern.h:414
uint8_t hitCount
Definition: HitPattern.h:411
uint8_t beginOuter
Definition: HitPattern.h:417
uint8_t endOuter
Definition: HitPattern.h:418
int reco::HitPattern::outermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1073 of file HitPattern.h.

References outermostMuonStationWithHits().

1074 {
1075  return outermostMuonStationWithHits(-1);
1076 }
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:825
int reco::HitPattern::outermostMuonStationWithBadHits ( ) const
inline

Definition at line 1068 of file HitPattern.h.

References outermostMuonStationWithHits().

1069 {
1070  return outermostMuonStationWithHits(3);
1071 }
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:825
int HitPattern::outermostMuonStationWithHits ( int  hitType) const

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

Definition at line 825 of file HitPattern.cc.

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

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

826 {
827  int ret = 0;
828  for (int i = beginTrackHits; i < endTrackHits; ++i) {
830  if (muonHitFilter(pattern) &&
831  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
832  int stat = getMuonStation(pattern);
833  if (ret == 0 || stat > ret) {
834  ret = stat;
835  }
836  }
837  }
838  return ret;
839 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:660
uint8_t beginTrackHits
Definition: HitPattern.h:413
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
uint8_t endTrackHits
Definition: HitPattern.h:414
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:232
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:669
int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 1063 of file HitPattern.h.

References outermostMuonStationWithHits().

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

Definition at line 508 of file HitPattern.h.

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

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

509 {
511  return false;
512  }
513 
514  uint32_t substructure = getSubStructure(pattern);
515  return (substructure == PixelSubdetector::PixelBarrel);
516 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 646 of file HitPattern.cc.

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

Referenced by pixelLayersNull().

647 {
648  int count = 0;
649  uint16_t NPixBarrel = 4;
650  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
652  count++;
653  }
654  }
655  return count;
656 }
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:370
int HitPattern::pixelBarrelLayersTotallyOffOrBad ( ) const

Definition at line 577 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

578 {
579  int count = 0;
580  uint16_t NPixBarrel = 4;
581  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
582  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::INACTIVE) {
583  count++;
584  }
585  }
586  return count;
587 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::pixelBarrelLayersWithMeasurement ( ) const

Definition at line 440 of file HitPattern.cc.

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

Referenced by TrackAnalyzer::fillHistosForTrackerSpecific(), PrimaryVertexAnalyzer4PU::fillTrackHistos(), pixelLayersWithMeasurement(), IsolatedTracksNxN::printTrack(), and BeamFitter::readEvent().

441 {
442  int count = 0;
443  uint16_t NPixBarrel = 4;
444  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
445  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::VALID) {
446  count++;
447  }
448  }
449  return count;
450 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::pixelBarrelLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 508 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

509 {
510  int count = 0;
511  uint16_t NPixBarrel = 4;
512  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
513  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::MISSING) {
514  count++;
515  }
516  }
517  return count;
518 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
bool reco::HitPattern::pixelEndcapHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 518 of file HitPattern.h.

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

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

519 {
521  return false;
522  }
523 
524  uint32_t substructure = getSubStructure(pattern);
525  return (substructure == PixelSubdetector::PixelEndcap);
526 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 658 of file HitPattern.cc.

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

Referenced by pixelLayersNull().

659 {
660  int count = 0;
661  uint16_t NPixForward = 3;
662  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
664  count++;
665  }
666  }
667  return count;
668 }
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:370
int HitPattern::pixelEndcapLayersTotallyOffOrBad ( ) const

Definition at line 589 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

590 {
591  int count = 0;
592  uint16_t NPixForward = 3;
593  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
594  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::INACTIVE) {
595  count++;
596  }
597  }
598  return count;
599 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::pixelEndcapLayersWithMeasurement ( ) const

Definition at line 452 of file HitPattern.cc.

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

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

453 {
454  int count = 0;
455  uint16_t NPixForward = 3;
456  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
457  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::VALID) {
458  count++;
459  }
460  }
461  return count;
462 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::pixelEndcapLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 520 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

521 {
522  int count = 0;
523  uint16_t NPixForward = 3;
524  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
525  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::MISSING) {
526  count++;
527  }
528  }
529  return count;
530 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
bool reco::HitPattern::pixelHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 974 of file HitPattern.h.

References pixelBarrelLayersNull(), and pixelEndcapLayersNull().

Referenced by trackerLayersNull().

975 {
976  return pixelBarrelLayersNull() +
978 }
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:646
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:658
int reco::HitPattern::pixelLayersTotallyOffOrBad ( ) const
inline

Definition at line 954 of file HitPattern.h.

References pixelBarrelLayersTotallyOffOrBad(), and pixelEndcapLayersTotallyOffOrBad().

Referenced by trackerLayersTotallyOffOrBad().

955 {
958 }
int pixelBarrelLayersTotallyOffOrBad() const
Definition: HitPattern.cc:577
int pixelEndcapLayersTotallyOffOrBad() const
Definition: HitPattern.cc:589
int reco::HitPattern::pixelLayersWithMeasurement ( ) const
inline
int reco::HitPattern::pixelLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 934 of file HitPattern.h.

References pixelBarrelLayersWithoutMeasurement(), and pixelEndcapLayersWithoutMeasurement().

Referenced by trackerLayersWithoutMeasurement().

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

Definition at line 745 of file HitPattern.cc.

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

Referenced by spr::goodTrack().

746 {
747  stream << "HitPattern" << std::endl;
748  for (int i = 0; i < numberOfHits(category); ++i) {
750  }
751  std::ios_base::fmtflags flags = stream.flags();
752  stream.setf(std::ios_base::hex, std::ios_base::basefield);
753  stream.setf(std::ios_base::showbase);
754 
755  for (int i = 0; i < this->numberOfHits(category); ++i) {
756  stream << getHitPattern(category, i) << std::endl;
757  }
758 
759  stream.flags(flags);
760 }
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:714
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:448
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:721
void HitPattern::printHitPattern ( HitCategory  category,
int  position,
std::ostream &  stream 
) const

Definition at line 714 of file HitPattern.cc.

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

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

715 {
716  uint16_t pattern = getHitPattern(category, position);
717  stream << "\t";
718  if (muonHitFilter(pattern)) {
719  stream << "muon";
720  } else if (trackerHitFilter(pattern)) {
721  stream << "tracker";
722  }
723 
724  stream << "\tsubstructure " << getSubStructure(pattern);
725  if (muonHitFilter(pattern)) {
726  stream << "\tstation " << getMuonStation(pattern);
727  if (muonDTHitFilter(pattern)) {
728  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
729  } else if (muonCSCHitFilter(pattern)) {
730  stream << "\tcsc ring " << getCSCRing(pattern);
731  } else if (muonRPCHitFilter(pattern)) {
732  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel")
733  << ", layer " << getRPCLayer(pattern);
734  } else {
735  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure "
736  << getSubStructure(pattern);
737  }
738  } else {
739  stream << "\tlayer " << getLayer(pattern);
740  }
741  stream << "\thit type " << getHitType(pattern);
742  stream << std::endl;
743 }
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:679
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:627
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:674
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:580
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:660
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:696
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:609
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:570
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:684
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:669
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:448
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:590
int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 1043 of file HitPattern.h.

References muonStations().

1044 {
1045  return muonStations(3, -1);
1046 }
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:793
int reco::HitPattern::rpcStationsWithBadHits ( ) const
inline

Definition at line 1038 of file HitPattern.h.

References muonStations().

1039 {
1040  return muonStations(3, 3);
1041 }
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:793
int reco::HitPattern::rpcStationsWithValidHits ( ) const
inline

Definition at line 1033 of file HitPattern.h.

References muonStations().

1034 {
1035  return muonStations(3, 0);
1036 }
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:793
bool reco::HitPattern::stripHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 528 of file HitPattern.h.

References getSubStructure(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, trackerHitFilter(), and unlikely.

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

529 {
531  return false;
532  }
533 
534  uint32_t substructure = getSubStructure(pattern);
535  return (substructure == StripSubdetector::TIB ||
536  substructure == StripSubdetector::TID ||
537  substructure == StripSubdetector::TOB ||
538  substructure == StripSubdetector::TEC);
539 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
int reco::HitPattern::stripLayersNull ( ) const
inline

Definition at line 980 of file HitPattern.h.

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

Referenced by trackerLayersNull().

981 {
982  return stripTIBLayersNull() +
986 }
int stripTIBLayersNull() const
Definition: HitPattern.cc:670
int stripTECLayersNull() const
Definition: HitPattern.cc:703
int stripTIDLayersNull() const
Definition: HitPattern.cc:681
int stripTOBLayersNull() const
Definition: HitPattern.cc:692
int reco::HitPattern::stripLayersTotallyOffOrBad ( ) const
inline
int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline
int reco::HitPattern::stripLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 940 of file HitPattern.h.

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

Referenced by trackerLayersWithoutMeasurement().

941 {
946 }
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:554
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:543
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:565
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:532
bool reco::HitPattern::stripSubdetectorHitFilter ( uint16_t  pattern,
StripSubdetector::SubDetector  substructure 
)
inlinestaticprivate

Definition at line 541 of file HitPattern.h.

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

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

542 {
544  return false;
545  }
546 
547  return substructure == getSubStructure(pattern);
548 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:618
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:600
bool reco::HitPattern::stripTECHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 565 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TEC.

Referenced by numberOfLostStripTECHits(), and numberOfValidStripTECHits().

566 {
568 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:541
int HitPattern::stripTECLayersNull ( ) const

Definition at line 703 of file HitPattern.cc.

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

Referenced by stripLayersNull().

704 {
705  int count = 0;
706  for (uint16_t layer = 1; layer <= 9; layer++) {
708  count++;
709  }
710  }
711  return count;
712 }
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:370
int HitPattern::stripTECLayersTotallyOffOrBad ( ) const

Definition at line 635 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

636 {
637  int count = 0;
638  for (uint16_t layer = 1; layer <= 9; layer++) {
639  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::INACTIVE) {
640  count++;
641  }
642  }
643  return count;
644 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::stripTECLayersWithMeasurement ( ) const

Definition at line 497 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().

498 {
499  int count = 0;
500  for (uint16_t layer = 1; layer <= 9; layer++) {
501  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::VALID) {
502  count++;
503  }
504  }
505  return count;
506 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::stripTECLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 565 of file HitPattern.cc.

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

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

566 {
567  int count = 0;
568  for (uint16_t layer = 1; layer <= 9; layer++) {
569  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::MISSING) {
570  count++;
571  }
572  }
573  return count;
574 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
bool reco::HitPattern::stripTIBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 550 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TIB.

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

551 {
553 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:541
int HitPattern::stripTIBLayersNull ( ) const

Definition at line 670 of file HitPattern.cc.

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

Referenced by stripLayersNull().

671 {
672  int count = 0;
673  for (uint16_t layer = 1; layer <= 4; layer++) {
675  count++;
676  }
677  }
678  return count;
679 }
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:370
int HitPattern::stripTIBLayersTotallyOffOrBad ( ) const

Definition at line 601 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

602 {
603  int count = 0;
604  for (uint16_t layer = 1; layer <= 4; layer++) {
605  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::INACTIVE) {
606  count++;
607  }
608  }
609  return count;
610 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::stripTIBLayersWithMeasurement ( ) const

Definition at line 464 of file HitPattern.cc.

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

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

465 {
466  int count = 0;
467  for (uint16_t layer = 1; layer <= 4; layer++) {
468  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::VALID) {
469  count++;
470  }
471  }
472  return count;
473 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::stripTIBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 532 of file HitPattern.cc.

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

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

533 {
534  int count = 0;
535  for (uint16_t layer = 1; layer <= 4; layer++) {
536  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::MISSING) {
537  count++;
538  }
539  }
540  return count;
541 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
bool reco::HitPattern::stripTIDHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 555 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TID.

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

556 {
558 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:541
int HitPattern::stripTIDLayersNull ( ) const

Definition at line 681 of file HitPattern.cc.

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

Referenced by stripLayersNull().

682 {
683  int count = 0;
684  for (uint16_t layer = 1; layer <= 3; layer++) {
686  count++;
687  }
688  }
689  return count;
690 }
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:370
int HitPattern::stripTIDLayersTotallyOffOrBad ( ) const

Definition at line 612 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

613 {
614  int count = 0;
615  for (uint16_t layer = 1; layer <= 3; layer++) {
616  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::INACTIVE) {
617  count++;
618  }
619  }
620  return count;
621 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::stripTIDLayersWithMeasurement ( ) const

Definition at line 475 of file HitPattern.cc.

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

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

476 {
477  int count = 0;
478  for (uint16_t layer = 1; layer <= 3; layer++) {
479  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::VALID) {
480  count++;
481  }
482  }
483  return count;
484 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::stripTIDLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 543 of file HitPattern.cc.

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

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

544 {
545  int count = 0;
546  for (uint16_t layer = 1; layer <= 3; layer++) {
547  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::MISSING) {
548  count++;
549  }
550  }
551  return count;
552 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
bool reco::HitPattern::stripTOBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 560 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TOB.

Referenced by numberOfLostStripTOBHits(), and numberOfValidStripTOBHits().

561 {
563 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:541
int HitPattern::stripTOBLayersNull ( ) const

Definition at line 692 of file HitPattern.cc.

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

Referenced by stripLayersNull().

693 {
694  int count = 0;
695  for (uint16_t layer = 1; layer <= 6; layer++) {
697  count++;
698  }
699  }
700  return count;
701 }
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:370
int HitPattern::stripTOBLayersTotallyOffOrBad ( ) const

Definition at line 623 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

624 {
625  int count = 0;
626  for (uint16_t layer = 1; layer <= 6; layer++) {
627 
628  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::INACTIVE) {
629  count++;
630  }
631  }
632  return count;
633 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::stripTOBLayersWithMeasurement ( ) const

Definition at line 486 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().

487 {
488  int count = 0;
489  for (uint16_t layer = 1; layer <= 6; layer++) {
490  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::VALID) {
491  count++;
492  }
493  }
494  return count;
495 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
int HitPattern::stripTOBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 554 of file HitPattern.cc.

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

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

555 {
556  int count = 0;
557  for (uint16_t layer = 1; layer <= 6; layer++) {
558  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::MISSING) {
559  count++;
560  }
561  }
562  return count;
563 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:370
bool reco::HitPattern::trackerHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 968 of file HitPattern.h.

References pixelLayersNull(), and stripLayersNull().

969 {
970  return pixelLayersNull() +
971  stripLayersNull();
972 }
int pixelLayersNull() const
Definition: HitPattern.h:974
int stripLayersNull() const
Definition: HitPattern.h:980
int reco::HitPattern::trackerLayersTotallyOffOrBad ( ) const
inline

Definition at line 948 of file HitPattern.h.

References pixelLayersTotallyOffOrBad(), and stripLayersTotallyOffOrBad().

949 {
950  return pixelLayersTotallyOffOrBad() +
952 }
int pixelLayersTotallyOffOrBad() const
Definition: HitPattern.h:954
int stripLayersTotallyOffOrBad() const
Definition: HitPattern.h:960
int reco::HitPattern::trackerLayersWithMeasurement ( ) const
inline
int reco::HitPattern::trackerLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 928 of file HitPattern.h.

References pixelLayersWithoutMeasurement(), and stripLayersWithoutMeasurement().

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

929 {
932 }
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:934
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:940
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

Definition at line 367 of file HitPattern.h.

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

const unsigned short reco::HitPattern::HitTypeOffset = 0
staticprivate

Definition at line 366 of file HitPattern.h.

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

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 uint32_t reco::HitPattern::NULL_RETURN = 999999
static
const unsigned short reco::HitPattern::SideMask = 0x1
staticprivate

Definition at line 371 of file HitPattern.h.

Referenced by encode(), and getSide().

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

Definition at line 370 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 378 of file HitPattern.h.

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