CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | 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-6 for station 0, 1-2 for stations 1 and 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 147 of file HitPattern.h.

Member Typedef Documentation

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

Definition at line 473 of file HitPattern.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MONO 
STEREO 

Definition at line 149 of file HitPattern.h.

Enumerator
MUON_HIT 
TRACKER_HIT 
MTD_HIT 

Definition at line 151 of file HitPattern.h.

Enumerator
VALID 
MISSING 
INACTIVE 
BAD 

Definition at line 153 of file HitPattern.h.

Enumerator
TRACK_HITS 
MISSING_INNER_HITS 
MISSING_OUTER_HITS 

Definition at line 155 of file HitPattern.h.

Constructor & Destructor Documentation

HitPattern::HitPattern ( )

Definition at line 19 of file HitPattern.cc.

References ARRAY_LENGTH, EMPTY_PATTERN, and hitPattern.

22 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
uint8_t endInner
Definition: HitPattern.h:496
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:490
uint8_t beginInner
Definition: HitPattern.h:495
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint8_t hitCount
Definition: HitPattern.h:491
uint8_t beginOuter
Definition: HitPattern.h:497
uint8_t endOuter
Definition: HitPattern.h:498
HitPattern::~HitPattern ( )

Definition at line 35 of file HitPattern.cc.

35 { ; }
HitPattern::HitPattern ( const HitPattern other)

Definition at line 24 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

25  : hitCount(other.hitCount),
28  beginInner(other.beginInner),
29  endInner(other.endInner),
30  beginOuter(other.beginOuter),
31  endOuter(other.endOuter) {
32  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
33 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
uint8_t endInner
Definition: HitPattern.h:496
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:490
uint8_t beginInner
Definition: HitPattern.h:495
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint8_t hitCount
Definition: HitPattern.h:491
uint8_t beginOuter
Definition: HitPattern.h:497
uint8_t endOuter
Definition: HitPattern.h:498

Member Function Documentation

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

Definition at line 210 of file HitPattern.cc.

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

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

210  {
211  return appendHit(hit.geographicalId(), hit.getType(), ttopo);
212 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:210
Type getType() const
DetId geographicalId() const
bool HitPattern::appendHit ( const TrackingRecHitRef ref,
const TrackerTopology ttopo 
)

Definition at line 70 of file HitPattern.cc.

References appendHit().

70  {
71  return appendHit(*ref, ttopo);
72 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:210
bool HitPattern::appendHit ( const DetId id,
TrackingRecHit::Type  hitType,
const TrackerTopology ttopo 
)

Definition at line 214 of file HitPattern.cc.

References appendHit(), encode(), hitCount, MaxHits, and UNLIKELY.

214  {
215  //if HitPattern is full, journey ends no matter what.
217  return false;
218  }
219 
220  uint16_t pattern = HitPattern::encode(id, hitType, ttopo);
221 
222  return appendHit(pattern, hitType);
223 }
static const unsigned short MaxHits
Definition: HitPattern.h:158
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:210
uint8_t hitCount
Definition: HitPattern.h:491
#define UNLIKELY(x)
Definition: Likely.h:21
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:74
bool HitPattern::appendHit ( const uint16_t  pattern,
TrackingRecHit::Type  hitType 
)

Definition at line 225 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.

225  {
226  //if HitPattern is full, journey ends no matter what.
228  return false;
229  }
230 
231  switch (hitType) {
235  case TrackingRecHit::bad:
236  // hitCount != endT => we are not inserting T type of hits but of T'
237  // 0 != beginT || 0 != endT => we already have hits of T type
238  // so we already have hits of T in the vector and we don't want to
239  // mess them with T' hits.
240  if UNLIKELY (((hitCount != endTrackHits) && (0 != beginTrackHits || 0 != endTrackHits))) {
241  cms::Exception("HitPattern") << "TRACK_HITS"
242  << " were stored on this object before hits of some other category were inserted "
243  << "but hits of the same category should be inserted in a row. "
244  << "Please rework the code so it inserts all "
245  << "TRACK_HITS"
246  << " in a row.";
247  return false;
248  }
249  return insertTrackHit(pattern);
250  break;
253  if UNLIKELY (((hitCount != endInner) && (0 != beginInner || 0 != endInner))) {
254  cms::Exception("HitPattern") << "MISSING_INNER_HITS"
255  << " were stored on this object before hits of some other category were inserted "
256  << "but hits of the same category should be inserted in a row. "
257  << "Please rework the code so it inserts all "
258  << "MISSING_INNER_HITS"
259  << " in a row.";
260  return false;
261  }
262  return insertExpectedInnerHit(pattern);
263  break;
266  if UNLIKELY (((hitCount != endOuter) && (0 != beginOuter || 0 != endOuter))) {
267  cms::Exception("HitPattern") << "MISSING_OUTER_HITS"
268  << " were stored on this object before hits of some other category were inserted "
269  << "but hits of the same category should be inserted in a row. "
270  << "Please rework the code so it inserts all "
271  << "MISSING_OUTER_HITS"
272  << " in a row.";
273  return false;
274  }
275  return insertExpectedOuterHit(pattern);
276  break;
277  }
278 
279  return false;
280 }
static const unsigned short MaxHits
Definition: HitPattern.h:158
bool insertExpectedOuterHit(const uint16_t pattern)
Definition: HitPattern.cc:1005
uint8_t endInner
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:495
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint8_t hitCount
Definition: HitPattern.h:491
uint8_t beginOuter
Definition: HitPattern.h:497
bool insertExpectedInnerHit(const uint16_t pattern)
Definition: HitPattern.cc:993
bool insertTrackHit(const uint16_t pattern)
Definition: HitPattern.cc:975
#define UNLIKELY(x)
Definition: Likely.h:21
uint8_t endOuter
Definition: HitPattern.h:498
template<typename I >
bool reco::HitPattern::appendHits ( const I &  begin,
const I &  end,
const TrackerTopology ttopo 
)

Definition at line 522 of file HitPattern.h.

References appendHit(), dataset::end, Exhume::I, and UNLIKELY.

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

522  {
523  for (I hit = begin; hit != end; hit++) {
524  if UNLIKELY ((!appendHit(*hit, ttopo))) {
525  return false;
526  }
527  }
528  return true;
529  }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:210
const std::complex< double > I
Definition: I.h:8
string end
Definition: dataset.py:937
#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 286 of file HitPattern.cc.

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

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

286  {
287  //if HitPattern is full, journey ends no matter what.
289  return false;
290  }
291 
292  if UNLIKELY (id.det() != DetId::Muon) {
293  throw cms::Exception("HitPattern")
294  << "Got DetId from det " << id.det()
295  << " that is not Muon in appendMuonHit(), which should only be used for muon hits in the HitPattern IO rule";
296  }
297 
298  uint16_t subdet = id.subdetId();
299  return appendHit(encode(MUON_HIT, subdet, encodeMuonLayer(id), 0, hitType), hitType);
300 }
static const unsigned short MaxHits
Definition: HitPattern.h:158
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:210
uint8_t hitCount
Definition: HitPattern.h:491
#define UNLIKELY(x)
Definition: Likely.h:21
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:74
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 282 of file HitPattern.cc.

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

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

282  {
283  return appendHit(encode(TRACKER_HIT, subdet, layer, stereo, hitType), hitType);
284 }
constexpr std::array< uint8_t, layerIndexSize > layer
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:210
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:74
bool reco::HitPattern::badHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 796 of file HitPattern.h.

References BAD, and getHitType().

Referenced by numberOfBadHits().

796 { return getHitType(pattern) == HitPattern::BAD; }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:741
template<typename F >
void reco::HitPattern::call ( HitCategory  category,
filterType  typeFilter,
F  f 
) const
private

Definition at line 552 of file HitPattern.h.

References validate-o2o-wbm::f, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), mps_fire::i, and sistrip::SpyUtilities::range().

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

552  {
553  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
554  for (int i = range.first; i < range.second; i++) {
555  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
556  // f() return false to ask to stop looping
557  if (typeFilter(pattern) && !f(pattern)) {
558  break;
559  }
560  }
561  }
static const char category[]
const uint16_t range(const Frame &aFrame)
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
void HitPattern::clear ( void  )

Definition at line 58 of file HitPattern.cc.

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

Referenced by fillNewHitPatternWithOldHitPattern_v12(), reco::TrackBase::resetHitPattern(), and BeautifulSoup.Tag::setString().

58  {
59  this->hitCount = 0;
60  this->beginTrackHits = 0;
61  this->endTrackHits = 0;
62  this->beginInner = 0;
63  this->endInner = 0;
64  this->beginOuter = 0;
65  this->endOuter = 0;
66 
67  memset(this->hitPattern, EMPTY_PATTERN, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
68 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
uint8_t endInner
Definition: HitPattern.h:496
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:490
uint8_t beginInner
Definition: HitPattern.h:495
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint8_t hitCount
Definition: HitPattern.h:491
uint8_t beginOuter
Definition: HitPattern.h:497
uint8_t endOuter
Definition: HitPattern.h:498
int reco::HitPattern::countHits ( HitCategory  category,
filterType  filter 
) const
inlineprivate

Definition at line 540 of file HitPattern.h.

References submitPVResolutionJobs::count, alcazmumu_cfi::filter, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), mps_fire::i, and sistrip::SpyUtilities::range().

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

540  {
541  int count = 0;
542  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
543  for (int i = range.first; i < range.second; ++i) {
545  ++count;
546  }
547  }
548  return count;
549  }
static const char category[]
const uint16_t range(const Frame &aFrame)
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
int reco::HitPattern::countTypedHits ( HitCategory  category,
filterType  typeFilter,
filterType  filter 
) const
inlineprivate

Definition at line 563 of file HitPattern.h.

References submitPVResolutionJobs::count, alcazmumu_cfi::filter, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), mps_fire::i, and sistrip::SpyUtilities::range().

Referenced by numberOfBadMuonCSCHits(), numberOfBadMuonDTHits(), numberOfBadMuonGEMHits(), numberOfBadMuonHits(), numberOfBadMuonME0Hits(), numberOfBadMuonRPCHits(), numberOfInactiveTrackerHits(), numberOfLostMuonCSCHits(), numberOfLostMuonDTHits(), numberOfLostMuonGEMHits(), numberOfLostMuonHits(), numberOfLostMuonME0Hits(), numberOfLostMuonRPCHits(), numberOfLostPixelBarrelHits(), numberOfLostPixelEndcapHits(), numberOfLostPixelHits(), numberOfLostStripHits(), numberOfLostStripTECHits(), numberOfLostStripTIBHits(), numberOfLostStripTIDHits(), numberOfLostStripTOBHits(), numberOfLostTimingBTLHits(), numberOfLostTimingETLHits(), numberOfLostTimingHits(), numberOfLostTrackerHits(), numberOfValidMuonCSCHits(), numberOfValidMuonDTHits(), numberOfValidMuonGEMHits(), numberOfValidMuonHits(), numberOfValidMuonME0Hits(), numberOfValidMuonRPCHits(), numberOfValidPixelBarrelHits(), numberOfValidPixelEndcapHits(), numberOfValidPixelHits(), numberOfValidStripHits(), numberOfValidStripTECHits(), numberOfValidStripTIBHits(), numberOfValidStripTIDHits(), numberOfValidStripTOBHits(), numberOfValidTimingBTLHits(), numberOfValidTimingETLHits(), numberOfValidTimingHits(), and numberOfValidTrackerHits().

563  {
564  int count = 0;
565  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
566  for (int i = range.first; i < range.second; ++i) {
567  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
568  if (typeFilter(pattern) && filter(pattern)) {
569  ++count;
570  }
571  }
572  return count;
573  }
static const char category[]
const uint16_t range(const Frame &aFrame)
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
int reco::HitPattern::cscStationsWithAnyHits ( ) const
inline

Definition at line 1054 of file HitPattern.h.

References muonStations().

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

Definition at line 1052 of file HitPattern.h.

References muonStations().

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

Definition at line 1050 of file HitPattern.h.

References muonStations().

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

Definition at line 1048 of file HitPattern.h.

References muonStations().

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

Definition at line 1046 of file HitPattern.h.

References muonStations().

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

Definition at line 1044 of file HitPattern.h.

References muonStations().

1044 { return muonStations(1, 0); }
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:886
uint16_t HitPattern::encode ( const TrackingRecHit hit,
const TrackerTopology ttopo 
)
staticprivate

Definition at line 74 of file HitPattern.cc.

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

Referenced by appendHit(), appendMuonHit(), appendTrackerHit(), and encode().

74  {
75  return encode(hit.geographicalId(), hit.getType(), ttopo);
76 }
Type getType() const
DetId geographicalId() const
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:74
uint16_t HitPattern::encode ( const DetId id,
TrackingRecHit::Type  hitType,
const TrackerTopology ttopo 
)
staticprivate

Definition at line 148 of file HitPattern.cc.

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

148  {
149  uint16_t detid = id.det();
150  uint16_t subdet = id.subdetId();
151 
152  // adding layer/disk/wheel bits
153  uint16_t layer = 0x0;
154  if (detid == DetId::Tracker) {
155  layer = ttopo.layer(id);
156  } else if (detid == DetId::Muon) {
157  layer = encodeMuonLayer(id);
158  } else if (detid == DetId::Forward && subdet == FastTime) {
159  layer = encodeTimingLayer(id);
160  }
161 
162  // adding mono/stereo bit
163  uint16_t side = 0x0;
164  if (detid == DetId::Tracker) {
165  side = isStereo(id, ttopo);
166  } else if (detid == DetId::Muon || (detid == DetId::Forward && subdet == FastTime)) {
167  side = 0x0;
168  }
169 
170  // juggle the detid around to deal with the fact the bitwidth is larger
171  // DetId::Muon is 2 and DetId::Forward is 6, must map to 0 and 2 respectively
172  if (detid == DetId::Tracker) {
173  detid = TRACKER_HIT;
174  } else if (detid == DetId::Muon) {
175  detid = MUON_HIT; // DetId::Muon is 2 and needs to be reordered to match old encoding where it got masked
176  } else if (detid == DetId::Forward && subdet == FastTime) {
177  detid = MTD_HIT; // since DetId::Forward is some other number, reorder it here
178  }
179 
180  return encode(detid, subdet, layer, side, hitType);
181 }
static uint16_t isStereo(DetId i, const TrackerTopology &ttopo)
Definition: HitPattern.cc:864
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int layer(const DetId &id) const
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:74
uint16_t HitPattern::encode ( uint16_t  det,
uint16_t  subdet,
uint16_t  layer,
uint16_t  side,
TrackingRecHit::Type  hitType 
)
staticprivate

Definition at line 183 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, SideMask, SideOffset, SubDetectorMask, SubDetectorOffset, SubstrMask, and SubstrOffset.

183  {
184  uint16_t pattern = HitPattern::EMPTY_PATTERN;
185 
186  // adding tracker/muon/mtd detector bits
187  pattern |= (det & SubDetectorMask) << SubDetectorOffset;
188 
189  // adding substructure (PXB, PXF, TIB, TID, TOB, TEC, or DT, CSC, RPC,GEM, or BTL, ETL) bits
190  pattern |= (subdet & SubstrMask) << SubstrOffset;
191 
192  // adding layer/disk/wheel/ring/modType bits
193  pattern |= (layer & LayerMask) << LayerOffset;
194 
195  // adding mono/stereo bit
196  pattern |= (side & SideMask) << SideOffset;
197 
198  TrackingRecHit::Type patternHitType =
203  : hitType);
204 
205  pattern |= (patternHitType & HitTypeMask) << HitTypeOffset;
206 
207  return pattern;
208 }
static const unsigned short SideOffset
Definition: HitPattern.h:444
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short SubstrOffset
Definition: HitPattern.h:452
static const unsigned short HitTypeMask
Definition: HitPattern.h:441
constexpr std::array< uint8_t, layerIndexSize > layer
static const unsigned short SubDetectorMask
Definition: HitPattern.h:457
static const unsigned short HitTypeOffset
Definition: HitPattern.h:440
static const unsigned short SideMask
Definition: HitPattern.h:445
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:456
static const unsigned short SubstrMask
Definition: HitPattern.h:453
static const unsigned short LayerOffset
Definition: HitPattern.h:448
static const unsigned short LayerMask
Definition: HitPattern.h:449
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 60 of file rootio_HitPattern.cc.

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

68  {
69  newObj->clear();
70  bool ret = true;
71  for (int i = 0; i < MaxHitsV12; i++) {
72  uint16_t pattern = getHitFromOldHitPattern(oldHitPattern, i);
73  if (pattern == 0) {
74  break;
75  }
76  if (!newObj->appendHit(pattern, hitTypeFromOldHitPattern(pattern))) {
77  ret = false;
78  break;
79  }
80  }
81  newObj->hitCount = hitCount;
83  newObj->endTrackHits = endTrackHits;
84  newObj->beginInner = beginInner;
85  newObj->endInner = endInner;
86  newObj->beginOuter = beginOuter;
87  newObj->endOuter = endOuter;
88  return ret;
89 }
tuple ret
prodAgent to be discontinued
uint8_t endInner
Definition: HitPattern.h:496
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:210
uint8_t beginInner
Definition: HitPattern.h:495
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint8_t hitCount
Definition: HitPattern.h:491
uint8_t beginOuter
Definition: HitPattern.h:497
uint8_t endOuter
Definition: HitPattern.h:498
int reco::HitPattern::gemStationsWithAnyHits ( ) const
inline

Definition at line 1066 of file HitPattern.h.

References muonStations().

1066 { return muonStations(4, -1); }
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:886
int reco::HitPattern::gemStationsWithBadHits ( ) const
inline

Definition at line 1064 of file HitPattern.h.

References muonStations().

1064 { return muonStations(4, 3); }
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:886
int reco::HitPattern::gemStationsWithValidHits ( ) const
inline

Definition at line 1062 of file HitPattern.h.

References muonStations().

1062 { return muonStations(4, 0); }
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:886
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 779 of file HitPattern.h.

References getSubSubStructure().

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

Definition at line 506 of file HitPattern.h.

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

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

506  {
507  switch (category) {
508  case TRACK_HITS:
509  return std::pair<uint8_t, uint8_t>(beginTrackHits, endTrackHits);
510  break;
511  case MISSING_INNER_HITS:
512  return std::pair<uint8_t, uint8_t>(beginInner, endInner);
513  break;
514  case MISSING_OUTER_HITS:
515  return std::pair<uint8_t, uint8_t>(beginOuter, endOuter);
516  break;
517  }
518  return std::pair<uint8_t, uint8_t>(-1, -1);
519  }
static const char category[]
uint8_t endInner
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:495
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint8_t beginOuter
Definition: HitPattern.h:497
uint8_t endOuter
Definition: HitPattern.h:498
uint16_t reco::HitPattern::getCSCRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 755 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

755 { return (getSubSubStructure(pattern) & 3) + 1; }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
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 753 of file HitPattern.h.

References getSubSubStructure().

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

753 { return (getSubSubStructure(pattern) & 3); }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
uint16_t reco::HitPattern::getETLRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 781 of file HitPattern.h.

References getSubSubStructure().

781 { return getSubSubStructure(pattern); }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
uint16_t reco::HitPattern::getGEMLayer ( uint16_t  pattern)
inlinestatic

GEM layer: 1-6 for station 0, 1-2 for stations 1 and 2. Only valid for muon GEM patterns, of course.

Definition at line 783 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

783  {
784  uint16_t sss = getSubSubStructure(pattern);
785  if (sss & 0b1000)
786  return (sss & 0b0111) + 1;
787  return (sss & 0b11) + 1;
788  }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
uint16_t reco::HitPattern::getGEMStation ( uint16_t  pattern)
inlinestatic

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

Definition at line 771 of file HitPattern.h.

References getSubSubStructure().

Referenced by getMuonStation(), and printHitPattern().

771  {
772  uint16_t sss = getSubSubStructure(pattern);
773  if (sss & 0b1000)
774  return 0;
775  return (sss >> 2) + 1;
776  }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
uint16_t reco::HitPattern::getHitPattern ( HitCategory  category,
int  position 
) const
inline

Definition at line 531 of file HitPattern.h.

References EMPTY_PATTERN, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), sistrip::SpyUtilities::range(), and UNLIKELY.

Referenced by PFCheckHitPattern::analyze(), pat::SoftMuonMvaEstimator::computeMva(), reco::tau::countHits(), tadqm::TrackAnalyzer::fillHistosForEfficiencyFromHitPatter(), OniaPhotonConversionProducer::foundCompatibleInnerHits(), egamma::getClosestCtfToGsf(), PFElecTkProducer::isInnerMost(), CheckHitPattern::operator()(), FWTrackResidualDetailView::prepareData(), CheckHitPattern::print(), PFCheckHitPattern::print(), print(), printHitPattern(), pat::PATPackedCandidateProducer::produce(), FWConvTrackHitsDetailView::setTextInfo(), egamma::sharedDets(), egamma::sharedHits(), and QcdUeDQM::trackSelection().

531  {
532  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
533  if UNLIKELY ((position < 0 || (position + range.first) >= range.second)) {
535  }
536 
537  return getHitPatternByAbsoluteIndex(range.first + position);
538  }
static const char category[]
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
const uint16_t range(const Frame &aFrame)
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static int position[264][3]
Definition: ReadPGInfo.cc:289
#define UNLIKELY(x)
Definition: Likely.h:21
uint16_t HitPattern::getHitPatternByAbsoluteIndex ( int  position) const
private

Definition at line 302 of file HitPattern.cc.

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

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

302  {
303  if UNLIKELY ((position < 0 || position >= hitCount)) {
305  }
306  /*
307  Note: you are not taking a consecutive sequence of HIT_LENGTH bits starting from position * HIT_LENGTH
308  as the bit order in the words are reversed.
309  e.g. if position = 0 you take the lowest 12 bits of the first word.
310 
311  I hope this can clarify what is the memory layout of such thing
312 
313  straight 01234567890123456789012345678901 | 23456789012345678901234567890123 | 4567
314  (global) 0 1 2 3 | 3 4 5 6 | 6
315  words [--------------0---------------] | [--------------1---------------] | [---
316  word 01234567890123456789012345678901 | 01234567890123456789012345678901 | 0123
317  (str) 0 1 2 3 | 0 1 2 3 | 0
318  [--------------0---------------] | [--------------1---------------] | [---
319  word 10987654321098765432109876543210 | 10987654321098765432109876543210 | 1098
320  (rev) 32 21 10 0 | 32 21 10 0 | 32
321  reverse 10987654321098765432109876543210 | 32109876543210987654321098765432 | 5432
322  32 21 10 0 | 6 65 54 43 3 9
323 
324  ugly enough, but it's not my fault, I was not even in CMS at that time [gpetrucc]
325  */
326 
327  uint16_t bitEndOffset = (position + 1) * HIT_LENGTH;
328  uint8_t secondWord = (bitEndOffset >> 4);
329  uint8_t secondWordBits = bitEndOffset & (16 - 1); // that is, bitEndOffset % 16
330  if (secondWordBits >= HIT_LENGTH) { // full block is in this word
331  uint8_t lowBitsToTrash = secondWordBits - HIT_LENGTH;
332  uint16_t myResult = (hitPattern[secondWord] >> lowBitsToTrash) & ((1 << HIT_LENGTH) - 1);
333  return myResult;
334  } else {
335  uint8_t firstWordBits = HIT_LENGTH - secondWordBits;
336  uint16_t firstWordBlock = hitPattern[secondWord - 1] >> (16 - firstWordBits);
337  if (secondWordBits == 0)
338  return firstWordBlock;
339  uint16_t secondWordBlock = hitPattern[secondWord] & ((1 << secondWordBits) - 1);
340  uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
341  return myResult;
342  }
343 }
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:157
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:490
uint8_t hitCount
Definition: HitPattern.h:491
static int position[264][3]
Definition: ReadPGInfo.cc:289
#define UNLIKELY(x)
Definition: Likely.h:21
uint32_t reco::HitPattern::getHitType ( uint16_t  pattern)
inlinestatic

Definition at line 741 of file HitPattern.h.

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

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

741  {
742  if UNLIKELY (pattern == HitPattern::EMPTY_PATTERN) {
743  return NULL_RETURN;
744  }
745 
746  return ((pattern >> HitTypeOffset) & HitTypeMask);
747  }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short HitTypeMask
Definition: HitPattern.h:441
static const unsigned short HitTypeOffset
Definition: HitPattern.h:440
#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 749 of file HitPattern.h.

References getGEMStation(), getSubSubStructure(), and muonGEMHitFilter().

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

749  {
750  return muonGEMHitFilter(pattern) ? getGEMStation(pattern) : (getSubSubStructure(pattern) >> 2) + 1;
751  }
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:657
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:771
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
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 757 of file HitPattern.h.

References getSubSubStructure(), LIKELY, and edm_modernize_messagelogger::stat.

Referenced by printHitPattern().

757  {
758  uint16_t subSubStructure = getSubSubStructure(pattern);
759  uint16_t stat = subSubStructure >> 2;
760 
761  if LIKELY (stat <= 1) {
762  return ((subSubStructure >> 1) & 1) + 1;
763  }
764 
765  return 0;
766  }
#define LIKELY(x)
Definition: Likely.h:20
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
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 768 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

768 { return getSubSubStructure(pattern) & 1; }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
uint32_t reco::HitPattern::getSide ( uint16_t  pattern)
inlinestatic

Definition at line 733 of file HitPattern.h.

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

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

733  {
734  if UNLIKELY (pattern == HitPattern::EMPTY_PATTERN) {
735  return NULL_RETURN;
736  }
737 
738  return (pattern >> SideOffset) & SideMask;
739  }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const unsigned short SideOffset
Definition: HitPattern.h:444
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short SideMask
Definition: HitPattern.h:445
#define UNLIKELY(x)
Definition: Likely.h:21
uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 725 of file HitPattern.h.

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

725  {
726  if UNLIKELY (pattern == HitPattern::EMPTY_PATTERN) {
727  return NULL_RETURN;
728  }
729 
730  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
731  }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short SubDetectorMask
Definition: HitPattern.h:457
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:456
#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 717 of file HitPattern.h.

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

Referenced by getBTLModType(), getCSCRing(), getDTSuperLayer(), getETLRing(), getGEMLayer(), getGEMStation(), getLayer(), getMuonStation(), getRPCLayer(), getRPCregion(), and numberOfValidStripLayersWithMonoAndStereo().

717  {
718  if UNLIKELY (pattern == HitPattern::EMPTY_PATTERN) {
719  return NULL_RETURN;
720  }
721 
722  return ((pattern >> LayerOffset) & LayerMask);
723  }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short LayerOffset
Definition: HitPattern.h:448
#define UNLIKELY(x)
Definition: Likely.h:21
static const unsigned short LayerMask
Definition: HitPattern.h:449
uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 438 of file HitPattern.cc.

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

438  {
439  uint16_t tk_substr_layer =
440  (0x1 << SubDetectorOffset) + ((substr & SubstrMask) << SubstrOffset) + ((layer & LayerMask) << LayerOffset);
441 
442  uint16_t mask = (SubDetectorMask << SubDetectorOffset) + (SubstrMask << SubstrOffset) + (LayerMask << LayerOffset);
443 
444  // layer case 0: valid + (missing, off, bad) ==> with measurement
445  // layer case 1: missing + (off, bad) ==> without measurement
446  // layer case 2: off, bad ==> totally off or bad, cannot say much
447  // layer case NULL_RETURN: track outside acceptance or in gap ==> null
448  uint32_t layerCase = NULL_RETURN;
449  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
450  for (int i = range.first; i < range.second; ++i) {
451  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
452  if ((pattern & mask) == tk_substr_layer) {
453  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
454  if (hitType < layerCase) {
455  // BAD and INACTIVE as the same type (as INACTIVE)
456  layerCase = (hitType == HIT_TYPE::BAD ? (uint32_t)HIT_TYPE::INACTIVE : hitType);
457  if (layerCase == HIT_TYPE::VALID) {
458  break;
459  }
460  }
461  }
462  }
463  return layerCase;
464 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
static const char category[]
static const unsigned short SubstrOffset
Definition: HitPattern.h:452
static const unsigned short HitTypeMask
Definition: HitPattern.h:441
constexpr std::array< uint8_t, layerIndexSize > layer
const uint16_t range(const Frame &aFrame)
static const unsigned short SubDetectorMask
Definition: HitPattern.h:457
static const unsigned short HitTypeOffset
Definition: HitPattern.h:440
double const BAD
Definition: Constants.h:15
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:456
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static const unsigned short SubstrMask
Definition: HitPattern.h:453
static const unsigned short LayerOffset
Definition: HitPattern.h:448
static const unsigned short LayerMask
Definition: HitPattern.h:449
uint16_t HitPattern::getTrackerMonoStereo ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 466 of file HitPattern.cc.

References getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), getSide(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerMask, LayerOffset, MONO, sistrip::SpyUtilities::range(), STEREO, SubDetectorMask, SubDetectorOffset, SubstrMask, and SubstrOffset.

Referenced by OniaPhotonConversionProducer::foundCompatibleInnerHits().

466  {
467  uint16_t tk_substr_layer =
468  (0x1 << SubDetectorOffset) + ((substr & SubstrMask) << SubstrOffset) + ((layer & LayerMask) << LayerOffset);
469  uint16_t mask = (SubDetectorMask << SubDetectorOffset) + (SubstrMask << SubstrOffset) + (LayerMask << LayerOffset);
470 
471  // 0: neither a valid mono nor a valid stereo hit
472  // MONO: valid mono hit
473  // STEREO: valid stereo hit
474  // MONO | STEREO: both
475  uint16_t monoStereo = 0x0;
476  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
477  for (int i = range.first; i < range.second; ++i) {
478  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
479  if ((pattern & mask) == tk_substr_layer) {
480  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
481  if (hitType == HIT_TYPE::VALID) {
482  switch (getSide(pattern)) {
483  case 0: // mono
484  monoStereo |= MONO;
485  break;
486  case 1: // stereo
487  monoStereo |= STEREO;
488  break;
489  }
490  }
491 
492  if (monoStereo == (MONO | STEREO)) {
493  break;
494  }
495  }
496  }
497  return monoStereo;
498 }
static const char category[]
static const unsigned short SubstrOffset
Definition: HitPattern.h:452
static const unsigned short HitTypeMask
Definition: HitPattern.h:441
constexpr std::array< uint8_t, layerIndexSize > layer
const uint16_t range(const Frame &aFrame)
static const unsigned short SubDetectorMask
Definition: HitPattern.h:457
static const unsigned short HitTypeOffset
Definition: HitPattern.h:440
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:456
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:733
static const unsigned short SubstrMask
Definition: HitPattern.h:453
static const unsigned short LayerOffset
Definition: HitPattern.h:448
static const unsigned short LayerMask
Definition: HitPattern.h:449
bool HitPattern::hasValidHitInPixelLayer ( enum PixelSubdetector::SubDetector  det,
uint16_t  layer 
) const

Definition at line 345 of file HitPattern.cc.

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

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

345  {
346  for (int i = beginTrackHits; i < endTrackHits; ++i) {
347  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
348  bool pixelHitFilter = ((det == 1 && pixelBarrelHitFilter(pattern)) || (det == 2 && pixelEndcapHitFilter(pattern)));
349  if (pixelHitFilter && (getLayer(pattern) == layer) && validHitFilter(pattern)) {
350  return true;
351  }
352  }
353  return false;
354 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:715
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:575
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:584
constexpr std::array< uint8_t, layerIndexSize > layer
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:593
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
bool reco::HitPattern::inactiveHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1078 of file HitPattern.h.

References innermostMuonStationWithHits().

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

Definition at line 1076 of file HitPattern.h.

References innermostMuonStationWithHits().

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

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

Definition at line 899 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getHitType(), getMuonStation(), mps_fire::i, muonHitFilter(), runTheMatrix::ret, and edm_modernize_messagelogger::stat.

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

899  {
900  int ret = 0;
901  for (int i = beginTrackHits; i < endTrackHits; ++i) {
902  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
903  if (muonHitFilter(pattern) && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
904  int stat = getMuonStation(pattern);
905  if (ret == 0 || stat < ret) {
906  ret = stat;
907  }
908  }
909  }
910 
911  return ret;
912 }
tuple ret
prodAgent to be discontinued
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:741
uint8_t beginTrackHits
Definition: HitPattern.h:493
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
uint8_t endTrackHits
Definition: HitPattern.h:494
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
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:749
int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 1074 of file HitPattern.h.

References innermostMuonStationWithHits().

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

Definition at line 993 of file HitPattern.cc.

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

Referenced by appendHit().

993  {
994  if UNLIKELY ((0 == beginInner && 0 == endInner)) {
997  }
998 
999  insertHit(pattern);
1000  endInner++;
1001 
1002  return true;
1003 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:964
uint8_t endInner
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:495
uint8_t hitCount
Definition: HitPattern.h:491
#define UNLIKELY(x)
Definition: Likely.h:21
bool HitPattern::insertExpectedOuterHit ( const uint16_t  pattern)
private

Definition at line 1005 of file HitPattern.cc.

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

Referenced by appendHit().

1005  {
1006  if UNLIKELY ((0 == beginOuter && 0 == endOuter)) {
1007  beginOuter = hitCount;
1008  endOuter = beginOuter;
1009  }
1010 
1011  insertHit(pattern);
1012  endOuter++;
1013 
1014  return true;
1015 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:964
uint8_t hitCount
Definition: HitPattern.h:491
uint8_t beginOuter
Definition: HitPattern.h:497
#define UNLIKELY(x)
Definition: Likely.h:21
uint8_t endOuter
Definition: HitPattern.h:498
void HitPattern::insertHit ( const uint16_t  pattern)
private

Definition at line 964 of file HitPattern.cc.

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

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

964  {
965  int offset = hitCount * HIT_LENGTH;
966  for (int i = 0; i < HIT_LENGTH; i++) {
967  int pos = offset + i;
968  uint16_t bit = (pattern >> i) & 0x1;
969  //equivalent to hitPattern[pos / 16] += bit << ((offset + i) % 16);
970  hitPattern[pos >> 4] += bit << ((offset + i) & (16 - 1));
971  }
972  hitCount++;
973 }
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:157
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:490
uint8_t hitCount
Definition: HitPattern.h:491
bool HitPattern::insertTrackHit ( const uint16_t  pattern)
private

Definition at line 975 of file HitPattern.cc.

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

Referenced by appendHit().

975  {
976  // if begin is 0, this is the first hit of this type being inserted, so
977  // we need to update begin so it points to the correct index, the first
978  // empty index.
979  // unlikely, because it will happen only when inserting
980  // the first hit of this type
981  if UNLIKELY ((0 == beginTrackHits && 0 == endTrackHits)) {
983  // before the first hit of this type is inserted, there are no hits
985  }
986 
987  insertHit(pattern);
988  endTrackHits++;
989 
990  return true;
991 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:964
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint8_t hitCount
Definition: HitPattern.h:491
#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 864 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().

864  {
865  if (i.det() != DetId::Tracker) {
866  return 0;
867  }
868 
869  switch (i.subdetId()) {
872  return 0;
874  return ttopo.tibIsStereo(i);
876  return ttopo.tidIsStereo(i);
878  return ttopo.tobIsStereo(i);
880  return ttopo.tecIsStereo(i);
881  default:
882  return 0;
883  }
884 }
static constexpr auto TEC
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:48
static constexpr auto TOB
static constexpr auto TIB
bool tibIsStereo(const DetId &id) const
static constexpr auto TID
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
int reco::HitPattern::me0StationsWithAnyHits ( ) const
inline

Definition at line 1072 of file HitPattern.h.

References muonStations().

1072 { return muonStations(5, -1); }
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:886
int reco::HitPattern::me0StationsWithBadHits ( ) const
inline

Definition at line 1070 of file HitPattern.h.

References muonStations().

1070 { return muonStations(5, 3); }
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:886
int reco::HitPattern::me0StationsWithValidHits ( ) const
inline

Definition at line 1068 of file HitPattern.h.

References muonStations().

1068 { return muonStations(5, 0); }
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:886
bool reco::HitPattern::missingHitFilter ( uint16_t  pattern)
inlinestatic
bool reco::HitPattern::muonCSCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 639 of file HitPattern.h.

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

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

639  {
640  if UNLIKELY (!muonHitFilter(pattern)) {
641  return false;
642  }
643 
644  uint32_t substructure = getSubStructure(pattern);
645  return (substructure == (uint32_t)MuonSubdetId::CSC);
646  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
#define UNLIKELY(x)
Definition: Likely.h:21
static constexpr int CSC
Definition: MuonSubdetId.h:12
bool reco::HitPattern::muonDTHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 630 of file HitPattern.h.

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

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

630  {
631  if UNLIKELY (!muonHitFilter(pattern)) {
632  return false;
633  }
634 
635  uint32_t substructure = getSubStructure(pattern);
636  return (substructure == (uint32_t)MuonSubdetId::DT);
637  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
#define UNLIKELY(x)
Definition: Likely.h:21
static constexpr int DT
Definition: MuonSubdetId.h:11
bool reco::HitPattern::muonGEMHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 657 of file HitPattern.h.

References MuonSubdetId::GEM, getSubStructure(), muonHitFilter(), and UNLIKELY.

Referenced by getMuonStation(), numberOfBadMuonGEMHits(), numberOfLostMuonGEMHits(), numberOfValidMuonGEMHits(), and printHitPattern().

657  {
658  if UNLIKELY (!muonHitFilter(pattern)) {
659  return false;
660  }
661 
662  uint32_t substructure = getSubStructure(pattern);
663  return (substructure == (uint32_t)MuonSubdetId::GEM);
664  }
static constexpr int GEM
Definition: MuonSubdetId.h:14
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::muonHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 677 of file HitPattern.h.

References EMPTY_PATTERN, SubDetectorMask, SubDetectorOffset, and UNLIKELY.

Referenced by reco::tau::countHits(), innermostMuonStationWithHits(), muonCSCHitFilter(), muonDTHitFilter(), muonGEMHitFilter(), muonME0HitFilter(), muonRPCHitFilter(), muonStations(), numberOfBadMuonHits(), numberOfLostMuonHits(), numberOfMuonHits(), numberOfValidMuonHits(), outermostMuonStationWithHits(), and printHitPattern().

677  {
678  if UNLIKELY (pattern == HitPattern::EMPTY_PATTERN) {
679  return false;
680  }
681 
682  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 0);
683  }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short SubDetectorMask
Definition: HitPattern.h:457
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:456
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::muonME0HitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 666 of file HitPattern.h.

References getSubStructure(), MuonSubdetId::ME0, muonHitFilter(), and UNLIKELY.

Referenced by numberOfBadMuonME0Hits(), numberOfLostMuonME0Hits(), numberOfValidMuonME0Hits(), and printHitPattern().

666  {
667  if UNLIKELY (!muonHitFilter(pattern))
668  return false;
669  uint16_t substructure = getSubStructure(pattern);
670  return (substructure == (uint16_t)MuonSubdetId::ME0);
671  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
ME0 Data Record : block-&gt;header().getID() = 6.
Definition: Block.h:23
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 648 of file HitPattern.h.

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

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

648  {
649  if UNLIKELY (!muonHitFilter(pattern)) {
650  return false;
651  }
652 
653  uint32_t substructure = getSubStructure(pattern);
654  return (substructure == (uint32_t)MuonSubdetId::RPC);
655  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
static constexpr int RPC
Definition: MuonSubdetId.h:13
#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 886 of file HitPattern.cc.

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

Referenced by cscStationsWithAnyHits(), cscStationsWithBadHits(), cscStationsWithValidHits(), dtStationsWithAnyHits(), dtStationsWithBadHits(), dtStationsWithValidHits(), gemStationsWithAnyHits(), gemStationsWithBadHits(), gemStationsWithValidHits(), me0StationsWithAnyHits(), me0StationsWithBadHits(), me0StationsWithValidHits(), muonStationsWithAnyHits(), muonStationsWithBadHits(), muonStationsWithValidHits(), rpcStationsWithAnyHits(), rpcStationsWithBadHits(), and rpcStationsWithValidHits().

886  {
887  int stations[5] = {0, 0, 0, 0, 0};
888  for (int i = beginTrackHits; i < endTrackHits; ++i) {
889  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
890  if (muonHitFilter(pattern) && (subdet == 0 || int(getSubStructure(pattern)) == subdet) &&
891  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
892  stations[getMuonStation(pattern)] = 1;
893  }
894  }
895 
896  return stations[0] + stations[1] + stations[2] + stations[3] + stations[4];
897 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:741
uint8_t beginTrackHits
Definition: HitPattern.h:493
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
uint8_t endTrackHits
Definition: HitPattern.h:494
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
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:749
int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 1042 of file HitPattern.h.

References muonStations().

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

Definition at line 1040 of file HitPattern.h.

References muonStations().

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

Definition at line 1038 of file HitPattern.h.

References muonStations().

1038 { return muonStations(0, 0); }
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:886
int reco::HitPattern::numberOfAllHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfAllTrackerHits ( HitCategory  category) const
inline

Definition at line 803 of file HitPattern.h.

References countHits(), and trackerHitFilter().

803  {
805  }
static const char category[]
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:540
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 959 of file HitPattern.h.

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

959 { return countHits(TRACK_HITS, badHitFilter); }
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:540
int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 969 of file HitPattern.h.

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

969  {
971  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:639
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:794
int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 965 of file HitPattern.h.

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

965  {
967  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:794
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
int reco::HitPattern::numberOfBadMuonGEMHits ( ) const
inline

Definition at line 977 of file HitPattern.h.

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

977  {
979  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:794
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:657
int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 961 of file HitPattern.h.

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

961  {
963  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:794
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int reco::HitPattern::numberOfBadMuonME0Hits ( ) const
inline

Definition at line 981 of file HitPattern.h.

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

981  {
983  }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:666
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:794
int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 973 of file HitPattern.h.

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

973  {
975  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:794
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:648
int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 951 of file HitPattern.cc.

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

951  {
952  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
953  for (int i = beginTrackHits; i < endTrackHits; ++i) {
954  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
955  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
956  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
957  }
958  }
959 
960  return stations[0][0] * stations[0][1] + stations[1][0] * stations[1][1] + stations[2][0] * stations[2][1] +
961  stations[3][0] * stations[3][1];
962 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the &quot;hit&quot; was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:753
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
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:749
int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 928 of file HitPattern.cc.

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

928  {
929  int stations[4] = {0, 0, 0, 0};
930  for (int i = beginTrackHits; i < endTrackHits; ++i) {
931  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
932 
933  if (muonDTHitFilter(pattern) && validHitFilter(pattern) && getDTSuperLayer(pattern) != 2) {
934  stations[getMuonStation(pattern) - 1] = 1;
935  }
936  }
937  return stations[0] + stations[1] + stations[2] + stations[3];
938 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the &quot;hit&quot; was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:753
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
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:749
int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 940 of file HitPattern.cc.

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

940  {
941  int stations[4] = {0, 0, 0, 0};
942  for (int i = beginTrackHits; i < endTrackHits; ++i) {
943  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
944  if (muonDTHitFilter(pattern) && validHitFilter(pattern) && getDTSuperLayer(pattern) == 2) {
945  stations[getMuonStation(pattern) - 1] = 1;
946  }
947  }
948  return stations[0] + stations[1] + stations[2] + stations[3];
949 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the &quot;hit&quot; was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:753
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
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:749
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 985 of file HitPattern.h.

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

static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:794
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:540
int reco::HitPattern::numberOfInactiveTimingHits ( ) const
int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 987 of file HitPattern.h.

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

987  {
989  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:794
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
int reco::HitPattern::numberOfLostHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 943 of file HitPattern.h.

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

Referenced by MuonBadTrackFilter::trackInfo().

943  {
945  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:639
int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 939 of file HitPattern.h.

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

Referenced by MuonBadTrackFilter::trackInfo().

939  {
941  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
int reco::HitPattern::numberOfLostMuonGEMHits ( ) const
inline

Definition at line 951 of file HitPattern.h.

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

951  {
953  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:657
int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 891 of file HitPattern.h.

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

Referenced by MuonBadTrackFilter::trackInfo().

891  {
893  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int reco::HitPattern::numberOfLostMuonME0Hits ( ) const
inline

Definition at line 955 of file HitPattern.h.

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

955  {
957  }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:666
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 947 of file HitPattern.h.

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

Referenced by MuonBadTrackFilter::trackInfo().

947  {
949  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:648
int reco::HitPattern::numberOfLostPixelBarrelHits ( HitCategory  category) const
inline

Definition at line 911 of file HitPattern.h.

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

911  {
913  }
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:584
int reco::HitPattern::numberOfLostPixelEndcapHits ( HitCategory  category) const
inline

Definition at line 915 of file HitPattern.h.

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

915  {
917  }
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:593
int reco::HitPattern::numberOfLostPixelHits ( HitCategory  category) const
inline

Definition at line 907 of file HitPattern.h.

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

907  {
909  }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:575
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::numberOfLostStripHits ( HitCategory  category) const
inline

Definition at line 919 of file HitPattern.h.

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

919  {
921  }
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
int reco::HitPattern::numberOfLostStripTECHits ( HitCategory  category) const
inline

Definition at line 935 of file HitPattern.h.

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

935  {
937  }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:626
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::numberOfLostStripTIBHits ( HitCategory  category) const
inline

Definition at line 923 of file HitPattern.h.

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

923  {
925  }
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:614
int reco::HitPattern::numberOfLostStripTIDHits ( HitCategory  category) const
inline

Definition at line 927 of file HitPattern.h.

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

927  {
929  }
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:618
int reco::HitPattern::numberOfLostStripTOBHits ( HitCategory  category) const
inline

Definition at line 931 of file HitPattern.h.

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

931  {
933  }
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:622
int reco::HitPattern::numberOfLostTimingBTLHits ( ) const
inline

Definition at line 899 of file HitPattern.h.

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

899  {
901  }
static bool timingBTLHitFilter(uint16_t pattern)
Definition: HitPattern.h:685
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::numberOfLostTimingETLHits ( ) const
inline

Definition at line 903 of file HitPattern.h.

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

903  {
905  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool timingETLHitFilter(uint16_t pattern)
Definition: HitPattern.h:692
int reco::HitPattern::numberOfLostTimingHits ( ) const
inline

Definition at line 895 of file HitPattern.h.

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

895  {
897  }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:699
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::numberOfLostTrackerHits ( HitCategory  category) const
inline

Definition at line 887 of file HitPattern.h.

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

Referenced by tadqm::TrackAnalyzer::analyze(), TrackingNtuple::fillTracks(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), MultiTrackSelector::select(), HIMultiTrackSelector::select(), and reco::TrackBase::validFraction().

887  {
889  }
static const char category[]
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 807 of file HitPattern.h.

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

807 { return countHits(TRACK_HITS, muonHitFilter); }
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:540
int reco::HitPattern::numberOfTimingHits ( ) const
inline

Definition at line 809 of file HitPattern.h.

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

static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:699
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:540
int reco::HitPattern::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 861 of file HitPattern.h.

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

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

861  {
863  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:639
int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 857 of file HitPattern.h.

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

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

857  {
859  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
int reco::HitPattern::numberOfValidMuonGEMHits ( ) const
inline

Definition at line 869 of file HitPattern.h.

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

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

869  {
871  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:657
int reco::HitPattern::numberOfValidMuonHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonME0Hits ( ) const
inline

Definition at line 873 of file HitPattern.h.

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

Referenced by MuonTrackValidator::analyze().

873  {
875  }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:666
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 865 of file HitPattern.h.

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

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

865  {
867  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:648
int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelHits ( ) const
inline

Definition at line 825 of file HitPattern.h.

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

Referenced by TrackTypeMonitor::analyze(), MuonRecoAnalyzer::analyze(), StandaloneTrackMonitor::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()(), EleTkIsolFromCands::passTrackPreselection(), pat::PATLostTracks::passTrkCuts(), TrackListMerger::produce(), pat::PATPackedCandidateProducer::produce(), IPProducer< Container, Base, Helper >::produce(), pat::PackedCandidate::setHits(), TrackWithVertexSelector::testTrack(), TrackVertexArbitration< VTX >::trackFilterArbitrator(), MuonBadTrackFilter::trackInfo(), reco::TrackSelector::trackSelection(), and QuickTrackAssociatorByHitsImpl::weightedNumberOfTrackClusters().

825  {
827  }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:575
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
int reco::HitPattern::numberOfValidStripHits ( ) const
inline
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

Definition at line 356 of file HitPattern.cc.

References beginTrackHits, submitPVResolutionJobs::count, endTrackHits, getHitPatternByAbsoluteIndex(), getLayer(), getSide(), getSubStructure(), getSubSubStructure(), mps_fire::i, dqmiolumiharvest::j, LayerMask, stripHitFilter(), SubstrMask, and validHitFilter().

Referenced by tadqm::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().

356  {
357  bool hasMono[SubstrMask + 1][LayerMask + 1];
358  bool hasStereo[SubstrMask + 1][LayerMask + 1];
359  memset(hasMono, 0, sizeof(hasMono));
360  memset(hasStereo, 0, sizeof(hasStereo));
361 
362  // mark which layers have mono/stereo hits
363  for (int i = beginTrackHits; i < endTrackHits; ++i) {
364  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
365  uint16_t subStructure = getSubStructure(pattern);
366 
367  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
368  if (stripdet != 0 && subStructure != stripdet) {
369  continue;
370  }
371 
372  if (layer != 0 && getSubSubStructure(pattern) != layer) {
373  continue;
374  }
375 
376  switch (getSide(pattern)) {
377  case 0: // mono
378  hasMono[subStructure][getLayer(pattern)] = true;
379  break;
380  case 1: // stereo
381  hasStereo[subStructure][getLayer(pattern)] = true;
382  break;
383  default:;
384  break;
385  }
386  }
387  }
388 
389  // count how many layers have mono and stereo hits
390  int count = 0;
391  for (int i = 0; i < SubstrMask + 1; ++i) {
392  for (int j = 0; j < LayerMask + 1; ++j) {
393  if (hasMono[i][j] && hasStereo[i][j]) {
394  count++;
395  }
396  }
397  }
398  return count;
399 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:715
constexpr std::array< uint8_t, layerIndexSize > layer
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
uint8_t beginTrackHits
Definition: HitPattern.h:493
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
uint8_t endTrackHits
Definition: HitPattern.h:494
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:733
static const unsigned short SubstrMask
Definition: HitPattern.h:453
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:717
static const unsigned short LayerMask
Definition: HitPattern.h:449
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( ) const

Definition at line 401 of file HitPattern.cc.

References category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), getSide(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, maxTrackerWord, minStripWord, minTrackerWord, sistrip::SpyUtilities::range(), and TRACK_HITS.

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

401  {
402  auto category = TRACK_HITS;
403  std::bitset<128> side[2];
404  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
405  for (int i = range.first; i < range.second; ++i) {
406  auto pattern = getHitPatternByAbsoluteIndex(i);
407  if (pattern > maxTrackerWord)
408  continue;
409  if (pattern < minStripWord)
410  continue;
411  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
412  if (hitType != HIT_TYPE::VALID)
413  continue;
414  auto apattern = (pattern - minTrackerWord) >> LayerOffset;
415  // assert(apattern<128);
416  side[getSide(pattern)].set(apattern);
417  }
418  // assert(numberOfValidStripLayersWithMonoAndStereo(0, 0)==int((side[0]&side[1]).count()));
419  return (side[0] & side[1]).count();
420 }
static const char category[]
static const unsigned short maxTrackerWord
Definition: HitPattern.h:460
static const unsigned short HitTypeMask
Definition: HitPattern.h:441
const uint16_t range(const Frame &aFrame)
static const unsigned short minTrackerWord
Definition: HitPattern.h:459
static const unsigned short HitTypeOffset
Definition: HitPattern.h:440
static const unsigned short minStripWord
Definition: HitPattern.h:462
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:733
static const unsigned short LayerOffset
Definition: HitPattern.h:448
int reco::HitPattern::numberOfValidStripTECHits ( ) const
inline
int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline
int reco::HitPattern::numberOfValidStripTOBHits ( ) const
inline
int HitPattern::numberOfValidTECLayersWithMonoAndStereo ( uint32_t  layer = 0) const

Definition at line 434 of file HitPattern.cc.

References numberOfValidStripLayersWithMonoAndStereo(), and StripSubdetector::TEC.

434  {
436 }
static constexpr auto TEC
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:401
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::numberOfValidTIBLayersWithMonoAndStereo ( uint32_t  layer = 0) const

Definition at line 426 of file HitPattern.cc.

References numberOfValidStripLayersWithMonoAndStereo(), and StripSubdetector::TIB.

426  {
428 }
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:401
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TIB
int HitPattern::numberOfValidTIDLayersWithMonoAndStereo ( uint32_t  layer = 0) const

Definition at line 430 of file HitPattern.cc.

References numberOfValidStripLayersWithMonoAndStereo(), and StripSubdetector::TID.

430  {
432 }
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:401
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TID
int reco::HitPattern::numberOfValidTimingBTLHits ( ) const
inline

Definition at line 877 of file HitPattern.h.

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

Referenced by MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos().

877  {
879  }
static bool timingBTLHitFilter(uint16_t pattern)
Definition: HitPattern.h:685
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
int reco::HitPattern::numberOfValidTimingETLHits ( ) const
inline

Definition at line 881 of file HitPattern.h.

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

Referenced by MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos().

881  {
883  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
static bool timingETLHitFilter(uint16_t pattern)
Definition: HitPattern.h:692
int reco::HitPattern::numberOfValidTimingHits ( ) const
inline

Definition at line 821 of file HitPattern.h.

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

821  {
823  }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:699
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:563
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:790
int HitPattern::numberOfValidTOBLayersWithMonoAndStereo ( uint32_t  layer = 0) const

Definition at line 422 of file HitPattern.cc.

References numberOfValidStripLayersWithMonoAndStereo(), and StripSubdetector::TOB.

422  {
424 }
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:401
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TOB
int reco::HitPattern::numberOfValidTrackerHits ( ) const
inline
HitPattern & HitPattern::operator= ( const HitPattern other)

Definition at line 37 of file HitPattern.cc.

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

37  {
38  if (this == &other) {
39  return *this;
40  }
41 
42  this->hitCount = other.hitCount;
43 
44  this->beginTrackHits = other.beginTrackHits;
45  this->endTrackHits = other.endTrackHits;
46 
47  this->beginInner = other.beginInner;
48  this->endInner = other.endInner;
49 
50  this->beginOuter = other.beginOuter;
51  this->endOuter = other.endOuter;
52 
53  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
54 
55  return *this;
56 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:156
uint8_t endInner
Definition: HitPattern.h:496
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:490
uint8_t beginInner
Definition: HitPattern.h:495
uint8_t beginTrackHits
Definition: HitPattern.h:493
uint8_t endTrackHits
Definition: HitPattern.h:494
uint8_t hitCount
Definition: HitPattern.h:491
uint8_t beginOuter
Definition: HitPattern.h:497
uint8_t endOuter
Definition: HitPattern.h:498
int reco::HitPattern::outermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1084 of file HitPattern.h.

References outermostMuonStationWithHits().

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

Definition at line 1082 of file HitPattern.h.

References outermostMuonStationWithHits().

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

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

Definition at line 914 of file HitPattern.cc.

References beginTrackHits, endTrackHits, getHitPatternByAbsoluteIndex(), getHitType(), getMuonStation(), mps_fire::i, muonHitFilter(), runTheMatrix::ret, and edm_modernize_messagelogger::stat.

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

914  {
915  int ret = 0;
916  for (int i = beginTrackHits; i < endTrackHits; ++i) {
917  uint16_t pattern = getHitPatternByAbsoluteIndex(i);
918  if (muonHitFilter(pattern) && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
919  int stat = getMuonStation(pattern);
920  if (ret == 0 || stat > ret) {
921  ret = stat;
922  }
923  }
924  }
925  return ret;
926 }
tuple ret
prodAgent to be discontinued
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:741
uint8_t beginTrackHits
Definition: HitPattern.h:493
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
uint8_t endTrackHits
Definition: HitPattern.h:494
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
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:749
int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 1080 of file HitPattern.h.

References outermostMuonStationWithHits().

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

Definition at line 584 of file HitPattern.h.

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

Referenced by hasValidHitInPixelLayer(), numberOfLostPixelBarrelHits(), and numberOfValidPixelBarrelHits().

584  {
585  if UNLIKELY (!trackerHitFilter(pattern)) {
586  return false;
587  }
588 
589  uint32_t substructure = getSubStructure(pattern);
590  return (substructure == PixelSubdetector::PixelBarrel);
591  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
#define UNLIKELY(x)
Definition: Likely.h:21
int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 749 of file HitPattern.cc.

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

Referenced by pixelLayersNull().

749  {
750  int count = 0;
751  uint16_t NPixBarrel = 4;
752  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
754  count++;
755  }
756  }
757  return count;
758 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::pixelBarrelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 687 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

687  {
688  int count = 0;
689  uint16_t NPixBarrel = 4;
690  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
691  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::INACTIVE) {
692  count++;
693  }
694  }
695  return count;
696 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::pixelBarrelLayersWithMeasurement ( ) const

Definition at line 563 of file HitPattern.cc.

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

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

563  {
564  int count = 0;
565  uint16_t NPixBarrel = 4;
566  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
568  count++;
569  }
570  }
571  return count;
572 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::pixelBarrelLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 625 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

625  {
626  int count = 0;
627  uint16_t NPixBarrel = 4;
628  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
629  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::MISSING) {
630  count++;
631  }
632  }
633  return count;
634 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
bool reco::HitPattern::pixelEndcapHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 593 of file HitPattern.h.

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

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

593  {
594  if UNLIKELY (!trackerHitFilter(pattern)) {
595  return false;
596  }
597 
598  uint32_t substructure = getSubStructure(pattern);
599  return (substructure == PixelSubdetector::PixelEndcap);
600  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
#define UNLIKELY(x)
Definition: Likely.h:21
int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 760 of file HitPattern.cc.

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

Referenced by pixelLayersNull().

760  {
761  int count = 0;
762  uint16_t NPixForward = 3;
763  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
765  count++;
766  }
767  }
768  return count;
769 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::pixelEndcapLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 698 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

698  {
699  int count = 0;
700  uint16_t NPixForward = 3;
701  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
702  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::INACTIVE) {
703  count++;
704  }
705  }
706  return count;
707 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::pixelEndcapLayersWithMeasurement ( ) const

Definition at line 574 of file HitPattern.cc.

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

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

574  {
575  int count = 0;
576  uint16_t NPixForward = 3;
577  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
579  count++;
580  }
581  }
582  return count;
583 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::pixelEndcapLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 636 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

636  {
637  int count = 0;
638  uint16_t NPixForward = 3;
639  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
640  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::MISSING) {
641  count++;
642  }
643  }
644  return count;
645 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
bool reco::HitPattern::pixelHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 575 of file HitPattern.h.

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

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

575  {
576  if UNLIKELY (!trackerHitFilter(pattern)) {
577  return false;
578  }
579 
580  uint32_t substructure = getSubStructure(pattern);
581  return (substructure == PixelSubdetector::PixelBarrel || substructure == PixelSubdetector::PixelEndcap);
582  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
#define UNLIKELY(x)
Definition: Likely.h:21
int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 1032 of file HitPattern.h.

References pixelBarrelLayersNull(), and pixelEndcapLayersNull().

Referenced by trackerLayersNull().

int pixelBarrelLayersNull() const
Definition: HitPattern.cc:749
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:760
int reco::HitPattern::pixelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1021 of file HitPattern.h.

References pixelBarrelLayersTotallyOffOrBad(), and pixelEndcapLayersTotallyOffOrBad().

Referenced by trackerLayersTotallyOffOrBad().

1021  {
1023  }
int pixelBarrelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:687
static const char category[]
int pixelEndcapLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:698
int HitPattern::pixelLayersWithMeasurement ( ) const

Definition at line 500 of file HitPattern.cc.

References category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minStripWord, minTrackerWord, sistrip::SpyUtilities::range(), TRACK_HITS, trackerHitFilter(), and UNLIKELY.

Referenced by tadqm::TrackAnalyzer::analyze(), StandaloneTrackMonitor::analyze(), MuonTrackValidator::analyze(), PackedCandidateTrackValidator::analyze(), MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), PrimaryVertexValidation::fillTrackHistos(), TrackingNtuple::fillTracks(), GhostTrackComputer::operator()(), TrackFilterForPVFinding::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(), trackerLayersWithMeasurementOld(), and QcdUeDQM::trackSelection().

500  {
501  auto category = TRACK_HITS;
502  std::bitset<128> layerOk;
503  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
504  for (int i = range.first; i < range.second; ++i) {
505  auto pattern = getHitPatternByAbsoluteIndex(i);
506  if UNLIKELY (!trackerHitFilter(pattern))
507  continue;
508  if (pattern > minStripWord)
509  continue;
510  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
511  if (hitType != HIT_TYPE::VALID)
512  continue;
513  pattern = (pattern - minTrackerWord) >> LayerOffset;
514  // assert(pattern<128);
515  layerOk.set(pattern);
516  }
517  // assert(pixelLayersWithMeasurementOld()==int(layerOk.count()));
518  return layerOk.count();
519 }
static const char category[]
static const unsigned short HitTypeMask
Definition: HitPattern.h:441
const uint16_t range(const Frame &aFrame)
static const unsigned short minTrackerWord
Definition: HitPattern.h:459
if(conf_.getParameter< bool >("UseStripCablingDB"))
static const unsigned short HitTypeOffset
Definition: HitPattern.h:440
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
static const unsigned short minStripWord
Definition: HitPattern.h:462
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static const unsigned short LayerOffset
Definition: HitPattern.h:448
#define UNLIKELY(x)
Definition: Likely.h:21
int reco::HitPattern::pixelLayersWithMeasurementOld ( ) const
inline

Definition at line 995 of file HitPattern.h.

References pixelBarrelLayersWithMeasurement(), and pixelEndcapLayersWithMeasurement().

995  {
997  }
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:574
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:563
int reco::HitPattern::pixelLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1008 of file HitPattern.h.

References pixelBarrelLayersWithoutMeasurement(), and pixelEndcapLayersWithoutMeasurement().

Referenced by trackerLayersWithoutMeasurementOld().

1008  {
1010  }
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:625
static const char category[]
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:636
void HitPattern::print ( HitCategory  category,
std::ostream &  stream = std::cout 
) const

Definition at line 848 of file HitPattern.cc.

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

848  {
849  stream << "HitPattern" << std::endl;
850  for (int i = 0; i < numberOfAllHits(category); ++i) {
852  }
853  std::ios_base::fmtflags flags = stream.flags();
854  stream.setf(std::ios_base::hex, std::ios_base::basefield);
855  stream.setf(std::ios_base::showbase);
856 
857  for (int i = 0; i < this->numberOfAllHits(category); ++i) {
858  stream << getHitPattern(category, i) << std::endl;
859  }
860 
861  stream.flags(flags);
862 }
static const char category[]
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:811
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:798
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:531
void HitPattern::printHitPattern ( HitCategory  category,
int  position,
std::ostream &  stream 
) const

Definition at line 811 of file HitPattern.cc.

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

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

811  {
812  uint16_t pattern = getHitPattern(category, position);
813  stream << "\t";
814  if (muonHitFilter(pattern)) {
815  stream << "muon";
816  } else if (trackerHitFilter(pattern)) {
817  stream << "tracker";
818  } else if (timingHitFilter(pattern)) {
819  stream << "timing";
820  }
821 
822  stream << "\tsubstructure " << getSubStructure(pattern);
823  if (muonHitFilter(pattern)) {
824  stream << "\tstation " << getMuonStation(pattern);
825  if (muonDTHitFilter(pattern)) {
826  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
827  } else if (muonCSCHitFilter(pattern)) {
828  stream << "\tcsc ring " << getCSCRing(pattern);
829  } else if (muonRPCHitFilter(pattern)) {
830  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel") << ", layer " << getRPCLayer(pattern);
831  } else if (muonGEMHitFilter(pattern)) {
832  stream << "\tgem "
833  << " station " << getGEMStation(pattern) << ", layer" << getGEMLayer(pattern);
834  } else if (muonME0HitFilter(pattern)) {
835  stream << "\tme0 ";
836  } else {
837  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure " << getSubStructure(pattern);
838  }
839  } else if (timingHitFilter(pattern)) {
840  stream << "\tdetector " << getSubStructure(pattern);
841  } else {
842  stream << "\tlayer " << getLayer(pattern);
843  }
844  stream << "\thit type " << getHitType(pattern);
845  stream << std::endl;
846 }
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:755
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:715
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:699
static const char category[]
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the &quot;hit&quot; was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:753
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:666
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1-6 for station 0, 1-2 for stations 1 and 2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:783
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:639
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:741
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:768
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:657
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:771
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
static int position[264][3]
Definition: ReadPGInfo.cc:289
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:757
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:749
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:531
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:648
int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 1060 of file HitPattern.h.

References muonStations().

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

Definition at line 1058 of file HitPattern.h.

References muonStations().

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

Definition at line 1056 of file HitPattern.h.

References muonStations().

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

Definition at line 602 of file HitPattern.h.

References maxTrackerWord, and minStripWord.

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

602  {
603  return pattern > minStripWord && pattern <= maxTrackerWord;
604  }
static const unsigned short maxTrackerWord
Definition: HitPattern.h:460
static const unsigned short minStripWord
Definition: HitPattern.h:462
int reco::HitPattern::stripLayersNull ( ) const
inline

Definition at line 1034 of file HitPattern.h.

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

Referenced by trackerLayersNull().

1034  {
1036  }
int stripTIBLayersNull() const
Definition: HitPattern.cc:771
int stripTECLayersNull() const
Definition: HitPattern.cc:801
int stripTIDLayersNull() const
Definition: HitPattern.cc:781
int stripTOBLayersNull() const
Definition: HitPattern.cc:791
int reco::HitPattern::stripLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1025 of file HitPattern.h.

References stripTECLayersTotallyOffOrBad(), stripTIBLayersTotallyOffOrBad(), stripTIDLayersTotallyOffOrBad(), and stripTOBLayersTotallyOffOrBad().

Referenced by trackerLayersTotallyOffOrBad().

1025  {
1028  }
int stripTOBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:729
static const char category[]
int stripTIBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:709
int stripTIDLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:719
int stripTECLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:739
int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline
int reco::HitPattern::stripLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1012 of file HitPattern.h.

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

Referenced by trackerLayersWithoutMeasurementOld().

1012  {
1015  }
static const char category[]
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:667
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:657
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:677
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:647
bool reco::HitPattern::stripSubdetectorHitFilter ( uint16_t  pattern,
StripSubdetector::SubDetector  substructure 
)
inlinestaticprivate

Definition at line 606 of file HitPattern.h.

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

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

606  {
607  if UNLIKELY (!trackerHitFilter(pattern)) {
608  return false;
609  }
610 
611  return substructure == getSubStructure(pattern);
612  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::stripTECHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 626 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TEC.

Referenced by numberOfLostStripTECHits(), and numberOfValidStripTECHits().

626  {
628  }
static constexpr auto TEC
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:606
int HitPattern::stripTECLayersNull ( ) const

Definition at line 801 of file HitPattern.cc.

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

Referenced by stripLayersNull().

801  {
802  int count = 0;
803  for (uint16_t layer = 1; layer <= 9; layer++) {
805  count++;
806  }
807  }
808  return count;
809 }
static constexpr auto TEC
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::stripTECLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 739 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

739  {
740  int count = 0;
741  for (uint16_t layer = 1; layer <= 9; layer++) {
742  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::INACTIVE) {
743  count++;
744  }
745  }
746  return count;
747 }
static constexpr auto TEC
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::stripTECLayersWithMeasurement ( ) const

Definition at line 615 of file HitPattern.cc.

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

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

615  {
616  int count = 0;
617  for (uint16_t layer = 1; layer <= 9; layer++) {
618  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::VALID) {
619  count++;
620  }
621  }
622  return count;
623 }
static constexpr auto TEC
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
int HitPattern::stripTECLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 677 of file HitPattern.cc.

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

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

677  {
678  int count = 0;
679  for (uint16_t layer = 1; layer <= 9; layer++) {
680  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::MISSING) {
681  count++;
682  }
683  }
684  return count;
685 }
static constexpr auto TEC
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
bool reco::HitPattern::stripTIBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 614 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TIB.

Referenced by egamma::getClosestCtfToGsf(), numberOfLostStripTIBHits(), and numberOfValidStripTIBHits().

614  {
616  }
static constexpr auto TIB
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:606
int HitPattern::stripTIBLayersNull ( ) const

Definition at line 771 of file HitPattern.cc.

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

Referenced by stripLayersNull().

771  {
772  int count = 0;
773  for (uint16_t layer = 1; layer <= 4; layer++) {
775  count++;
776  }
777  }
778  return count;
779 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TIB
int HitPattern::stripTIBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 709 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

709  {
710  int count = 0;
711  for (uint16_t layer = 1; layer <= 4; layer++) {
712  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::INACTIVE) {
713  count++;
714  }
715  }
716  return count;
717 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TIB
int HitPattern::stripTIBLayersWithMeasurement ( ) const

Definition at line 585 of file HitPattern.cc.

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

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

585  {
586  int count = 0;
587  for (uint16_t layer = 1; layer <= 4; layer++) {
588  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::VALID) {
589  count++;
590  }
591  }
592  return count;
593 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TIB
int HitPattern::stripTIBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 647 of file HitPattern.cc.

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

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

647  {
648  int count = 0;
649  for (uint16_t layer = 1; layer <= 4; layer++) {
650  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::MISSING) {
651  count++;
652  }
653  }
654  return count;
655 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TIB
bool reco::HitPattern::stripTIDHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 618 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TID.

Referenced by egamma::getClosestCtfToGsf(), numberOfLostStripTIDHits(), and numberOfValidStripTIDHits().

618  {
620  }
static constexpr auto TID
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:606
int HitPattern::stripTIDLayersNull ( ) const

Definition at line 781 of file HitPattern.cc.

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

Referenced by stripLayersNull().

781  {
782  int count = 0;
783  for (uint16_t layer = 1; layer <= 3; layer++) {
785  count++;
786  }
787  }
788  return count;
789 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TID
int HitPattern::stripTIDLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 719 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

719  {
720  int count = 0;
721  for (uint16_t layer = 1; layer <= 3; layer++) {
722  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::INACTIVE) {
723  count++;
724  }
725  }
726  return count;
727 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TID
int HitPattern::stripTIDLayersWithMeasurement ( ) const

Definition at line 595 of file HitPattern.cc.

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

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

595  {
596  int count = 0;
597  for (uint16_t layer = 1; layer <= 3; layer++) {
598  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::VALID) {
599  count++;
600  }
601  }
602  return count;
603 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TID
int HitPattern::stripTIDLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 657 of file HitPattern.cc.

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

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

657  {
658  int count = 0;
659  for (uint16_t layer = 1; layer <= 3; layer++) {
660  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::MISSING) {
661  count++;
662  }
663  }
664  return count;
665 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TID
bool reco::HitPattern::stripTOBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 622 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TOB.

Referenced by numberOfLostStripTOBHits(), and numberOfValidStripTOBHits().

622  {
624  }
static constexpr auto TOB
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:606
int HitPattern::stripTOBLayersNull ( ) const

Definition at line 791 of file HitPattern.cc.

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

Referenced by stripLayersNull().

791  {
792  int count = 0;
793  for (uint16_t layer = 1; layer <= 6; layer++) {
795  count++;
796  }
797  }
798  return count;
799 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:160
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TOB
int HitPattern::stripTOBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 729 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

729  {
730  int count = 0;
731  for (uint16_t layer = 1; layer <= 6; layer++) {
732  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::INACTIVE) {
733  count++;
734  }
735  }
736  return count;
737 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TOB
int HitPattern::stripTOBLayersWithMeasurement ( ) const

Definition at line 605 of file HitPattern.cc.

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

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

605  {
606  int count = 0;
607  for (uint16_t layer = 1; layer <= 6; layer++) {
608  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::VALID) {
609  count++;
610  }
611  }
612  return count;
613 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TOB
int HitPattern::stripTOBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 667 of file HitPattern.cc.

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

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

667  {
668  int count = 0;
669  for (uint16_t layer = 1; layer <= 6; layer++) {
670  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::MISSING) {
671  count++;
672  }
673  }
674  return count;
675 }
static const char category[]
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:438
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TOB
bool reco::HitPattern::timingBTLHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 685 of file HitPattern.h.

References MTDDetId::BTL, getSubStructure(), timingHitFilter(), and UNLIKELY.

Referenced by numberOfLostTimingBTLHits(), and numberOfValidTimingBTLHits().

685  {
686  if UNLIKELY (!timingHitFilter(pattern))
687  return false;
688  uint16_t substructure = getSubStructure(pattern);
689  return (substructure == (uint16_t)MTDDetId::BTL);
690  }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:699
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::timingETLHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 692 of file HitPattern.h.

References MTDDetId::ETL, getSubStructure(), timingHitFilter(), and UNLIKELY.

Referenced by numberOfLostTimingETLHits(), and numberOfValidTimingETLHits().

692  {
693  if UNLIKELY (!timingHitFilter(pattern))
694  return false;
695  uint16_t substructure = getSubStructure(pattern);
696  return (substructure == (uint16_t)MTDDetId::ETL);
697  }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:699
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:707
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::timingHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 699 of file HitPattern.h.

References EMPTY_PATTERN, SubDetectorMask, SubDetectorOffset, and UNLIKELY.

Referenced by numberOfLostTimingHits(), numberOfTimingHits(), numberOfValidTimingHits(), printHitPattern(), timingBTLHitFilter(), and timingETLHitFilter().

699  {
700  if UNLIKELY (pattern == HitPattern::EMPTY_PATTERN) {
701  return false;
702  }
703 
704  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 2);
705  }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:161
static const unsigned short SubDetectorMask
Definition: HitPattern.h:457
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:456
#define UNLIKELY(x)
Definition: Likely.h:21
bool reco::HitPattern::trackerHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 1030 of file HitPattern.h.

References pixelLayersNull(), and stripLayersNull().

1030 { return pixelLayersNull() + stripLayersNull(); }
int pixelLayersNull() const
Definition: HitPattern.h:1032
int stripLayersNull() const
Definition: HitPattern.h:1034
int reco::HitPattern::trackerLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1017 of file HitPattern.h.

References pixelLayersTotallyOffOrBad(), and stripLayersTotallyOffOrBad().

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

1017  {
1019  }
int pixelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1021
static const char category[]
int stripLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1025
int HitPattern::trackerLayersWithMeasurement ( ) const

Definition at line 521 of file HitPattern.cc.

References category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minTrackerWord, sistrip::SpyUtilities::range(), TRACK_HITS, trackerHitFilter(), and UNLIKELY.

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

521  {
522  auto category = TRACK_HITS;
523  std::bitset<128> layerOk;
524  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
525  for (int i = range.first; i < range.second; ++i) {
526  auto pattern = getHitPatternByAbsoluteIndex(i);
527  if UNLIKELY (!trackerHitFilter(pattern))
528  continue;
529  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
530  if (hitType != HIT_TYPE::VALID)
531  continue;
532  pattern = (pattern - minTrackerWord) >> LayerOffset;
533  // assert(pattern<128);
534  layerOk.set(pattern);
535  }
536  // assert(trackerLayersWithMeasurementOld()==int(layerOk.count()));
537  return layerOk.count();
538 }
static const char category[]
static const unsigned short HitTypeMask
Definition: HitPattern.h:441
const uint16_t range(const Frame &aFrame)
static const unsigned short minTrackerWord
Definition: HitPattern.h:459
if(conf_.getParameter< bool >("UseStripCablingDB"))
static const unsigned short HitTypeOffset
Definition: HitPattern.h:440
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static const unsigned short LayerOffset
Definition: HitPattern.h:448
#define UNLIKELY(x)
Definition: Likely.h:21
int reco::HitPattern::trackerLayersWithMeasurementOld ( ) const
inline

Definition at line 991 of file HitPattern.h.

References pixelLayersWithMeasurement(), and stripLayersWithMeasurement().

991  {
993  }
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:500
int stripLayersWithMeasurement() const
Definition: HitPattern.h:999
int HitPattern::trackerLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 540 of file HitPattern.cc.

References getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minTrackerWord, sistrip::SpyUtilities::range(), trackerHitFilter(), and UNLIKELY.

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

540  {
541  std::bitset<128> layerOk;
542  std::bitset<128> layerMissed;
543  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
544  for (int i = range.first; i < range.second; ++i) {
545  auto pattern = getHitPatternByAbsoluteIndex(i);
546  if UNLIKELY (!trackerHitFilter(pattern))
547  continue;
548  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
549  pattern = (pattern - minTrackerWord) >> LayerOffset;
550  // assert(pattern<128);
551  if (hitType == HIT_TYPE::VALID)
552  layerOk.set(pattern);
553  if (hitType == HIT_TYPE::MISSING)
554  layerMissed.set(pattern);
555  }
556  layerMissed &= ~layerOk;
557 
558  // assert(trackerLayersWithoutMeasurementOld(category)==int(layerMissed.count()));
559 
560  return layerMissed.count();
561 }
static const char category[]
static const unsigned short HitTypeMask
Definition: HitPattern.h:441
const uint16_t range(const Frame &aFrame)
static const unsigned short minTrackerWord
Definition: HitPattern.h:459
if(conf_.getParameter< bool >("UseStripCablingDB"))
static const unsigned short HitTypeOffset
Definition: HitPattern.h:440
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:673
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:302
static const unsigned short LayerOffset
Definition: HitPattern.h:448
#define UNLIKELY(x)
Definition: Likely.h:21
int reco::HitPattern::trackerLayersWithoutMeasurementOld ( HitCategory  category) const
inline

Definition at line 1004 of file HitPattern.h.

References pixelLayersWithoutMeasurement(), and stripLayersWithoutMeasurement().

1004  {
1006  }
static const char category[]
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1008
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1012
bool reco::HitPattern::validHitFilter ( uint16_t  pattern)
inlinestatic

Friends And Related Function Documentation

template<int N>
friend struct PatternSet
friend

Definition at line 503 of file HitPattern.h.

Member Data Documentation

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

Definition at line 156 of file HitPattern.h.

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

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

Definition at line 157 of file HitPattern.h.

Referenced by getHitPatternByAbsoluteIndex(), and insertHit().

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

Definition at line 158 of file HitPattern.h.

Referenced by appendHit(), and appendMuonHit().

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

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

Referenced by encode(), and getSide().

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

Definition at line 444 of file HitPattern.h.

Referenced by encode(), and getSide().

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

Definition at line 452 of file HitPattern.h.

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