CMS 3D CMS Logo

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

#include <HitPattern.h>

Public Types

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

Public Member Functions

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

Static Public Member Functions

static bool badHitFilter (uint16_t pattern)
 
static uint16_t getBTLModType (uint16_t pattern)
 BTL Module type: 1,2,3. Only valid for BTL patterns of course. More...
 
static uint16_t getCSCRing (uint16_t pattern)
 CSC ring (1-4). Only valid for muon CSC patterns, of course. More...
 
static uint16_t getDTSuperLayer (uint16_t pattern)
 DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patterns, of course. More...
 
static uint16_t getETLRing (uint16_t pattern)
 ETL Ring: 1-12. Only valid for ETL patterns of course. More...
 
static uint16_t getGEMLayer (uint16_t pattern)
 GEM layer: 1,2. Only valid for muon GEM patterns, of course. More...
 
static uint16_t getGEMStation (uint16_t pattern)
 GEM station: 1,2. Only valid for muon GEM patterns, of course. More...
 
static uint32_t getHitType (uint16_t pattern)
 
static uint32_t getLayer (uint16_t pattern)
 
static uint16_t getMuonStation (uint16_t pattern)
 Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon, of course. More...
 
static uint16_t getRPCLayer (uint16_t pattern)
 RPC layer: for station 1 and 2, layer = 1(inner) or 2(outer); for station 3, 4 layer is always 0. Only valid for muon RPC patterns, of course. More...
 
static uint16_t getRPCregion (uint16_t pattern)
 RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course. More...
 
static uint32_t getSide (uint16_t pattern)
 
static uint32_t getSubDetector (uint16_t pattern)
 
static uint32_t getSubStructure (uint16_t pattern)
 
static uint32_t getSubSubStructure (uint16_t pattern)
 
static bool inactiveHitFilter (uint16_t pattern)
 
static bool missingHitFilter (uint16_t pattern)
 
static bool muonCSCHitFilter (uint16_t pattern)
 
static bool muonDTHitFilter (uint16_t pattern)
 
static bool muonGEMHitFilter (uint16_t pattern)
 
static bool muonHitFilter (uint16_t pattern)
 
static bool muonME0HitFilter (uint16_t pattern)
 
static bool muonRPCHitFilter (uint16_t pattern)
 
static bool pixelBarrelHitFilter (uint16_t pattern)
 
static bool pixelEndcapHitFilter (uint16_t pattern)
 
static bool pixelHitFilter (uint16_t pattern)
 
static bool stripHitFilter (uint16_t pattern)
 
static bool stripTECHitFilter (uint16_t pattern)
 
static bool stripTIBHitFilter (uint16_t pattern)
 
static bool stripTIDHitFilter (uint16_t pattern)
 
static bool stripTOBHitFilter (uint16_t pattern)
 
static bool timingBTLHitFilter (uint16_t pattern)
 
static bool timingETLHitFilter (uint16_t pattern)
 
static bool timingHitFilter (uint16_t pattern)
 
static bool trackerHitFilter (uint16_t pattern)
 
static bool validHitFilter (uint16_t pattern)
 

Static Public Attributes

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

Private Types

typedef bool filterType(uint16_t)
 

Private Member Functions

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

Static Private Member Functions

static uint16_t encode (const TrackingRecHit &hit, const TrackerTopology &ttopo)
 
static uint16_t encode (const DetId &id, TrackingRecHit::Type hitType, const TrackerTopology &ttopo)
 
static uint16_t encode (uint16_t det, uint16_t subdet, uint16_t layer, uint16_t side, TrackingRecHit::Type hitType)
 
static uint16_t isStereo (DetId i, const TrackerTopology &ttopo)
 
static bool stripSubdetectorHitFilter (uint16_t pattern, StripSubdetector::SubDetector substructure)
 

Private Attributes

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

Static Private Attributes

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

Friends

template<int N>
struct PatternSet
 

Detailed Description

Definition at line 149 of file HitPattern.h.

Member Typedef Documentation

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

Definition at line 485 of file HitPattern.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MONO 
STEREO 

Definition at line 153 of file HitPattern.h.

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

Definition at line 158 of file HitPattern.h.

Enumerator
VALID 
MISSING 
INACTIVE 
BAD 

Definition at line 164 of file HitPattern.h.

Enumerator
TRACK_HITS 
MISSING_INNER_HITS 
MISSING_OUTER_HITS 

Definition at line 171 of file HitPattern.h.

Constructor & Destructor Documentation

HitPattern::HitPattern ( )

Definition at line 20 of file HitPattern.cc.

References ARRAY_LENGTH, EMPTY_PATTERN, and hitPattern.

20  :
21  hitCount(0),
22  beginTrackHits(0),
23  endTrackHits(0),
24  beginInner(0),
25  endInner(0),
26  beginOuter(0),
27  endOuter(0)
28 {
30 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:176
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
uint8_t endInner
Definition: HitPattern.h:508
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:502
uint8_t beginInner
Definition: HitPattern.h:507
uint8_t beginTrackHits
Definition: HitPattern.h:505
uint8_t endTrackHits
Definition: HitPattern.h:506
uint8_t hitCount
Definition: HitPattern.h:503
uint8_t beginOuter
Definition: HitPattern.h:509
uint8_t endOuter
Definition: HitPattern.h:510
HitPattern::~HitPattern ( )

Definition at line 44 of file HitPattern.cc.

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

Definition at line 32 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

32  :
33  hitCount(other.hitCount),
36  beginInner(other.beginInner),
37  endInner(other.endInner),
38  beginOuter(other.beginOuter),
39  endOuter(other.endOuter)
40 {
41  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
42 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:176
uint8_t endInner
Definition: HitPattern.h:508
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:502
uint8_t beginInner
Definition: HitPattern.h:507
uint8_t beginTrackHits
Definition: HitPattern.h:505
uint8_t endTrackHits
Definition: HitPattern.h:506
uint8_t hitCount
Definition: HitPattern.h:503
uint8_t beginOuter
Definition: HitPattern.h:509
uint8_t endOuter
Definition: HitPattern.h:510

Member Function Documentation

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

Definition at line 226 of file HitPattern.cc.

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

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

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

Definition at line 84 of file HitPattern.cc.

References appendHit().

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

Definition at line 231 of file HitPattern.cc.

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

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

Definition at line 243 of file HitPattern.cc.

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

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

Definition at line 535 of file HitPattern.h.

References end, Exhume::I, and UNLIKELY.

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

536 {
537  for (I hit = begin; hit != end; hit++) {
538  if UNLIKELY((!appendHit(*hit, ttopo))) {
539  return false;
540  }
541  }
542  return true;
543 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:226
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
#define UNLIKELY(x)
bool HitPattern::appendMuonHit ( const DetId id,
TrackingRecHit::Type  hitType 
)

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

Definition at line 308 of file HitPattern.cc.

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

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

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

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

Definition at line 304 of file HitPattern.cc.

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

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

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

Definition at line 862 of file HitPattern.h.

References hcaldqm::constants::BAD.

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

Definition at line 569 of file HitPattern.h.

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

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

570 {
571  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
572  for (int i = range.first; i < range.second; i++) {
574  // f() return false to ask to stop looping
575  if (typeFilter(pattern) && !f(pattern)) {
576  break;
577  }
578  }
579 }
double f[11][100]
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:518
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
void HitPattern::clear ( void  )

Definition at line 71 of file HitPattern.cc.

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

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

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

Definition at line 555 of file HitPattern.h.

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

556 {
557  int count = 0;
558  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
559  for (int i = range.first; i < range.second; ++i) {
561  ++count;
562  }
563  }
564  return count;
565 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:518
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
int reco::HitPattern::countTypedHits ( HitCategory  category,
filterType  typeFilter,
filterType  filter 
) const
inlineprivate

Definition at line 581 of file HitPattern.h.

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

582 {
583  int count = 0;
584  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
585  for (int i = range.first; i < range.second; ++i) {
587  if (typeFilter(pattern) && filter(pattern)) {
588  ++count;
589  }
590  }
591  return count;
592 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:518
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
int reco::HitPattern::cscStationsWithAnyHits ( ) const
inline

Definition at line 1236 of file HitPattern.h.

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

Definition at line 1231 of file HitPattern.h.

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

Definition at line 1226 of file HitPattern.h.

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

Definition at line 1221 of file HitPattern.h.

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

Definition at line 1216 of file HitPattern.h.

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

Definition at line 1211 of file HitPattern.h.

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

Definition at line 163 of file HitPattern.cc.

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

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

Definition at line 199 of file HitPattern.cc.

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

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

Definition at line 1266 of file HitPattern.h.

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

Definition at line 1261 of file HitPattern.h.

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

Definition at line 1256 of file HitPattern.h.

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

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

MTD.

Definition at line 834 of file HitPattern.h.

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

Definition at line 518 of file HitPattern.h.

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

519 {
520  switch (category) {
521  case TRACK_HITS:
522  return std::pair<uint8_t, uint8_t>(beginTrackHits, endTrackHits);
523  break;
524  case MISSING_INNER_HITS:
525  return std::pair<uint8_t, uint8_t>(beginInner, endInner);
526  break;
527  case MISSING_OUTER_HITS:
528  return std::pair<uint8_t, uint8_t>(beginOuter, endOuter);
529  break;
530  }
531  return std::pair<uint8_t, uint8_t>(-1, -1);
532 }
uint8_t endInner
Definition: HitPattern.h:508
uint8_t beginInner
Definition: HitPattern.h:507
uint8_t beginTrackHits
Definition: HitPattern.h:505
uint8_t endTrackHits
Definition: HitPattern.h:506
uint8_t beginOuter
Definition: HitPattern.h:509
uint8_t endOuter
Definition: HitPattern.h:510
uint16_t reco::HitPattern::getCSCRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 803 of file HitPattern.h.

Referenced by printHitPattern().

804 {
805  return (getSubSubStructure(pattern) & 3) + 1;
806 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:756
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 798 of file HitPattern.h.

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

799 {
800  return (getSubSubStructure(pattern) & 3);
801 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:756
uint16_t reco::HitPattern::getETLRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 838 of file HitPattern.h.

838  {
839  return getSubSubStructure(pattern);
840 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:756
uint16_t reco::HitPattern::getGEMLayer ( uint16_t  pattern)
inlinestatic

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

Definition at line 842 of file HitPattern.h.

Referenced by printHitPattern().

843 {
844  return (getSubSubStructure(pattern) & 1) + 1;
845 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:756
uint16_t reco::HitPattern::getGEMStation ( uint16_t  pattern)
inlinestatic

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

Definition at line 826 of file HitPattern.h.

Referenced by printHitPattern().

828 {
829  uint16_t sss = getSubSubStructure(pattern), stat = sss >> 1;
830  return stat + 1;
831 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:756
uint16_t reco::HitPattern::getHitPattern ( HitCategory  category,
int  position 
) const
inline

Definition at line 545 of file HitPattern.h.

References UNLIKELY.

Referenced by PFCheckHitPattern::analyze(), GsfElectronAlgo::ElectronData::checkCtfTrack(), pat::SoftMuonMvaEstimator::computeMva(), OniaPhotonConversionProducer::foundCompatibleInnerHits(), GsfElectronCoreBaseProducer::getCtfTrackRef(), PrimaryVertexValidation::hasFirstLayerPixelHits(), SoftPFElectronTagInfoProducer::isElecClean(), PFElecTkProducer::isInnerMost(), CheckHitPattern::operator()(), FWTrackResidualDetailView::prepareData(), CheckHitPattern::print(), PFCheckHitPattern::print(), print(), printHitPattern(), pat::PATPackedCandidateProducer::produce(), FWConvTrackHitsDetailView::setTextInfo(), EgAmbiguityTools::sharedDets(), EgAmbiguityTools::sharedHits(), and QcdUeDQM::trackSelection().

546 {
547  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
548  if UNLIKELY((position < 0 || (position + range.first) >= range.second)) {
550  }
551 
552  return getHitPatternByAbsoluteIndex(range.first + position);
553 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:518
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static int position[264][3]
Definition: ReadPGInfo.cc:509
#define UNLIKELY(x)
uint16_t HitPattern::getHitPatternByAbsoluteIndex ( int  position) const
private

Definition at line 322 of file HitPattern.cc.

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

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

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

Definition at line 784 of file HitPattern.h.

References UNLIKELY.

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

785 {
787  return NULL_RETURN;
788  }
789 
790  return ((pattern >> HitTypeOffset) & HitTypeMask);
791 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short HitTypeMask
Definition: HitPattern.h:452
static const unsigned short HitTypeOffset
Definition: HitPattern.h:451
#define UNLIKELY(x)
uint32_t reco::HitPattern::getLayer ( uint16_t  pattern)
inlinestatic
uint16_t reco::HitPattern::getMuonStation ( uint16_t  pattern)
inlinestatic

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

Definition at line 793 of file HitPattern.h.

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

794 {
795  return (getSubSubStructure(pattern) >> 2) + 1;
796 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:756
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 808 of file HitPattern.h.

References LIKELY.

Referenced by printHitPattern().

809 {
810  uint16_t subSubStructure = getSubSubStructure(pattern);
811  uint16_t stat = subSubStructure >> 2;
812 
813  if LIKELY(stat <= 1) {
814  return ((subSubStructure >> 1) & 1) + 1;
815  }
816 
817  return 0;
818 }
#define LIKELY(x)
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:756
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 820 of file HitPattern.h.

Referenced by printHitPattern().

821 {
822  return getSubSubStructure(pattern) & 1;
823 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:756
uint32_t reco::HitPattern::getSide ( uint16_t  pattern)
inlinestatic

Definition at line 775 of file HitPattern.h.

References UNLIKELY.

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

776 {
778  return NULL_RETURN;
779  }
780 
781  return (pattern >> SideOffset) & SideMask;
782 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const unsigned short SideOffset
Definition: HitPattern.h:455
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SideMask
Definition: HitPattern.h:456
#define UNLIKELY(x)
uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 765 of file HitPattern.h.

References UNLIKELY.

766 {
768  return NULL_RETURN;
769  }
770 
771  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
772 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SubDetectorMask
Definition: HitPattern.h:468
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:467
#define UNLIKELY(x)
uint32_t reco::HitPattern::getSubStructure ( uint16_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getSubSubStructure ( uint16_t  pattern)
inlinestatic

Definition at line 756 of file HitPattern.h.

References UNLIKELY.

Referenced by numberOfValidStripLayersWithMonoAndStereo().

757 {
759  return NULL_RETURN;
760  }
761 
762  return ((pattern >> LayerOffset) & LayerMask);
763 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:180
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short LayerOffset
Definition: HitPattern.h:459
static const unsigned short LayerMask
Definition: HitPattern.h:460
#define UNLIKELY(x)
uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 467 of file HitPattern.cc.

References hcaldqm::constants::BAD, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, mps_fire::i, LayerMask, LayerOffset, RecoTauDiscriminantConfiguration::mask, NULL_RETURN, listBenchmarks::pattern, SubDetectorMask, SubDetectorOffset, SubstrMask, and SubstrOffset.

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

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

Definition at line 499 of file HitPattern.cc.

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

Referenced by OniaPhotonConversionProducer::foundCompatibleInnerHits().

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

Definition at line 365 of file HitPattern.cc.

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

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

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

Definition at line 857 of file HitPattern.h.

858 {
860 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:784
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1296 of file HitPattern.h.

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

Definition at line 1291 of file HitPattern.h.

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

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

Definition at line 966 of file HitPattern.cc.

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

967 {
968  int ret = 0;
969  for (int i = beginTrackHits; i < endTrackHits; ++i) {
971  if (muonHitFilter(pattern)
972  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
973  int stat = getMuonStation(pattern);
974  if (ret == 0 || stat < ret) {
975  ret = stat;
976  }
977  }
978  }
979 
980  return ret;
981 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:784
uint8_t beginTrackHits
Definition: HitPattern.h:505
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
uint8_t endTrackHits
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
Definition: HitPattern.h:793
int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 1286 of file HitPattern.h.

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

Definition at line 1073 of file HitPattern.cc.

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

Referenced by appendHit().

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

Definition at line 1086 of file HitPattern.cc.

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

Referenced by appendHit().

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

Definition at line 1042 of file HitPattern.cc.

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

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

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

Definition at line 1054 of file HitPattern.cc.

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

Referenced by appendHit().

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

Definition at line 928 of file HitPattern.cc.

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

Referenced by encode().

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

Definition at line 1281 of file HitPattern.h.

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

Definition at line 1276 of file HitPattern.h.

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

Definition at line 1271 of file HitPattern.h.

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

Definition at line 852 of file HitPattern.h.

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

853 {
855 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:784
bool reco::HitPattern::muonCSCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 670 of file HitPattern.h.

References MuonSubdetId::CSC, and UNLIKELY.

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

671 {
673  return false;
674  }
675 
676  uint32_t substructure = getSubStructure(pattern);
677  return (substructure == (uint32_t) MuonSubdetId::CSC);
678 }
static const int CSC
Definition: MuonSubdetId.h:13
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
#define UNLIKELY(x)
bool reco::HitPattern::muonDTHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 660 of file HitPattern.h.

References MuonSubdetId::DT, and UNLIKELY.

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

661 {
663  return false;
664  }
665 
666  uint32_t substructure = getSubStructure(pattern);
667  return (substructure == (uint32_t) MuonSubdetId::DT);
668 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
static const int DT
Definition: MuonSubdetId.h:12
#define UNLIKELY(x)
bool reco::HitPattern::muonGEMHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 690 of file HitPattern.h.

References MuonSubdetId::GEM, and UNLIKELY.

Referenced by printHitPattern().

691 {
693  return false;
694  }
695 
696  uint32_t substructure = getSubStructure(pattern);
697  return (substructure == (uint32_t) MuonSubdetId::GEM);
698 }
static const int GEM
Definition: MuonSubdetId.h:15
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
#define UNLIKELY(x)
bool reco::HitPattern::muonHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 712 of file HitPattern.h.

References UNLIKELY.

Referenced by innermostMuonStationWithHits(), muonStations(), outermostMuonStationWithHits(), and printHitPattern().

713 {
715  return false;
716  }
717 
718  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 0);
719 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SubDetectorMask
Definition: HitPattern.h:468
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:467
#define UNLIKELY(x)
bool reco::HitPattern::muonME0HitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 700 of file HitPattern.h.

References MuonSubdetId::ME0, and UNLIKELY.

Referenced by printHitPattern().

700  {
702  uint16_t substructure = getSubStructure(pattern);
703  return (substructure == (uint16_t) MuonSubdetId::ME0);
704 }
return((rh^lh)&mask)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
#define UNLIKELY(x)
bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 680 of file HitPattern.h.

References MuonSubdetId::RPC, and UNLIKELY.

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

681 {
683  return false;
684  }
685 
686  uint32_t substructure = getSubStructure(pattern);
687  return (substructure == (uint32_t) MuonSubdetId::RPC);
688 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
static const int RPC
Definition: MuonSubdetId.h:14
#define UNLIKELY(x)
int HitPattern::muonStations ( int  subdet,
int  hitType 
) const

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

Definition at line 951 of file HitPattern.cc.

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

952 {
953  int stations[4] = {0, 0, 0, 0};
954  for (int i = beginTrackHits; i < endTrackHits; ++i) {
956  if (muonHitFilter(pattern)
957  && (subdet == 0 || int(getSubStructure(pattern)) == subdet)
958  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
959  stations[getMuonStation(pattern) - 1] = 1;
960  }
961  }
962 
963  return stations[0] + stations[1] + stations[2] + stations[3];
964 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:784
uint8_t beginTrackHits
Definition: HitPattern.h:505
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
uint8_t endTrackHits
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
Definition: HitPattern.h:793
int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 1206 of file HitPattern.h.

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

Definition at line 1201 of file HitPattern.h.

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

Definition at line 1196 of file HitPattern.h.

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

Definition at line 873 of file HitPattern.h.

874 {
876 }
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:707
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:555
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 1076 of file HitPattern.h.

1077 {
1079 }
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:862
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:555
int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 1091 of file HitPattern.h.

1092 {
1094 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:670
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:857
int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 1086 of file HitPattern.h.

1087 {
1089 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:857
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
int reco::HitPattern::numberOfBadMuonGEMHits ( ) const
inline

Definition at line 1101 of file HitPattern.h.

1102 {
1104 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:857
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:690
int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 1081 of file HitPattern.h.

1082 {
1084 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:857
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
int reco::HitPattern::numberOfBadMuonME0Hits ( ) const
inline

Definition at line 1106 of file HitPattern.h.

1106  {
1108 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:700
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:857
int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 1096 of file HitPattern.h.

1097 {
1099 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:857
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:680
int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 1026 of file HitPattern.cc.

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

1027 {
1028  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
1029  for (int i = beginTrackHits; i < endTrackHits; ++i) {
1031  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
1032  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
1033  }
1034  }
1035 
1036  return stations[0][0] * stations[0][1]
1037  + stations[1][0] * stations[1][1]
1038  + stations[2][0] * stations[2][1]
1039  + stations[3][0] * stations[3][1];
1040 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:798
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
uint8_t beginTrackHits
Definition: HitPattern.h:505
uint8_t endTrackHits
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
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:793
int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 999 of file HitPattern.cc.

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

1000 {
1001  int stations[4] = {0, 0, 0, 0};
1002  for (int i = beginTrackHits; i < endTrackHits; ++i) {
1004 
1005  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
1006  && getDTSuperLayer(pattern) != 2) {
1007  stations[getMuonStation(pattern) - 1] = 1;
1008  }
1009  }
1010  return stations[0] + stations[1] + stations[2] + stations[3];
1011 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:798
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
uint8_t beginTrackHits
Definition: HitPattern.h:505
uint8_t endTrackHits
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
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:793
int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 1013 of file HitPattern.cc.

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

1014 {
1015  int stations[4] = {0, 0, 0, 0};
1016  for (int i = beginTrackHits; i < endTrackHits; ++i) {
1018  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
1019  && getDTSuperLayer(pattern) == 2) {
1020  stations[getMuonStation(pattern) - 1] = 1;
1021  }
1022  }
1023  return stations[0] + stations[1] + stations[2] + stations[3];
1024 }
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h:798
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
uint8_t beginTrackHits
Definition: HitPattern.h:505
uint8_t endTrackHits
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
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:793
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 1110 of file HitPattern.h.

1111 {
1113 }
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:857
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:555
int reco::HitPattern::numberOfInactiveTimingHits ( ) const
int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 1115 of file HitPattern.h.

1116 {
1118 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:857
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:707
int reco::HitPattern::numberOfLostHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 1057 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

1058 {
1060 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:670
int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 1052 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

1053 {
1055 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
int reco::HitPattern::numberOfLostMuonGEMHits ( ) const
inline

Definition at line 1067 of file HitPattern.h.

1068 {
1070 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:690
int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 992 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

993 {
995 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
int reco::HitPattern::numberOfLostMuonME0Hits ( ) const
inline

Definition at line 1072 of file HitPattern.h.

1072  {
1074 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:700
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 1062 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

1063 {
1065 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:680
int reco::HitPattern::numberOfLostPixelBarrelHits ( HitCategory  category) const
inline

Definition at line 1017 of file HitPattern.h.

1018 {
1020 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:605
int reco::HitPattern::numberOfLostPixelEndcapHits ( HitCategory  category) const
inline

Definition at line 1022 of file HitPattern.h.

1023 {
1025 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:615
int reco::HitPattern::numberOfLostPixelHits ( HitCategory  category) const
inline

Definition at line 1012 of file HitPattern.h.

1013 {
1015 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:594
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
int reco::HitPattern::numberOfLostStripHits ( HitCategory  category) const
inline

Definition at line 1027 of file HitPattern.h.

1028 {
1030 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:625
int reco::HitPattern::numberOfLostStripTECHits ( HitCategory  category) const
inline

Definition at line 1047 of file HitPattern.h.

1048 {
1050 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:655
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
int reco::HitPattern::numberOfLostStripTIBHits ( HitCategory  category) const
inline

Definition at line 1032 of file HitPattern.h.

1033 {
1035 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:640
int reco::HitPattern::numberOfLostStripTIDHits ( HitCategory  category) const
inline

Definition at line 1037 of file HitPattern.h.

1038 {
1040 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:645
int reco::HitPattern::numberOfLostStripTOBHits ( HitCategory  category) const
inline

Definition at line 1042 of file HitPattern.h.

1043 {
1045 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:650
int reco::HitPattern::numberOfLostTimingBTLHits ( ) const
inline

Definition at line 1002 of file HitPattern.h.

1003 {
1005 }
static bool timingBTLHitFilter(uint16_t pattern)
Definition: HitPattern.h:721
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
int reco::HitPattern::numberOfLostTimingETLHits ( ) const
inline

Definition at line 1007 of file HitPattern.h.

1008 {
1010 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
static bool timingETLHitFilter(uint16_t pattern)
Definition: HitPattern.h:727
int reco::HitPattern::numberOfLostTimingHits ( ) const
inline

Definition at line 997 of file HitPattern.h.

998 {
1000 }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:733
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:852
int reco::HitPattern::numberOfLostTrackerHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 878 of file HitPattern.h.

879 {
881 }
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:555
int reco::HitPattern::numberOfTimingHits ( ) const
inline

Definition at line 883 of file HitPattern.h.

884 {
886 }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:733
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:555
int reco::HitPattern::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 953 of file HitPattern.h.

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

954 {
956 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:670
int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 948 of file HitPattern.h.

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

949 {
951 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
int reco::HitPattern::numberOfValidMuonGEMHits ( ) const
inline

Definition at line 963 of file HitPattern.h.

Referenced by MuonTrackValidator::analyze().

964 {
966 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:690
int reco::HitPattern::numberOfValidMuonHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonME0Hits ( ) const
inline

Definition at line 968 of file HitPattern.h.

Referenced by MuonTrackValidator::analyze().

968  {
970 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:700
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 958 of file HitPattern.h.

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

959 {
961 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:680
int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelHits ( ) const
inline

Definition at line 908 of file HitPattern.h.

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

909 {
911 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:594
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
int reco::HitPattern::numberOfValidStripHits ( ) const
inline
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

Definition at line 379 of file HitPattern.cc.

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

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

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

Definition at line 426 of file HitPattern.cc.

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

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

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

Definition at line 943 of file HitPattern.h.

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

944 {
946 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:655
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 933 of file HitPattern.h.

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

934 {
936 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:645
int reco::HitPattern::numberOfValidStripTOBHits ( ) const
inline
int HitPattern::numberOfValidTECLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int HitPattern::numberOfValidTIBLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int HitPattern::numberOfValidTIDLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int reco::HitPattern::numberOfValidTimingBTLHits ( ) const
inline

Definition at line 972 of file HitPattern.h.

973 {
975 }
static bool timingBTLHitFilter(uint16_t pattern)
Definition: HitPattern.h:721
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
int reco::HitPattern::numberOfValidTimingETLHits ( ) const
inline

Definition at line 977 of file HitPattern.h.

978 {
980 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
static bool timingETLHitFilter(uint16_t pattern)
Definition: HitPattern.h:727
int reco::HitPattern::numberOfValidTimingHits ( ) const
inline

Definition at line 903 of file HitPattern.h.

904 {
906 }
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:733
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:581
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:847
int HitPattern::numberOfValidTOBLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int reco::HitPattern::numberOfValidTrackerHits ( ) const
inline
HitPattern & HitPattern::operator= ( const HitPattern other)

Definition at line 49 of file HitPattern.cc.

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

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

Definition at line 1311 of file HitPattern.h.

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

Definition at line 1306 of file HitPattern.h.

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

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

Definition at line 983 of file HitPattern.cc.

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

984 {
985  int ret = 0;
986  for (int i = beginTrackHits; i < endTrackHits; ++i) {
988  if (muonHitFilter(pattern) &&
989  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
990  int stat = getMuonStation(pattern);
991  if (ret == 0 || stat > ret) {
992  ret = stat;
993  }
994  }
995  }
996  return ret;
997 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:784
uint8_t beginTrackHits
Definition: HitPattern.h:505
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
uint8_t endTrackHits
Definition: HitPattern.h:506
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:322
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
Definition: HitPattern.h:793
int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 1301 of file HitPattern.h.

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

Definition at line 605 of file HitPattern.h.

References PixelSubdetector::PixelBarrel, and UNLIKELY.

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

606 {
608  return false;
609  }
610 
611  uint32_t substructure = getSubStructure(pattern);
612  return (substructure == PixelSubdetector::PixelBarrel);
613 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:707
#define UNLIKELY(x)
int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 803 of file HitPattern.cc.

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

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

Definition at line 734 of file HitPattern.cc.

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

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

Definition at line 597 of file HitPattern.cc.

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

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

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

Definition at line 665 of file HitPattern.cc.

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

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

Definition at line 615 of file HitPattern.h.

References PixelSubdetector::PixelEndcap, and UNLIKELY.

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

616 {
618  return false;
619  }
620 
621  uint32_t substructure = getSubStructure(pattern);
622  return (substructure == PixelSubdetector::PixelEndcap);
623 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:707
#define UNLIKELY(x)
int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 815 of file HitPattern.cc.

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

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

Definition at line 746 of file HitPattern.cc.

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

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

Definition at line 609 of file HitPattern.cc.

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

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

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

Definition at line 677 of file HitPattern.cc.

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

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

Definition at line 594 of file HitPattern.h.

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

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

595 {
597  return false;
598  }
599 
600  uint32_t substructure = getSubStructure(pattern);
601  return (substructure == PixelSubdetector::PixelBarrel ||
602  substructure == PixelSubdetector::PixelEndcap);
603 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:707
#define UNLIKELY(x)
int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 1182 of file HitPattern.h.

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

Definition at line 1162 of file HitPattern.h.

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

Definition at line 538 of file HitPattern.cc.

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

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

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

Definition at line 1125 of file HitPattern.h.

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

Definition at line 1142 of file HitPattern.h.

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

Definition at line 911 of file HitPattern.cc.

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

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

Definition at line 871 of file HitPattern.cc.

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

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

872 {
873  uint16_t pattern = getHitPattern(category, position);
874  stream << "\t";
875  if (muonHitFilter(pattern)) {
876  stream << "muon";
877  } else if (trackerHitFilter(pattern)) {
878  stream << "tracker";
879  } else if (timingHitFilter(pattern)) {
880  stream << "timing";
881  }
882 
883  stream << "\tsubstructure " << getSubStructure(pattern);
884  if (muonHitFilter(pattern)) {
885  stream << "\tstation " << getMuonStation(pattern);
886  if (muonDTHitFilter(pattern)) {
887  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
888  } else if (muonCSCHitFilter(pattern)) {
889  stream << "\tcsc ring " << getCSCRing(pattern);
890  } else if (muonRPCHitFilter(pattern)) {
891  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel")
892  << ", layer " << getRPCLayer(pattern);
893  } else if (muonGEMHitFilter(pattern)) {
894  stream << "\tgem " << (getGEMLayer(pattern) ? "layer1" : "layer2")
895  << ", station " << getGEMStation(pattern);
896  } else if (muonME0HitFilter(pattern)) {
897  stream << "\tme0 ";
898  } else {
899  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure "
900  << getSubStructure(pattern);
901  }
902  } else if( timingHitFilter(pattern) ) {
903  stream << "\tdetector " << getSubStructure(pattern);
904  } else {
905  stream << "\tlayer " << getLayer(pattern);
906  }
907  stream << "\thit type " << getHitType(pattern);
908  stream << std::endl;
909 }
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:803
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:751
static bool timingHitFilter(uint16_t pattern)
Definition: HitPattern.h:733
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:798
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:700
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:842
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:670
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:784
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:820
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:690
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:826
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:712
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:707
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
static int position[264][3]
Definition: ReadPGInfo.cc:509
static uint16_t getRPCLayer(uint16_t pattern)
RPC layer: for station 1 and 2, layer = 1(inner) or 2(outer); for station 3, 4 layer is always 0...
Definition: HitPattern.h:808
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:793
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:545
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:680
int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 1251 of file HitPattern.h.

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

Definition at line 1246 of file HitPattern.h.

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

Definition at line 1241 of file HitPattern.h.

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

Definition at line 625 of file HitPattern.h.

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

626 {
627  return pattern > minStripWord;
628 }
static const unsigned short minStripWord
Definition: HitPattern.h:473
int reco::HitPattern::stripLayersNull ( ) const
inline

Definition at line 1188 of file HitPattern.h.

1189 {
1190  return stripTIBLayersNull() +
1191  stripTIDLayersNull() +
1192  stripTOBLayersNull() +
1194 }
int stripTIBLayersNull() const
Definition: HitPattern.cc:827
int stripTECLayersNull() const
Definition: HitPattern.cc:860
int stripTIDLayersNull() const
Definition: HitPattern.cc:838
int stripTOBLayersNull() const
Definition: HitPattern.cc:849
int reco::HitPattern::stripLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1168 of file HitPattern.h.

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

Definition at line 1148 of file HitPattern.h.

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

Definition at line 631 of file HitPattern.h.

References UNLIKELY.

632 {
634  return false;
635  }
636 
637  return substructure == getSubStructure(pattern);
638 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:742
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:707
#define UNLIKELY(x)
bool reco::HitPattern::stripTECHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 655 of file HitPattern.h.

References StripSubdetector::TEC.

656 {
658 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:631
int HitPattern::stripTECLayersNull ( ) const

Definition at line 860 of file HitPattern.cc.

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

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

Definition at line 792 of file HitPattern.cc.

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

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

Definition at line 654 of file HitPattern.cc.

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

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

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

Definition at line 722 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

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

Definition at line 640 of file HitPattern.h.

References StripSubdetector::TIB.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef().

641 {
643 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:631
int HitPattern::stripTIBLayersNull ( ) const

Definition at line 827 of file HitPattern.cc.

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

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

Definition at line 758 of file HitPattern.cc.

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

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

Definition at line 621 of file HitPattern.cc.

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

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

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

Definition at line 689 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

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

Definition at line 645 of file HitPattern.h.

References StripSubdetector::TID.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef().

646 {
648 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:631
int HitPattern::stripTIDLayersNull ( ) const

Definition at line 838 of file HitPattern.cc.

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

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

Definition at line 769 of file HitPattern.cc.

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

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

Definition at line 632 of file HitPattern.cc.

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

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

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

Definition at line 700 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

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

Definition at line 650 of file HitPattern.h.

References StripSubdetector::TOB.

651 {
653 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:631
int HitPattern::stripTOBLayersNull ( ) const

Definition at line 849 of file HitPattern.cc.

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

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

Definition at line 780 of file HitPattern.cc.

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

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

Definition at line 643 of file HitPattern.cc.

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

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

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

Definition at line 711 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

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

Definition at line 721 of file HitPattern.h.

References MTDDetId::BTL, and UNLIKELY.

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

Definition at line 727 of file HitPattern.h.

References MTDDetId::ETL, and UNLIKELY.

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

Definition at line 733 of file HitPattern.h.

References UNLIKELY.

Referenced by printHitPattern().

734 {
736  return false;
737  }
738 
739  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 2);
740 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:181
static const unsigned short SubDetectorMask
Definition: HitPattern.h:468
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:467
#define UNLIKELY(x)
bool reco::HitPattern::trackerHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 1176 of file HitPattern.h.

1177 {
1178  return pixelLayersNull() +
1179  stripLayersNull();
1180 }
int pixelLayersNull() const
Definition: HitPattern.h:1182
int stripLayersNull() const
Definition: HitPattern.h:1188
int reco::HitPattern::trackerLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1156 of file HitPattern.h.

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

1157 {
1160 }
int pixelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1162
int stripLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1168
int HitPattern::trackerLayersWithMeasurement ( ) const

Definition at line 557 of file HitPattern.cc.

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

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

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

Definition at line 1120 of file HitPattern.h.

1121 {
1123 }
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:538
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1130
int HitPattern::trackerLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 574 of file HitPattern.cc.

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

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

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

Definition at line 1136 of file HitPattern.h.

1137 {
1140 }
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1142
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1148
bool reco::HitPattern::validHitFilter ( uint16_t  pattern)
inlinestatic

Friends And Related Function Documentation

template<int N>
friend struct PatternSet
friend

Definition at line 515 of file HitPattern.h.

Member Data Documentation

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

Definition at line 176 of file HitPattern.h.

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

uint8_t reco::HitPattern::beginInner
private

Definition at line 507 of file HitPattern.h.

Referenced by appendHit(), clear(), insertExpectedInnerHit(), and operator=().

uint8_t reco::HitPattern::beginOuter
private

Definition at line 509 of file HitPattern.h.

Referenced by appendHit(), clear(), insertExpectedOuterHit(), and operator=().

uint8_t reco::HitPattern::beginTrackHits
private
const uint16_t reco::HitPattern::EMPTY_PATTERN = 0x0
static

Definition at line 181 of file HitPattern.h.

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

uint8_t reco::HitPattern::endInner
private

Definition at line 508 of file HitPattern.h.

Referenced by appendHit(), clear(), insertExpectedInnerHit(), and operator=().

uint8_t reco::HitPattern::endOuter
private

Definition at line 510 of file HitPattern.h.

Referenced by appendHit(), clear(), insertExpectedOuterHit(), and operator=().

uint8_t reco::HitPattern::endTrackHits
private
const unsigned short reco::HitPattern::HIT_LENGTH = 12
static

Definition at line 177 of file HitPattern.h.

Referenced by getHitPatternByAbsoluteIndex(), and insertHit().

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

Definition at line 178 of file HitPattern.h.

Referenced by appendHit(), and appendMuonHit().

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

Definition at line 471 of file HitPattern.h.

Referenced by numberOfValidStripLayersWithMonoAndStereo().

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

Definition at line 472 of file HitPattern.h.

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

Definition at line 456 of file HitPattern.h.

Referenced by encode().

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

Definition at line 455 of file HitPattern.h.

Referenced by encode().

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

Definition at line 468 of file HitPattern.h.

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

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

Definition at line 467 of file HitPattern.h.

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

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

Definition at line 463 of file HitPattern.h.

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