CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
reco::HitPattern Class Reference

#include <HitPattern.h>

Public Types

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

Public Member Functions

bool appendHit (const TrackingRecHit &hit, const TrackerTopology &ttopo)
 
bool appendHit (const TrackingRecHitRef &ref, const TrackerTopology &ttopo)
 
bool appendHit (const DetId &id, TrackingRecHit::Type hitType, const TrackerTopology &ttopo)
 
bool appendHit (const uint16_t pattern, TrackingRecHit::Type hitType)
 
template<typename I >
bool appendHits (const I &begin, const I &end, const TrackerTopology &ttopo)
 
bool appendMuonHit (const DetId &id, TrackingRecHit::Type hitType)
 
bool appendTrackerHit (uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType)
 
void clear ()
 
int cscStationsWithAnyHits () const
 
int cscStationsWithBadHits () const
 
int cscStationsWithValidHits () const
 
int dtStationsWithAnyHits () const
 
int dtStationsWithBadHits () const
 
int dtStationsWithValidHits () const
 
int gemStationsWithAnyHits () const
 
int gemStationsWithBadHits () const
 
int gemStationsWithValidHits () const
 
uint16_t getHitPattern (HitCategory category, int position) const
 
uint32_t getTrackerLayerCase (HitCategory category, uint16_t substr, uint16_t layer) const
 
uint16_t getTrackerMonoStereo (HitCategory category, uint16_t substr, uint16_t layer) const
 
bool hasValidHitInPixelLayer (enum PixelSubdetector::SubDetector, uint16_t layer) const
 
 HitPattern ()
 
 HitPattern (const HitPattern &other)
 
 HitPattern (const Run3ScoutingHitPatternPOD &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
 
Run3ScoutingHitPatternPOD run3ScoutingHitPatternPOD () 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 148 of file HitPattern.h.

Member Typedef Documentation

◆ filterType

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

Definition at line 479 of file HitPattern.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MONO 
STEREO 

Definition at line 150 of file HitPattern.h.

◆ HIT_DETECTOR_TYPE

Enumerator
MUON_HIT 
TRACKER_HIT 
MTD_HIT 

Definition at line 152 of file HitPattern.h.

◆ HIT_TYPE

Enumerator
VALID 
MISSING 
INACTIVE 
BAD 

Definition at line 154 of file HitPattern.h.

◆ HitCategory

Enumerator
TRACK_HITS 
MISSING_INNER_HITS 
MISSING_OUTER_HITS 

Definition at line 156 of file HitPattern.h.

Constructor & Destructor Documentation

◆ HitPattern() [1/3]

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:157
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
uint8_t endInner
Definition: HitPattern.h:502
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
uint8_t endOuter
Definition: HitPattern.h:504

◆ ~HitPattern()

HitPattern::~HitPattern ( )

Definition at line 48 of file HitPattern.cc.

48 { ; }

◆ HitPattern() [2/3]

HitPattern::HitPattern ( const HitPattern other)

Definition at line 24 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

25  : hitCount(other.hitCount),
26  beginTrackHits(other.beginTrackHits),
27  endTrackHits(other.endTrackHits),
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:157
uint8_t endInner
Definition: HitPattern.h:502
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
uint8_t endOuter
Definition: HitPattern.h:504

◆ HitPattern() [3/3]

HitPattern::HitPattern ( const Run3ScoutingHitPatternPOD other)

Definition at line 35 of file HitPattern.cc.

References ARRAY_LENGTH, filterCSVwithJSON::copy, hitPattern, and trackingPlots::other.

36  : hitCount(other.hitCount),
37  beginTrackHits(other.beginTrackHits),
38  endTrackHits(other.endTrackHits),
39  beginInner(other.beginInner),
40  endInner(other.endInner),
41  beginOuter(other.beginOuter),
42  endOuter(other.endOuter) {
43  const unsigned short max_vector_length =
44  (other.hitPattern.size() > HitPattern::ARRAY_LENGTH) ? HitPattern::ARRAY_LENGTH : other.hitPattern.size();
45  std::copy(other.hitPattern.begin(), other.hitPattern.begin() + max_vector_length, this->hitPattern);
46 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:157
uint8_t endInner
Definition: HitPattern.h:502
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
uint8_t endOuter
Definition: HitPattern.h:504

Member Function Documentation

◆ appendHit() [1/4]

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

Definition at line 224 of file HitPattern.cc.

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

224  {
225  return appendHit(hit.geographicalId(), hit.getType(), ttopo);
226 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:224
DetId geographicalId() const

◆ appendHit() [2/4]

bool HitPattern::appendHit ( const TrackingRecHitRef ref,
const TrackerTopology ttopo 
)

Definition at line 83 of file HitPattern.cc.

References appendHit().

83  {
84  return appendHit(*ref, ttopo);
85 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:224

◆ appendHit() [3/4]

bool HitPattern::appendHit ( const DetId id,
TrackingRecHit::Type  hitType,
const TrackerTopology ttopo 
)

Definition at line 228 of file HitPattern.cc.

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

228  {
229  //if HitPattern is full, journey ends no matter what.
231  return false;
232  }
233 
234  uint16_t pattern = HitPattern::encode(id, hitType, ttopo);
235 
236  return appendHit(pattern, hitType);
237 }
static const unsigned short MaxHits
Definition: HitPattern.h:159
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:224
uint8_t hitCount
Definition: HitPattern.h:497
#define UNLIKELY(x)
Definition: Likely.h:21
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:87

◆ appendHit() [4/4]

bool HitPattern::appendHit ( const uint16_t  pattern,
TrackingRecHit::Type  hitType 
)

Definition at line 239 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, topSingleLeptonDQM_PU_cfi::pattern, UNLIKELY, and TrackingRecHit::valid.

239  {
240  //if HitPattern is full, journey ends no matter what.
242  return false;
243  }
244 
245  switch (hitType) {
249  case TrackingRecHit::bad:
250  // hitCount != endT => we are not inserting T type of hits but of T'
251  // 0 != beginT || 0 != endT => we already have hits of T type
252  // so we already have hits of T in the vector and we don't want to
253  // mess them with T' hits.
254  if UNLIKELY (((hitCount != endTrackHits) && (0 != beginTrackHits || 0 != endTrackHits))) {
255  cms::Exception("HitPattern") << "TRACK_HITS"
256  << " were stored on this object before hits of some other category were inserted "
257  << "but hits of the same category should be inserted in a row. "
258  << "Please rework the code so it inserts all "
259  << "TRACK_HITS"
260  << " in a row.";
261  return false;
262  }
263  return insertTrackHit(pattern);
264  break;
267  if UNLIKELY (((hitCount != endInner) && (0 != beginInner || 0 != endInner))) {
268  cms::Exception("HitPattern") << "MISSING_INNER_HITS"
269  << " were stored on this object before hits of some other category were inserted "
270  << "but hits of the same category should be inserted in a row. "
271  << "Please rework the code so it inserts all "
272  << "MISSING_INNER_HITS"
273  << " in a row.";
274  return false;
275  }
277  break;
280  if UNLIKELY (((hitCount != endOuter) && (0 != beginOuter || 0 != endOuter))) {
281  cms::Exception("HitPattern") << "MISSING_OUTER_HITS"
282  << " were stored on this object before hits of some other category were inserted "
283  << "but hits of the same category should be inserted in a row. "
284  << "Please rework the code so it inserts all "
285  << "MISSING_OUTER_HITS"
286  << " in a row.";
287  return false;
288  }
290  break;
291  }
292 
293  return false;
294 }
static const unsigned short MaxHits
Definition: HitPattern.h:159
bool insertExpectedOuterHit(const uint16_t pattern)
Definition: HitPattern.cc:1033
uint8_t endInner
Definition: HitPattern.h:502
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
bool insertExpectedInnerHit(const uint16_t pattern)
Definition: HitPattern.cc:1021
bool insertTrackHit(const uint16_t pattern)
Definition: HitPattern.cc:1003
#define UNLIKELY(x)
Definition: Likely.h:21
uint8_t endOuter
Definition: HitPattern.h:504

◆ appendHits()

template<typename I >
bool reco::HitPattern::appendHits ( const I &  begin,
const I &  end,
const TrackerTopology ttopo 
)

Definition at line 528 of file HitPattern.h.

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

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

528  {
529  for (I hit = begin; hit != end; hit++) {
530  if UNLIKELY ((!appendHit(*hit, ttopo))) {
531  return false;
532  }
533  }
534  return true;
535  }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:224
const std::complex< double > I
Definition: I.h:8
#define UNLIKELY(x)
Definition: Likely.h:21

◆ appendMuonHit()

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 300 of file HitPattern.cc.

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

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

300  {
301  //if HitPattern is full, journey ends no matter what.
303  return false;
304  }
305 
306  if UNLIKELY (id.det() != DetId::Muon) {
307  throw cms::Exception("HitPattern")
308  << "Got DetId from det " << id.det()
309  << " that is not Muon in appendMuonHit(), which should only be used for muon hits in the HitPattern IO rule";
310  }
311 
312  uint16_t subdet = id.subdetId();
313  return appendHit(encode(MUON_HIT, subdet, encodeMuonLayer(id), 0, hitType), hitType);
314 }
static const unsigned short MaxHits
Definition: HitPattern.h:159
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:224
uint8_t hitCount
Definition: HitPattern.h:497
#define UNLIKELY(x)
Definition: Likely.h:21
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:87

◆ appendTrackerHit()

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 296 of file HitPattern.cc.

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

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

296  {
297  return appendHit(encode(TRACKER_HIT, subdet, layer, stereo, hitType), hitType);
298 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:224
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:87

◆ badHitFilter()

bool reco::HitPattern::badHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 802 of file HitPattern.h.

References BAD, getHitType(), and topSingleLeptonDQM_PU_cfi::pattern.

Referenced by numberOfBadHits().

◆ call()

template<typename F >
void reco::HitPattern::call ( HitCategory  category,
filterType  typeFilter,
F  f 
) const
private

Definition at line 558 of file HitPattern.h.

References validateAlignments::category, f, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), mps_fire::i, topSingleLeptonDQM_PU_cfi::pattern, and FastTimerService_cff::range.

558  {
559  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
560  for (int i = range.first; i < range.second; i++) {
562  // f() return false to ask to stop looping
563  if (typeFilter(pattern) && !f(pattern)) {
564  break;
565  }
566  }
567  }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
double f[11][100]

◆ clear()

void HitPattern::clear ( void  )

Definition at line 71 of file HitPattern.cc.

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

Referenced by fillNewHitPatternWithOldHitPattern_v12(), reco::modules::TrackerTrackHitFilter::makeCandidate(), and reco::TrackBase::resetHitPattern().

71  {
72  this->hitCount = 0;
73  this->beginTrackHits = 0;
74  this->endTrackHits = 0;
75  this->beginInner = 0;
76  this->endInner = 0;
77  this->beginOuter = 0;
78  this->endOuter = 0;
79 
80  memset(this->hitPattern, EMPTY_PATTERN, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
81 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:157
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
uint8_t endInner
Definition: HitPattern.h:502
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
uint8_t endOuter
Definition: HitPattern.h:504

◆ countHits()

int reco::HitPattern::countHits ( HitCategory  category,
filterType  filter 
) const
inlineprivate

◆ countTypedHits()

int reco::HitPattern::countTypedHits ( HitCategory  category,
filterType  typeFilter,
filterType  filter 
) const
inlineprivate

Definition at line 569 of file HitPattern.h.

References validateAlignments::category, submitPVResolutionJobs::count, ALCARECOTkAlBeamHalo_cff::filter, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), mps_fire::i, topSingleLeptonDQM_PU_cfi::pattern, and FastTimerService_cff::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().

569  {
570  int count = 0;
571  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
572  for (int i = range.first; i < range.second; ++i) {
574  if (typeFilter(pattern) && filter(pattern)) {
575  ++count;
576  }
577  }
578  return count;
579  }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316

◆ cscStationsWithAnyHits()

int reco::HitPattern::cscStationsWithAnyHits ( ) const
inline

Definition at line 1060 of file HitPattern.h.

References muonStations().

1060 { 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:914

◆ cscStationsWithBadHits()

int reco::HitPattern::cscStationsWithBadHits ( ) const
inline

Definition at line 1058 of file HitPattern.h.

References muonStations().

1058 { 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:914

◆ cscStationsWithValidHits()

int reco::HitPattern::cscStationsWithValidHits ( ) const
inline

Definition at line 1056 of file HitPattern.h.

References muonStations().

1056 { 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:914

◆ dtStationsWithAnyHits()

int reco::HitPattern::dtStationsWithAnyHits ( ) const
inline

Definition at line 1054 of file HitPattern.h.

References muonStations().

1054 { 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:914

◆ dtStationsWithBadHits()

int reco::HitPattern::dtStationsWithBadHits ( ) const
inline

Definition at line 1052 of file HitPattern.h.

References muonStations().

1052 { 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:914

◆ dtStationsWithValidHits()

int reco::HitPattern::dtStationsWithValidHits ( ) const
inline

Definition at line 1050 of file HitPattern.h.

References muonStations().

1050 { 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:914

◆ encode() [1/3]

uint16_t HitPattern::encode ( const TrackingRecHit hit,
const TrackerTopology ttopo 
)
staticprivate

Definition at line 87 of file HitPattern.cc.

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

87  {
88  return encode(hit.geographicalId(), hit.getType(), ttopo);
89 }
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:87

◆ encode() [2/3]

uint16_t HitPattern::encode ( const DetId id,
TrackingRecHit::Type  hitType,
const TrackerTopology ttopo 
)
staticprivate

Definition at line 161 of file HitPattern.cc.

References encode(), FastTime, DetId::Forward, isStereo(), TrackerTopology::layer(), MTD_HIT, MTDDetId::mtdSubDetector(), DetId::Muon, MUON_HIT, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side(), DetId::Tracker, and TRACKER_HIT.

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

◆ encode() [3/3]

uint16_t HitPattern::encode ( uint16_t  det,
uint16_t  subdet,
uint16_t  layer,
uint16_t  side,
TrackingRecHit::Type  hitType 
)
staticprivate

Definition at line 197 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, topSingleLeptonDQM_PU_cfi::pattern, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side(), SideMask, SideOffset, SubDetectorMask, SubDetectorOffset, SubstrMask, and SubstrOffset.

197  {
199 
200  // adding tracker/muon/mtd detector bits
202 
203  // adding substructure (PXB, PXF, TIB, TID, TOB, TEC, or DT, CSC, RPC,GEM, or BTL, ETL) bits
204  pattern |= (subdet & SubstrMask) << SubstrOffset;
205 
206  // adding layer/disk/wheel/ring/modType bits
208 
209  // adding mono/stereo bit
210  pattern |= (side & SideMask) << SideOffset;
211 
212  TrackingRecHit::Type patternHitType =
217  : hitType);
218 
219  pattern |= (patternHitType & HitTypeMask) << HitTypeOffset;
220 
221  return pattern;
222 }
static const unsigned short SideOffset
Definition: HitPattern.h:450
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
static const unsigned short SubstrOffset
Definition: HitPattern.h:458
static const unsigned short HitTypeMask
Definition: HitPattern.h:447
static const unsigned short SubDetectorMask
Definition: HitPattern.h:463
static const unsigned short HitTypeOffset
Definition: HitPattern.h:446
static const unsigned short SideMask
Definition: HitPattern.h:451
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:462
static const unsigned short SubstrMask
Definition: HitPattern.h:459
static const unsigned short LayerOffset
Definition: HitPattern.h:454
static const unsigned short LayerMask
Definition: HitPattern.h:455

◆ fillNewHitPatternWithOldHitPattern_v12()

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, topSingleLeptonDQM_PU_cfi::pattern, 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 }
ret
prodAgent to be discontinued
uint8_t endInner
Definition: HitPattern.h:502
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:224
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
uint8_t endOuter
Definition: HitPattern.h:504

◆ gemStationsWithAnyHits()

int reco::HitPattern::gemStationsWithAnyHits ( ) const
inline

Definition at line 1072 of file HitPattern.h.

References muonStations().

1072 { 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:914

◆ gemStationsWithBadHits()

int reco::HitPattern::gemStationsWithBadHits ( ) const
inline

Definition at line 1070 of file HitPattern.h.

References muonStations().

1070 { 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:914

◆ gemStationsWithValidHits()

int reco::HitPattern::gemStationsWithValidHits ( ) const
inline

Definition at line 1068 of file HitPattern.h.

References muonStations().

1068 { 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:914

◆ getBTLModType()

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 785 of file HitPattern.h.

References getSubSubStructure(), and topSingleLeptonDQM_PU_cfi::pattern.

785 { return getSubSubStructure(pattern); }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getCategoryIndexRange()

std::pair< uint8_t, uint8_t > reco::HitPattern::getCategoryIndexRange ( HitCategory  category) const
inlineprivate

Definition at line 512 of file HitPattern.h.

References beginInner, beginOuter, beginTrackHits, validateAlignments::category, 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().

512  {
513  switch (category) {
514  case TRACK_HITS:
515  return std::pair<uint8_t, uint8_t>(beginTrackHits, endTrackHits);
516  break;
517  case MISSING_INNER_HITS:
518  return std::pair<uint8_t, uint8_t>(beginInner, endInner);
519  break;
520  case MISSING_OUTER_HITS:
521  return std::pair<uint8_t, uint8_t>(beginOuter, endOuter);
522  break;
523  }
524  return std::pair<uint8_t, uint8_t>(-1, -1);
525  }
uint8_t endInner
Definition: HitPattern.h:502
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t beginOuter
Definition: HitPattern.h:503
uint8_t endOuter
Definition: HitPattern.h:504

◆ getCSCRing()

uint16_t reco::HitPattern::getCSCRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 761 of file HitPattern.h.

References getSubSubStructure(), and topSingleLeptonDQM_PU_cfi::pattern.

Referenced by printHitPattern().

761 { return (getSubSubStructure(pattern) & 3) + 1; }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getDTSuperLayer()

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 759 of file HitPattern.h.

References getSubSubStructure(), and topSingleLeptonDQM_PU_cfi::pattern.

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

759 { return (getSubSubStructure(pattern) & 3); }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getETLRing()

uint16_t reco::HitPattern::getETLRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 787 of file HitPattern.h.

References getSubSubStructure(), and topSingleLeptonDQM_PU_cfi::pattern.

787 { return getSubSubStructure(pattern); }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getGEMLayer()

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 789 of file HitPattern.h.

References b11, getSubSubStructure(), and topSingleLeptonDQM_PU_cfi::pattern.

Referenced by printHitPattern().

789  {
790  uint16_t sss = getSubSubStructure(pattern);
791  if (sss & 0b1000)
792  return (sss & 0b0111) + 1;
793  return (sss & 0b11) + 1;
794  }
bias11_t b11[15]
Definition: b11.h:9
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getGEMStation()

uint16_t reco::HitPattern::getGEMStation ( uint16_t  pattern)
inlinestatic

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

Definition at line 777 of file HitPattern.h.

References getSubSubStructure(), and topSingleLeptonDQM_PU_cfi::pattern.

Referenced by getMuonStation(), and printHitPattern().

777  {
778  uint16_t sss = getSubSubStructure(pattern);
779  if (sss & 0b1000)
780  return 0;
781  return (sss >> 2) + 1;
782  }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getHitPattern()

uint16_t reco::HitPattern::getHitPattern ( HitCategory  category,
int  position 
) const
inline

Definition at line 537 of file HitPattern.h.

References validateAlignments::category, EMPTY_PATTERN, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), position, FastTimerService_cff::range, and UNLIKELY.

Referenced by StandaloneTrackMonitor::analyze(), pat::SoftMuonMvaEstimator::computeMva(), reco::tau::countHits(), OniaPhotonConversionProducer::foundCompatibleInnerHits(), egamma::getClosestCtfToGsf(), PFElecTkProducer::isInnerMost(), FWTrackResidualDetailView::prepareData(), print(), printHitPattern(), SingleLongTrackProducer::produce(), pat::PATPackedCandidateProducer::produce(), FWConvTrackHitsDetailView::setTextInfo(), egamma::sharedDets(), and egamma::sharedHits().

537  {
538  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
539  if UNLIKELY ((position < 0 || (position + range.first) >= range.second)) {
541  }
542 
544  }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static int position[264][3]
Definition: ReadPGInfo.cc:289
#define UNLIKELY(x)
Definition: Likely.h:21

◆ getHitPatternByAbsoluteIndex()

uint16_t HitPattern::getHitPatternByAbsoluteIndex ( int  position) const
private

Definition at line 316 of file HitPattern.cc.

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

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

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

◆ getHitType()

uint32_t reco::HitPattern::getHitType ( uint16_t  pattern)
inlinestatic

Definition at line 747 of file HitPattern.h.

References EMPTY_PATTERN, HitTypeMask, HitTypeOffset, NULL_RETURN, topSingleLeptonDQM_PU_cfi::pattern, and UNLIKELY.

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

747  {
749  return NULL_RETURN;
750  }
751 
752  return ((pattern >> HitTypeOffset) & HitTypeMask);
753  }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
static const unsigned short HitTypeMask
Definition: HitPattern.h:447
static const unsigned short HitTypeOffset
Definition: HitPattern.h:446
#define UNLIKELY(x)
Definition: Likely.h:21

◆ getLayer()

uint32_t reco::HitPattern::getLayer ( uint16_t  pattern)
inlinestatic

◆ getMuonStation()

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 755 of file HitPattern.h.

References getGEMStation(), getSubSubStructure(), muonGEMHitFilter(), and topSingleLeptonDQM_PU_cfi::pattern.

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

755  {
757  }
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:663
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:777
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getRPCLayer()

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 763 of file HitPattern.h.

References getSubSubStructure(), LIKELY, and topSingleLeptonDQM_PU_cfi::pattern.

Referenced by printHitPattern().

763  {
764  uint16_t subSubStructure = getSubSubStructure(pattern);
765  uint16_t stat = subSubStructure >> 2;
766 
767  if LIKELY (stat <= 1) {
768  return ((subSubStructure >> 1) & 1) + 1;
769  }
770 
771  return 0;
772  }
#define LIKELY(x)
Definition: Likely.h:20
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getRPCregion()

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 774 of file HitPattern.h.

References getSubSubStructure(), and topSingleLeptonDQM_PU_cfi::pattern.

Referenced by printHitPattern().

774 { return getSubSubStructure(pattern) & 1; }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723

◆ getSide()

uint32_t reco::HitPattern::getSide ( uint16_t  pattern)
inlinestatic

Definition at line 739 of file HitPattern.h.

References EMPTY_PATTERN, NULL_RETURN, topSingleLeptonDQM_PU_cfi::pattern, SideMask, SideOffset, and UNLIKELY.

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

739  {
741  return NULL_RETURN;
742  }
743 
744  return (pattern >> SideOffset) & SideMask;
745  }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
static const unsigned short SideOffset
Definition: HitPattern.h:450
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
static const unsigned short SideMask
Definition: HitPattern.h:451
#define UNLIKELY(x)
Definition: Likely.h:21

◆ getSubDetector()

uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 731 of file HitPattern.h.

References EMPTY_PATTERN, NULL_RETURN, topSingleLeptonDQM_PU_cfi::pattern, SubDetectorMask, SubDetectorOffset, and UNLIKELY.

731  {
733  return NULL_RETURN;
734  }
735 
736  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
737  }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
static const unsigned short SubDetectorMask
Definition: HitPattern.h:463
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:462
#define UNLIKELY(x)
Definition: Likely.h:21

◆ getSubStructure()

uint32_t reco::HitPattern::getSubStructure ( uint16_t  pattern)
inlinestatic

◆ getSubSubStructure()

uint32_t reco::HitPattern::getSubSubStructure ( uint16_t  pattern)
inlinestatic

Definition at line 723 of file HitPattern.h.

References EMPTY_PATTERN, LayerMask, LayerOffset, NULL_RETURN, topSingleLeptonDQM_PU_cfi::pattern, and UNLIKELY.

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

723  {
725  return NULL_RETURN;
726  }
727 
728  return ((pattern >> LayerOffset) & LayerMask);
729  }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
static const unsigned short LayerOffset
Definition: HitPattern.h:454
#define UNLIKELY(x)
Definition: Likely.h:21
static const unsigned short LayerMask
Definition: HitPattern.h:455

◆ getTrackerLayerCase()

uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 452 of file HitPattern.cc.

References hcaldqm::constants::BAD, validateAlignments::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerMask, LayerOffset, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, NULL_RETURN, topSingleLeptonDQM_PU_cfi::pattern, FastTimerService_cff::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().

452  {
453  uint16_t tk_substr_layer =
454  (0x1 << SubDetectorOffset) + ((substr & SubstrMask) << SubstrOffset) + ((layer & LayerMask) << LayerOffset);
455 
457 
458  // layer case 0: valid + (missing, off, bad) ==> with measurement
459  // layer case 1: missing + (off, bad) ==> without measurement
460  // layer case 2: off, bad ==> totally off or bad, cannot say much
461  // layer case NULL_RETURN: track outside acceptance or in gap ==> null
462  uint32_t layerCase = NULL_RETURN;
463  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
464  for (int i = range.first; i < range.second; ++i) {
466  if ((pattern & mask) == tk_substr_layer) {
467  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
468  if (hitType < layerCase) {
469  // BAD and INACTIVE as the same type (as INACTIVE)
470  layerCase = (hitType == HIT_TYPE::BAD ? (uint32_t)HIT_TYPE::INACTIVE : hitType);
471  if (layerCase == HIT_TYPE::VALID) {
472  break;
473  }
474  }
475  }
476  }
477  return layerCase;
478 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static const unsigned short SubstrOffset
Definition: HitPattern.h:458
static const unsigned short HitTypeMask
Definition: HitPattern.h:447
static const unsigned short SubDetectorMask
Definition: HitPattern.h:463
static const unsigned short HitTypeOffset
Definition: HitPattern.h:446
double const BAD
Definition: Constants.h:15
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:462
static const unsigned short SubstrMask
Definition: HitPattern.h:459
static const unsigned short LayerOffset
Definition: HitPattern.h:454
static const unsigned short LayerMask
Definition: HitPattern.h:455

◆ getTrackerMonoStereo()

uint16_t HitPattern::getTrackerMonoStereo ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 480 of file HitPattern.cc.

References validateAlignments::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), getSide(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerMask, LayerOffset, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, MONO, topSingleLeptonDQM_PU_cfi::pattern, FastTimerService_cff::range, STEREO, SubDetectorMask, SubDetectorOffset, SubstrMask, and SubstrOffset.

Referenced by OniaPhotonConversionProducer::foundCompatibleInnerHits().

480  {
481  uint16_t tk_substr_layer =
482  (0x1 << SubDetectorOffset) + ((substr & SubstrMask) << SubstrOffset) + ((layer & LayerMask) << LayerOffset);
484 
485  // 0: neither a valid mono nor a valid stereo hit
486  // MONO: valid mono hit
487  // STEREO: valid stereo hit
488  // MONO | STEREO: both
489  uint16_t monoStereo = 0x0;
490  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
491  for (int i = range.first; i < range.second; ++i) {
493  if ((pattern & mask) == tk_substr_layer) {
494  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
495  if (hitType == HIT_TYPE::VALID) {
496  switch (getSide(pattern)) {
497  case 0: // mono
498  monoStereo |= MONO;
499  break;
500  case 1: // stereo
501  monoStereo |= STEREO;
502  break;
503  }
504  }
505 
506  if (monoStereo == (MONO | STEREO)) {
507  break;
508  }
509  }
510  }
511  return monoStereo;
512 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static const unsigned short SubstrOffset
Definition: HitPattern.h:458
static const unsigned short HitTypeMask
Definition: HitPattern.h:447
static const unsigned short SubDetectorMask
Definition: HitPattern.h:463
static const unsigned short HitTypeOffset
Definition: HitPattern.h:446
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:462
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:739
static const unsigned short SubstrMask
Definition: HitPattern.h:459
static const unsigned short LayerOffset
Definition: HitPattern.h:454
static const unsigned short LayerMask
Definition: HitPattern.h:455

◆ hasValidHitInPixelLayer()

bool HitPattern::hasValidHitInPixelLayer ( enum PixelSubdetector::SubDetector  det,
uint16_t  layer 
) const

Definition at line 359 of file HitPattern.cc.

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

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

359  {
360  for (int i = beginTrackHits; i < endTrackHits; ++i) {
362  bool pixelHitFilter = ((det == 1 && pixelBarrelHitFilter(pattern)) || (det == 2 && pixelEndcapHitFilter(pattern)));
364  return true;
365  }
366  }
367  return false;
368 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:721
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:590
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:599
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500

◆ inactiveHitFilter()

bool reco::HitPattern::inactiveHitFilter ( uint16_t  pattern)
inlinestatic

◆ innermostMuonStationWithAnyHits()

int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1084 of file HitPattern.h.

References innermostMuonStationWithHits().

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

◆ innermostMuonStationWithBadHits()

int reco::HitPattern::innermostMuonStationWithBadHits ( ) const
inline

Definition at line 1082 of file HitPattern.h.

References innermostMuonStationWithHits().

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

◆ innermostMuonStationWithHits()

int HitPattern::innermostMuonStationWithHits ( int  hitType) const

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

Definition at line 927 of file HitPattern.cc.

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

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

927  {
928  int ret = 0;
929  for (int i = beginTrackHits; i < endTrackHits; ++i) {
931  if (muonHitFilter(pattern) && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
932  int stat = getMuonStation(pattern);
933  if (ret == 0 || stat < ret) {
934  ret = stat;
935  }
936  }
937  }
938 
939  return ret;
940 }
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
ret
prodAgent to be discontinued
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:747
uint8_t beginTrackHits
Definition: HitPattern.h:499
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
uint8_t endTrackHits
Definition: HitPattern.h:500
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:755

◆ innermostMuonStationWithValidHits()

int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 1080 of file HitPattern.h.

References innermostMuonStationWithHits().

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

◆ insertExpectedInnerHit()

bool HitPattern::insertExpectedInnerHit ( const uint16_t  pattern)
private

Definition at line 1021 of file HitPattern.cc.

References beginInner, endInner, hitCount, insertHit(), topSingleLeptonDQM_PU_cfi::pattern, and UNLIKELY.

Referenced by appendHit().

1021  {
1022  if UNLIKELY ((0 == beginInner && 0 == endInner)) {
1023  beginInner = hitCount;
1024  endInner = beginInner;
1025  }
1026 
1027  insertHit(pattern);
1028  endInner++;
1029 
1030  return true;
1031 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:992
uint8_t endInner
Definition: HitPattern.h:502
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t hitCount
Definition: HitPattern.h:497
#define UNLIKELY(x)
Definition: Likely.h:21

◆ insertExpectedOuterHit()

bool HitPattern::insertExpectedOuterHit ( const uint16_t  pattern)
private

Definition at line 1033 of file HitPattern.cc.

References beginOuter, endOuter, hitCount, insertHit(), topSingleLeptonDQM_PU_cfi::pattern, and UNLIKELY.

Referenced by appendHit().

1033  {
1034  if UNLIKELY ((0 == beginOuter && 0 == endOuter)) {
1035  beginOuter = hitCount;
1036  endOuter = beginOuter;
1037  }
1038 
1039  insertHit(pattern);
1040  endOuter++;
1041 
1042  return true;
1043 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:992
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
#define UNLIKELY(x)
Definition: Likely.h:21
uint8_t endOuter
Definition: HitPattern.h:504

◆ insertHit()

void HitPattern::insertHit ( const uint16_t  pattern)
private

Definition at line 992 of file HitPattern.cc.

References triggerObjects_cff::bit, HIT_LENGTH, hitCount, hitPattern, mps_fire::i, hltrates_dqm_sourceclient-live_cfg::offset, and topSingleLeptonDQM_PU_cfi::pattern.

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

992  {
993  int offset = hitCount * HIT_LENGTH;
994  for (int i = 0; i < HIT_LENGTH; i++) {
995  int pos = offset + i;
996  uint16_t bit = (pattern >> i) & 0x1;
997  //equivalent to hitPattern[pos / 16] += bit << ((offset + i) % 16);
998  hitPattern[pos >> 4] += bit << ((offset + i) & (16 - 1));
999  }
1000  hitCount++;
1001 }
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:158
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:496
uint8_t hitCount
Definition: HitPattern.h:497

◆ insertTrackHit()

bool HitPattern::insertTrackHit ( const uint16_t  pattern)
private

Definition at line 1003 of file HitPattern.cc.

References beginTrackHits, endTrackHits, hitCount, insertHit(), topSingleLeptonDQM_PU_cfi::pattern, and UNLIKELY.

Referenced by appendHit().

1003  {
1004  // if begin is 0, this is the first hit of this type being inserted, so
1005  // we need to update begin so it points to the correct index, the first
1006  // empty index.
1007  // unlikely, because it will happen only when inserting
1008  // the first hit of this type
1009  if UNLIKELY ((0 == beginTrackHits && 0 == endTrackHits)) {
1011  // before the first hit of this type is inserted, there are no hits
1013  }
1014 
1015  insertHit(pattern);
1016  endTrackHits++;
1017 
1018  return true;
1019 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:992
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
#define UNLIKELY(x)
Definition: Likely.h:21

◆ int ::test::TestHitPattern::test()

reco::HitPattern::int ::test::TestHitPattern::test ( )
private

◆ isStereo()

uint16_t HitPattern::isStereo ( DetId  i,
const TrackerTopology ttopo 
)
staticprivate

Definition at line 892 of file HitPattern.cc.

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

Referenced by encode().

892  {
893  if (i.det() != DetId::Tracker) {
894  return 0;
895  }
896 
897  switch (i.subdetId()) {
900  return 0;
902  return ttopo.tibIsStereo(i);
904  return ttopo.tidIsStereo(i);
906  return ttopo.tobIsStereo(i);
908  return ttopo.tecIsStereo(i);
909  default:
910  return 0;
911  }
912 }
static constexpr auto TEC
bool tibIsStereo(const DetId &id) const
bool tobIsStereo(const DetId &id) const
static constexpr auto TOB
static constexpr auto TIB
bool tecIsStereo(const DetId &id) const
bool tidIsStereo(const DetId &id) const
static constexpr auto TID

◆ me0StationsWithAnyHits()

int reco::HitPattern::me0StationsWithAnyHits ( ) const
inline

Definition at line 1078 of file HitPattern.h.

References muonStations().

1078 { 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:914

◆ me0StationsWithBadHits()

int reco::HitPattern::me0StationsWithBadHits ( ) const
inline

Definition at line 1076 of file HitPattern.h.

References muonStations().

1076 { 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:914

◆ me0StationsWithValidHits()

int reco::HitPattern::me0StationsWithValidHits ( ) const
inline

Definition at line 1074 of file HitPattern.h.

References muonStations().

1074 { 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:914

◆ missingHitFilter()

bool reco::HitPattern::missingHitFilter ( uint16_t  pattern)
inlinestatic

◆ muonCSCHitFilter()

bool reco::HitPattern::muonCSCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 645 of file HitPattern.h.

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

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

645  {
647  return false;
648  }
649 
650  uint32_t substructure = getSubStructure(pattern);
651  return (substructure == (uint32_t)MuonSubdetId::CSC);
652  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
#define UNLIKELY(x)
Definition: Likely.h:21
static constexpr int CSC
Definition: MuonSubdetId.h:12

◆ muonDTHitFilter()

bool reco::HitPattern::muonDTHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 636 of file HitPattern.h.

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

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

636  {
638  return false;
639  }
640 
641  uint32_t substructure = getSubStructure(pattern);
642  return (substructure == (uint32_t)MuonSubdetId::DT);
643  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
#define UNLIKELY(x)
Definition: Likely.h:21
static constexpr int DT
Definition: MuonSubdetId.h:11

◆ muonGEMHitFilter()

bool reco::HitPattern::muonGEMHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 663 of file HitPattern.h.

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

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

663  {
665  return false;
666  }
667 
668  uint32_t substructure = getSubStructure(pattern);
669  return (substructure == (uint32_t)MuonSubdetId::GEM);
670  }
static constexpr int GEM
Definition: MuonSubdetId.h:14
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
#define UNLIKELY(x)
Definition: Likely.h:21

◆ muonHitFilter()

bool reco::HitPattern::muonHitFilter ( uint16_t  pattern)
inlinestatic

◆ muonME0HitFilter()

bool reco::HitPattern::muonME0HitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 672 of file HitPattern.h.

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

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

672  {
674  return false;
675  uint16_t substructure = getSubStructure(pattern);
676  return (substructure == (uint16_t)MuonSubdetId::ME0);
677  }
static constexpr int ME0
Definition: MuonSubdetId.h:15
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
#define UNLIKELY(x)
Definition: Likely.h:21

◆ muonRPCHitFilter()

bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 654 of file HitPattern.h.

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

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

654  {
656  return false;
657  }
658 
659  uint32_t substructure = getSubStructure(pattern);
660  return (substructure == (uint32_t)MuonSubdetId::RPC);
661  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
static constexpr int RPC
Definition: MuonSubdetId.h:13
#define UNLIKELY(x)
Definition: Likely.h:21

◆ muonStations()

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 914 of file HitPattern.cc.

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

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

914  {
915  int stations[5] = {0, 0, 0, 0, 0};
916  for (int i = beginTrackHits; i < endTrackHits; ++i) {
918  if (muonHitFilter(pattern) && (subdet == 0 || int(getSubStructure(pattern)) == subdet) &&
919  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
920  stations[getMuonStation(pattern)] = 1;
921  }
922  }
923 
924  return stations[0] + stations[1] + stations[2] + stations[3] + stations[4];
925 }
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:747
uint8_t beginTrackHits
Definition: HitPattern.h:499
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
uint8_t endTrackHits
Definition: HitPattern.h:500
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:755

◆ muonStationsWithAnyHits()

int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 1048 of file HitPattern.h.

References muonStations().

1048 { 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:914

◆ muonStationsWithBadHits()

int reco::HitPattern::muonStationsWithBadHits ( ) const
inline

Definition at line 1046 of file HitPattern.h.

References muonStations().

1046 { 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:914

◆ muonStationsWithValidHits()

int reco::HitPattern::muonStationsWithValidHits ( ) const
inline

Definition at line 1044 of file HitPattern.h.

References muonStations().

1044 { 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:914

◆ numberOfAllHits()

int reco::HitPattern::numberOfAllHits ( HitCategory  category) const
inline

◆ numberOfAllTrackerHits()

int reco::HitPattern::numberOfAllTrackerHits ( HitCategory  category) const
inline

Definition at line 809 of file HitPattern.h.

References validateAlignments::category, countHits(), and trackerHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

809  {
811  }
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:546
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679

◆ numberOfBadHits()

int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 965 of file HitPattern.h.

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

965 { return countHits(TRACK_HITS, badHitFilter); }
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:546
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:802

◆ numberOfBadMuonCSCHits()

int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 975 of file HitPattern.h.

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

975  {
977  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:645
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:800

◆ numberOfBadMuonDTHits()

int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 971 of file HitPattern.h.

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

971  {
973  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:800
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:636

◆ numberOfBadMuonGEMHits()

int reco::HitPattern::numberOfBadMuonGEMHits ( ) const
inline

Definition at line 983 of file HitPattern.h.

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

983  {
985  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:800
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:663

◆ numberOfBadMuonHits()

int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 967 of file HitPattern.h.

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

967  {
969  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:800
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683

◆ numberOfBadMuonME0Hits()

int reco::HitPattern::numberOfBadMuonME0Hits ( ) const
inline

Definition at line 987 of file HitPattern.h.

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

987  {
989  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:672
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:800

◆ numberOfBadMuonRPCHits()

int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 979 of file HitPattern.h.

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

979  {
981  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:800
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:654

◆ numberOfDTStationsWithBothViews()

int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 979 of file HitPattern.cc.

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

979  {
980  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
981  for (int i = beginTrackHits; i < endTrackHits; ++i) {
984  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
985  }
986  }
987 
988  return stations[0][0] * stations[0][1] + stations[1][0] * stations[1][1] + stations[2][0] * stations[2][1] +
989  stations[3][0] * stations[3][1];
990 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:759
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:636
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:755

◆ numberOfDTStationsWithRPhiView()

int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 956 of file HitPattern.cc.

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

956  {
957  int stations[4] = {0, 0, 0, 0};
958  for (int i = beginTrackHits; i < endTrackHits; ++i) {
960 
962  stations[getMuonStation(pattern) - 1] = 1;
963  }
964  }
965  return stations[0] + stations[1] + stations[2] + stations[3];
966 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:759
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:636
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:755

◆ numberOfDTStationsWithRZView()

int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 968 of file HitPattern.cc.

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

968  {
969  int stations[4] = {0, 0, 0, 0};
970  for (int i = beginTrackHits; i < endTrackHits; ++i) {
973  stations[getMuonStation(pattern) - 1] = 1;
974  }
975  }
976  return stations[0] + stations[1] + stations[2] + stations[3];
977 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:759
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:636
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:755

◆ numberOfInactiveHits()

int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 991 of file HitPattern.h.

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

int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:546
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:800

◆ numberOfInactiveTimingHits()

int reco::HitPattern::numberOfInactiveTimingHits ( ) const

◆ numberOfInactiveTrackerHits()

int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 993 of file HitPattern.h.

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

993  {
995  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:800
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679

◆ numberOfLostHits()

int reco::HitPattern::numberOfLostHits ( HitCategory  category) const
inline

◆ numberOfLostMuonCSCHits()

int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 949 of file HitPattern.h.

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

949  {
951  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:645

◆ numberOfLostMuonDTHits()

int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 945 of file HitPattern.h.

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

945  {
947  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:636

◆ numberOfLostMuonGEMHits()

int reco::HitPattern::numberOfLostMuonGEMHits ( ) const
inline

Definition at line 957 of file HitPattern.h.

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

957  {
959  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:663

◆ numberOfLostMuonHits()

int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 897 of file HitPattern.h.

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

897  {
899  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683

◆ numberOfLostMuonME0Hits()

int reco::HitPattern::numberOfLostMuonME0Hits ( ) const
inline

Definition at line 961 of file HitPattern.h.

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

961  {
963  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:672
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798

◆ numberOfLostMuonRPCHits()

int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 953 of file HitPattern.h.

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

953  {
955  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:654

◆ numberOfLostPixelBarrelHits()

int reco::HitPattern::numberOfLostPixelBarrelHits ( HitCategory  category) const
inline

Definition at line 917 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and pixelBarrelHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

917  {
919  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:590

◆ numberOfLostPixelEndcapHits()

int reco::HitPattern::numberOfLostPixelEndcapHits ( HitCategory  category) const
inline

Definition at line 921 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and pixelEndcapHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

921  {
923  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:599

◆ numberOfLostPixelHits()

int reco::HitPattern::numberOfLostPixelHits ( HitCategory  category) const
inline

Definition at line 913 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and pixelHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

913  {
915  }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798

◆ numberOfLostStripHits()

int reco::HitPattern::numberOfLostStripHits ( HitCategory  category) const
inline

Definition at line 925 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and stripHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

925  {
927  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:608

◆ numberOfLostStripTECHits()

int reco::HitPattern::numberOfLostStripTECHits ( HitCategory  category) const
inline

Definition at line 941 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and stripTECHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

941  {
943  }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:632
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798

◆ numberOfLostStripTIBHits()

int reco::HitPattern::numberOfLostStripTIBHits ( HitCategory  category) const
inline

Definition at line 929 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and stripTIBHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

929  {
931  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:620

◆ numberOfLostStripTIDHits()

int reco::HitPattern::numberOfLostStripTIDHits ( HitCategory  category) const
inline

Definition at line 933 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and stripTIDHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

933  {
935  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:624

◆ numberOfLostStripTOBHits()

int reco::HitPattern::numberOfLostStripTOBHits ( HitCategory  category) const
inline

Definition at line 937 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and stripTOBHitFilter().

Referenced by StandaloneTrackMonitor::analyze().

937  {
939  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:628

◆ numberOfLostTimingBTLHits()

int reco::HitPattern::numberOfLostTimingBTLHits ( ) const
inline

Definition at line 905 of file HitPattern.h.

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

905  {
907  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool timingBTLHitFilter(uint16_t pattern)
Definition: HitPattern.h:691
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798

◆ numberOfLostTimingETLHits()

int reco::HitPattern::numberOfLostTimingETLHits ( ) const
inline

Definition at line 909 of file HitPattern.h.

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

909  {
911  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool timingETLHitFilter(uint16_t pattern)
Definition: HitPattern.h:698

◆ numberOfLostTimingHits()

int reco::HitPattern::numberOfLostTimingHits ( ) const
inline

Definition at line 901 of file HitPattern.h.

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

901  {
903  }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:705
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798

◆ numberOfLostTrackerHits()

int reco::HitPattern::numberOfLostTrackerHits ( HitCategory  category) const
inline

Definition at line 893 of file HitPattern.h.

References validateAlignments::category, countTypedHits(), missingHitFilter(), and trackerHitFilter().

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

893  {
895  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679

◆ numberOfMuonHits()

int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 813 of file HitPattern.h.

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

813 { return countHits(TRACK_HITS, muonHitFilter); }
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:546
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683

◆ numberOfTimingHits()

int reco::HitPattern::numberOfTimingHits ( ) const
inline

Definition at line 815 of file HitPattern.h.

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

int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:546
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:705

◆ numberOfValidHits()

int reco::HitPattern::numberOfValidHits ( ) const
inline

◆ numberOfValidMuonCSCHits()

int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 867 of file HitPattern.h.

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

Referenced by MuonRecoAnalyzer::analyze().

867  {
869  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:645

◆ numberOfValidMuonDTHits()

int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 863 of file HitPattern.h.

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

Referenced by MuonRecoAnalyzer::analyze().

863  {
865  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:636

◆ numberOfValidMuonGEMHits()

int reco::HitPattern::numberOfValidMuonGEMHits ( ) const
inline

Definition at line 875 of file HitPattern.h.

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

Referenced by MuonRecoAnalyzer::analyze().

875  {
877  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:663

◆ numberOfValidMuonHits()

int reco::HitPattern::numberOfValidMuonHits ( ) const
inline

Definition at line 823 of file HitPattern.h.

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

Referenced by MuonRecoAnalyzer::analyze(), HLTMuonL3PreFilter::applySelection(), HLTMuonL3andL2PreFilter::applySelection(), and HLTMuonL3SimplePreFilter::hltFilter().

823  {
825  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683

◆ numberOfValidMuonME0Hits()

int reco::HitPattern::numberOfValidMuonME0Hits ( ) const
inline

Definition at line 879 of file HitPattern.h.

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

879  {
881  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:672
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796

◆ numberOfValidMuonRPCHits()

int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 871 of file HitPattern.h.

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

Referenced by MuonRecoAnalyzer::analyze().

871  {
873  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:654

◆ numberOfValidPixelBarrelHits()

int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline

Definition at line 835 of file HitPattern.h.

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

Referenced by StandaloneTrackMonitor::analyze(), and ShortenedTrackValidation::trackComparator::fill().

835  {
837  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:590
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796

◆ numberOfValidPixelEndcapHits()

int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline

Definition at line 839 of file HitPattern.h.

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

Referenced by StandaloneTrackMonitor::analyze(), and ShortenedTrackValidation::trackComparator::fill().

839  {
841  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:599
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796

◆ numberOfValidPixelHits()

int reco::HitPattern::numberOfValidPixelHits ( ) const
inline

◆ numberOfValidStripHits()

int reco::HitPattern::numberOfValidStripHits ( ) const
inline

◆ numberOfValidStripLayersWithMonoAndStereo() [1/2]

int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

Definition at line 370 of file HitPattern.cc.

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

Referenced by MultiTrackSelector::processMVA(), CosmicTrackSelector::select(), MultiTrackSelector::select(), and QcdUeDQM::trackSelection().

370  {
371  bool hasMono[SubstrMask + 1][LayerMask + 1];
372  bool hasStereo[SubstrMask + 1][LayerMask + 1];
373  memset(hasMono, 0, sizeof(hasMono));
374  memset(hasStereo, 0, sizeof(hasStereo));
375 
376  // mark which layers have mono/stereo hits
377  for (int i = beginTrackHits; i < endTrackHits; ++i) {
379  uint16_t subStructure = getSubStructure(pattern);
380 
382  if (stripdet != 0 && subStructure != stripdet) {
383  continue;
384  }
385 
386  if (layer != 0 && getSubSubStructure(pattern) != layer) {
387  continue;
388  }
389 
390  switch (getSide(pattern)) {
391  case 0: // mono
392  hasMono[subStructure][getLayer(pattern)] = true;
393  break;
394  case 1: // stereo
395  hasStereo[subStructure][getLayer(pattern)] = true;
396  break;
397  default:;
398  break;
399  }
400  }
401  }
402 
403  // count how many layers have mono and stereo hits
404  int count = 0;
405  for (int i = 0; i < SubstrMask + 1; ++i) {
406  for (int j = 0; j < LayerMask + 1; ++j) {
407  if (hasMono[i][j] && hasStereo[i][j]) {
408  count++;
409  }
410  }
411  }
412  return count;
413 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:721
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:608
uint8_t beginTrackHits
Definition: HitPattern.h:499
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
uint8_t endTrackHits
Definition: HitPattern.h:500
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:739
static const unsigned short SubstrMask
Definition: HitPattern.h:459
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:723
static const unsigned short LayerMask
Definition: HitPattern.h:455

◆ numberOfValidStripLayersWithMonoAndStereo() [2/2]

int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( ) const

Definition at line 415 of file HitPattern.cc.

References validateAlignments::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), getSide(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, maxTrackerWord, minStripWord, minTrackerWord, topSingleLeptonDQM_PU_cfi::pattern, FastTimerService_cff::range, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side(), and TRACK_HITS.

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

415  {
416  auto category = TRACK_HITS;
417  std::bitset<128> side[2];
418  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
419  for (int i = range.first; i < range.second; ++i) {
421  if (pattern > maxTrackerWord)
422  continue;
423  if (pattern < minStripWord)
424  continue;
425  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
426  if (hitType != HIT_TYPE::VALID)
427  continue;
428  auto apattern = (pattern - minTrackerWord) >> LayerOffset;
429  // assert(apattern<128);
430  side[getSide(pattern)].set(apattern);
431  }
432  // assert(numberOfValidStripLayersWithMonoAndStereo(0, 0)==int((side[0]&side[1]).count()));
433  return (side[0] & side[1]).count();
434 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static const unsigned short maxTrackerWord
Definition: HitPattern.h:466
static const unsigned short HitTypeMask
Definition: HitPattern.h:447
static const unsigned short minTrackerWord
Definition: HitPattern.h:465
static const unsigned short HitTypeOffset
Definition: HitPattern.h:446
static const unsigned short minStripWord
Definition: HitPattern.h:468
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:739
static const unsigned short LayerOffset
Definition: HitPattern.h:454

◆ numberOfValidStripTECHits()

int reco::HitPattern::numberOfValidStripTECHits ( ) const
inline

Definition at line 859 of file HitPattern.h.

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

Referenced by StandaloneTrackMonitor::analyze(), and ShortenedTrackValidation::trackComparator::fill().

859  {
861  }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:632
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796

◆ numberOfValidStripTIBHits()

int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline

Definition at line 847 of file HitPattern.h.

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

Referenced by StandaloneTrackMonitor::analyze(), and ShortenedTrackValidation::trackComparator::fill().

847  {
849  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:620

◆ numberOfValidStripTIDHits()

int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 851 of file HitPattern.h.

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

Referenced by StandaloneTrackMonitor::analyze(), and ShortenedTrackValidation::trackComparator::fill().

851  {
853  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:624

◆ numberOfValidStripTOBHits()

int reco::HitPattern::numberOfValidStripTOBHits ( ) const
inline

Definition at line 855 of file HitPattern.h.

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

Referenced by StandaloneTrackMonitor::analyze(), and ShortenedTrackValidation::trackComparator::fill().

855  {
857  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:628

◆ numberOfValidTECLayersWithMonoAndStereo()

int HitPattern::numberOfValidTECLayersWithMonoAndStereo ( uint32_t  layer = 0) const

◆ numberOfValidTIBLayersWithMonoAndStereo()

int HitPattern::numberOfValidTIBLayersWithMonoAndStereo ( uint32_t  layer = 0) const

◆ numberOfValidTIDLayersWithMonoAndStereo()

int HitPattern::numberOfValidTIDLayersWithMonoAndStereo ( uint32_t  layer = 0) const

◆ numberOfValidTimingBTLHits()

int reco::HitPattern::numberOfValidTimingBTLHits ( ) const
inline

Definition at line 883 of file HitPattern.h.

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

883  {
885  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool timingBTLHitFilter(uint16_t pattern)
Definition: HitPattern.h:691
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796

◆ numberOfValidTimingETLHits()

int reco::HitPattern::numberOfValidTimingETLHits ( ) const
inline

Definition at line 887 of file HitPattern.h.

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

887  {
889  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool timingETLHitFilter(uint16_t pattern)
Definition: HitPattern.h:698

◆ numberOfValidTimingHits()

int reco::HitPattern::numberOfValidTimingHits ( ) const
inline

Definition at line 827 of file HitPattern.h.

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

827  {
829  }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:705
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796

◆ numberOfValidTOBLayersWithMonoAndStereo()

int HitPattern::numberOfValidTOBLayersWithMonoAndStereo ( uint32_t  layer = 0) const

◆ numberOfValidTrackerHits()

int reco::HitPattern::numberOfValidTrackerHits ( ) const
inline

Definition at line 819 of file HitPattern.h.

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

Referenced by MuonRecoAnalyzer::analyze(), StandaloneTrackMonitor::analyze(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), reco::tau::RecoTauPiZeroStripPlugin3::operator()(), and reco::TrackBase::validFraction().

819  {
821  }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:569
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679

◆ operator=()

HitPattern & HitPattern::operator= ( const HitPattern other)

Definition at line 50 of file HitPattern.cc.

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

50  {
51  if (this == &other) {
52  return *this;
53  }
54 
55  this->hitCount = other.hitCount;
56 
57  this->beginTrackHits = other.beginTrackHits;
58  this->endTrackHits = other.endTrackHits;
59 
60  this->beginInner = other.beginInner;
61  this->endInner = other.endInner;
62 
63  this->beginOuter = other.beginOuter;
64  this->endOuter = other.endOuter;
65 
66  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
67 
68  return *this;
69 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:157
uint8_t endInner
Definition: HitPattern.h:502
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
uint8_t endOuter
Definition: HitPattern.h:504

◆ outermostMuonStationWithAnyHits()

int reco::HitPattern::outermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1090 of file HitPattern.h.

References outermostMuonStationWithHits().

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

◆ outermostMuonStationWithBadHits()

int reco::HitPattern::outermostMuonStationWithBadHits ( ) const
inline

Definition at line 1088 of file HitPattern.h.

References outermostMuonStationWithHits().

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

◆ outermostMuonStationWithHits()

int HitPattern::outermostMuonStationWithHits ( int  hitType) const

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

Definition at line 942 of file HitPattern.cc.

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

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

942  {
943  int ret = 0;
944  for (int i = beginTrackHits; i < endTrackHits; ++i) {
946  if (muonHitFilter(pattern) && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
947  int stat = getMuonStation(pattern);
948  if (ret == 0 || stat > ret) {
949  ret = stat;
950  }
951  }
952  }
953  return ret;
954 }
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
ret
prodAgent to be discontinued
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:747
uint8_t beginTrackHits
Definition: HitPattern.h:499
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
uint8_t endTrackHits
Definition: HitPattern.h:500
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:755

◆ outermostMuonStationWithValidHits()

int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 1086 of file HitPattern.h.

References outermostMuonStationWithHits().

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

◆ pixelBarrelHitFilter()

bool reco::HitPattern::pixelBarrelHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 590 of file HitPattern.h.

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

Referenced by StandaloneTrackMonitor::analyze(), hasValidHitInPixelLayer(), numberOfLostPixelBarrelHits(), and numberOfValidPixelBarrelHits().

590  {
592  return false;
593  }
594 
595  uint32_t substructure = getSubStructure(pattern);
596  return (substructure == PixelSubdetector::PixelBarrel);
597  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679
#define UNLIKELY(x)
Definition: Likely.h:21

◆ pixelBarrelLayersNull()

int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 763 of file HitPattern.cc.

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

Referenced by pixelLayersNull().

763  {
764  int count = 0;
765  uint16_t NPixBarrel = 4;
766  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
768  count++;
769  }
770  }
771  return count;
772 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ pixelBarrelLayersTotallyOffOrBad()

int HitPattern::pixelBarrelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 701 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

701  {
702  int count = 0;
703  uint16_t NPixBarrel = 4;
704  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
705  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::INACTIVE) {
706  count++;
707  }
708  }
709  return count;
710 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ pixelBarrelLayersWithMeasurement()

int HitPattern::pixelBarrelLayersWithMeasurement ( ) const

Definition at line 577 of file HitPattern.cc.

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

Referenced by StandaloneTrackMonitor::analyze(), pixelLayersWithMeasurementOld(), and BeamFitter::readEvent().

577  {
578  int count = 0;
579  uint16_t NPixBarrel = 4;
580  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
582  count++;
583  }
584  }
585  return count;
586 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ pixelBarrelLayersWithoutMeasurement()

int HitPattern::pixelBarrelLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 639 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

639  {
640  int count = 0;
641  uint16_t NPixBarrel = 4;
642  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
643  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::MISSING) {
644  count++;
645  }
646  }
647  return count;
648 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ pixelEndcapHitFilter()

bool reco::HitPattern::pixelEndcapHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 599 of file HitPattern.h.

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

Referenced by StandaloneTrackMonitor::analyze(), hasValidHitInPixelLayer(), numberOfLostPixelEndcapHits(), and numberOfValidPixelEndcapHits().

599  {
601  return false;
602  }
603 
604  uint32_t substructure = getSubStructure(pattern);
605  return (substructure == PixelSubdetector::PixelEndcap);
606  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679
#define UNLIKELY(x)
Definition: Likely.h:21

◆ pixelEndcapLayersNull()

int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 774 of file HitPattern.cc.

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

Referenced by pixelLayersNull().

774  {
775  int count = 0;
776  uint16_t NPixForward = 3;
777  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
779  count++;
780  }
781  }
782  return count;
783 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ pixelEndcapLayersTotallyOffOrBad()

int HitPattern::pixelEndcapLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 712 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

712  {
713  int count = 0;
714  uint16_t NPixForward = 3;
715  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
716  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::INACTIVE) {
717  count++;
718  }
719  }
720  return count;
721 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ pixelEndcapLayersWithMeasurement()

int HitPattern::pixelEndcapLayersWithMeasurement ( ) const

Definition at line 588 of file HitPattern.cc.

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

Referenced by StandaloneTrackMonitor::analyze(), pixelLayersWithMeasurementOld(), and BeamFitter::readEvent().

588  {
589  int count = 0;
590  uint16_t NPixForward = 3;
591  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
593  count++;
594  }
595  }
596  return count;
597 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ pixelEndcapLayersWithoutMeasurement()

int HitPattern::pixelEndcapLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 650 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

650  {
651  int count = 0;
652  uint16_t NPixForward = 3;
653  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
654  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::MISSING) {
655  count++;
656  }
657  }
658  return count;
659 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ pixelHitFilter()

bool reco::HitPattern::pixelHitFilter ( uint16_t  pattern)
inlinestatic

◆ pixelLayersNull()

int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 1038 of file HitPattern.h.

References pixelBarrelLayersNull(), and pixelEndcapLayersNull().

Referenced by trackerLayersNull().

int pixelEndcapLayersNull() const
Definition: HitPattern.cc:774
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:763

◆ pixelLayersTotallyOffOrBad()

int reco::HitPattern::pixelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1027 of file HitPattern.h.

References validateAlignments::category, pixelBarrelLayersTotallyOffOrBad(), and pixelEndcapLayersTotallyOffOrBad().

Referenced by trackerLayersTotallyOffOrBad().

1027  {
1029  }
int pixelEndcapLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:712
int pixelBarrelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:701

◆ pixelLayersWithMeasurement()

int HitPattern::pixelLayersWithMeasurement ( ) const

Definition at line 514 of file HitPattern.cc.

References validateAlignments::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minStripWord, minTrackerWord, topSingleLeptonDQM_PU_cfi::pattern, FastTimerService_cff::range, TRACK_HITS, trackerHitFilter(), and UNLIKELY.

Referenced by StandaloneTrackMonitor::analyze(), PackedCandidateTrackValidator::analyze(), TrackFilterForPVFinding::operator()(), MultiTrackSelector::processMVA(), BeamFitter::readEvent(), CosmicTrackSelector::select(), MultiTrackSelector::select(), pat::PackedCandidate::setHits(), trackerLayersWithMeasurementOld(), and QcdUeDQM::trackSelection().

514  {
515  auto category = TRACK_HITS;
516  std::bitset<128> layerOk;
517  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
518  for (int i = range.first; i < range.second; ++i) {
521  continue;
522  if (pattern > minStripWord)
523  continue;
524  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
525  if (hitType != HIT_TYPE::VALID)
526  continue;
528  // assert(pattern<128);
529  layerOk.set(pattern);
530  }
531  // assert(pixelLayersWithMeasurementOld()==int(layerOk.count()));
532  return layerOk.count();
533 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static const unsigned short HitTypeMask
Definition: HitPattern.h:447
static const unsigned short minTrackerWord
Definition: HitPattern.h:465
static const unsigned short HitTypeOffset
Definition: HitPattern.h:446
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679
static const unsigned short minStripWord
Definition: HitPattern.h:468
static const unsigned short LayerOffset
Definition: HitPattern.h:454
#define UNLIKELY(x)
Definition: Likely.h:21

◆ pixelLayersWithMeasurementOld()

int reco::HitPattern::pixelLayersWithMeasurementOld ( ) const
inline

Definition at line 1001 of file HitPattern.h.

References pixelBarrelLayersWithMeasurement(), and pixelEndcapLayersWithMeasurement().

1001  {
1003  }
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:588
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:577

◆ pixelLayersWithoutMeasurement()

int reco::HitPattern::pixelLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1014 of file HitPattern.h.

References validateAlignments::category, pixelBarrelLayersWithoutMeasurement(), and pixelEndcapLayersWithoutMeasurement().

Referenced by trackerLayersWithoutMeasurementOld().

1014  {
1016  }
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:650
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:639

◆ print()

void HitPattern::print ( HitCategory  category,
std::ostream &  stream = std::cout 
) const

Definition at line 876 of file HitPattern.cc.

References validateAlignments::category, HLT_2024v14_cff::flags, getHitPattern(), mps_fire::i, numberOfAllHits(), printHitPattern(), and cms::cuda::stream.

876  {
877  stream << "HitPattern" << std::endl;
878  for (int i = 0; i < numberOfAllHits(category); ++i) {
880  }
881  std::ios_base::fmtflags flags = stream.flags();
882  stream.setf(std::ios_base::hex, std::ios_base::basefield);
883  stream.setf(std::ios_base::showbase);
884 
885  for (int i = 0; i < this->numberOfAllHits(category); ++i) {
886  stream << getHitPattern(category, i) << std::endl;
887  }
888 
889  stream.flags(flags);
890 }
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:804
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:537
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:825

◆ printHitPattern()

void HitPattern::printHitPattern ( HitCategory  category,
int  position,
std::ostream &  stream 
) const

Definition at line 825 of file HitPattern.cc.

References validateAlignments::category, ETLDetId::decodeSector(), TtSemiLepEvtBuilder_cfi::disc, getCSCRing(), getDTSuperLayer(), getGEMLayer(), getGEMStation(), getHitPattern(), getHitType(), getLayer(), getMuonStation(), getRPCLayer(), getRPCregion(), getSubStructure(), muonCSCHitFilter(), muonDTHitFilter(), muonGEMHitFilter(), muonHitFilter(), muonME0HitFilter(), muonRPCHitFilter(), topSingleLeptonDQM_PU_cfi::pattern, position, findQualityFiles::rr, nano_mu_digi_cff::sector, cms::cuda::stream, timingHitFilter(), and trackerHitFilter().

Referenced by spr::goodTrack(), and print().

825  {
826  uint16_t pattern = getHitPattern(category, position);
827  stream << "\t";
828  if (muonHitFilter(pattern)) {
829  stream << "muon";
830  } else if (trackerHitFilter(pattern)) {
831  stream << "tracker";
832  } else if (timingHitFilter(pattern)) {
833  stream << "timing";
834  }
835 
836  stream << "\tsubstructure " << getSubStructure(pattern);
837  if (muonHitFilter(pattern)) {
838  stream << "\tstation " << getMuonStation(pattern);
839  if (muonDTHitFilter(pattern)) {
840  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
841  } else if (muonCSCHitFilter(pattern)) {
842  stream << "\tcsc ring " << getCSCRing(pattern);
843  } else if (muonRPCHitFilter(pattern)) {
844  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel") << ", layer " << getRPCLayer(pattern);
845  } else if (muonGEMHitFilter(pattern)) {
846  stream << "\tgem "
847  << " station " << getGEMStation(pattern) << ", layer" << getGEMLayer(pattern);
848  } else if (muonME0HitFilter(pattern)) {
849  stream << "\tme0 ";
850  } else {
851  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure " << getSubStructure(pattern);
852  }
853  } else if (timingHitFilter(pattern)) {
854  uint32_t rr = getLayer(pattern);
855  switch (getSubStructure(pattern)) {
856  case 1:
857  stream << "\tRU " << getLayer(pattern);
858  break;
859  case 2: {
860  uint32_t disc(99), discside(99), sector(99);
861  ETLDetId::decodeSector(rr, disc, discside, sector);
862  stream << "\tdisc/disc side/sector " << disc << " " << discside << " " << sector;
863  break;
864  }
865  default:
866  stream << "\tlayer " << rr;
867  break;
868  }
869  } else {
870  stream << "\tlayer " << getLayer(pattern);
871  }
872  stream << "\thit type " << getHitType(pattern);
873  stream << std::endl;
874 }
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:761
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:721
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:705
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:759
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:672
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:789
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:645
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:747
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:537
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:774
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:663
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:777
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:636
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:763
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:755
static void decodeSector(const uint32_t rr, uint32_t &nDisc, uint32_t &discSide, uint32_t &sector)
Definition: ETLDetId.h:109
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:654

◆ rpcStationsWithAnyHits()

int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 1066 of file HitPattern.h.

References muonStations().

1066 { 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:914

◆ rpcStationsWithBadHits()

int reco::HitPattern::rpcStationsWithBadHits ( ) const
inline

Definition at line 1064 of file HitPattern.h.

References muonStations().

1064 { 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:914

◆ rpcStationsWithValidHits()

int reco::HitPattern::rpcStationsWithValidHits ( ) const
inline

Definition at line 1062 of file HitPattern.h.

References muonStations().

1062 { 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:914

◆ run3ScoutingHitPatternPOD()

Run3ScoutingHitPatternPOD HitPattern::run3ScoutingHitPatternPOD ( ) const

Definition at line 1045 of file HitPattern.cc.

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

1045  {
1047  .hitCount = hitCount,
1048  .beginTrackHits = beginTrackHits,
1049  .endTrackHits = endTrackHits,
1050  .beginInner = beginInner,
1051  .endInner = endInner,
1052  .beginOuter = beginOuter,
1053  .endOuter = endOuter,
1054  .hitPattern = std::vector<uint16_t>(hitPattern, hitPattern + HitPattern::ARRAY_LENGTH)};
1055  return result;
1056 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:157
uint8_t endInner
Definition: HitPattern.h:502
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:496
uint8_t beginInner
Definition: HitPattern.h:501
uint8_t beginTrackHits
Definition: HitPattern.h:499
uint8_t endTrackHits
Definition: HitPattern.h:500
uint8_t hitCount
Definition: HitPattern.h:497
uint8_t beginOuter
Definition: HitPattern.h:503
uint8_t endOuter
Definition: HitPattern.h:504

◆ stripHitFilter()

bool reco::HitPattern::stripHitFilter ( uint16_t  pattern)
inlinestatic

◆ stripLayersNull()

int reco::HitPattern::stripLayersNull ( ) const
inline

Definition at line 1040 of file HitPattern.h.

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

Referenced by trackerLayersNull().

1040  {
1042  }
int stripTIBLayersNull() const
Definition: HitPattern.cc:785
int stripTOBLayersNull() const
Definition: HitPattern.cc:805
int stripTECLayersNull() const
Definition: HitPattern.cc:815
int stripTIDLayersNull() const
Definition: HitPattern.cc:795

◆ stripLayersTotallyOffOrBad()

int reco::HitPattern::stripLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1031 of file HitPattern.h.

References validateAlignments::category, stripTECLayersTotallyOffOrBad(), stripTIBLayersTotallyOffOrBad(), stripTIDLayersTotallyOffOrBad(), and stripTOBLayersTotallyOffOrBad().

Referenced by trackerLayersTotallyOffOrBad().

1031  {
1034  }
int stripTECLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:753
int stripTOBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:743
int stripTIBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:723
int stripTIDLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:733

◆ stripLayersWithMeasurement()

int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline

◆ stripLayersWithoutMeasurement()

int reco::HitPattern::stripLayersWithoutMeasurement ( HitCategory  category) const
inline

◆ stripSubdetectorHitFilter()

bool reco::HitPattern::stripSubdetectorHitFilter ( uint16_t  pattern,
StripSubdetector::SubDetector  substructure 
)
inlinestaticprivate

Definition at line 612 of file HitPattern.h.

References getSubStructure(), topSingleLeptonDQM_PU_cfi::pattern, trackerHitFilter(), and UNLIKELY.

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

612  {
614  return false;
615  }
616 
617  return substructure == getSubStructure(pattern);
618  }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679
#define UNLIKELY(x)
Definition: Likely.h:21

◆ stripTECHitFilter()

bool reco::HitPattern::stripTECHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 632 of file HitPattern.h.

References topSingleLeptonDQM_PU_cfi::pattern, stripSubdetectorHitFilter(), and StripSubdetector::TEC.

Referenced by StandaloneTrackMonitor::analyze(), numberOfLostStripTECHits(), and numberOfValidStripTECHits().

632  {
634  }
static constexpr auto TEC
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:612

◆ stripTECLayersNull()

int HitPattern::stripTECLayersNull ( ) const

Definition at line 815 of file HitPattern.cc.

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

Referenced by stripLayersNull().

815  {
816  int count = 0;
817  for (uint16_t layer = 1; layer <= 9; layer++) {
819  count++;
820  }
821  }
822  return count;
823 }
static constexpr auto TEC
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTECLayersTotallyOffOrBad()

int HitPattern::stripTECLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 753 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

753  {
754  int count = 0;
755  for (uint16_t layer = 1; layer <= 9; layer++) {
756  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::INACTIVE) {
757  count++;
758  }
759  }
760  return count;
761 }
static constexpr auto TEC
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTECLayersWithMeasurement()

int HitPattern::stripTECLayersWithMeasurement ( ) const

Definition at line 629 of file HitPattern.cc.

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

Referenced by StandaloneTrackMonitor::analyze(), IsolatedTracksNxN::analyze(), HcalHBHEMuonHighEtaAnalyzer::fillTrackParameters(), spr::goodTrack(), BeamFitter::readEvent(), and stripLayersWithMeasurement().

629  {
630  int count = 0;
631  for (uint16_t layer = 1; layer <= 9; layer++) {
632  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::VALID) {
633  count++;
634  }
635  }
636  return count;
637 }
static constexpr auto TEC
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTECLayersWithoutMeasurement()

int HitPattern::stripTECLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 691 of file HitPattern.cc.

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

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

691  {
692  int count = 0;
693  for (uint16_t layer = 1; layer <= 9; layer++) {
694  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::MISSING) {
695  count++;
696  }
697  }
698  return count;
699 }
static constexpr auto TEC
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTIBHitFilter()

bool reco::HitPattern::stripTIBHitFilter ( uint16_t  pattern)
inlinestatic

◆ stripTIBLayersNull()

int HitPattern::stripTIBLayersNull ( ) const

Definition at line 785 of file HitPattern.cc.

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

Referenced by stripLayersNull().

785  {
786  int count = 0;
787  for (uint16_t layer = 1; layer <= 4; layer++) {
789  count++;
790  }
791  }
792  return count;
793 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
static constexpr auto TIB
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTIBLayersTotallyOffOrBad()

int HitPattern::stripTIBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 723 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

723  {
724  int count = 0;
725  for (uint16_t layer = 1; layer <= 4; layer++) {
726  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::INACTIVE) {
727  count++;
728  }
729  }
730  return count;
731 }
static constexpr auto TIB
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTIBLayersWithMeasurement()

int HitPattern::stripTIBLayersWithMeasurement ( ) const

Definition at line 599 of file HitPattern.cc.

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

Referenced by StandaloneTrackMonitor::analyze(), IsolatedTracksNxN::analyze(), BeamFitter::readEvent(), and stripLayersWithMeasurement().

599  {
600  int count = 0;
601  for (uint16_t layer = 1; layer <= 4; layer++) {
602  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::VALID) {
603  count++;
604  }
605  }
606  return count;
607 }
static constexpr auto TIB
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTIBLayersWithoutMeasurement()

int HitPattern::stripTIBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 661 of file HitPattern.cc.

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

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

661  {
662  int count = 0;
663  for (uint16_t layer = 1; layer <= 4; layer++) {
664  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::MISSING) {
665  count++;
666  }
667  }
668  return count;
669 }
static constexpr auto TIB
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTIDHitFilter()

bool reco::HitPattern::stripTIDHitFilter ( uint16_t  pattern)
inlinestatic

◆ stripTIDLayersNull()

int HitPattern::stripTIDLayersNull ( ) const

Definition at line 795 of file HitPattern.cc.

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

Referenced by stripLayersNull().

795  {
796  int count = 0;
797  for (uint16_t layer = 1; layer <= 3; layer++) {
799  count++;
800  }
801  }
802  return count;
803 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
static constexpr auto TID
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTIDLayersTotallyOffOrBad()

int HitPattern::stripTIDLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 733 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

733  {
734  int count = 0;
735  for (uint16_t layer = 1; layer <= 3; layer++) {
736  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::INACTIVE) {
737  count++;
738  }
739  }
740  return count;
741 }
static constexpr auto TID
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTIDLayersWithMeasurement()

int HitPattern::stripTIDLayersWithMeasurement ( ) const

Definition at line 609 of file HitPattern.cc.

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

Referenced by StandaloneTrackMonitor::analyze(), IsolatedTracksNxN::analyze(), BeamFitter::readEvent(), and stripLayersWithMeasurement().

609  {
610  int count = 0;
611  for (uint16_t layer = 1; layer <= 3; layer++) {
612  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::VALID) {
613  count++;
614  }
615  }
616  return count;
617 }
static constexpr auto TID
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTIDLayersWithoutMeasurement()

int HitPattern::stripTIDLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 671 of file HitPattern.cc.

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

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

671  {
672  int count = 0;
673  for (uint16_t layer = 1; layer <= 3; layer++) {
674  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::MISSING) {
675  count++;
676  }
677  }
678  return count;
679 }
static constexpr auto TID
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTOBHitFilter()

bool reco::HitPattern::stripTOBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 628 of file HitPattern.h.

References topSingleLeptonDQM_PU_cfi::pattern, stripSubdetectorHitFilter(), and StripSubdetector::TOB.

Referenced by StandaloneTrackMonitor::analyze(), numberOfLostStripTOBHits(), and numberOfValidStripTOBHits().

628  {
630  }
static constexpr auto TOB
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:612

◆ stripTOBLayersNull()

int HitPattern::stripTOBLayersNull ( ) const

Definition at line 805 of file HitPattern.cc.

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

Referenced by stripLayersNull().

805  {
806  int count = 0;
807  for (uint16_t layer = 1; layer <= 6; layer++) {
809  count++;
810  }
811  }
812  return count;
813 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:161
static constexpr auto TOB
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTOBLayersTotallyOffOrBad()

int HitPattern::stripTOBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 743 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

743  {
744  int count = 0;
745  for (uint16_t layer = 1; layer <= 6; layer++) {
746  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::INACTIVE) {
747  count++;
748  }
749  }
750  return count;
751 }
static constexpr auto TOB
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTOBLayersWithMeasurement()

int HitPattern::stripTOBLayersWithMeasurement ( ) const

Definition at line 619 of file HitPattern.cc.

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

Referenced by StandaloneTrackMonitor::analyze(), IsolatedTracksNxN::analyze(), HcalHBHEMuonHighEtaAnalyzer::fillTrackParameters(), spr::goodTrack(), BeamFitter::readEvent(), and stripLayersWithMeasurement().

619  {
620  int count = 0;
621  for (uint16_t layer = 1; layer <= 6; layer++) {
622  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::VALID) {
623  count++;
624  }
625  }
626  return count;
627 }
static constexpr auto TOB
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ stripTOBLayersWithoutMeasurement()

int HitPattern::stripTOBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 681 of file HitPattern.cc.

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

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

681  {
682  int count = 0;
683  for (uint16_t layer = 1; layer <= 6; layer++) {
684  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::MISSING) {
685  count++;
686  }
687  }
688  return count;
689 }
static constexpr auto TOB
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:452

◆ timingBTLHitFilter()

bool reco::HitPattern::timingBTLHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 691 of file HitPattern.h.

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

Referenced by numberOfLostTimingBTLHits(), and numberOfValidTimingBTLHits().

691  {
693  return false;
694  uint16_t substructure = getSubStructure(pattern);
695  return (substructure == (uint16_t)MTDDetId::BTL);
696  }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:705
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
#define UNLIKELY(x)
Definition: Likely.h:21

◆ timingETLHitFilter()

bool reco::HitPattern::timingETLHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 698 of file HitPattern.h.

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

Referenced by numberOfLostTimingETLHits(), and numberOfValidTimingETLHits().

698  {
700  return false;
701  uint16_t substructure = getSubStructure(pattern);
702  return (substructure == (uint16_t)MTDDetId::ETL);
703  }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:705
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
#define UNLIKELY(x)
Definition: Likely.h:21

◆ timingHitFilter()

bool reco::HitPattern::timingHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 705 of file HitPattern.h.

References EMPTY_PATTERN, topSingleLeptonDQM_PU_cfi::pattern, SubDetectorMask, SubDetectorOffset, and UNLIKELY.

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

705  {
707  return false;
708  }
709 
710  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 2);
711  }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:162
static const unsigned short SubDetectorMask
Definition: HitPattern.h:463
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:462
#define UNLIKELY(x)
Definition: Likely.h:21

◆ trackerHitFilter()

bool reco::HitPattern::trackerHitFilter ( uint16_t  pattern)
inlinestatic

◆ trackerLayersNull()

int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 1036 of file HitPattern.h.

References pixelLayersNull(), and stripLayersNull().

1036 { return pixelLayersNull() + stripLayersNull(); }
int stripLayersNull() const
Definition: HitPattern.h:1040
int pixelLayersNull() const
Definition: HitPattern.h:1038

◆ trackerLayersTotallyOffOrBad()

int reco::HitPattern::trackerLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1023 of file HitPattern.h.

References validateAlignments::category, pixelLayersTotallyOffOrBad(), and stripLayersTotallyOffOrBad().

1023  {
1025  }
int stripLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1031
int pixelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1027

◆ trackerLayersWithMeasurement()

int HitPattern::trackerLayersWithMeasurement ( ) const

Definition at line 535 of file HitPattern.cc.

References validateAlignments::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minTrackerWord, topSingleLeptonDQM_PU_cfi::pattern, FastTimerService_cff::range, TRACK_HITS, trackerHitFilter(), and UNLIKELY.

Referenced by MuonRecoAnalyzer::analyze(), StandaloneTrackMonitor::analyze(), IsolatedTracksCone::analyze(), IsolatedTracksNxN::analyze(), PackedCandidateTrackValidator::analyze(), spr::coneChargeIsolation(), HcalHBHEMuonHighEtaAnalyzer::fillTrackParameters(), spr::goodTrack(), TrackFilterForPVFinding::operator()(), MultiTrackSelector::processMVA(), SingleLongTrackProducer::produce(), EvtPlaneProducer::produce(), BeamFitter::readEvent(), CosmicTrackSelector::select(), MultiTrackSelector::select(), and QcdUeDQM::trackSelection().

535  {
536  auto category = TRACK_HITS;
537  std::bitset<128> layerOk;
538  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
539  for (int i = range.first; i < range.second; ++i) {
542  continue;
543  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
544  if (hitType != HIT_TYPE::VALID)
545  continue;
547  // assert(pattern<128);
548  layerOk.set(pattern);
549  }
550  // assert(trackerLayersWithMeasurementOld()==int(layerOk.count()));
551  return layerOk.count();
552 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static const unsigned short HitTypeMask
Definition: HitPattern.h:447
static const unsigned short minTrackerWord
Definition: HitPattern.h:465
static const unsigned short HitTypeOffset
Definition: HitPattern.h:446
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679
static const unsigned short LayerOffset
Definition: HitPattern.h:454
#define UNLIKELY(x)
Definition: Likely.h:21

◆ trackerLayersWithMeasurementOld()

int reco::HitPattern::trackerLayersWithMeasurementOld ( ) const
inline

Definition at line 997 of file HitPattern.h.

References pixelLayersWithMeasurement(), and stripLayersWithMeasurement().

997  {
999  }
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1005
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:514

◆ trackerLayersWithoutMeasurement()

int HitPattern::trackerLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 554 of file HitPattern.cc.

References validateAlignments::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerOffset, minTrackerWord, topSingleLeptonDQM_PU_cfi::pattern, FastTimerService_cff::range, trackerHitFilter(), and UNLIKELY.

Referenced by HcalHBHEMuonHighEtaAnalyzer::fillTrackParameters(), spr::goodTrack(), pat::IsolatedTrack::lostInnerLayers(), pat::IsolatedTrack::lostLayers(), pat::IsolatedTrack::lostOuterLayers(), MultiTrackSelector::processMVA(), CosmicTrackSelector::select(), and MultiTrackSelector::select().

554  {
555  std::bitset<128> layerOk;
556  std::bitset<128> layerMissed;
557  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
558  for (int i = range.first; i < range.second; ++i) {
561  continue;
562  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
564  // assert(pattern<128);
565  if (hitType == HIT_TYPE::VALID)
566  layerOk.set(pattern);
567  if (hitType == HIT_TYPE::MISSING)
568  layerMissed.set(pattern);
569  }
570  layerMissed &= ~layerOk;
571 
572  // assert(trackerLayersWithoutMeasurementOld(category)==int(layerMissed.count()));
573 
574  return layerMissed.count();
575 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:512
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:316
static const unsigned short HitTypeMask
Definition: HitPattern.h:447
static const unsigned short minTrackerWord
Definition: HitPattern.h:465
static const unsigned short HitTypeOffset
Definition: HitPattern.h:446
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:679
static const unsigned short LayerOffset
Definition: HitPattern.h:454
#define UNLIKELY(x)
Definition: Likely.h:21

◆ trackerLayersWithoutMeasurementOld()

int reco::HitPattern::trackerLayersWithoutMeasurementOld ( HitCategory  category) const
inline

Definition at line 1010 of file HitPattern.h.

References validateAlignments::category, pixelLayersWithoutMeasurement(), and stripLayersWithoutMeasurement().

1010  {
1012  }
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1014
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1018

◆ validHitFilter()

bool reco::HitPattern::validHitFilter ( uint16_t  pattern)
inlinestatic

Friends And Related Function Documentation

◆ PatternSet

template<int N>
friend struct PatternSet
friend

Definition at line 509 of file HitPattern.h.

Member Data Documentation

◆ ARRAY_LENGTH

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

Definition at line 157 of file HitPattern.h.

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

◆ beginInner

uint8_t reco::HitPattern::beginInner
private

◆ beginOuter

uint8_t reco::HitPattern::beginOuter
private

◆ beginTrackHits

uint8_t reco::HitPattern::beginTrackHits
private

◆ EMPTY_PATTERN

const uint16_t reco::HitPattern::EMPTY_PATTERN = 0x0
static

◆ endInner

uint8_t reco::HitPattern::endInner
private

◆ endOuter

uint8_t reco::HitPattern::endOuter
private

◆ endTrackHits

uint8_t reco::HitPattern::endTrackHits
private

◆ HIT_LENGTH

const unsigned short reco::HitPattern::HIT_LENGTH = 12
static

Definition at line 158 of file HitPattern.h.

Referenced by getHitPatternByAbsoluteIndex(), and insertHit().

◆ hitCount

uint8_t reco::HitPattern::hitCount
private

◆ hitPattern

uint16_t reco::HitPattern::hitPattern[ARRAY_LENGTH]
private

◆ HitTypeMask

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

◆ HitTypeOffset

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

◆ LayerMask

const unsigned short reco::HitPattern::LayerMask = 0xF
staticprivate

◆ LayerOffset

const unsigned short reco::HitPattern::LayerOffset = 3
staticprivate

◆ MaxHits

const unsigned short reco::HitPattern::MaxHits = (8 * sizeof(uint16_t) * ARRAY_LENGTH) / HIT_LENGTH
static

Definition at line 159 of file HitPattern.h.

Referenced by appendHit(), and appendMuonHit().

◆ maxTrackerWord

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

◆ minPixelWord

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

Definition at line 467 of file HitPattern.h.

◆ minStripWord

const unsigned short reco::HitPattern::minStripWord = minTrackerWord | (3 << SubstrOffset)
staticprivate

◆ minTrackerWord

const unsigned short reco::HitPattern::minTrackerWord = 1 << SubDetectorOffset
staticprivate

◆ NULL_RETURN

const uint32_t reco::HitPattern::NULL_RETURN = 999999
static

◆ SideMask

const unsigned short reco::HitPattern::SideMask = 0x1
staticprivate

Definition at line 451 of file HitPattern.h.

Referenced by encode(), and getSide().

◆ SideOffset

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

Definition at line 450 of file HitPattern.h.

Referenced by encode(), and getSide().

◆ SubDetectorMask

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

◆ SubDetectorOffset

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

◆ SubstrMask

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

◆ SubstrOffset

const unsigned short reco::HitPattern::SubstrOffset = 7
staticprivate

Definition at line 458 of file HitPattern.h.

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