CMS 3D CMS Logo

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 | Friends
reco::HitPattern Class Reference

#include <HitPattern.h>

Public Types

enum  { MONO = 1, STEREO = 2 }
 
enum  HIT_DETECTOR_TYPE { MUON_HIT = 0, TRACKER_HIT = 1, MTD_HIT = 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, const TrackerTopology &ttopo)
 
bool appendHit (const TrackingRecHitRef &ref, const TrackerTopology &ttopo)
 
bool appendHit (const DetId &id, TrackingRecHit::Type hitType, const TrackerTopology &ttopo)
 
bool appendHit (const uint16_t pattern, TrackingRecHit::Type hitType)
 
template<typename I >
bool appendHits (const I &begin, const I &end, const TrackerTopology &ttopo)
 
bool appendMuonHit (const DetId &id, TrackingRecHit::Type hitType)
 
bool appendTrackerHit (uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType)
 
void clear ()
 
int cscStationsWithAnyHits () const
 
int cscStationsWithBadHits () const
 
int cscStationsWithValidHits () const
 
int dtStationsWithAnyHits () const
 
int dtStationsWithBadHits () const
 
int dtStationsWithValidHits () const
 
int gemStationsWithAnyHits () const
 
int gemStationsWithBadHits () const
 
int gemStationsWithValidHits () 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 hasValidHitInPixelLayer (enum PixelSubdetector::SubDetector, uint16_t layer) 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 me0StationsWithAnyHits () const
 
int me0StationsWithBadHits () const
 
int me0StationsWithValidHits () const
 
int muonStations (int subdet, int hitType) const
 subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad More...
 
int muonStationsWithAnyHits () const
 
int muonStationsWithBadHits () const
 
int muonStationsWithValidHits () const
 
int numberOfAllHits (HitCategory category) const
 
int numberOfAllTrackerHits (HitCategory category) const
 
int numberOfBadHits () const
 
int numberOfBadMuonCSCHits () const
 
int numberOfBadMuonDTHits () const
 
int numberOfBadMuonGEMHits () const
 
int numberOfBadMuonHits () const
 
int numberOfBadMuonME0Hits () const
 
int numberOfBadMuonRPCHits () const
 
int numberOfDTStationsWithBothViews () const
 
int numberOfDTStationsWithRPhiView () const
 
int numberOfDTStationsWithRZView () const
 
int numberOfInactiveHits () const
 
int numberOfInactiveTimingHits () const
 
int numberOfInactiveTrackerHits () const
 
int numberOfLostHits (HitCategory category) const
 
int numberOfLostMuonCSCHits () const
 
int numberOfLostMuonDTHits () const
 
int numberOfLostMuonGEMHits () const
 
int numberOfLostMuonHits () const
 
int numberOfLostMuonME0Hits () 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 numberOfLostTimingBTLHits () const
 
int numberOfLostTimingETLHits () const
 
int numberOfLostTimingHits () const
 
int numberOfLostTrackerHits (HitCategory category) const
 
int numberOfMuonHits () const
 
int numberOfTimingHits () const
 
int numberOfValidHits () const
 
int numberOfValidMuonCSCHits () const
 
int numberOfValidMuonDTHits () const
 
int numberOfValidMuonGEMHits () const
 
int numberOfValidMuonHits () const
 
int numberOfValidMuonME0Hits () 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 numberOfValidTimingBTLHits () const
 
int numberOfValidTimingETLHits () const
 
int numberOfValidTimingHits () 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 (HitCategory category=TRACK_HITS) const
 
int pixelBarrelLayersWithMeasurement () const
 
int pixelBarrelLayersWithoutMeasurement (HitCategory category) const
 
int pixelEndcapLayersNull () const
 
int pixelEndcapLayersTotallyOffOrBad (HitCategory category=TRACK_HITS) const
 
int pixelEndcapLayersWithMeasurement () const
 
int pixelEndcapLayersWithoutMeasurement (HitCategory category) const
 
int pixelLayersNull () const
 
int pixelLayersTotallyOffOrBad (HitCategory category=TRACK_HITS) const
 
int pixelLayersWithMeasurement () const
 
int pixelLayersWithMeasurementOld () const
 
int pixelLayersWithoutMeasurement (HitCategory category) const
 
void print (HitCategory category, std::ostream &stream=std::cout) const
 
void printHitPattern (HitCategory category, int position, std::ostream &stream) const
 
int rpcStationsWithAnyHits () const
 
int rpcStationsWithBadHits () const
 
int rpcStationsWithValidHits () const
 
int stripLayersNull () const
 
int stripLayersTotallyOffOrBad (HitCategory category=TRACK_HITS) const
 
int stripLayersWithMeasurement () const
 
int stripLayersWithoutMeasurement (HitCategory category) const
 
int stripTECLayersNull () const
 
int stripTECLayersTotallyOffOrBad (HitCategory category=TRACK_HITS) const
 
int stripTECLayersWithMeasurement () const
 
int stripTECLayersWithoutMeasurement (HitCategory category) const
 
int stripTIBLayersNull () const
 
int stripTIBLayersTotallyOffOrBad (HitCategory category=TRACK_HITS) const
 
int stripTIBLayersWithMeasurement () const
 
int stripTIBLayersWithoutMeasurement (HitCategory category) const
 
int stripTIDLayersNull () const
 
int stripTIDLayersTotallyOffOrBad (HitCategory category=TRACK_HITS) const
 
int stripTIDLayersWithMeasurement () const
 
int stripTIDLayersWithoutMeasurement (HitCategory category) const
 
int stripTOBLayersNull () const
 
int stripTOBLayersTotallyOffOrBad (HitCategory category=TRACK_HITS) const
 
int stripTOBLayersWithMeasurement () const
 
int stripTOBLayersWithoutMeasurement (HitCategory category) const
 
int trackerLayersNull () const
 
int trackerLayersTotallyOffOrBad (HitCategory category=TRACK_HITS) const
 
int trackerLayersWithMeasurement () const
 
int trackerLayersWithMeasurementOld () const
 
int trackerLayersWithoutMeasurement (HitCategory category) const
 
int trackerLayersWithoutMeasurementOld (HitCategory category) const
 
 ~HitPattern ()
 

Static Public Member Functions

static bool badHitFilter (uint16_t pattern)
 
static bool fillNewHitPatternWithOldHitPattern_v12 (const uint16_t oldHitPattern[], uint8_t hitCount, uint8_t beginTrackHits, uint8_t endTrackHits, uint8_t beginInner, uint8_t endInner, uint8_t beginOuter, uint8_t endOuter, reco::HitPattern *newObj)
 
static uint16_t getBTLModType (uint16_t pattern)
 BTL Module type: 1,2,3. Only valid for BTL patterns of course. More...
 
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 uint16_t getETLRing (uint16_t pattern)
 ETL Ring: 1-12. Only valid for ETL patterns of course. More...
 
static uint16_t getGEMLayer (uint16_t pattern)
 GEM layer: 1,2. Only valid for muon GEM patterns, of course. More...
 
static uint16_t getGEMStation (uint16_t pattern)
 GEM station: 1,2. Only valid for muon GEM 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 muonGEMHitFilter (uint16_t pattern)
 
static bool muonHitFilter (uint16_t pattern)
 
static bool muonME0HitFilter (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 timingBTLHitFilter (uint16_t pattern)
 
static bool timingETLHitFilter (uint16_t pattern)
 
static bool timingHitFilter (uint16_t pattern)
 
static bool trackerHitFilter (uint16_t pattern)
 
static bool validHitFilter (uint16_t pattern)
 

Static Public Attributes

static const unsigned short ARRAY_LENGTH = 57
 
static const uint16_t EMPTY_PATTERN = 0x0
 
static const unsigned short HIT_LENGTH = 12
 
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)
 
friend int::test::TestHitPattern::test ()
 

Static Private Member Functions

static uint16_t encode (const TrackingRecHit &hit, const TrackerTopology &ttopo)
 
static uint16_t encode (const DetId &id, TrackingRecHit::Type hitType, const TrackerTopology &ttopo)
 
static uint16_t encode (uint16_t det, uint16_t subdet, uint16_t layer, uint16_t side, TrackingRecHit::Type hitType)
 
static uint16_t isStereo (DetId i, const TrackerTopology &ttopo)
 
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 maxTrackerWord = (2 << SubDetectorOffset) - 1
 
static const unsigned short minPixelWord = minTrackerWord | (1<<SubstrOffset)
 
static const unsigned short minStripWord = minTrackerWord | (3<<SubstrOffset)
 
static const unsigned short minTrackerWord = 1 << SubDetectorOffset
 
static const unsigned short SideMask = 0x1
 
static const unsigned short SideOffset = 2
 
static const unsigned short SubDetectorMask = 0x3
 
static const unsigned short SubDetectorOffset = 10
 
static const unsigned short SubstrMask = 0x7
 
static const unsigned short SubstrOffset = 7
 

Friends

template<int N>
struct PatternSet
 

Detailed Description

Definition at line 149 of file HitPattern.h.

Member Typedef Documentation

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

Definition at line 493 of file HitPattern.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MONO 
STEREO 

Definition at line 153 of file HitPattern.h.

153  {
154  MONO = 1,
155  STEREO = 2
156  };
Enumerator
MUON_HIT 
TRACKER_HIT 
MTD_HIT 

Definition at line 158 of file HitPattern.h.

Enumerator
VALID 
MISSING 
INACTIVE 
BAD 

Definition at line 164 of file HitPattern.h.

Enumerator
TRACK_HITS 
MISSING_INNER_HITS 
MISSING_OUTER_HITS 

Definition at line 171 of file HitPattern.h.

Constructor & Destructor Documentation

HitPattern::HitPattern ( )

Definition at line 20 of file HitPattern.cc.

References ARRAY_LENGTH, EMPTY_PATTERN, and hitPattern.

20  :
21  hitCount(0),
22  beginTrackHits(0),
23  endTrackHits(0),
24  beginInner(0),
25  endInner(0),
26  beginOuter(0),
27  endOuter(0)
28 {
30 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:176
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
uint8_t endInner
Definition: HitPattern.h:516
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:510
uint8_t beginInner
Definition: HitPattern.h:515
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint8_t hitCount
Definition: HitPattern.h:511
uint8_t beginOuter
Definition: HitPattern.h:517
uint8_t endOuter
Definition: HitPattern.h:518
HitPattern::~HitPattern ( )

Definition at line 44 of file HitPattern.cc.

45 {
46  ;
47 }
HitPattern::HitPattern ( const HitPattern other)

Definition at line 32 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

32  :
33  hitCount(other.hitCount),
36  beginInner(other.beginInner),
37  endInner(other.endInner),
38  beginOuter(other.beginOuter),
39  endOuter(other.endOuter)
40 {
41  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
42 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:176
uint8_t endInner
Definition: HitPattern.h:516
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:510
uint8_t beginInner
Definition: HitPattern.h:515
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint8_t hitCount
Definition: HitPattern.h:511
uint8_t beginOuter
Definition: HitPattern.h:517
uint8_t endOuter
Definition: HitPattern.h:518

Member Function Documentation

bool HitPattern::appendHit ( const TrackingRecHit hit,
const TrackerTopology ttopo 
)

Definition at line 226 of file HitPattern.cc.

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

Referenced by appendHit(), reco::TrackBase::appendHitPattern(), appendMuonHit(), appendTrackerHit(), and fillNewHitPatternWithOldHitPattern_v12().

227 {
228  return appendHit(hit.geographicalId(), hit.getType(), ttopo);
229 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:226
Type getType() const
DetId geographicalId() const
bool HitPattern::appendHit ( const TrackingRecHitRef ref,
const TrackerTopology ttopo 
)

Definition at line 84 of file HitPattern.cc.

References appendHit().

85 {
86  return appendHit(*ref, ttopo);
87 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:226
bool HitPattern::appendHit ( const DetId id,
TrackingRecHit::Type  hitType,
const TrackerTopology ttopo 
)

Definition at line 231 of file HitPattern.cc.

References appendHit(), encode(), hitCount, MaxHits, listBenchmarks::pattern, and UNLIKELY.

232 {
233  //if HitPattern is full, journey ends no matter what.
235  return false;
236  }
237 
238  uint16_t pattern = HitPattern::encode(id, hitType, ttopo);
239 
240  return appendHit(pattern, hitType);
241 }
static const unsigned short MaxHits
Definition: HitPattern.h:178
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:226
uint8_t hitCount
Definition: HitPattern.h:511
#define UNLIKELY(x)
Definition: Likely.h:21
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:89
bool HitPattern::appendHit ( const uint16_t  pattern,
TrackingRecHit::Type  hitType 
)

Definition at line 243 of file HitPattern.cc.

References TrackingRecHit::bad, beginInner, beginOuter, beginTrackHits, endInner, endOuter, endTrackHits, Exception, hitCount, TrackingRecHit::inactive, TrackingRecHit::inactive_inner, TrackingRecHit::inactive_outer, insertExpectedInnerHit(), insertExpectedOuterHit(), insertTrackHit(), MaxHits, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, UNLIKELY, and TrackingRecHit::valid.

244 {
245  //if HitPattern is full, journey ends no matter what.
247  return false;
248  }
249 
250  switch (hitType) {
254  case TrackingRecHit::bad:
255  // hitCount != endT => we are not inserting T type of hits but of T'
256  // 0 != beginT || 0 != endT => we already have hits of T type
257  // so we already have hits of T in the vector and we don't want to
258  // mess them with T' hits.
259  if UNLIKELY(((hitCount != endTrackHits) && (0 != beginTrackHits || 0 != endTrackHits))) {
260  cms::Exception("HitPattern")
261  << "TRACK_HITS"
262  << " were stored on this object before hits of some other category were inserted "
263  << "but hits of the same category should be inserted in a row. "
264  << "Please rework the code so it inserts all "
265  << "TRACK_HITS"
266  << " in a row.";
267  return false;
268  }
269  return insertTrackHit(pattern);
270  break;
273  if UNLIKELY(((hitCount != endInner) && (0 != beginInner || 0 != endInner))) {
274  cms::Exception("HitPattern")
275  << "MISSING_INNER_HITS"
276  << " were stored on this object before hits of some other category were inserted "
277  << "but hits of the same category should be inserted in a row. "
278  << "Please rework the code so it inserts all "
279  << "MISSING_INNER_HITS"
280  << " in a row.";
281  return false;
282  }
284  break;
287  if UNLIKELY(((hitCount != endOuter) && (0 != beginOuter || 0 != endOuter))) {
288  cms::Exception("HitPattern")
289  << "MISSING_OUTER_HITS"
290  << " were stored on this object before hits of some other category were inserted "
291  << "but hits of the same category should be inserted in a row. "
292  << "Please rework the code so it inserts all "
293  << "MISSING_OUTER_HITS"
294  << " in a row.";
295  return false;
296  }
298  break;
299  }
300 
301  return false;
302 }
static const unsigned short MaxHits
Definition: HitPattern.h:178
bool insertExpectedOuterHit(const uint16_t pattern)
Definition: HitPattern.cc:1086
uint8_t endInner
Definition: HitPattern.h:516
uint8_t beginInner
Definition: HitPattern.h:515
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint8_t hitCount
Definition: HitPattern.h:511
uint8_t beginOuter
Definition: HitPattern.h:517
bool insertExpectedInnerHit(const uint16_t pattern)
Definition: HitPattern.cc:1073
bool insertTrackHit(const uint16_t pattern)
Definition: HitPattern.cc:1054
#define UNLIKELY(x)
Definition: Likely.h:21
uint8_t endOuter
Definition: HitPattern.h:518
template<typename I >
bool reco::HitPattern::appendHits ( const I &  begin,
const I &  end,
const TrackerTopology ttopo 
)

Definition at line 543 of file HitPattern.h.

References end, Exhume::I, and UNLIKELY.

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

544 {
545  for (I hit = begin; hit != end; hit++) {
546  if UNLIKELY((!appendHit(*hit, ttopo))) {
547  return false;
548  }
549  }
550  return true;
551 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:226
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
#define UNLIKELY(x)
Definition: Likely.h:21
bool HitPattern::appendMuonHit ( const DetId id,
TrackingRecHit::Type  hitType 
)

This is meant to be used only in cases where the an already-packed hit information is re-interpreted in terms of HitPattern (i.e. the IO rule for reading old versions of HitPattern)

Definition at line 308 of file HitPattern.cc.

References appendHit(), encode(), Exception, hitCount, MaxHits, DetId::Muon, MUON_HIT, and UNLIKELY.

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

308  {
309  //if HitPattern is full, journey ends no matter what.
311  return false;
312  }
313 
314  if UNLIKELY(id.det() != DetId::Muon) {
315  throw cms::Exception("HitPattern") << "Got DetId from det " << id.det() << " that is not Muon in appendMuonHit(), which should only be used for muon hits in the HitPattern IO rule";
316  }
317 
318  uint16_t subdet = id.subdetId();
319  return appendHit(encode(MUON_HIT, subdet, encodeMuonLayer(id), 0, hitType), hitType);
320 }
static const unsigned short MaxHits
Definition: HitPattern.h:178
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:226
uint8_t hitCount
Definition: HitPattern.h:511
#define UNLIKELY(x)
Definition: Likely.h:21
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:89
bool HitPattern::appendTrackerHit ( uint16_t  subdet,
uint16_t  layer,
uint16_t  stereo,
TrackingRecHit::Type  hitType 
)

This is meant to be used only in cases where the an already-packed hit information is re-interpreted in terms of HitPattern (i.e. MiniAOD PackedCandidate, and the IO rule for reading old versions of HitPattern)

Definition at line 304 of file HitPattern.cc.

References appendHit(), encode(), and TRACKER_HIT.

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

304  {
305  return appendHit(encode(TRACKER_HIT, subdet, layer, stereo, hitType), hitType);
306 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:226
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:89
bool reco::HitPattern::badHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 870 of file HitPattern.h.

References hcaldqm::constants::BAD.

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

Definition at line 577 of file HitPattern.h.

References f, mps_fire::i, and listBenchmarks::pattern.

Referenced by reco::PatternSet< N >::fill().

578 {
579  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
580  for (int i = range.first; i < range.second; i++) {
582  // f() return false to ask to stop looping
583  if (typeFilter(pattern) && !f(pattern)) {
584  break;
585  }
586  }
587 }
double f[11][100]
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
void HitPattern::clear ( void  )

Definition at line 71 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(), fillNewHitPatternWithOldHitPattern_v12(), 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().

72 {
73  this->hitCount = 0;
74  this->beginTrackHits = 0;
75  this->endTrackHits = 0;
76  this->beginInner = 0;
77  this->endInner = 0;
78  this->beginOuter = 0;
79  this->endOuter = 0;
80 
81  memset(this->hitPattern, EMPTY_PATTERN, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
82 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:176
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
uint8_t endInner
Definition: HitPattern.h:516
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:510
uint8_t beginInner
Definition: HitPattern.h:515
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint8_t hitCount
Definition: HitPattern.h:511
uint8_t beginOuter
Definition: HitPattern.h:517
uint8_t endOuter
Definition: HitPattern.h:518
int reco::HitPattern::countHits ( HitCategory  category,
filterType  filter 
) const
inlineprivate

Definition at line 563 of file HitPattern.h.

References KineDebug3::count(), ALCARECOTkAlBeamHalo_cff::filter, and mps_fire::i.

564 {
565  int count = 0;
566  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
567  for (int i = range.first; i < range.second; ++i) {
569  ++count;
570  }
571  }
572  return count;
573 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
int reco::HitPattern::countTypedHits ( HitCategory  category,
filterType  typeFilter,
filterType  filter 
) const
inlineprivate

Definition at line 589 of file HitPattern.h.

References KineDebug3::count(), ALCARECOTkAlBeamHalo_cff::filter, mps_fire::i, and listBenchmarks::pattern.

590 {
591  int count = 0;
592  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
593  for (int i = range.first; i < range.second; ++i) {
595  if (typeFilter(pattern) && filter(pattern)) {
596  ++count;
597  }
598  }
599  return count;
600 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
int reco::HitPattern::cscStationsWithAnyHits ( ) const
inline

Definition at line 1244 of file HitPattern.h.

1245 {
1246  return muonStations(2, -1);
1247 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::cscStationsWithBadHits ( ) const
inline

Definition at line 1239 of file HitPattern.h.

1240 {
1241  return muonStations(2, 3);
1242 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::cscStationsWithValidHits ( ) const
inline

Definition at line 1234 of file HitPattern.h.

1235 {
1236  return muonStations(2, 0);
1237 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::dtStationsWithAnyHits ( ) const
inline

Definition at line 1229 of file HitPattern.h.

1230 {
1231  return muonStations(1, -1);
1232 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::dtStationsWithBadHits ( ) const
inline

Definition at line 1224 of file HitPattern.h.

1225 {
1226  return muonStations(1, 3);
1227 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::dtStationsWithValidHits ( ) const
inline

Definition at line 1219 of file HitPattern.h.

1220 {
1221  return muonStations(1, 0);
1222 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
uint16_t HitPattern::encode ( const TrackingRecHit hit,
const TrackerTopology ttopo 
)
staticprivate
uint16_t HitPattern::encode ( const DetId id,
TrackingRecHit::Type  hitType,
const TrackerTopology ttopo 
)
staticprivate

Definition at line 163 of file HitPattern.cc.

References encode(), FastTime, DetId::Forward, isStereo(), TrackerTopology::layer(), MTD_HIT, DetId::Muon, MUON_HIT, DetId::Tracker, and TRACKER_HIT.

164 {
165  uint16_t detid = id.det();
166  uint16_t subdet = id.subdetId();
167 
168  // adding layer/disk/wheel bits
169  uint16_t layer = 0x0;
170  if (detid == DetId::Tracker) {
171  layer = ttopo.layer(id);
172  } else if (detid == DetId::Muon) {
173  layer = encodeMuonLayer(id);
174  } else if( detid == DetId::Forward && subdet == FastTime ) {
175  layer = encodeTimingLayer(id);
176  }
177 
178  // adding mono/stereo bit
179  uint16_t side = 0x0;
180  if (detid == DetId::Tracker) {
181  side = isStereo(id, ttopo);
182  } else if (detid == DetId::Muon || (detid == DetId::Forward && subdet == FastTime) ) {
183  side = 0x0;
184  }
185 
186  // juggle the detid around to deal with the fact the bitwidth is larger
187  // DetId::Muon is 2 and DetId::Forward is 6, must map to 0 and 2 respectively
188  if( detid == DetId::Tracker ) {
189  detid = TRACKER_HIT;
190  } else if( detid == DetId::Muon ) {
191  detid = MUON_HIT; // DetId::Muon is 2 and needs to be reordered to match old encoding where it got masked
192  } else if( detid == DetId::Forward && subdet == FastTime ) {
193  detid = MTD_HIT; // since DetId::Forward is some other number, reorder it here
194  }
195 
196  return encode(detid, subdet, layer, side, hitType);
197 }
static uint16_t isStereo(DetId i, const TrackerTopology &ttopo)
Definition: HitPattern.cc:928
unsigned int layer(const DetId &id) const
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:89
uint16_t HitPattern::encode ( uint16_t  det,
uint16_t  subdet,
uint16_t  layer,
uint16_t  side,
TrackingRecHit::Type  hitType 
)
staticprivate

Definition at line 199 of file HitPattern.cc.

References EMPTY_PATTERN, HitTypeMask, HitTypeOffset, TrackingRecHit::inactive, TrackingRecHit::inactive_inner, TrackingRecHit::inactive_outer, LayerMask, LayerOffset, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, listBenchmarks::pattern, SideMask, SideOffset, SubDetectorMask, SubDetectorOffset, SubstrMask, and SubstrOffset.

199  {
201 
202  // adding tracker/muon/mtd detector bits
203  pattern |= (det & SubDetectorMask) << SubDetectorOffset;
204 
205  // adding substructure (PXB, PXF, TIB, TID, TOB, TEC, or DT, CSC, RPC,GEM, or BTL, ETL) bits
206  pattern |= (subdet & SubstrMask) << SubstrOffset;
207 
208  // adding layer/disk/wheel/ring/modType bits
209  pattern |= (layer & LayerMask) << LayerOffset;
210 
211  // adding mono/stereo bit
212  pattern |= (side & SideMask) << SideOffset;
213 
214  TrackingRecHit::Type patternHitType = (hitType == TrackingRecHit::missing_inner ||
216  : (
217  (hitType == TrackingRecHit::inactive_inner ||
219  :hitType);
220 
221  pattern |= (patternHitType & HitTypeMask) << HitTypeOffset;
222 
223  return pattern;
224 }
static const unsigned short SideOffset
Definition: HitPattern.h:463
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SubstrOffset
Definition: HitPattern.h:471
static const unsigned short HitTypeMask
Definition: HitPattern.h:460
static const unsigned short SubDetectorMask
Definition: HitPattern.h:476
static const unsigned short HitTypeOffset
Definition: HitPattern.h:459
static const unsigned short SideMask
Definition: HitPattern.h:464
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:475
static const unsigned short SubstrMask
Definition: HitPattern.h:472
static const unsigned short LayerOffset
Definition: HitPattern.h:467
static const unsigned short LayerMask
Definition: HitPattern.h:468
bool reco::HitPattern::fillNewHitPatternWithOldHitPattern_v12 ( const uint16_t  oldHitPattern[],
uint8_t  hitCount,
uint8_t  beginTrackHits,
uint8_t  endTrackHits,
uint8_t  beginInner,
uint8_t  endInner,
uint8_t  beginOuter,
uint8_t  endOuter,
reco::HitPattern newObj 
)
static

Definition at line 61 of file rootio_HitPattern.cc.

References appendHit(), beginInner, beginOuter, beginTrackHits, clear(), endInner, endOuter, endTrackHits, hitCount, mps_fire::i, and listBenchmarks::pattern.

66  {
67  newObj->clear();
68  bool ret = true;
69  for (int i = 0; i < MaxHitsV12; i++) {
70  uint16_t pattern = getHitFromOldHitPattern(oldHitPattern, i);
71  if (pattern == 0) {
72  break;
73  }
74  if(! newObj->appendHit(pattern, hitTypeFromOldHitPattern(pattern)) ) {
75  ret = false;
76  break;
77  }
78  }
79  newObj->hitCount = hitCount;
81  newObj->endTrackHits = endTrackHits;
82  newObj->beginInner = beginInner;
83  newObj->endInner = endInner;
84  newObj->beginOuter = beginOuter;
85  newObj->endOuter = endOuter;
86  return ret;
87 }
uint8_t endInner
Definition: HitPattern.h:516
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:226
uint8_t beginInner
Definition: HitPattern.h:515
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint8_t hitCount
Definition: HitPattern.h:511
uint8_t beginOuter
Definition: HitPattern.h:517
uint8_t endOuter
Definition: HitPattern.h:518
int reco::HitPattern::gemStationsWithAnyHits ( ) const
inline

Definition at line 1274 of file HitPattern.h.

1275 {
1276  return muonStations(4,-1);
1277 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::gemStationsWithBadHits ( ) const
inline

Definition at line 1269 of file HitPattern.h.

1270 {
1271  return muonStations(4, 3);
1272 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::gemStationsWithValidHits ( ) const
inline

Definition at line 1264 of file HitPattern.h.

1265 {
1266  return muonStations(4, 0);
1267 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
uint16_t reco::HitPattern::getBTLModType ( uint16_t  pattern)
inlinestatic

BTL Module type: 1,2,3. Only valid for BTL patterns of course.

MTD.

Definition at line 842 of file HitPattern.h.

842  {
843  return getSubSubStructure(pattern);
844 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
std::pair< uint8_t, uint8_t > reco::HitPattern::getCategoryIndexRange ( HitCategory  category) const
inlineprivate

Definition at line 526 of file HitPattern.h.

Referenced by getTrackerLayerCase(), getTrackerMonoStereo(), numberOfValidStripLayersWithMonoAndStereo(), pixelLayersWithMeasurement(), trackerLayersWithMeasurement(), and trackerLayersWithoutMeasurement().

527 {
528  switch (category) {
529  case TRACK_HITS:
530  return std::pair<uint8_t, uint8_t>(beginTrackHits, endTrackHits);
531  break;
532  case MISSING_INNER_HITS:
533  return std::pair<uint8_t, uint8_t>(beginInner, endInner);
534  break;
535  case MISSING_OUTER_HITS:
536  return std::pair<uint8_t, uint8_t>(beginOuter, endOuter);
537  break;
538  }
539  return std::pair<uint8_t, uint8_t>(-1, -1);
540 }
uint8_t endInner
Definition: HitPattern.h:516
uint8_t beginInner
Definition: HitPattern.h:515
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint8_t beginOuter
Definition: HitPattern.h:517
uint8_t endOuter
Definition: HitPattern.h:518
uint16_t reco::HitPattern::getCSCRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 811 of file HitPattern.h.

Referenced by printHitPattern().

812 {
813  return (getSubSubStructure(pattern) & 3) + 1;
814 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
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 806 of file HitPattern.h.

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

807 {
808  return (getSubSubStructure(pattern) & 3);
809 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
uint16_t reco::HitPattern::getETLRing ( uint16_t  pattern)
inlinestatic

ETL Ring: 1-12. Only valid for ETL patterns of course.

Definition at line 846 of file HitPattern.h.

846  {
847  return getSubSubStructure(pattern);
848 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
uint16_t reco::HitPattern::getGEMLayer ( uint16_t  pattern)
inlinestatic

GEM layer: 1,2. Only valid for muon GEM patterns, of course.

Definition at line 850 of file HitPattern.h.

Referenced by printHitPattern().

851 {
852  return (getSubSubStructure(pattern) & 1) + 1;
853 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
uint16_t reco::HitPattern::getGEMStation ( uint16_t  pattern)
inlinestatic

GEM station: 1,2. Only valid for muon GEM patterns, of course.

Definition at line 834 of file HitPattern.h.

Referenced by printHitPattern().

836 {
837  uint16_t sss = getSubSubStructure(pattern), stat = sss >> 1;
838  return stat + 1;
839 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
uint16_t reco::HitPattern::getHitPattern ( HitCategory  category,
int  position 
) const
inline

Definition at line 553 of file HitPattern.h.

References UNLIKELY.

Referenced by PFCheckHitPattern::analyze(), pat::SoftMuonMvaEstimator::computeMva(), reco::tau::countHits(), OniaPhotonConversionProducer::foundCompatibleInnerHits(), gsfElectronTools::getClosestCtfToGsf(), PrimaryVertexValidation::hasFirstLayerPixelHits(), SoftPFElectronTagInfoProducer::isElecClean(), PFElecTkProducer::isInnerMost(), CheckHitPattern::operator()(), FWTrackResidualDetailView::prepareData(), CheckHitPattern::print(), PFCheckHitPattern::print(), print(), printHitPattern(), pat::PATPackedCandidateProducer::produce(), FWConvTrackHitsDetailView::setTextInfo(), EgAmbiguityTools::sharedDets(), EgAmbiguityTools::sharedHits(), and QcdUeDQM::trackSelection().

554 {
555  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
556  if UNLIKELY((position < 0 || (position + range.first) >= range.second)) {
558  }
559 
560  return getHitPatternByAbsoluteIndex(range.first + position);
561 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static int position[264][3]
Definition: ReadPGInfo.cc:509
#define UNLIKELY(x)
Definition: Likely.h:21
uint16_t HitPattern::getHitPatternByAbsoluteIndex ( int  position) const
private

Definition at line 322 of file HitPattern.cc.

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

Referenced by getTrackerLayerCase(), getTrackerMonoStereo(), hasValidHitInPixelLayer(), innermostMuonStationWithHits(), muonStations(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), numberOfValidStripLayersWithMonoAndStereo(), outermostMuonStationWithHits(), pixelLayersWithMeasurement(), trackerLayersWithMeasurement(), and trackerLayersWithoutMeasurement().

323 {
324  if UNLIKELY((position < 0 || position >= hitCount)) {
326  }
327  /*
328  Note: you are not taking a consecutive sequence of HIT_LENGTH bits starting from position * HIT_LENGTH
329  as the bit order in the words are reversed.
330  e.g. if position = 0 you take the lowest 12 bits of the first word.
331 
332  I hope this can clarify what is the memory layout of such thing
333 
334  straight 01234567890123456789012345678901 | 23456789012345678901234567890123 | 4567
335  (global) 0 1 2 3 | 3 4 5 6 | 6
336  words [--------------0---------------] | [--------------1---------------] | [---
337  word 01234567890123456789012345678901 | 01234567890123456789012345678901 | 0123
338  (str) 0 1 2 3 | 0 1 2 3 | 0
339  [--------------0---------------] | [--------------1---------------] | [---
340  word 10987654321098765432109876543210 | 10987654321098765432109876543210 | 1098
341  (rev) 32 21 10 0 | 32 21 10 0 | 32
342  reverse 10987654321098765432109876543210 | 32109876543210987654321098765432 | 5432
343  32 21 10 0 | 6 65 54 43 3 9
344 
345  ugly enough, but it's not my fault, I was not even in CMS at that time [gpetrucc]
346  */
347 
348  uint16_t bitEndOffset = (position + 1) * HIT_LENGTH;
349  uint8_t secondWord = (bitEndOffset >> 4);
350  uint8_t secondWordBits = bitEndOffset & (16 - 1); // that is, bitEndOffset % 16
351  if (secondWordBits >= HIT_LENGTH) { // full block is in this word
352  uint8_t lowBitsToTrash = secondWordBits - HIT_LENGTH;
353  uint16_t myResult = (hitPattern[secondWord] >> lowBitsToTrash) & ((1 << HIT_LENGTH) - 1);
354  return myResult;
355  } else {
356  uint8_t firstWordBits = HIT_LENGTH - secondWordBits;
357  uint16_t firstWordBlock = hitPattern[secondWord - 1] >> (16 - firstWordBits);
358  uint16_t secondWordBlock = hitPattern[secondWord] & ((1 << secondWordBits) - 1);
359  uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
360  return myResult;
361  }
362 }
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:177
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:510
uint8_t hitCount
Definition: HitPattern.h:511
static int position[264][3]
Definition: ReadPGInfo.cc:509
#define UNLIKELY(x)
Definition: Likely.h:21
uint32_t reco::HitPattern::getHitType ( uint16_t  pattern)
inlinestatic

Definition at line 792 of file HitPattern.h.

References UNLIKELY.

Referenced by reco::tau::countHits(), innermostMuonStationWithHits(), muonStations(), outermostMuonStationWithHits(), CheckHitPattern::print(), PFCheckHitPattern::print(), and printHitPattern().

793 {
795  return NULL_RETURN;
796  }
797 
798  return ((pattern >> HitTypeOffset) & HitTypeMask);
799 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short HitTypeMask
Definition: HitPattern.h:460
static const unsigned short HitTypeOffset
Definition: HitPattern.h:459
#define UNLIKELY(x)
Definition: Likely.h:21
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 801 of file HitPattern.h.

Referenced by pat::SoftMuonMvaEstimator::computeMva(), reco::tau::countHits(), innermostMuonStationWithHits(), muonStations(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), outermostMuonStationWithHits(), and printHitPattern().

802 {
803  return (getSubSubStructure(pattern) >> 2) + 1;
804 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
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 816 of file HitPattern.h.

References LIKELY.

Referenced by printHitPattern().

817 {
818  uint16_t subSubStructure = getSubSubStructure(pattern);
819  uint16_t stat = subSubStructure >> 2;
820 
821  if LIKELY(stat <= 1) {
822  return ((subSubStructure >> 1) & 1) + 1;
823  }
824 
825  return 0;
826 }
#define LIKELY(x)
Definition: Likely.h:20
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
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 828 of file HitPattern.h.

Referenced by printHitPattern().

829 {
830  return getSubSubStructure(pattern) & 1;
831 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
uint32_t reco::HitPattern::getSide ( uint16_t  pattern)
inlinestatic

Definition at line 783 of file HitPattern.h.

References UNLIKELY.

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

784 {
786  return NULL_RETURN;
787  }
788 
789  return (pattern >> SideOffset) & SideMask;
790 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const unsigned short SideOffset
Definition: HitPattern.h:463
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SideMask
Definition: HitPattern.h:464
#define UNLIKELY(x)
Definition: Likely.h:21
uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 773 of file HitPattern.h.

References UNLIKELY.

774 {
776  return NULL_RETURN;
777  }
778 
779  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
780 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SubDetectorMask
Definition: HitPattern.h:476
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:475
#define UNLIKELY(x)
Definition: Likely.h:21
uint32_t reco::HitPattern::getSubStructure ( uint16_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getSubSubStructure ( uint16_t  pattern)
inlinestatic

Definition at line 764 of file HitPattern.h.

References UNLIKELY.

Referenced by numberOfValidStripLayersWithMonoAndStereo().

765 {
767  return NULL_RETURN;
768  }
769 
770  return ((pattern >> LayerOffset) & LayerMask);
771 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short LayerOffset
Definition: HitPattern.h:467
#define UNLIKELY(x)
Definition: Likely.h:21
static const unsigned short LayerMask
Definition: HitPattern.h:468
uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 467 of file HitPattern.cc.

References hcaldqm::constants::BAD, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerMask, LayerOffset, RecoTauDiscriminantConfiguration::mask, 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().

468 {
469  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
470  + ((substr & SubstrMask) << SubstrOffset)
471  + ((layer & LayerMask) << LayerOffset);
472 
473  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
474  + (SubstrMask << SubstrOffset)
475  + (LayerMask << LayerOffset);
476 
477  // layer case 0: valid + (missing, off, bad) ==> with measurement
478  // layer case 1: missing + (off, bad) ==> without measurement
479  // layer case 2: off, bad ==> totally off or bad, cannot say much
480  // layer case NULL_RETURN: track outside acceptance or in gap ==> null
481  uint32_t layerCase = NULL_RETURN;
482  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
483  for (int i = range.first; i < range.second; ++i) {
485  if ((pattern & mask) == tk_substr_layer) {
486  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
487  if (hitType < layerCase) {
488  // BAD and INACTIVE as the same type (as INACTIVE)
489  layerCase = (hitType == HIT_TYPE::BAD ? HIT_TYPE::INACTIVE : hitType);
490  if (layerCase == HIT_TYPE::VALID) {
491  break;
492  }
493  }
494  }
495  }
496  return layerCase;
497 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const unsigned short SubstrOffset
Definition: HitPattern.h:471
static const unsigned short HitTypeMask
Definition: HitPattern.h:460
static const unsigned short SubDetectorMask
Definition: HitPattern.h:476
static const unsigned short HitTypeOffset
Definition: HitPattern.h:459
double const BAD
Definition: Constants.h:15
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:475
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static const unsigned short SubstrMask
Definition: HitPattern.h:472
static const unsigned short LayerOffset
Definition: HitPattern.h:467
static const unsigned short LayerMask
Definition: HitPattern.h:468
uint16_t HitPattern::getTrackerMonoStereo ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 499 of file HitPattern.cc.

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

Referenced by OniaPhotonConversionProducer::foundCompatibleInnerHits().

500 {
501  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
502  + ((substr & SubstrMask) << SubstrOffset)
503  + ((layer & LayerMask) << LayerOffset);
504  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
505  + (SubstrMask << SubstrOffset)
506  + (LayerMask << LayerOffset);
507 
508  // 0: neither a valid mono nor a valid stereo hit
509  // MONO: valid mono hit
510  // STEREO: valid stereo hit
511  // MONO | STEREO: both
512  uint16_t monoStereo = 0x0;
513  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
514  for (int i = range.first; i < range.second; ++i) {
516  if ((pattern & mask) == tk_substr_layer) {
517  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
518  if (hitType == HIT_TYPE::VALID) {
519  switch (getSide(pattern)) {
520  case 0: // mono
521  monoStereo |= MONO;
522  break;
523  case 1: // stereo
524  monoStereo |= STEREO;
525  break;
526  }
527  }
528 
529  if (monoStereo == (MONO | STEREO)) {
530  break;
531  }
532  }
533  }
534  return monoStereo;
535 }
static const unsigned short SubstrOffset
Definition: HitPattern.h:471
static const unsigned short HitTypeMask
Definition: HitPattern.h:460
static const unsigned short SubDetectorMask
Definition: HitPattern.h:476
static const unsigned short HitTypeOffset
Definition: HitPattern.h:459
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:475
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:783
static const unsigned short SubstrMask
Definition: HitPattern.h:472
static const unsigned short LayerOffset
Definition: HitPattern.h:467
static const unsigned short LayerMask
Definition: HitPattern.h:468
bool HitPattern::hasValidHitInPixelLayer ( enum PixelSubdetector::SubDetector  det,
uint16_t  layer 
) const

Definition at line 365 of file HitPattern.cc.

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

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

366 {
367  for (int i = beginTrackHits; i < endTrackHits; ++i) {
369  bool pixelHitFilter = ( (det==1 && pixelBarrelHitFilter(pattern)) ||
370  (det==2 && pixelEndcapHitFilter(pattern)) );
371  if (pixelHitFilter && (getLayer(pattern) == layer) && validHitFilter(pattern)) {
372  return true;
373  }
374  }
375  return false;
376 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:759
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:613
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:623
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
bool reco::HitPattern::inactiveHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 865 of file HitPattern.h.

866 {
868 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1304 of file HitPattern.h.

1305 {
1306  return innermostMuonStationWithHits(-1);
1307 }
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:966
int reco::HitPattern::innermostMuonStationWithBadHits ( ) const
inline

Definition at line 1299 of file HitPattern.h.

1300 {
1301  return innermostMuonStationWithHits(3);
1302 }
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:966
int HitPattern::innermostMuonStationWithHits ( int  hitType) const

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

Definition at line 966 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getHitType(), getMuonStation(), mps_fire::i, muonHitFilter(), listBenchmarks::pattern, and trackingPlots::stat.

967 {
968  int ret = 0;
969  for (int i = beginTrackHits; i < endTrackHits; ++i) {
971  if (muonHitFilter(pattern)
972  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
973  int stat = getMuonStation(pattern);
974  if (ret == 0 || stat < ret) {
975  ret = stat;
976  }
977  }
978  }
979 
980  return ret;
981 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:792
uint8_t beginTrackHits
Definition: HitPattern.h:513
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
uint8_t endTrackHits
Definition: HitPattern.h:514
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
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:801
int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 1294 of file HitPattern.h.

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

Definition at line 1073 of file HitPattern.cc.

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

Referenced by appendHit().

1074 {
1075  if UNLIKELY((0 == beginInner && 0 == endInner)) {
1076  beginInner = hitCount;
1077  endInner = beginInner;
1078  }
1079 
1080  insertHit(pattern);
1081  endInner++;
1082 
1083  return true;
1084 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1042
uint8_t endInner
Definition: HitPattern.h:516
uint8_t beginInner
Definition: HitPattern.h:515
uint8_t hitCount
Definition: HitPattern.h:511
#define UNLIKELY(x)
Definition: Likely.h:21
bool HitPattern::insertExpectedOuterHit ( const uint16_t  pattern)
private

Definition at line 1086 of file HitPattern.cc.

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

Referenced by appendHit().

1087 {
1088  if UNLIKELY((0 == beginOuter && 0 == endOuter)) {
1089  beginOuter = hitCount;
1090  endOuter = beginOuter;
1091  }
1092 
1093  insertHit(pattern);
1094  endOuter++;
1095 
1096  return true;
1097 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1042
uint8_t hitCount
Definition: HitPattern.h:511
uint8_t beginOuter
Definition: HitPattern.h:517
#define UNLIKELY(x)
Definition: Likely.h:21
uint8_t endOuter
Definition: HitPattern.h:518
void HitPattern::insertHit ( const uint16_t  pattern)
private

Definition at line 1042 of file HitPattern.cc.

References HIT_LENGTH, hitCount, hitPattern, mps_fire::i, PFRecoTauDiscriminationByIsolation_cfi::offset, and globals_cff::x1.

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

1043 {
1044  int offset = hitCount * HIT_LENGTH;
1045  for (int i = 0; i < HIT_LENGTH; i++) {
1046  int pos = offset + i;
1047  uint16_t bit = (pattern >> i) & 0x1;
1048  //equivalent to hitPattern[pos / 16] += bit << ((offset + i) % 16);
1049  hitPattern[pos >> 4] += bit << ((offset + i) & (16 - 1));
1050  }
1051  hitCount++;
1052 }
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:177
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:510
uint8_t hitCount
Definition: HitPattern.h:511
bool HitPattern::insertTrackHit ( const uint16_t  pattern)
private

Definition at line 1054 of file HitPattern.cc.

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

Referenced by appendHit().

1055 {
1056  // if begin is 0, this is the first hit of this type being inserted, so
1057  // we need to update begin so it points to the correct index, the first
1058  // empty index.
1059  // unlikely, because it will happen only when inserting
1060  // the first hit of this type
1061  if UNLIKELY((0 == beginTrackHits && 0 == endTrackHits)) {
1063  // before the first hit of this type is inserted, there are no hits
1065  }
1066 
1067  insertHit(pattern);
1068  endTrackHits++;
1069 
1070  return true;
1071 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1042
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint8_t hitCount
Definition: HitPattern.h:511
#define UNLIKELY(x)
Definition: Likely.h:21
reco::HitPattern::int::test::TestHitPattern::test ( )
private
uint16_t HitPattern::isStereo ( DetId  i,
const TrackerTopology ttopo 
)
staticprivate

Definition at line 928 of file HitPattern.cc.

References DetId::det(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecIsStereo(), StripSubdetector::TIB, TrackerTopology::tibIsStereo(), StripSubdetector::TID, TrackerTopology::tidIsStereo(), StripSubdetector::TOB, TrackerTopology::tobIsStereo(), and DetId::Tracker.

Referenced by encode().

929 {
930  if (i.det() != DetId::Tracker) {
931  return 0;
932  }
933 
934  switch (i.subdetId()) {
937  return 0;
939  return ttopo.tibIsStereo(i);
941  return ttopo.tidIsStereo(i);
943  return ttopo.tobIsStereo(i);
945  return ttopo.tecIsStereo(i);
946  default:
947  return 0;
948  }
949 }
bool tobIsStereo(const DetId &id) const
bool tidIsStereo(const DetId &id) const
bool tecIsStereo(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
bool tibIsStereo(const DetId &id) const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
int reco::HitPattern::me0StationsWithAnyHits ( ) const
inline

Definition at line 1289 of file HitPattern.h.

1290 {
1291  return muonStations(5,-1);
1292 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::me0StationsWithBadHits ( ) const
inline

Definition at line 1284 of file HitPattern.h.

1285 {
1286  return muonStations(5, 3);
1287 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::me0StationsWithValidHits ( ) const
inline

Definition at line 1279 of file HitPattern.h.

1280 {
1281  return muonStations(5, 0);
1282 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
bool reco::HitPattern::missingHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 860 of file HitPattern.h.

Referenced by PFCheckHitPattern::analyze(), and CheckHitPattern::operator()().

861 {
863 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:792
bool reco::HitPattern::muonCSCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 678 of file HitPattern.h.

References MuonSubdetId::CSC, and UNLIKELY.

Referenced by pat::SoftMuonMvaEstimator::computeMva(), reco::tau::countHits(), and printHitPattern().

679 {
681  return false;
682  }
683 
684  uint32_t substructure = getSubStructure(pattern);
685  return (substructure == (uint32_t) MuonSubdetId::CSC);
686 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
#define UNLIKELY(x)
Definition: Likely.h:21
static constexpr int CSC
Definition: MuonSubdetId.h:13
bool reco::HitPattern::muonDTHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 668 of file HitPattern.h.

References MuonSubdetId::DT, and UNLIKELY.

Referenced by pat::SoftMuonMvaEstimator::computeMva(), reco::tau::countHits(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), and printHitPattern().

669 {
671  return false;
672  }
673 
674  uint32_t substructure = getSubStructure(pattern);
675  return (substructure == (uint32_t) MuonSubdetId::DT);
676 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
#define UNLIKELY(x)
Definition: Likely.h:21
static constexpr int DT
Definition: MuonSubdetId.h:12
bool reco::HitPattern::muonGEMHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 698 of file HitPattern.h.

References MuonSubdetId::GEM, and UNLIKELY.

Referenced by printHitPattern().

699 {
701  return false;
702  }
703 
704  uint32_t substructure = getSubStructure(pattern);
705  return (substructure == (uint32_t) MuonSubdetId::GEM);
706 }
static constexpr int GEM
Definition: MuonSubdetId.h:15
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::muonHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 720 of file HitPattern.h.

References UNLIKELY.

Referenced by reco::tau::countHits(), innermostMuonStationWithHits(), muonStations(), outermostMuonStationWithHits(), and printHitPattern().

721 {
723  return false;
724  }
725 
726  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 0);
727 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SubDetectorMask
Definition: HitPattern.h:476
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:475
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::muonME0HitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 708 of file HitPattern.h.

References MuonSubdetId::ME0, and UNLIKELY.

Referenced by printHitPattern().

708  {
710  uint16_t substructure = getSubStructure(pattern);
711  return (substructure == (uint16_t) MuonSubdetId::ME0);
712 }
return((rh^lh)&mask)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 688 of file HitPattern.h.

References MuonSubdetId::RPC, and UNLIKELY.

Referenced by pat::SoftMuonMvaEstimator::computeMva(), reco::tau::countHits(), and printHitPattern().

689 {
691  return false;
692  }
693 
694  uint32_t substructure = getSubStructure(pattern);
695  return (substructure == (uint32_t) MuonSubdetId::RPC);
696 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
static constexpr int RPC
Definition: MuonSubdetId.h:14
#define UNLIKELY(x)
Definition: Likely.h:21
int HitPattern::muonStations ( int  subdet,
int  hitType 
) const

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

Definition at line 951 of file HitPattern.cc.

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

952 {
953  int stations[4] = {0, 0, 0, 0};
954  for (int i = beginTrackHits; i < endTrackHits; ++i) {
956  if (muonHitFilter(pattern)
957  && (subdet == 0 || int(getSubStructure(pattern)) == subdet)
958  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
959  stations[getMuonStation(pattern) - 1] = 1;
960  }
961  }
962 
963  return stations[0] + stations[1] + stations[2] + stations[3];
964 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:792
uint8_t beginTrackHits
Definition: HitPattern.h:513
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
uint8_t endTrackHits
Definition: HitPattern.h:514
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
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:801
int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 1214 of file HitPattern.h.

1215 {
1216  return muonStations(0, -1);
1217 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::muonStationsWithBadHits ( ) const
inline

Definition at line 1209 of file HitPattern.h.

1210 {
1211  return muonStations(0, 3);
1212 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::muonStationsWithValidHits ( ) const
inline

Definition at line 1204 of file HitPattern.h.

1205 {
1206  return muonStations(0, 0);
1207 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::numberOfAllHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfAllTrackerHits ( HitCategory  category) const
inline

Definition at line 881 of file HitPattern.h.

References reco::tau::countHits().

882 {
884 }
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:563
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 1084 of file HitPattern.h.

References reco::tau::countHits().

1085 {
1087 }
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:870
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:563
int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 1099 of file HitPattern.h.

1100 {
1102 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:865
int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 1094 of file HitPattern.h.

1095 {
1097 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:865
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:668
int reco::HitPattern::numberOfBadMuonGEMHits ( ) const
inline

Definition at line 1109 of file HitPattern.h.

1110 {
1112 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:865
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 1089 of file HitPattern.h.

1090 {
1092 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:865
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
int reco::HitPattern::numberOfBadMuonME0Hits ( ) const
inline

Definition at line 1114 of file HitPattern.h.

1114  {
1116 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:708
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:865
int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 1104 of file HitPattern.h.

1105 {
1107 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:865
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:688
int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 1026 of file HitPattern.cc.

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

1027 {
1028  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
1029  for (int i = beginTrackHits; i < endTrackHits; ++i) {
1031  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
1032  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
1033  }
1034  }
1035 
1036  return stations[0][0] * stations[0][1]
1037  + stations[1][0] * stations[1][1]
1038  + stations[2][0] * stations[2][1]
1039  + stations[3][0] * stations[3][1];
1040 }
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 patter...
Definition: HitPattern.h:806
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:668
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:801
int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 999 of file HitPattern.cc.

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

1000 {
1001  int stations[4] = {0, 0, 0, 0};
1002  for (int i = beginTrackHits; i < endTrackHits; ++i) {
1004 
1005  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
1006  && getDTSuperLayer(pattern) != 2) {
1007  stations[getMuonStation(pattern) - 1] = 1;
1008  }
1009  }
1010  return stations[0] + stations[1] + stations[2] + stations[3];
1011 }
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 patter...
Definition: HitPattern.h:806
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:668
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:801
int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 1013 of file HitPattern.cc.

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

1014 {
1015  int stations[4] = {0, 0, 0, 0};
1016  for (int i = beginTrackHits; i < endTrackHits; ++i) {
1018  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
1019  && getDTSuperLayer(pattern) == 2) {
1020  stations[getMuonStation(pattern) - 1] = 1;
1021  }
1022  }
1023  return stations[0] + stations[1] + stations[2] + stations[3];
1024 }
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 patter...
Definition: HitPattern.h:806
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:668
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:801
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 1118 of file HitPattern.h.

References reco::tau::countHits().

1119 {
1121 }
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:865
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:563
int reco::HitPattern::numberOfInactiveTimingHits ( ) const
int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 1123 of file HitPattern.h.

1124 {
1126 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:865
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
int reco::HitPattern::numberOfLostHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 1065 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

1066 {
1068 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 1060 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

1061 {
1063 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:668
int reco::HitPattern::numberOfLostMuonGEMHits ( ) const
inline

Definition at line 1075 of file HitPattern.h.

1076 {
1078 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 1000 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

1001 {
1003 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
int reco::HitPattern::numberOfLostMuonME0Hits ( ) const
inline

Definition at line 1080 of file HitPattern.h.

1080  {
1082 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:708
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 1070 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

1071 {
1073 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:688
int reco::HitPattern::numberOfLostPixelBarrelHits ( HitCategory  category) const
inline

Definition at line 1025 of file HitPattern.h.

1026 {
1028 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:613
int reco::HitPattern::numberOfLostPixelEndcapHits ( HitCategory  category) const
inline

Definition at line 1030 of file HitPattern.h.

1031 {
1033 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:623
int reco::HitPattern::numberOfLostPixelHits ( HitCategory  category) const
inline

Definition at line 1020 of file HitPattern.h.

1021 {
1023 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
int reco::HitPattern::numberOfLostStripHits ( HitCategory  category) const
inline

Definition at line 1035 of file HitPattern.h.

1036 {
1038 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:633
int reco::HitPattern::numberOfLostStripTECHits ( HitCategory  category) const
inline

Definition at line 1055 of file HitPattern.h.

1056 {
1058 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:663
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
int reco::HitPattern::numberOfLostStripTIBHits ( HitCategory  category) const
inline

Definition at line 1040 of file HitPattern.h.

1041 {
1043 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:648
int reco::HitPattern::numberOfLostStripTIDHits ( HitCategory  category) const
inline

Definition at line 1045 of file HitPattern.h.

1046 {
1048 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:653
int reco::HitPattern::numberOfLostStripTOBHits ( HitCategory  category) const
inline

Definition at line 1050 of file HitPattern.h.

1051 {
1053 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:658
int reco::HitPattern::numberOfLostTimingBTLHits ( ) const
inline

Definition at line 1010 of file HitPattern.h.

1011 {
1013 }
static bool timingBTLHitFilter(uint16_t pattern)
Definition: HitPattern.h:729
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
int reco::HitPattern::numberOfLostTimingETLHits ( ) const
inline

Definition at line 1015 of file HitPattern.h.

1016 {
1018 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
static bool timingETLHitFilter(uint16_t pattern)
Definition: HitPattern.h:735
int reco::HitPattern::numberOfLostTimingHits ( ) const
inline

Definition at line 1005 of file HitPattern.h.

1006 {
1008 }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:741
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:860
int reco::HitPattern::numberOfLostTrackerHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 886 of file HitPattern.h.

References reco::tau::countHits().

887 {
889 }
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:563
int reco::HitPattern::numberOfTimingHits ( ) const
inline

Definition at line 891 of file HitPattern.h.

References reco::tau::countHits().

892 {
894 }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:741
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:563
int reco::HitPattern::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 961 of file HitPattern.h.

Referenced by MuonRecoAnalyzer::analyze(), MuonTrackValidator::analyze(), and MuonBadTrackFilter::trackInfo().

962 {
964 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 956 of file HitPattern.h.

Referenced by MuonRecoAnalyzer::analyze(), MuonTrackValidator::analyze(), and MuonBadTrackFilter::trackInfo().

957 {
959 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:668
int reco::HitPattern::numberOfValidMuonGEMHits ( ) const
inline

Definition at line 971 of file HitPattern.h.

Referenced by MuonTrackValidator::analyze().

972 {
974 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
int reco::HitPattern::numberOfValidMuonHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonME0Hits ( ) const
inline

Definition at line 976 of file HitPattern.h.

Referenced by MuonTrackValidator::analyze().

976  {
978 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:708
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 966 of file HitPattern.h.

Referenced by MuonRecoAnalyzer::analyze(), MuonTrackValidator::analyze(), and MuonBadTrackFilter::trackInfo().

967 {
969 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:688
int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelHits ( ) const
inline

Definition at line 916 of file HitPattern.h.

Referenced by TrackTypeMonitor::analyze(), StandaloneTrackMonitor::analyze(), MuonRecoAnalyzer::analyze(), BDHadronTrackMonitoringAnalyzer::analyze(), PackedCandidateTrackValidator::analyze(), IPTagPlotter< Container, Base >::analyzeTag(), PFRecoTauDiscriminationByHPSSelection::discriminate(), TrackingNtuple::fillTracks(), ZtoMMEventSelector::filter(), ZtoEEEventSelector::filter(), WtoLNuSelector::filter(), HLTMuonPointingFilter::filter(), reco::tau::RecoTauQualityCuts::filterTrack_(), HLTTrackWithHits::hltFilter(), TrackClassFilter::operator()(), CheckHitPattern::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), reco::tau::RecoTauPiZeroStripPlugin3::operator()(), RecoTrackSelectorBase::operator()(), pat::PATLostTracks::passTrkCuts(), EleTkIsolFromCands::passTrkSel(), TrackListMerger::produce(), pat::PATPackedCandidateProducer::produce(), IPProducer< Container, Base, Helper >::produce(), pat::PackedCandidate::setHits(), reco::IPTagInfo< Container, Base >::taggingVariables(), TrackWithVertexSelector::testTrack(), TrackVertexArbitration< VTX >::trackFilterArbitrator(), MuonBadTrackFilter::trackInfo(), reco::TrackSelector::trackSelection(), reco::tau::qcuts::trkPixelHits(), and QuickTrackAssociatorByHitsImpl::weightedNumberOfTrackClusters().

917 {
919 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
int reco::HitPattern::numberOfValidStripHits ( ) const
inline
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

Definition at line 379 of file HitPattern.cc.

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

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

380 {
381  bool hasMono[SubstrMask + 1][LayerMask + 1];
382  bool hasStereo[SubstrMask + 1][LayerMask + 1];
383  memset(hasMono, 0, sizeof(hasMono));
384  memset(hasStereo, 0, sizeof(hasStereo));
385 
386  // mark which layers have mono/stereo hits
387  for (int i = beginTrackHits; i < endTrackHits; ++i) {
389  uint16_t subStructure = getSubStructure(pattern);
390 
391  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
392  if (stripdet != 0 && subStructure != stripdet) {
393  continue;
394  }
395 
396  if (layer != 0 && getSubSubStructure(pattern) != layer) {
397  continue;
398  }
399 
400  switch (getSide(pattern)) {
401  case 0: // mono
402  hasMono[subStructure][getLayer(pattern)] = true;
403  break;
404  case 1: // stereo
405  hasStereo[subStructure][getLayer(pattern)] = true;
406  break;
407  default:
408  ;
409  break;
410  }
411  }
412  }
413 
414  // count how many layers have mono and stereo hits
415  int count = 0;
416  for (int i = 0; i < SubstrMask + 1; ++i) {
417  for (int j = 0; j < LayerMask + 1; ++j) {
418  if (hasMono[i][j] && hasStereo[i][j]) {
419  count++;
420  }
421  }
422  }
423  return count;
424 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:759
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:633
uint8_t beginTrackHits
Definition: HitPattern.h:513
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
uint8_t endTrackHits
Definition: HitPattern.h:514
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:783
static const unsigned short SubstrMask
Definition: HitPattern.h:472
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:764
static const unsigned short LayerMask
Definition: HitPattern.h:468
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( ) const

Definition at line 426 of file HitPattern.cc.

References taus_updatedMVAIds_cff::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), getSide(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, maxTrackerWord, minStripWord, minTrackerWord, listBenchmarks::pattern, and TRACK_HITS.

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

427 {
428  auto category = TRACK_HITS;
429  std::bitset<128> side[2];
430  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
431  for (int i = range.first; i < range.second; ++i) {
433  if (pattern > maxTrackerWord) continue;
434  if (pattern < minStripWord) continue;
435  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
436  if (hitType != HIT_TYPE::VALID) continue;
437  auto apattern = (pattern-minTrackerWord) >> LayerOffset;
438  // assert(apattern<128);
439  side[getSide(pattern)].set(apattern);
440  }
441  // assert(numberOfValidStripLayersWithMonoAndStereo(0, 0)==int((side[0]&side[1]).count()));
442  return (side[0]&side[1]).count();
443 
444 
445 }
static const unsigned short maxTrackerWord
Definition: HitPattern.h:479
static const unsigned short HitTypeMask
Definition: HitPattern.h:460
static const unsigned short minTrackerWord
Definition: HitPattern.h:478
static const unsigned short HitTypeOffset
Definition: HitPattern.h:459
static const unsigned short minStripWord
Definition: HitPattern.h:481
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:783
static const unsigned short LayerOffset
Definition: HitPattern.h:467
int reco::HitPattern::numberOfValidStripTECHits ( ) const
inline

Definition at line 951 of file HitPattern.h.

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

952 {
954 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:663
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 941 of file HitPattern.h.

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

942 {
944 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:653
int reco::HitPattern::numberOfValidStripTOBHits ( ) const
inline
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 reco::HitPattern::numberOfValidTimingBTLHits ( ) const
inline

Definition at line 980 of file HitPattern.h.

981 {
983 }
static bool timingBTLHitFilter(uint16_t pattern)
Definition: HitPattern.h:729
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
int reco::HitPattern::numberOfValidTimingETLHits ( ) const
inline

Definition at line 985 of file HitPattern.h.

986 {
988 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
static bool timingETLHitFilter(uint16_t pattern)
Definition: HitPattern.h:735
int reco::HitPattern::numberOfValidTimingHits ( ) const
inline

Definition at line 911 of file HitPattern.h.

912 {
914 }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:741
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:589
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:855
int HitPattern::numberOfValidTOBLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int reco::HitPattern::numberOfValidTrackerHits ( ) const
inline
HitPattern & HitPattern::operator= ( const HitPattern other)

Definition at line 49 of file HitPattern.cc.

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

50 {
51  if (this == &other) {
52  return *this;
53  }
54 
55  this->hitCount = other.hitCount;
56 
57  this->beginTrackHits = other.beginTrackHits;
58  this->endTrackHits = other.endTrackHits;
59 
60  this->beginInner = other.beginInner;
61  this->endInner = other.endInner;
62 
63  this->beginOuter = other.beginOuter;
64  this->endOuter = other.endOuter;
65 
66  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
67 
68  return *this;
69 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:176
uint8_t endInner
Definition: HitPattern.h:516
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:510
uint8_t beginInner
Definition: HitPattern.h:515
uint8_t beginTrackHits
Definition: HitPattern.h:513
uint8_t endTrackHits
Definition: HitPattern.h:514
uint8_t hitCount
Definition: HitPattern.h:511
uint8_t beginOuter
Definition: HitPattern.h:517
uint8_t endOuter
Definition: HitPattern.h:518
int reco::HitPattern::outermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1319 of file HitPattern.h.

1320 {
1321  return outermostMuonStationWithHits(-1);
1322 }
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:983
int reco::HitPattern::outermostMuonStationWithBadHits ( ) const
inline

Definition at line 1314 of file HitPattern.h.

1315 {
1316  return outermostMuonStationWithHits(3);
1317 }
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:983
int HitPattern::outermostMuonStationWithHits ( int  hitType) const

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

Definition at line 983 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getHitType(), getMuonStation(), mps_fire::i, muonHitFilter(), listBenchmarks::pattern, and trackingPlots::stat.

984 {
985  int ret = 0;
986  for (int i = beginTrackHits; i < endTrackHits; ++i) {
988  if (muonHitFilter(pattern) &&
989  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
990  int stat = getMuonStation(pattern);
991  if (ret == 0 || stat > ret) {
992  ret = stat;
993  }
994  }
995  }
996  return ret;
997 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:792
uint8_t beginTrackHits
Definition: HitPattern.h:513
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
uint8_t endTrackHits
Definition: HitPattern.h:514
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
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:801
int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 1309 of file HitPattern.h.

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

Definition at line 613 of file HitPattern.h.

References PixelSubdetector::PixelBarrel, and UNLIKELY.

Referenced by PrimaryVertexValidation::hasFirstLayerPixelHits(), and hasValidHitInPixelLayer().

614 {
616  return false;
617  }
618 
619  uint32_t substructure = getSubStructure(pattern);
620  return (substructure == PixelSubdetector::PixelBarrel);
621 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
#define UNLIKELY(x)
Definition: Likely.h:21
int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 803 of file HitPattern.cc.

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

804 {
805  int count = 0;
806  uint16_t NPixBarrel = 4;
807  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
809  count++;
810  }
811  }
812  return count;
813 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::pixelBarrelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 734 of file HitPattern.cc.

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

735 {
736  int count = 0;
737  uint16_t NPixBarrel = 4;
738  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
739  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::INACTIVE) {
740  count++;
741  }
742  }
743  return count;
744 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::pixelBarrelLayersWithMeasurement ( ) const

Definition at line 597 of file HitPattern.cc.

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

Referenced by dqm::TrackAnalyzer::fillHistosForTrackerSpecific(), PrimaryVertexValidation::fillTrackHistos(), IsolatedTracksNxN::printTrack(), and BeamFitter::readEvent().

598 {
599  int count = 0;
600  uint16_t NPixBarrel = 4;
601  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
602  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::VALID) {
603  count++;
604  }
605  }
606  return count;
607 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::pixelBarrelLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 665 of file HitPattern.cc.

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

666 {
667  int count = 0;
668  uint16_t NPixBarrel = 4;
669  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
670  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::MISSING) {
671  count++;
672  }
673  }
674  return count;
675 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
bool reco::HitPattern::pixelEndcapHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 623 of file HitPattern.h.

References PixelSubdetector::PixelEndcap, and UNLIKELY.

Referenced by PrimaryVertexValidation::hasFirstLayerPixelHits(), and hasValidHitInPixelLayer().

624 {
626  return false;
627  }
628 
629  uint32_t substructure = getSubStructure(pattern);
630  return (substructure == PixelSubdetector::PixelEndcap);
631 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
#define UNLIKELY(x)
Definition: Likely.h:21
int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 815 of file HitPattern.cc.

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

816 {
817  int count = 0;
818  uint16_t NPixForward = 3;
819  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
821  count++;
822  }
823  }
824  return count;
825 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::pixelEndcapLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 746 of file HitPattern.cc.

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

747 {
748  int count = 0;
749  uint16_t NPixForward = 3;
750  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
751  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::INACTIVE) {
752  count++;
753  }
754  }
755  return count;
756 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::pixelEndcapLayersWithMeasurement ( ) const

Definition at line 609 of file HitPattern.cc.

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

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

610 {
611  int count = 0;
612  uint16_t NPixForward = 3;
613  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
614  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::VALID) {
615  count++;
616  }
617  }
618  return count;
619 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::pixelEndcapLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 677 of file HitPattern.cc.

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

678 {
679  int count = 0;
680  uint16_t NPixForward = 3;
681  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
682  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::MISSING) {
683  count++;
684  }
685  }
686  return count;
687 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
bool reco::HitPattern::pixelHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 602 of file HitPattern.h.

References PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, and UNLIKELY.

Referenced by gsfElectronTools::getClosestCtfToGsf(), hasValidHitInPixelLayer(), FWConvTrackHitsDetailView::setTextInfo(), QcdUeDQM::trackSelection(), and pat::PackedCandidate::unpackTrk().

603 {
605  return false;
606  }
607 
608  uint32_t substructure = getSubStructure(pattern);
609  return (substructure == PixelSubdetector::PixelBarrel ||
610  substructure == PixelSubdetector::PixelEndcap);
611 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
#define UNLIKELY(x)
Definition: Likely.h:21
int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 1190 of file HitPattern.h.

1191 {
1192  return pixelBarrelLayersNull() +
1194 }
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:803
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:815
int reco::HitPattern::pixelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1170 of file HitPattern.h.

1171 {
1174 }
int pixelBarrelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:734
int pixelEndcapLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:746
int HitPattern::pixelLayersWithMeasurement ( ) const

Definition at line 538 of file HitPattern.cc.

References taus_updatedMVAIds_cff::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minStripWord, minTrackerWord, listBenchmarks::pattern, TRACK_HITS, trackerHitFilter(), and UNLIKELY.

Referenced by StandaloneTrackMonitor::analyze(), dqm::TrackAnalyzer::analyze(), MuonTrackValidator::analyze(), PackedCandidateTrackValidator::analyze(), MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), PrimaryVertexValidation::fillTrackHistos(), TrackingNtuple::fillTracks(), TrackFilterForPVFinding::operator()(), GhostTrackComputer::operator()(), RecoTrackSelectorBase::operator()(), IsolatedTracksNxN::printTrack(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), BeamFitter::readEvent(), CosmicTrackSelector::select(), MultiTrackSelector::select(), HIMultiTrackSelector::select(), BPhysicsOniaDQM::selGlobalMuon(), MuScleFitMuonSelector::selGlobalMuon(), MuScleFit::selGlobalMuon(), BPhysicsOniaDQM::selTrackerMuon(), MuScleFitMuonSelector::selTrackerMuon(), MuScleFit::selTrackerMuon(), pat::PackedCandidate::setHits(), and QcdUeDQM::trackSelection().

538  {
539  auto category = TRACK_HITS;
540  std::bitset<128> layerOk;
541  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
542  for (int i = range.first; i < range.second; ++i) {
544  if UNLIKELY(!trackerHitFilter(pattern)) continue;
545  if (pattern>minStripWord) continue;
546  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
547  if (hitType != HIT_TYPE::VALID) continue;
549  // assert(pattern<128);
550  layerOk.set(pattern);
551  }
552  // assert(pixelLayersWithMeasurementOld()==int(layerOk.count()));
553  return layerOk.count();
554 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:460
return((rh^lh)&mask)
static const unsigned short minTrackerWord
Definition: HitPattern.h:478
static const unsigned short HitTypeOffset
Definition: HitPattern.h:459
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
static const unsigned short minStripWord
Definition: HitPattern.h:481
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static const unsigned short LayerOffset
Definition: HitPattern.h:467
#define UNLIKELY(x)
Definition: Likely.h:21
int reco::HitPattern::pixelLayersWithMeasurementOld ( ) const
inline

Definition at line 1133 of file HitPattern.h.

1134 {
1136 }
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:609
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:597
int reco::HitPattern::pixelLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1150 of file HitPattern.h.

1151 {
1154 }
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:665
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:677
void HitPattern::print ( HitCategory  category,
std::ostream &  stream = std::cout 
) const

Definition at line 911 of file HitPattern.cc.

References flags, getHitPattern(), mps_fire::i, numberOfAllHits(), and printHitPattern().

912 {
913  stream << "HitPattern" << std::endl;
914  for (int i = 0; i < numberOfAllHits(category); ++i) {
915  printHitPattern(category, i, stream);
916  }
917  std::ios_base::fmtflags flags = stream.flags();
918  stream.setf(std::ios_base::hex, std::ios_base::basefield);
919  stream.setf(std::ios_base::showbase);
920 
921  for (int i = 0; i < this->numberOfAllHits(category); ++i) {
922  stream << getHitPattern(category, i) << std::endl;
923  }
924 
925  stream.flags(flags);
926 }
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:871
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:875
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:553
void HitPattern::printHitPattern ( HitCategory  category,
int  position,
std::ostream &  stream 
) const

Definition at line 871 of file HitPattern.cc.

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

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

872 {
873  uint16_t pattern = getHitPattern(category, position);
874  stream << "\t";
875  if (muonHitFilter(pattern)) {
876  stream << "muon";
877  } else if (trackerHitFilter(pattern)) {
878  stream << "tracker";
879  } else if (timingHitFilter(pattern)) {
880  stream << "timing";
881  }
882 
883  stream << "\tsubstructure " << getSubStructure(pattern);
884  if (muonHitFilter(pattern)) {
885  stream << "\tstation " << getMuonStation(pattern);
886  if (muonDTHitFilter(pattern)) {
887  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
888  } else if (muonCSCHitFilter(pattern)) {
889  stream << "\tcsc ring " << getCSCRing(pattern);
890  } else if (muonRPCHitFilter(pattern)) {
891  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel")
892  << ", layer " << getRPCLayer(pattern);
893  } else if (muonGEMHitFilter(pattern)) {
894  stream << "\tgem " << (getGEMLayer(pattern) ? "layer1" : "layer2")
895  << ", station " << getGEMStation(pattern);
896  } else if (muonME0HitFilter(pattern)) {
897  stream << "\tme0 ";
898  } else {
899  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure "
900  << getSubStructure(pattern);
901  }
902  } else if( timingHitFilter(pattern) ) {
903  stream << "\tdetector " << getSubStructure(pattern);
904  } else {
905  stream << "\tlayer " << getLayer(pattern);
906  }
907  stream << "\thit type " << getHitType(pattern);
908  stream << std::endl;
909 }
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:811
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:759
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:741
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 patter...
Definition: HitPattern.h:806
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:708
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:850
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:792
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:828
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:834
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:720
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:668
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:816
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:801
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:553
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:688
int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 1259 of file HitPattern.h.

1260 {
1261  return muonStations(3, -1);
1262 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::rpcStationsWithBadHits ( ) const
inline

Definition at line 1254 of file HitPattern.h.

1255 {
1256  return muonStations(3, 3);
1257 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
int reco::HitPattern::rpcStationsWithValidHits ( ) const
inline

Definition at line 1249 of file HitPattern.h.

1250 {
1251  return muonStations(3, 0);
1252 }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:951
bool reco::HitPattern::stripHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 633 of file HitPattern.h.

Referenced by numberOfValidStripLayersWithMonoAndStereo(), FWConvTrackHitsDetailView::setTextInfo(), and pat::PackedCandidate::unpackTrk().

634 {
636 }
static const unsigned short maxTrackerWord
Definition: HitPattern.h:479
static const unsigned short minStripWord
Definition: HitPattern.h:481
int reco::HitPattern::stripLayersNull ( ) const
inline

Definition at line 1196 of file HitPattern.h.

1197 {
1198  return stripTIBLayersNull() +
1199  stripTIDLayersNull() +
1200  stripTOBLayersNull() +
1202 }
int stripTIBLayersNull() const
Definition: HitPattern.cc:827
int stripTECLayersNull() const
Definition: HitPattern.cc:860
int stripTIDLayersNull() const
Definition: HitPattern.cc:838
int stripTOBLayersNull() const
Definition: HitPattern.cc:849
int reco::HitPattern::stripLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1176 of file HitPattern.h.

1177 {
1182 }
int stripTOBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:780
int stripTIBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:758
int stripTIDLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:769
int stripTECLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:792
int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline
int reco::HitPattern::stripLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1156 of file HitPattern.h.

1157 {
1162 }
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:711
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:700
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:722
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:689
bool reco::HitPattern::stripSubdetectorHitFilter ( uint16_t  pattern,
StripSubdetector::SubDetector  substructure 
)
inlinestaticprivate

Definition at line 639 of file HitPattern.h.

References UNLIKELY.

640 {
642  return false;
643  }
644 
645  return substructure == getSubStructure(pattern);
646 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::stripTECHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 663 of file HitPattern.h.

References StripSubdetector::TEC.

664 {
666 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:639
int HitPattern::stripTECLayersNull ( ) const

Definition at line 860 of file HitPattern.cc.

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

861 {
862  int count = 0;
863  for (uint16_t layer = 1; layer <= 9; layer++) {
865  count++;
866  }
867  }
868  return count;
869 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTECLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 792 of file HitPattern.cc.

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

793 {
794  int count = 0;
795  for (uint16_t layer = 1; layer <= 9; layer++) {
796  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::INACTIVE) {
797  count++;
798  }
799  }
800  return count;
801 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTECLayersWithMeasurement ( ) const

Definition at line 654 of file HitPattern.cc.

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

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

655 {
656  int count = 0;
657  for (uint16_t layer = 1; layer <= 9; layer++) {
658  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::VALID) {
659  count++;
660  }
661  }
662  return count;
663 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTECLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 722 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

723 {
724  int count = 0;
725  for (uint16_t layer = 1; layer <= 9; layer++) {
726  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::MISSING) {
727  count++;
728  }
729  }
730  return count;
731 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
bool reco::HitPattern::stripTIBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 648 of file HitPattern.h.

References StripSubdetector::TIB.

Referenced by gsfElectronTools::getClosestCtfToGsf().

649 {
651 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:639
int HitPattern::stripTIBLayersNull ( ) const

Definition at line 827 of file HitPattern.cc.

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

828 {
829  int count = 0;
830  for (uint16_t layer = 1; layer <= 4; layer++) {
832  count++;
833  }
834  }
835  return count;
836 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTIBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 758 of file HitPattern.cc.

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

759 {
760  int count = 0;
761  for (uint16_t layer = 1; layer <= 4; layer++) {
762  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::INACTIVE) {
763  count++;
764  }
765  }
766  return count;
767 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTIBLayersWithMeasurement ( ) const

Definition at line 621 of file HitPattern.cc.

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

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

622 {
623  int count = 0;
624  for (uint16_t layer = 1; layer <= 4; layer++) {
625  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::VALID) {
626  count++;
627  }
628  }
629  return count;
630 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTIBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 689 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

690 {
691  int count = 0;
692  for (uint16_t layer = 1; layer <= 4; layer++) {
693  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::MISSING) {
694  count++;
695  }
696  }
697  return count;
698 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
bool reco::HitPattern::stripTIDHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 653 of file HitPattern.h.

References StripSubdetector::TID.

Referenced by gsfElectronTools::getClosestCtfToGsf().

654 {
656 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:639
int HitPattern::stripTIDLayersNull ( ) const

Definition at line 838 of file HitPattern.cc.

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

839 {
840  int count = 0;
841  for (uint16_t layer = 1; layer <= 3; layer++) {
843  count++;
844  }
845  }
846  return count;
847 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTIDLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 769 of file HitPattern.cc.

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

770 {
771  int count = 0;
772  for (uint16_t layer = 1; layer <= 3; layer++) {
773  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::INACTIVE) {
774  count++;
775  }
776  }
777  return count;
778 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTIDLayersWithMeasurement ( ) const

Definition at line 632 of file HitPattern.cc.

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

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

633 {
634  int count = 0;
635  for (uint16_t layer = 1; layer <= 3; layer++) {
636  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::VALID) {
637  count++;
638  }
639  }
640  return count;
641 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTIDLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 700 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

701 {
702  int count = 0;
703  for (uint16_t layer = 1; layer <= 3; layer++) {
704  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::MISSING) {
705  count++;
706  }
707  }
708  return count;
709 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
bool reco::HitPattern::stripTOBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 658 of file HitPattern.h.

References StripSubdetector::TOB.

659 {
661 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:639
int HitPattern::stripTOBLayersNull ( ) const

Definition at line 849 of file HitPattern.cc.

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

850 {
851  int count = 0;
852  for (uint16_t layer = 1; layer <= 6; layer++) {
854  count++;
855  }
856  }
857  return count;
858 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTOBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 780 of file HitPattern.cc.

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

781 {
782  int count = 0;
783  for (uint16_t layer = 1; layer <= 6; layer++) {
784 
785  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::INACTIVE) {
786  count++;
787  }
788  }
789  return count;
790 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTOBLayersWithMeasurement ( ) const

Definition at line 643 of file HitPattern.cc.

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

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

644 {
645  int count = 0;
646  for (uint16_t layer = 1; layer <= 6; layer++) {
647  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::VALID) {
648  count++;
649  }
650  }
651  return count;
652 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
int HitPattern::stripTOBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 711 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

712 {
713  int count = 0;
714  for (uint16_t layer = 1; layer <= 6; layer++) {
715  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::MISSING) {
716  count++;
717  }
718  }
719  return count;
720 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:467
bool reco::HitPattern::timingBTLHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 729 of file HitPattern.h.

References MTDDetId::BTL, and UNLIKELY.

729  {
731  uint16_t substructure = getSubStructure(pattern);
732  return (substructure == (uint16_t) MTDDetId::BTL);
733 }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:741
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
return((rh^lh)&mask)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::timingETLHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 735 of file HitPattern.h.

References MTDDetId::ETL, and UNLIKELY.

735  {
737  uint16_t substructure = getSubStructure(pattern);
738  return (substructure == (uint16_t) MTDDetId::ETL);
739 }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:741
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
return((rh^lh)&mask)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::timingHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 741 of file HitPattern.h.

References UNLIKELY.

Referenced by printHitPattern().

742 {
744  return false;
745  }
746 
747  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 2);
748 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SubDetectorMask
Definition: HitPattern.h:476
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:475
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::trackerHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 1184 of file HitPattern.h.

1185 {
1186  return pixelLayersNull() +
1187  stripLayersNull();
1188 }
int pixelLayersNull() const
Definition: HitPattern.h:1190
int stripLayersNull() const
Definition: HitPattern.h:1196
int reco::HitPattern::trackerLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1164 of file HitPattern.h.

Referenced by dqm::TrackAnalyzer::analyze(), and TrackingNtuple::fillTracks().

1165 {
1168 }
int pixelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1170
int stripLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1176
int HitPattern::trackerLayersWithMeasurement ( ) const

Definition at line 557 of file HitPattern.cc.

References taus_updatedMVAIds_cff::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minTrackerWord, listBenchmarks::pattern, TRACK_HITS, trackerHitFilter(), and UNLIKELY.

Referenced by StandaloneTrackMonitor::analyze(), dqm::TrackAnalyzer::analyze(), MuonRecoAnalyzer::analyze(), IsolatedTracksCone::analyze(), MuonTrackValidator::analyze(), IsolatedTracksNxN::analyze(), PackedCandidateTrackValidator::analyze(), spr::coneChargeIsolation(), MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), dqm::TrackAnalyzer::fillHistosForState(), PrimaryVertexValidation::fillTrackHistos(), HLTMuonPointingFilter::filter(), spr::goodTrack(), cms::MuonTCMETValueMapProducer::nLayers(), TrackFilterForPVFinding::operator()(), GhostTrackComputer::operator()(), RecoTrackSelectorBase::operator()(), IsolatedTracksNxN::printTrack(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), FastTrackerRecHitMaskProducer::produce(), BeamFitter::readEvent(), CosmicTrackSelector::select(), MultiTrackSelector::select(), HIMultiTrackSelector::select(), TrackVertexArbitration< VTX >::trackFilterArbitrator(), and QcdUeDQM::trackSelection().

557  {
558  auto category = TRACK_HITS;
559  std::bitset<128> layerOk;
560  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
561  for (int i = range.first; i < range.second; ++i) {
563  if UNLIKELY(!trackerHitFilter(pattern)) continue;
564  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
565  if (hitType != HIT_TYPE::VALID) continue;
567  // assert(pattern<128);
568  layerOk.set(pattern);
569  }
570  // assert(trackerLayersWithMeasurementOld()==int(layerOk.count()));
571  return layerOk.count();
572 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:460
return((rh^lh)&mask)
static const unsigned short minTrackerWord
Definition: HitPattern.h:478
static const unsigned short HitTypeOffset
Definition: HitPattern.h:459
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static const unsigned short LayerOffset
Definition: HitPattern.h:467
#define UNLIKELY(x)
Definition: Likely.h:21
int reco::HitPattern::trackerLayersWithMeasurementOld ( ) const
inline

Definition at line 1128 of file HitPattern.h.

1129 {
1131 }
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:538
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1138
int HitPattern::trackerLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 574 of file HitPattern.cc.

References getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minTrackerWord, listBenchmarks::pattern, trackerHitFilter(), and UNLIKELY.

Referenced by dqm::TrackAnalyzer::analyze(), TrackingNtuple::fillTracks(), spr::goodTrack(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), CosmicTrackSelector::select(), MultiTrackSelector::select(), and HIMultiTrackSelector::select().

574  {
575  std::bitset<128> layerOk;
576  std::bitset<128> layerMissed;
577  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
578  for (int i = range.first; i < range.second; ++i) {
580  if UNLIKELY(!trackerHitFilter(pattern)) continue;
581  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
583  // assert(pattern<128);
584  if (hitType == HIT_TYPE::VALID) layerOk.set(pattern);
585  if (hitType == HIT_TYPE::MISSING) layerMissed.set(pattern);
586  }
587  layerMissed &= ~layerOk;
588 
589  // assert(trackerLayersWithoutMeasurementOld(category)==int(layerMissed.count()));
590 
591  return layerMissed.count();
592 
593 
594 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:460
return((rh^lh)&mask)
static const unsigned short minTrackerWord
Definition: HitPattern.h:478
static const unsigned short HitTypeOffset
Definition: HitPattern.h:459
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:715
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:526
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static const unsigned short LayerOffset
Definition: HitPattern.h:467
#define UNLIKELY(x)
Definition: Likely.h:21
int reco::HitPattern::trackerLayersWithoutMeasurementOld ( HitCategory  category) const
inline

Definition at line 1144 of file HitPattern.h.

1145 {
1148 }
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1150
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1156
bool reco::HitPattern::validHitFilter ( uint16_t  pattern)
inlinestatic

Friends And Related Function Documentation

template<int N>
friend struct PatternSet
friend

Definition at line 523 of file HitPattern.h.

Member Data Documentation

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

Definition at line 176 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

Definition at line 181 of file HitPattern.h.

Referenced by clear(), encode(), getHitPatternByAbsoluteIndex(), and HitPattern().

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 = 12
static

Definition at line 177 of file HitPattern.h.

Referenced by getHitPatternByAbsoluteIndex(), and insertHit().

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

Definition at line 178 of file HitPattern.h.

Referenced by appendHit(), and appendMuonHit().

const unsigned short reco::HitPattern::maxTrackerWord = (2 << SubDetectorOffset) - 1
staticprivate

Definition at line 479 of file HitPattern.h.

Referenced by numberOfValidStripLayersWithMonoAndStereo().

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

Definition at line 480 of file HitPattern.h.

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

Definition at line 464 of file HitPattern.h.

Referenced by encode().

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

Definition at line 463 of file HitPattern.h.

Referenced by encode().

const unsigned short reco::HitPattern::SubDetectorMask = 0x3
staticprivate

Definition at line 476 of file HitPattern.h.

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

const unsigned short reco::HitPattern::SubDetectorOffset = 10
staticprivate

Definition at line 475 of file HitPattern.h.

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

const unsigned short reco::HitPattern::SubstrMask = 0x7
staticprivate
const unsigned short reco::HitPattern::SubstrOffset = 7
staticprivate

Definition at line 471 of file HitPattern.h.

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