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_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 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 numberOfLostTrackerHits (HitCategory category) const
 
int numberOfMuonHits () 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 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 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 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 trackerHitFilter (uint16_t pattern)
 
static bool validHitFilter (uint16_t pattern)
 

Static Public Attributes

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

Private Types

typedef bool filterType(uint16_t)
 

Private Member Functions

template<typename F >
void call (HitCategory category, filterType typeFilter, F f) const
 
int countHits (HitCategory category, filterType filter) const
 
int countTypedHits (HitCategory category, filterType typeFilter, filterType filter) const
 
std::pair< uint8_t, uint8_t > getCategoryIndexRange (HitCategory category) const
 
uint16_t getHitPatternByAbsoluteIndex (int position) const
 
bool insertExpectedInnerHit (const uint16_t pattern)
 
bool insertExpectedOuterHit (const uint16_t pattern)
 
void insertHit (const uint16_t pattern)
 
bool insertTrackHit (const uint16_t pattern)
 
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 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 = 0x1
 
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 146 of file HitPattern.h.

Member Typedef Documentation

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

Definition at line 456 of file HitPattern.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MONO 
STEREO 

Definition at line 150 of file HitPattern.h.

150  {
151  MONO = 1,
152  STEREO = 2
153  };
Enumerator
VALID 
MISSING 
INACTIVE 
BAD 

Definition at line 155 of file HitPattern.h.

Enumerator
TRACK_HITS 
MISSING_INNER_HITS 
MISSING_OUTER_HITS 

Definition at line 162 of file HitPattern.h.

Constructor & Destructor Documentation

HitPattern::HitPattern ( )

Definition at line 18 of file HitPattern.cc.

References ARRAY_LENGTH, EMPTY_PATTERN, and hitPattern.

18  :
19  hitCount(0),
20  beginTrackHits(0),
21  endTrackHits(0),
22  beginInner(0),
23  endInner(0),
24  beginOuter(0),
25  endOuter(0)
26 {
28 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:167
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
uint8_t endInner
Definition: HitPattern.h:479
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:473
uint8_t beginInner
Definition: HitPattern.h:478
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint8_t hitCount
Definition: HitPattern.h:474
uint8_t beginOuter
Definition: HitPattern.h:480
uint8_t endOuter
Definition: HitPattern.h:481
HitPattern::~HitPattern ( )

Definition at line 42 of file HitPattern.cc.

43 {
44  ;
45 }
HitPattern::HitPattern ( const HitPattern other)

Definition at line 30 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

30  :
31  hitCount(other.hitCount),
34  beginInner(other.beginInner),
35  endInner(other.endInner),
36  beginOuter(other.beginOuter),
37  endOuter(other.endOuter)
38 {
39  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
40 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:167
uint8_t endInner
Definition: HitPattern.h:479
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:473
uint8_t beginInner
Definition: HitPattern.h:478
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint8_t hitCount
Definition: HitPattern.h:474
uint8_t beginOuter
Definition: HitPattern.h:480
uint8_t endOuter
Definition: HitPattern.h:481

Member Function Documentation

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

Definition at line 189 of file HitPattern.cc.

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

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

190 {
191  return appendHit(hit.geographicalId(), hit.getType(), ttopo);
192 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:189
Type getType() const
DetId geographicalId() const
bool HitPattern::appendHit ( const TrackingRecHitRef ref,
const TrackerTopology ttopo 
)

Definition at line 82 of file HitPattern.cc.

References appendHit().

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

Definition at line 194 of file HitPattern.cc.

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

195 {
196  //if HitPattern is full, journey ends no matter what.
198  return false;
199  }
200 
201  uint16_t pattern = HitPattern::encode(id, hitType, ttopo);
202 
203  return appendHit(pattern, hitType);
204 }
static const unsigned short MaxHits
Definition: HitPattern.h:169
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:189
uint8_t hitCount
Definition: HitPattern.h:474
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:87
#define UNLIKELY(x)
bool HitPattern::appendHit ( const uint16_t  pattern,
TrackingRecHit::Type  hitType 
)

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

207 {
208  //if HitPattern is full, journey ends no matter what.
210  return false;
211  }
212 
213  switch (hitType) {
217  case TrackingRecHit::bad:
218  // hitCount != endT => we are not inserting T type of hits but of T'
219  // 0 != beginT || 0 != endT => we already have hits of T type
220  // so we already have hits of T in the vector and we don't want to
221  // mess them with T' hits.
222  if UNLIKELY(((hitCount != endTrackHits) && (0 != beginTrackHits || 0 != endTrackHits))) {
223  cms::Exception("HitPattern")
224  << "TRACK_HITS"
225  << " were stored on this object before hits of some other category were inserted "
226  << "but hits of the same category should be inserted in a row. "
227  << "Please rework the code so it inserts all "
228  << "TRACK_HITS"
229  << " in a row.";
230  return false;
231  }
232  return insertTrackHit(pattern);
233  break;
236  if UNLIKELY(((hitCount != endInner) && (0 != beginInner || 0 != endInner))) {
237  cms::Exception("HitPattern")
238  << "MISSING_INNER_HITS"
239  << " were stored on this object before hits of some other category were inserted "
240  << "but hits of the same category should be inserted in a row. "
241  << "Please rework the code so it inserts all "
242  << "MISSING_INNER_HITS"
243  << " in a row.";
244  return false;
245  }
247  break;
250  if UNLIKELY(((hitCount != endOuter) && (0 != beginOuter || 0 != endOuter))) {
251  cms::Exception("HitPattern")
252  << "MISSING_OUTER_HITS"
253  << " were stored on this object before hits of some other category were inserted "
254  << "but hits of the same category should be inserted in a row. "
255  << "Please rework the code so it inserts all "
256  << "MISSING_OUTER_HITS"
257  << " in a row.";
258  return false;
259  }
261  break;
262  }
263 
264  return false;
265 }
static const unsigned short MaxHits
Definition: HitPattern.h:169
bool insertExpectedOuterHit(const uint16_t pattern)
Definition: HitPattern.cc:1045
uint8_t endInner
Definition: HitPattern.h:479
uint8_t beginInner
Definition: HitPattern.h:478
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint8_t hitCount
Definition: HitPattern.h:474
uint8_t beginOuter
Definition: HitPattern.h:480
bool insertExpectedInnerHit(const uint16_t pattern)
Definition: HitPattern.cc:1032
bool insertTrackHit(const uint16_t pattern)
Definition: HitPattern.cc:1013
uint8_t endOuter
Definition: HitPattern.h:481
#define UNLIKELY(x)
template<typename I >
bool reco::HitPattern::appendHits ( const I &  begin,
const I &  end,
const TrackerTopology ttopo 
)

Definition at line 506 of file HitPattern.h.

References end, Exhume::I, and UNLIKELY.

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

507 {
508  for (I hit = begin; hit != end; hit++) {
509  if UNLIKELY((!appendHit(*hit, ttopo))) {
510  return false;
511  }
512  }
513  return true;
514 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:189
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 271 of file HitPattern.cc.

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

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

271  {
272  //if HitPattern is full, journey ends no matter what.
274  return false;
275  }
276 
277  if UNLIKELY(id.det() != DetId::Muon) {
278  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";
279  }
280 
281  uint16_t detid = id.det();
282  uint16_t subdet = id.subdetId();
283  return appendHit(encode(detid, subdet, encodeMuonLayer(id), 0, hitType), hitType);
284 }
static const unsigned short MaxHits
Definition: HitPattern.h:169
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:189
uint8_t hitCount
Definition: HitPattern.h:474
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:87
#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 267 of file HitPattern.cc.

References appendHit(), encode(), and DetId::Tracker.

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

267  {
268  return appendHit(encode(DetId::Tracker, subdet, layer, stereo, hitType), hitType);
269 }
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:189
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:87
bool reco::HitPattern::badHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 803 of file HitPattern.h.

References hcaldqm::constants::BAD.

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

Definition at line 540 of file HitPattern.h.

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

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

541 {
542  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
543  for (int i = range.first; i < range.second; i++) {
545  // f() return false to ask to stop looping
546  if (typeFilter(pattern) && !f(pattern)) {
547  break;
548  }
549  }
550 }
double f[11][100]
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
void HitPattern::clear ( void  )

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

70 {
71  this->hitCount = 0;
72  this->beginTrackHits = 0;
73  this->endTrackHits = 0;
74  this->beginInner = 0;
75  this->endInner = 0;
76  this->beginOuter = 0;
77  this->endOuter = 0;
78 
79  memset(this->hitPattern, EMPTY_PATTERN, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
80 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:167
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
uint8_t endInner
Definition: HitPattern.h:479
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:473
uint8_t beginInner
Definition: HitPattern.h:478
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint8_t hitCount
Definition: HitPattern.h:474
uint8_t beginOuter
Definition: HitPattern.h:480
uint8_t endOuter
Definition: HitPattern.h:481
int reco::HitPattern::countHits ( HitCategory  category,
filterType  filter 
) const
inlineprivate

Definition at line 526 of file HitPattern.h.

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

527 {
528  int count = 0;
529  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
530  for (int i = range.first; i < range.second; ++i) {
532  ++count;
533  }
534  }
535  return count;
536 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
int reco::HitPattern::countTypedHits ( HitCategory  category,
filterType  typeFilter,
filterType  filter 
) const
inlineprivate

Definition at line 552 of file HitPattern.h.

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

553 {
554  int count = 0;
555  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
556  for (int i = range.first; i < range.second; ++i) {
558  if (typeFilter(pattern) && filter(pattern)) {
559  ++count;
560  }
561  }
562  return count;
563 }
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
int reco::HitPattern::cscStationsWithAnyHits ( ) const
inline

Definition at line 1142 of file HitPattern.h.

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

Definition at line 1137 of file HitPattern.h.

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

Definition at line 1132 of file HitPattern.h.

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

Definition at line 1127 of file HitPattern.h.

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

Definition at line 1122 of file HitPattern.h.

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

Definition at line 1117 of file HitPattern.h.

1118 {
1119  return muonStations(1, 0);
1120 }
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:910
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 138 of file HitPattern.cc.

References encode(), isStereo(), TrackerTopology::layer(), DetId::Muon, and DetId::Tracker.

139 {
140  uint16_t detid = id.det();
141  uint16_t subdet = id.subdetId();
142 
143  // adding layer/disk/wheel bits
144  uint16_t layer = 0x0;
145  if (detid == DetId::Tracker) {
146  layer = ttopo.layer(id);
147  } else if (detid == DetId::Muon) {
148  layer = encodeMuonLayer(id);
149  }
150 
151  // adding mono/stereo bit
152  uint16_t side = 0x0;
153  if (detid == DetId::Tracker) {
154  side = isStereo(id, ttopo);
155  } else if (detid == DetId::Muon) {
156  side = 0x0;
157  }
158 
159  return encode(detid, subdet, layer, side, hitType);
160 }
static uint16_t isStereo(DetId i, const TrackerTopology &ttopo)
Definition: HitPattern.cc:887
unsigned int layer(const DetId &id) const
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:87
uint16_t HitPattern::encode ( uint16_t  det,
uint16_t  subdet,
uint16_t  layer,
uint16_t  side,
TrackingRecHit::Type  hitType 
)
staticprivate

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

162  {
164 
165  // adding tracker/muon detector bit
166  pattern |= (det & SubDetectorMask) << SubDetectorOffset;
167 
168  // adding substructure (PXB, PXF, TIB, TID, TOB, TEC, or DT, CSC, RPC,GEM) bits
169  pattern |= (subdet & SubstrMask) << SubstrOffset;
170 
171  // adding layer/disk/wheel bits
172  pattern |= (layer & LayerMask) << LayerOffset;
173 
174  // adding mono/stereo bit
175  pattern |= (side & SideMask) << SideOffset;
176 
177  TrackingRecHit::Type patternHitType = (hitType == TrackingRecHit::missing_inner ||
179  : (
180  (hitType == TrackingRecHit::inactive_inner ||
182  :hitType);
183 
184  pattern |= (patternHitType & HitTypeMask) << HitTypeOffset;
185 
186  return pattern;
187 }
static const unsigned short SideOffset
Definition: HitPattern.h:427
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
static const unsigned short SubstrOffset
Definition: HitPattern.h:435
static const unsigned short HitTypeMask
Definition: HitPattern.h:424
static const unsigned short SubDetectorMask
Definition: HitPattern.h:440
static const unsigned short HitTypeOffset
Definition: HitPattern.h:423
static const unsigned short SideMask
Definition: HitPattern.h:428
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:439
static const unsigned short SubstrMask
Definition: HitPattern.h:436
static const unsigned short LayerOffset
Definition: HitPattern.h:431
static const unsigned short LayerMask
Definition: HitPattern.h:432
int reco::HitPattern::gemStationsWithAnyHits ( ) const
inline

Definition at line 1172 of file HitPattern.h.

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

Definition at line 1167 of file HitPattern.h.

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

Definition at line 1162 of file HitPattern.h.

1163 {
1164  return muonStations(4, 0);
1165 }
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:910
std::pair< uint8_t, uint8_t > reco::HitPattern::getCategoryIndexRange ( HitCategory  category) const
inlineprivate

Definition at line 489 of file HitPattern.h.

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

490 {
491  switch (category) {
492  case TRACK_HITS:
493  return std::pair<uint8_t, uint8_t>(beginTrackHits, endTrackHits);
494  break;
495  case MISSING_INNER_HITS:
496  return std::pair<uint8_t, uint8_t>(beginInner, endInner);
497  break;
498  case MISSING_OUTER_HITS:
499  return std::pair<uint8_t, uint8_t>(beginOuter, endOuter);
500  break;
501  }
502  return std::pair<uint8_t, uint8_t>(-1, -1);
503 }
uint8_t endInner
Definition: HitPattern.h:479
uint8_t beginInner
Definition: HitPattern.h:478
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint8_t beginOuter
Definition: HitPattern.h:480
uint8_t endOuter
Definition: HitPattern.h:481
uint16_t reco::HitPattern::getCSCRing ( uint16_t  pattern)
inlinestatic

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

Definition at line 753 of file HitPattern.h.

Referenced by printHitPattern().

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

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

749 {
750  return (getSubSubStructure(pattern) & 3);
751 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:706
uint16_t reco::HitPattern::getGEMLayer ( uint16_t  pattern)
inlinestatic

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

Definition at line 783 of file HitPattern.h.

Referenced by printHitPattern().

784 {
785  return (getSubSubStructure(pattern) & 1) + 1;
786 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:706
uint16_t reco::HitPattern::getGEMStation ( uint16_t  pattern)
inlinestatic

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

Definition at line 776 of file HitPattern.h.

Referenced by printHitPattern().

778 {
779  uint16_t sss = getSubSubStructure(pattern), stat = sss >> 1;
780  return stat + 1;
781 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:706
uint16_t reco::HitPattern::getHitPattern ( HitCategory  category,
int  position 
) const
inline

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

517 {
518  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
519  if UNLIKELY((position < 0 || (position + range.first) >= range.second)) {
521  }
522 
523  return getHitPatternByAbsoluteIndex(range.first + position);
524 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static int position[264][3]
Definition: ReadPGInfo.cc:509
#define UNLIKELY(x)
uint16_t HitPattern::getHitPatternByAbsoluteIndex ( int  position) const
private

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

287 {
288  if UNLIKELY((position < 0 || position >= hitCount)) {
290  }
291  /*
292  Note: you are not taking a consecutive sequence of HIT_LENGTH bits starting from position * HIT_LENGTH
293  as the bit order in the words are reversed.
294  e.g. if position = 0 you take the lowest 10 bits of the first word.
295 
296  I hope this can clarify what is the memory layout of such thing
297 
298  straight 01234567890123456789012345678901 | 23456789012345678901234567890123 | 4567
299  (global) 0 1 2 3 | 3 4 5 6 | 6
300  words [--------------0---------------] | [--------------1---------------] | [---
301  word 01234567890123456789012345678901 | 01234567890123456789012345678901 | 0123
302  (str) 0 1 2 3 | 0 1 2 3 | 0
303  [--------------0---------------] | [--------------1---------------] | [---
304  word 10987654321098765432109876543210 | 10987654321098765432109876543210 | 1098
305  (rev) 32 21 10 0 | 32 21 10 0 | 32
306  reverse 10987654321098765432109876543210 | 32109876543210987654321098765432 | 5432
307  32 21 10 0 | 6 65 54 43 3 9
308 
309  ugly enough, but it's not my fault, I was not even in CMS at that time [gpetrucc]
310  */
311 
312  uint16_t bitEndOffset = (position + 1) * HIT_LENGTH;
313  uint8_t secondWord = (bitEndOffset >> 4);
314  uint8_t secondWordBits = bitEndOffset & (16 - 1); // that is, bitEndOffset % 16
315  if (secondWordBits >= HIT_LENGTH) { // full block is in this word
316  uint8_t lowBitsToTrash = secondWordBits - HIT_LENGTH;
317  uint16_t myResult = (hitPattern[secondWord] >> lowBitsToTrash) & ((1 << HIT_LENGTH) - 1);
318  return myResult;
319  } else {
320  uint8_t firstWordBits = HIT_LENGTH - secondWordBits;
321  uint16_t firstWordBlock = hitPattern[secondWord - 1] >> (16 - firstWordBits);
322  uint16_t secondWordBlock = hitPattern[secondWord] & ((1 << secondWordBits) - 1);
323  uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
324  return myResult;
325  }
326 }
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:168
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:473
uint8_t hitCount
Definition: HitPattern.h:474
static int position[264][3]
Definition: ReadPGInfo.cc:509
#define UNLIKELY(x)
uint32_t reco::HitPattern::getHitType ( uint16_t  pattern)
inlinestatic

Definition at line 734 of file HitPattern.h.

References UNLIKELY.

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

735 {
737  return NULL_RETURN;
738  }
739 
740  return ((pattern >> HitTypeOffset) & HitTypeMask);
741 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
static const unsigned short HitTypeMask
Definition: HitPattern.h:424
static const unsigned short HitTypeOffset
Definition: HitPattern.h:423
#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 743 of file HitPattern.h.

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

744 {
745  return (getSubSubStructure(pattern) >> 2) + 1;
746 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:706
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 758 of file HitPattern.h.

References LIKELY.

Referenced by printHitPattern().

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

Referenced by printHitPattern().

771 {
772  return getSubSubStructure(pattern) & 1;
773 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:706
uint32_t reco::HitPattern::getSide ( uint16_t  pattern)
inlinestatic

Definition at line 725 of file HitPattern.h.

References UNLIKELY.

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

726 {
728  return NULL_RETURN;
729  }
730 
731  return (pattern >> SideOffset) & SideMask;
732 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
static const unsigned short SideOffset
Definition: HitPattern.h:427
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
static const unsigned short SideMask
Definition: HitPattern.h:428
#define UNLIKELY(x)
uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 715 of file HitPattern.h.

References UNLIKELY.

716 {
718  return NULL_RETURN;
719  }
720 
721  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
722 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
static const unsigned short SubDetectorMask
Definition: HitPattern.h:440
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:439
#define UNLIKELY(x)
uint32_t reco::HitPattern::getSubStructure ( uint16_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getSubSubStructure ( uint16_t  pattern)
inlinestatic

Definition at line 706 of file HitPattern.h.

References UNLIKELY.

Referenced by numberOfValidStripLayersWithMonoAndStereo().

707 {
709  return NULL_RETURN;
710  }
711 
712  return ((pattern >> LayerOffset) & LayerMask);
713 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
static const unsigned short LayerOffset
Definition: HitPattern.h:431
static const unsigned short LayerMask
Definition: HitPattern.h:432
#define UNLIKELY(x)
uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

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

431 {
432  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
433  + ((substr & SubstrMask) << SubstrOffset)
434  + ((layer & LayerMask) << LayerOffset);
435 
436  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
437  + (SubstrMask << SubstrOffset)
438  + (LayerMask << LayerOffset);
439 
440  // layer case 0: valid + (missing, off, bad) ==> with measurement
441  // layer case 1: missing + (off, bad) ==> without measurement
442  // layer case 2: off, bad ==> totally off or bad, cannot say much
443  // layer case NULL_RETURN: track outside acceptance or in gap ==> null
444  uint32_t layerCase = NULL_RETURN;
445  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
446  for (int i = range.first; i < range.second; ++i) {
448  if ((pattern & mask) == tk_substr_layer) {
449  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
450  if (hitType < layerCase) {
451  // BAD and INACTIVE as the same type (as INACTIVE)
452  layerCase = (hitType == HIT_TYPE::BAD ? HIT_TYPE::INACTIVE : hitType);
453  if (layerCase == HIT_TYPE::VALID) {
454  break;
455  }
456  }
457  }
458  }
459  return layerCase;
460 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
static const unsigned short SubstrOffset
Definition: HitPattern.h:435
static const unsigned short HitTypeMask
Definition: HitPattern.h:424
static const unsigned short SubDetectorMask
Definition: HitPattern.h:440
static const unsigned short HitTypeOffset
Definition: HitPattern.h:423
double const BAD
Definition: Constants.h:17
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:439
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static const unsigned short SubstrMask
Definition: HitPattern.h:436
static const unsigned short LayerOffset
Definition: HitPattern.h:431
static const unsigned short LayerMask
Definition: HitPattern.h:432
uint16_t HitPattern::getTrackerMonoStereo ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

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

463 {
464  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
465  + ((substr & SubstrMask) << SubstrOffset)
466  + ((layer & LayerMask) << LayerOffset);
467  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
468  + (SubstrMask << SubstrOffset)
469  + (LayerMask << LayerOffset);
470 
471  // 0: neither a valid mono nor a valid stereo hit
472  // MONO: valid mono hit
473  // STEREO: valid stereo hit
474  // MONO | STEREO: both
475  uint16_t monoStereo = 0x0;
476  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
477  for (int i = range.first; i < range.second; ++i) {
479  if ((pattern & mask) == tk_substr_layer) {
480  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
481  if (hitType == HIT_TYPE::VALID) {
482  switch (getSide(pattern)) {
483  case 0: // mono
484  monoStereo |= MONO;
485  break;
486  case 1: // stereo
487  monoStereo |= STEREO;
488  break;
489  }
490  }
491 
492  if (monoStereo == (MONO | STEREO)) {
493  break;
494  }
495  }
496  }
497  return monoStereo;
498 }
static const unsigned short SubstrOffset
Definition: HitPattern.h:435
static const unsigned short HitTypeMask
Definition: HitPattern.h:424
static const unsigned short SubDetectorMask
Definition: HitPattern.h:440
static const unsigned short HitTypeOffset
Definition: HitPattern.h:423
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:439
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:725
static const unsigned short SubstrMask
Definition: HitPattern.h:436
static const unsigned short LayerOffset
Definition: HitPattern.h:431
static const unsigned short LayerMask
Definition: HitPattern.h:432
bool HitPattern::hasValidHitInPixelLayer ( enum PixelSubdetector::SubDetector  det,
uint16_t  layer 
) const

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

330 {
331  for (int i = beginTrackHits; i < endTrackHits; ++i) {
333  bool pixelHitFilter = ( (det==1 && pixelBarrelHitFilter(pattern)) ||
334  (det==2 && pixelEndcapHitFilter(pattern)) );
335  if (pixelHitFilter && (getLayer(pattern) == layer) && validHitFilter(pattern)) {
336  return true;
337  }
338  }
339  return false;
340 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:701
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:565
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:576
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:586
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
bool reco::HitPattern::inactiveHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 798 of file HitPattern.h.

799 {
801 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:734
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1202 of file HitPattern.h.

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

Definition at line 1197 of file HitPattern.h.

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

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

Definition at line 925 of file HitPattern.cc.

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

926 {
927  int ret = 0;
928  for (int i = beginTrackHits; i < endTrackHits; ++i) {
930  if (muonHitFilter(pattern)
931  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
932  int stat = getMuonStation(pattern);
933  if (ret == 0 || stat < ret) {
934  ret = stat;
935  }
936  }
937  }
938 
939  return ret;
940 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:734
uint8_t beginTrackHits
Definition: HitPattern.h:476
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
uint8_t endTrackHits
Definition: HitPattern.h:477
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
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:743
int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 1192 of file HitPattern.h.

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

Definition at line 1032 of file HitPattern.cc.

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

Referenced by appendHit().

1033 {
1034  if UNLIKELY((0 == beginInner && 0 == endInner)) {
1035  beginInner = hitCount;
1036  endInner = beginInner;
1037  }
1038 
1039  insertHit(pattern);
1040  endInner++;
1041 
1042  return true;
1043 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1001
uint8_t endInner
Definition: HitPattern.h:479
uint8_t beginInner
Definition: HitPattern.h:478
uint8_t hitCount
Definition: HitPattern.h:474
#define UNLIKELY(x)
bool HitPattern::insertExpectedOuterHit ( const uint16_t  pattern)
private

Definition at line 1045 of file HitPattern.cc.

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

Referenced by appendHit().

1046 {
1047  if UNLIKELY((0 == beginOuter && 0 == endOuter)) {
1048  beginOuter = hitCount;
1049  endOuter = beginOuter;
1050  }
1051 
1052  insertHit(pattern);
1053  endOuter++;
1054 
1055  return true;
1056 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1001
uint8_t hitCount
Definition: HitPattern.h:474
uint8_t beginOuter
Definition: HitPattern.h:480
uint8_t endOuter
Definition: HitPattern.h:481
#define UNLIKELY(x)
void HitPattern::insertHit ( const uint16_t  pattern)
private

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

1002 {
1003  int offset = hitCount * HIT_LENGTH;
1004  for (int i = 0; i < HIT_LENGTH; i++) {
1005  int pos = offset + i;
1006  uint16_t bit = (pattern >> i) & 0x1;
1007  //equivalent to hitPattern[pos / 16] += bit << ((offset + i) % 16);
1008  hitPattern[pos >> 4] += bit << ((offset + i) & (16 - 1));
1009  }
1010  hitCount++;
1011 }
static const unsigned short HIT_LENGTH
Definition: HitPattern.h:168
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:473
uint8_t hitCount
Definition: HitPattern.h:474
bool HitPattern::insertTrackHit ( const uint16_t  pattern)
private

Definition at line 1013 of file HitPattern.cc.

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

Referenced by appendHit().

1014 {
1015  // if begin is 0, this is the first hit of this type being inserted, so
1016  // we need to update begin so it points to the correct index, the first
1017  // empty index.
1018  // unlikely, because it will happen only when inserting
1019  // the first hit of this type
1020  if UNLIKELY((0 == beginTrackHits && 0 == endTrackHits)) {
1022  // before the first hit of this type is inserted, there are no hits
1024  }
1025 
1026  insertHit(pattern);
1027  endTrackHits++;
1028 
1029  return true;
1030 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1001
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint8_t hitCount
Definition: HitPattern.h:474
#define UNLIKELY(x)
reco::HitPattern::int::test::TestHitPattern::test ( )
private
uint16_t HitPattern::isStereo ( DetId  i,
const TrackerTopology ttopo 
)
staticprivate

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

888 {
889  if (i.det() != DetId::Tracker) {
890  return 0;
891  }
892 
893  switch (i.subdetId()) {
896  return 0;
898  return ttopo.tibIsStereo(i);
900  return ttopo.tidIsStereo(i);
902  return ttopo.tobIsStereo(i);
904  return ttopo.tecIsStereo(i);
905  default:
906  return 0;
907  }
908 }
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 1187 of file HitPattern.h.

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

Definition at line 1182 of file HitPattern.h.

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

Definition at line 1177 of file HitPattern.h.

1178 {
1179  return muonStations(5, 0);
1180 }
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:910
bool reco::HitPattern::missingHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 793 of file HitPattern.h.

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

794 {
796 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:734
bool reco::HitPattern::muonCSCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 641 of file HitPattern.h.

References MuonSubdetId::CSC, and UNLIKELY.

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

642 {
644  return false;
645  }
646 
647  uint32_t substructure = getSubStructure(pattern);
648  return (substructure == (uint32_t) MuonSubdetId::CSC);
649 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
static constexpr int CSC
Definition: MuonSubdetId.h:13
#define UNLIKELY(x)
bool reco::HitPattern::muonDTHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 631 of file HitPattern.h.

References MuonSubdetId::DT, and UNLIKELY.

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

632 {
634  return false;
635  }
636 
637  uint32_t substructure = getSubStructure(pattern);
638  return (substructure == (uint32_t) MuonSubdetId::DT);
639 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
static constexpr int DT
Definition: MuonSubdetId.h:12
#define UNLIKELY(x)
bool reco::HitPattern::muonGEMHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 661 of file HitPattern.h.

References MuonSubdetId::GEM, and UNLIKELY.

Referenced by printHitPattern().

662 {
664  return false;
665  }
666 
667  uint32_t substructure = getSubStructure(pattern);
668  return (substructure == (uint32_t) MuonSubdetId::GEM);
669 }
static constexpr int GEM
Definition: MuonSubdetId.h:15
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
#define UNLIKELY(x)
bool reco::HitPattern::muonHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 683 of file HitPattern.h.

References UNLIKELY.

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

684 {
686  return false;
687  }
688 
689  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 0);
690 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:172
static const unsigned short SubDetectorMask
Definition: HitPattern.h:440
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:439
#define UNLIKELY(x)
bool reco::HitPattern::muonME0HitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 671 of file HitPattern.h.

References MuonSubdetId::ME0, and UNLIKELY.

Referenced by printHitPattern().

671  {
673  uint16_t substructure = getSubStructure(pattern);
674  return (substructure == (uint16_t) MuonSubdetId::ME0);
675 }
return((rh^lh)&mask)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
#define UNLIKELY(x)
bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 651 of file HitPattern.h.

References MuonSubdetId::RPC, and UNLIKELY.

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

652 {
654  return false;
655  }
656 
657  uint32_t substructure = getSubStructure(pattern);
658  return (substructure == (uint32_t) MuonSubdetId::RPC);
659 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
static constexpr 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 910 of file HitPattern.cc.

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

911 {
912  int stations[4] = {0, 0, 0, 0};
913  for (int i = beginTrackHits; i < endTrackHits; ++i) {
915  if (muonHitFilter(pattern)
916  && (subdet == 0 || int(getSubStructure(pattern)) == subdet)
917  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
918  stations[getMuonStation(pattern) - 1] = 1;
919  }
920  }
921 
922  return stations[0] + stations[1] + stations[2] + stations[3];
923 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:734
uint8_t beginTrackHits
Definition: HitPattern.h:476
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
uint8_t endTrackHits
Definition: HitPattern.h:477
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
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:743
int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 1112 of file HitPattern.h.

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

Definition at line 1107 of file HitPattern.h.

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

Definition at line 1102 of file HitPattern.h.

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

Definition at line 814 of file HitPattern.h.

815 {
817 }
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:526
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 982 of file HitPattern.h.

983 {
985 }
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:803
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:526
int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 997 of file HitPattern.h.

998 {
1000 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:641
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 992 of file HitPattern.h.

993 {
995 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:631
int reco::HitPattern::numberOfBadMuonGEMHits ( ) const
inline

Definition at line 1007 of file HitPattern.h.

1008 {
1010 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:661
int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 987 of file HitPattern.h.

988 {
990 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
int reco::HitPattern::numberOfBadMuonME0Hits ( ) const
inline

Definition at line 1012 of file HitPattern.h.

1012  {
1014 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:671
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 1002 of file HitPattern.h.

1003 {
1005 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:651
int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 985 of file HitPattern.cc.

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

986 {
987  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
988  for (int i = beginTrackHits; i < endTrackHits; ++i) {
990  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
991  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
992  }
993  }
994 
995  return stations[0][0] * stations[0][1]
996  + stations[1][0] * stations[1][1]
997  + stations[2][0] * stations[2][1]
998  + stations[3][0] * stations[3][1];
999 }
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:748
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:631
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:743
int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 958 of file HitPattern.cc.

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

959 {
960  int stations[4] = {0, 0, 0, 0};
961  for (int i = beginTrackHits; i < endTrackHits; ++i) {
963 
964  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
965  && getDTSuperLayer(pattern) != 2) {
966  stations[getMuonStation(pattern) - 1] = 1;
967  }
968  }
969  return stations[0] + stations[1] + stations[2] + stations[3];
970 }
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:748
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:631
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:743
int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 972 of file HitPattern.cc.

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

973 {
974  int stations[4] = {0, 0, 0, 0};
975  for (int i = beginTrackHits; i < endTrackHits; ++i) {
977  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
978  && getDTSuperLayer(pattern) == 2) {
979  stations[getMuonStation(pattern) - 1] = 1;
980  }
981  }
982  return stations[0] + stations[1] + stations[2] + stations[3];
983 }
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:748
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:631
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:743
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 1016 of file HitPattern.h.

1017 {
1019 }
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:526
int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 1021 of file HitPattern.h.

1022 {
1024 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:798
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
int reco::HitPattern::numberOfLostHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 963 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

964 {
966 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:641
int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 958 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

959 {
961 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:631
int reco::HitPattern::numberOfLostMuonGEMHits ( ) const
inline

Definition at line 973 of file HitPattern.h.

974 {
976 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:661
int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 913 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

914 {
916 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
int reco::HitPattern::numberOfLostMuonME0Hits ( ) const
inline

Definition at line 978 of file HitPattern.h.

978  {
980 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:671
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 968 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

969 {
971 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:651
int reco::HitPattern::numberOfLostPixelBarrelHits ( HitCategory  category) const
inline

Definition at line 923 of file HitPattern.h.

924 {
926 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:576
int reco::HitPattern::numberOfLostPixelEndcapHits ( HitCategory  category) const
inline

Definition at line 928 of file HitPattern.h.

929 {
931 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:586
int reco::HitPattern::numberOfLostPixelHits ( HitCategory  category) const
inline

Definition at line 918 of file HitPattern.h.

919 {
921 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:565
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
int reco::HitPattern::numberOfLostStripHits ( HitCategory  category) const
inline

Definition at line 933 of file HitPattern.h.

934 {
936 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:596
int reco::HitPattern::numberOfLostStripTECHits ( HitCategory  category) const
inline

Definition at line 953 of file HitPattern.h.

954 {
956 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:626
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
int reco::HitPattern::numberOfLostStripTIBHits ( HitCategory  category) const
inline

Definition at line 938 of file HitPattern.h.

939 {
941 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:611
int reco::HitPattern::numberOfLostStripTIDHits ( HitCategory  category) const
inline

Definition at line 943 of file HitPattern.h.

944 {
946 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:616
int reco::HitPattern::numberOfLostStripTOBHits ( HitCategory  category) const
inline

Definition at line 948 of file HitPattern.h.

949 {
951 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:793
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:621
int reco::HitPattern::numberOfLostTrackerHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 819 of file HitPattern.h.

820 {
822 }
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:526
int reco::HitPattern::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 884 of file HitPattern.h.

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

885 {
887 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:641
int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 879 of file HitPattern.h.

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

880 {
882 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:631
int reco::HitPattern::numberOfValidMuonGEMHits ( ) const
inline

Definition at line 894 of file HitPattern.h.

Referenced by MuonTrackValidator::analyze().

895 {
897 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:661
int reco::HitPattern::numberOfValidMuonHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonME0Hits ( ) const
inline

Definition at line 899 of file HitPattern.h.

Referenced by MuonTrackValidator::analyze().

899  {
901 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:671
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 889 of file HitPattern.h.

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

890 {
892 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:651
int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelHits ( ) const
inline

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

840 {
842 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:565
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
int reco::HitPattern::numberOfValidStripHits ( ) const
inline
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

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

344 {
345  bool hasMono[SubstrMask + 1][LayerMask + 1];
346  bool hasStereo[SubstrMask + 1][LayerMask + 1];
347  memset(hasMono, 0, sizeof(hasMono));
348  memset(hasStereo, 0, sizeof(hasStereo));
349 
350  // mark which layers have mono/stereo hits
351  for (int i = beginTrackHits; i < endTrackHits; ++i) {
353  uint16_t subStructure = getSubStructure(pattern);
354 
355  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
356  if (stripdet != 0 && subStructure != stripdet) {
357  continue;
358  }
359 
360  if (layer != 0 && getSubSubStructure(pattern) != layer) {
361  continue;
362  }
363 
364  switch (getSide(pattern)) {
365  case 0: // mono
366  hasMono[subStructure][getLayer(pattern)] = true;
367  break;
368  case 1: // stereo
369  hasStereo[subStructure][getLayer(pattern)] = true;
370  break;
371  default:
372  ;
373  break;
374  }
375  }
376  }
377 
378  // count how many layers have mono and stereo hits
379  int count = 0;
380  for (int i = 0; i < SubstrMask + 1; ++i) {
381  for (int j = 0; j < LayerMask + 1; ++j) {
382  if (hasMono[i][j] && hasStereo[i][j]) {
383  count++;
384  }
385  }
386  }
387  return count;
388 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:701
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:596
uint8_t beginTrackHits
Definition: HitPattern.h:476
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
uint8_t endTrackHits
Definition: HitPattern.h:477
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:725
static const unsigned short SubstrMask
Definition: HitPattern.h:436
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:706
static const unsigned short LayerMask
Definition: HitPattern.h:432
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( ) const

Definition at line 390 of file HitPattern.cc.

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

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

391 {
392  auto category = TRACK_HITS;
393  std::bitset<128> side[2];
394  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
395  for (int i = range.first; i < range.second; ++i) {
397  if (pattern<minStripWord) continue;
398  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
399  if (hitType != HIT_TYPE::VALID) continue;
400  auto apattern = (pattern-minTrackerWord) >> LayerOffset;
401  // assert(apattern<128);
402  side[getSide(pattern)].set(apattern);
403  }
404  // assert(numberOfValidStripLayersWithMonoAndStereo(0, 0)==int((side[0]&side[1]).count()));
405  return (side[0]&side[1]).count();
406 
407 
408 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:424
static const unsigned short minTrackerWord
Definition: HitPattern.h:442
static const unsigned short HitTypeOffset
Definition: HitPattern.h:423
static const unsigned short minStripWord
Definition: HitPattern.h:444
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static uint32_t getSide(uint16_t pattern)
Definition: HitPattern.h:725
static const unsigned short LayerOffset
Definition: HitPattern.h:431
int reco::HitPattern::numberOfValidStripTECHits ( ) const
inline

Definition at line 874 of file HitPattern.h.

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

875 {
877 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:626
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 864 of file HitPattern.h.

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

865 {
867 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:552
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:616
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 HitPattern::numberOfValidTOBLayersWithMonoAndStereo ( uint32_t  layer = 0) const
int reco::HitPattern::numberOfValidTrackerHits ( ) const
inline
HitPattern & HitPattern::operator= ( const HitPattern other)

Definition at line 47 of file HitPattern.cc.

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

48 {
49  if (this == &other) {
50  return *this;
51  }
52 
53  this->hitCount = other.hitCount;
54 
55  this->beginTrackHits = other.beginTrackHits;
56  this->endTrackHits = other.endTrackHits;
57 
58  this->beginInner = other.beginInner;
59  this->endInner = other.endInner;
60 
61  this->beginOuter = other.beginOuter;
62  this->endOuter = other.endOuter;
63 
64  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
65 
66  return *this;
67 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:167
uint8_t endInner
Definition: HitPattern.h:479
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:473
uint8_t beginInner
Definition: HitPattern.h:478
uint8_t beginTrackHits
Definition: HitPattern.h:476
uint8_t endTrackHits
Definition: HitPattern.h:477
uint8_t hitCount
Definition: HitPattern.h:474
uint8_t beginOuter
Definition: HitPattern.h:480
uint8_t endOuter
Definition: HitPattern.h:481
int reco::HitPattern::outermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1217 of file HitPattern.h.

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

Definition at line 1212 of file HitPattern.h.

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

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

Definition at line 942 of file HitPattern.cc.

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

943 {
944  int ret = 0;
945  for (int i = beginTrackHits; i < endTrackHits; ++i) {
947  if (muonHitFilter(pattern) &&
948  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
949  int stat = getMuonStation(pattern);
950  if (ret == 0 || stat > ret) {
951  ret = stat;
952  }
953  }
954  }
955  return ret;
956 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:734
uint8_t beginTrackHits
Definition: HitPattern.h:476
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
uint8_t endTrackHits
Definition: HitPattern.h:477
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
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:743
int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 1207 of file HitPattern.h.

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

Definition at line 576 of file HitPattern.h.

References PixelSubdetector::PixelBarrel, and UNLIKELY.

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

577 {
579  return false;
580  }
581 
582  uint32_t substructure = getSubStructure(pattern);
583  return (substructure == PixelSubdetector::PixelBarrel);
584 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
#define UNLIKELY(x)
int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 766 of file HitPattern.cc.

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

767 {
768  int count = 0;
769  uint16_t NPixBarrel = 4;
770  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
772  count++;
773  }
774  }
775  return count;
776 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::pixelBarrelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 697 of file HitPattern.cc.

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

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

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

561 {
562  int count = 0;
563  uint16_t NPixBarrel = 4;
564  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
565  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::VALID) {
566  count++;
567  }
568  }
569  return count;
570 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::pixelBarrelLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 628 of file HitPattern.cc.

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

629 {
630  int count = 0;
631  uint16_t NPixBarrel = 4;
632  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
633  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::MISSING) {
634  count++;
635  }
636  }
637  return count;
638 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
bool reco::HitPattern::pixelEndcapHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 586 of file HitPattern.h.

References PixelSubdetector::PixelEndcap, and UNLIKELY.

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

587 {
589  return false;
590  }
591 
592  uint32_t substructure = getSubStructure(pattern);
593  return (substructure == PixelSubdetector::PixelEndcap);
594 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
#define UNLIKELY(x)
int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 778 of file HitPattern.cc.

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

779 {
780  int count = 0;
781  uint16_t NPixForward = 3;
782  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
784  count++;
785  }
786  }
787  return count;
788 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::pixelEndcapLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 709 of file HitPattern.cc.

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

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

Definition at line 572 of file HitPattern.cc.

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

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

573 {
574  int count = 0;
575  uint16_t NPixForward = 3;
576  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
577  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::VALID) {
578  count++;
579  }
580  }
581  return count;
582 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::pixelEndcapLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 640 of file HitPattern.cc.

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

641 {
642  int count = 0;
643  uint16_t NPixForward = 3;
644  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
645  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::MISSING) {
646  count++;
647  }
648  }
649  return count;
650 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
bool reco::HitPattern::pixelHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 565 of file HitPattern.h.

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

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

566 {
568  return false;
569  }
570 
571  uint32_t substructure = getSubStructure(pattern);
572  return (substructure == PixelSubdetector::PixelBarrel ||
573  substructure == PixelSubdetector::PixelEndcap);
574 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
#define UNLIKELY(x)
int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 1088 of file HitPattern.h.

1089 {
1090  return pixelBarrelLayersNull() +
1092 }
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:766
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:778
int reco::HitPattern::pixelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1068 of file HitPattern.h.

1069 {
1072 }
int pixelBarrelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:697
int pixelEndcapLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:709
int HitPattern::pixelLayersWithMeasurement ( ) const

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

501  {
502  auto category = TRACK_HITS;
503  std::bitset<128> layerOk;
504  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
505  for (int i = range.first; i < range.second; ++i) {
507  if UNLIKELY(!trackerHitFilter(pattern)) continue;
508  if (pattern>minStripWord) continue;
509  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
510  if (hitType != HIT_TYPE::VALID) continue;
512  // assert(pattern<128);
513  layerOk.set(pattern);
514  }
515  // assert(pixelLayersWithMeasurementOld()==int(layerOk.count()));
516  return layerOk.count();
517 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:424
return((rh^lh)&mask)
static const unsigned short minTrackerWord
Definition: HitPattern.h:442
static const unsigned short HitTypeOffset
Definition: HitPattern.h:423
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
static const unsigned short minStripWord
Definition: HitPattern.h:444
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static const unsigned short LayerOffset
Definition: HitPattern.h:431
#define UNLIKELY(x)
int reco::HitPattern::pixelLayersWithMeasurementOld ( ) const
inline

Definition at line 1031 of file HitPattern.h.

1032 {
1034 }
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:572
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:560
int reco::HitPattern::pixelLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1048 of file HitPattern.h.

1049 {
1052 }
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:628
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:640
void HitPattern::print ( HitCategory  category,
std::ostream &  stream = std::cout 
) const

Definition at line 870 of file HitPattern.cc.

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

871 {
872  stream << "HitPattern" << std::endl;
873  for (int i = 0; i < numberOfAllHits(category); ++i) {
874  printHitPattern(category, i, stream);
875  }
876  std::ios_base::fmtflags flags = stream.flags();
877  stream.setf(std::ios_base::hex, std::ios_base::basefield);
878  stream.setf(std::ios_base::showbase);
879 
880  for (int i = 0; i < this->numberOfAllHits(category); ++i) {
881  stream << getHitPattern(category, i) << std::endl;
882  }
883 
884  stream.flags(flags);
885 }
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:834
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:808
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:516
void HitPattern::printHitPattern ( HitCategory  category,
int  position,
std::ostream &  stream 
) const

Definition at line 834 of file HitPattern.cc.

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

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

835 {
836  uint16_t pattern = getHitPattern(category, position);
837  stream << "\t";
838  if (muonHitFilter(pattern)) {
839  stream << "muon";
840  } else if (trackerHitFilter(pattern)) {
841  stream << "tracker";
842  }
843 
844  stream << "\tsubstructure " << getSubStructure(pattern);
845  if (muonHitFilter(pattern)) {
846  stream << "\tstation " << getMuonStation(pattern);
847  if (muonDTHitFilter(pattern)) {
848  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
849  } else if (muonCSCHitFilter(pattern)) {
850  stream << "\tcsc ring " << getCSCRing(pattern);
851  } else if (muonRPCHitFilter(pattern)) {
852  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel")
853  << ", layer " << getRPCLayer(pattern);
854  } else if (muonGEMHitFilter(pattern)) {
855  stream << "\tgem " << (getGEMLayer(pattern) ? "layer1" : "layer2")
856  << ", station " << getGEMStation(pattern);
857  } else if (muonME0HitFilter(pattern)) {
858  stream << "\tme0 ";
859  } else {
860  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure "
861  << getSubStructure(pattern);
862  }
863  } else {
864  stream << "\tlayer " << getLayer(pattern);
865  }
866  stream << "\thit type " << getHitType(pattern);
867  stream << std::endl;
868 }
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:753
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:701
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:748
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:671
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:783
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:641
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:734
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:770
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:661
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:776
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:683
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:631
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:758
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:743
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:516
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:651
int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 1157 of file HitPattern.h.

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

Definition at line 1152 of file HitPattern.h.

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

Definition at line 1147 of file HitPattern.h.

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

Definition at line 596 of file HitPattern.h.

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

597 {
598  return pattern > minStripWord;
599 }
static const unsigned short minStripWord
Definition: HitPattern.h:444
int reco::HitPattern::stripLayersNull ( ) const
inline

Definition at line 1094 of file HitPattern.h.

1095 {
1096  return stripTIBLayersNull() +
1097  stripTIDLayersNull() +
1098  stripTOBLayersNull() +
1100 }
int stripTIBLayersNull() const
Definition: HitPattern.cc:790
int stripTECLayersNull() const
Definition: HitPattern.cc:823
int stripTIDLayersNull() const
Definition: HitPattern.cc:801
int stripTOBLayersNull() const
Definition: HitPattern.cc:812
int reco::HitPattern::stripLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1074 of file HitPattern.h.

1075 {
1080 }
int stripTOBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:743
int stripTIBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:721
int stripTIDLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:732
int stripTECLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:755
int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline
int reco::HitPattern::stripLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1054 of file HitPattern.h.

1055 {
1060 }
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:674
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:663
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:685
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:652
bool reco::HitPattern::stripSubdetectorHitFilter ( uint16_t  pattern,
StripSubdetector::SubDetector  substructure 
)
inlinestaticprivate

Definition at line 602 of file HitPattern.h.

References UNLIKELY.

603 {
605  return false;
606  }
607 
608  return substructure == getSubStructure(pattern);
609 }
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:692
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
#define UNLIKELY(x)
bool reco::HitPattern::stripTECHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 626 of file HitPattern.h.

References StripSubdetector::TEC.

627 {
629 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:602
int HitPattern::stripTECLayersNull ( ) const

Definition at line 823 of file HitPattern.cc.

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

824 {
825  int count = 0;
826  for (uint16_t layer = 1; layer <= 9; layer++) {
828  count++;
829  }
830  }
831  return count;
832 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::stripTECLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 755 of file HitPattern.cc.

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

756 {
757  int count = 0;
758  for (uint16_t layer = 1; layer <= 9; layer++) {
759  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::INACTIVE) {
760  count++;
761  }
762  }
763  return count;
764 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::stripTECLayersWithMeasurement ( ) const

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

618 {
619  int count = 0;
620  for (uint16_t layer = 1; layer <= 9; layer++) {
621  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::VALID) {
622  count++;
623  }
624  }
625  return count;
626 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::stripTECLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 685 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

686 {
687  int count = 0;
688  for (uint16_t layer = 1; layer <= 9; layer++) {
689  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::MISSING) {
690  count++;
691  }
692  }
693  return count;
694 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
bool reco::HitPattern::stripTIBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 611 of file HitPattern.h.

References StripSubdetector::TIB.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef().

612 {
614 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:602
int HitPattern::stripTIBLayersNull ( ) const

Definition at line 790 of file HitPattern.cc.

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

791 {
792  int count = 0;
793  for (uint16_t layer = 1; layer <= 4; layer++) {
795  count++;
796  }
797  }
798  return count;
799 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::stripTIBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 721 of file HitPattern.cc.

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

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

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

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

Definition at line 652 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

653 {
654  int count = 0;
655  for (uint16_t layer = 1; layer <= 4; layer++) {
656  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::MISSING) {
657  count++;
658  }
659  }
660  return count;
661 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
bool reco::HitPattern::stripTIDHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 616 of file HitPattern.h.

References StripSubdetector::TID.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef().

617 {
619 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:602
int HitPattern::stripTIDLayersNull ( ) const

Definition at line 801 of file HitPattern.cc.

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

802 {
803  int count = 0;
804  for (uint16_t layer = 1; layer <= 3; layer++) {
806  count++;
807  }
808  }
809  return count;
810 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::stripTIDLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 732 of file HitPattern.cc.

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

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

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

596 {
597  int count = 0;
598  for (uint16_t layer = 1; layer <= 3; layer++) {
599  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::VALID) {
600  count++;
601  }
602  }
603  return count;
604 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::stripTIDLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 663 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

664 {
665  int count = 0;
666  for (uint16_t layer = 1; layer <= 3; layer++) {
667  if (getTrackerLayerCase(category, StripSubdetector::TID, layer) == HIT_TYPE::MISSING) {
668  count++;
669  }
670  }
671  return count;
672 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
bool reco::HitPattern::stripTOBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 621 of file HitPattern.h.

References StripSubdetector::TOB.

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

Definition at line 812 of file HitPattern.cc.

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

813 {
814  int count = 0;
815  for (uint16_t layer = 1; layer <= 6; layer++) {
817  count++;
818  }
819  }
820  return count;
821 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:171
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::stripTOBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 743 of file HitPattern.cc.

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

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

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

607 {
608  int count = 0;
609  for (uint16_t layer = 1; layer <= 6; layer++) {
610  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::VALID) {
611  count++;
612  }
613  }
614  return count;
615 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
int HitPattern::stripTOBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 674 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

675 {
676  int count = 0;
677  for (uint16_t layer = 1; layer <= 6; layer++) {
678  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::MISSING) {
679  count++;
680  }
681  }
682  return count;
683 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:430
bool reco::HitPattern::trackerHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 1082 of file HitPattern.h.

1083 {
1084  return pixelLayersNull() +
1085  stripLayersNull();
1086 }
int pixelLayersNull() const
Definition: HitPattern.h:1088
int stripLayersNull() const
Definition: HitPattern.h:1094
int reco::HitPattern::trackerLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1062 of file HitPattern.h.

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

1063 {
1066 }
int pixelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1068
int stripLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1074
int HitPattern::trackerLayersWithMeasurement ( ) const

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

520  {
521  auto category = TRACK_HITS;
522  std::bitset<128> layerOk;
523  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
524  for (int i = range.first; i < range.second; ++i) {
526  if UNLIKELY(!trackerHitFilter(pattern)) continue;
527  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
528  if (hitType != HIT_TYPE::VALID) continue;
530  // assert(pattern<128);
531  layerOk.set(pattern);
532  }
533  // assert(trackerLayersWithMeasurementOld()==int(layerOk.count()));
534  return layerOk.count();
535 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:424
return((rh^lh)&mask)
static const unsigned short minTrackerWord
Definition: HitPattern.h:442
static const unsigned short HitTypeOffset
Definition: HitPattern.h:423
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static const unsigned short LayerOffset
Definition: HitPattern.h:431
#define UNLIKELY(x)
int reco::HitPattern::trackerLayersWithMeasurementOld ( ) const
inline

Definition at line 1026 of file HitPattern.h.

1027 {
1029 }
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:501
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1036
int HitPattern::trackerLayersWithoutMeasurement ( HitCategory  category) const

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

537  {
538  std::bitset<128> layerOk;
539  std::bitset<128> layerMissed;
540  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
541  for (int i = range.first; i < range.second; ++i) {
543  if UNLIKELY(!trackerHitFilter(pattern)) continue;
544  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
546  // assert(pattern<128);
547  if (hitType == HIT_TYPE::VALID) layerOk.set(pattern);
548  if (hitType == HIT_TYPE::MISSING) layerMissed.set(pattern);
549  }
550  layerMissed &= ~layerOk;
551 
552  // assert(trackerLayersWithoutMeasurementOld(category)==int(layerMissed.count()));
553 
554  return layerMissed.count();
555 
556 
557 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:424
return((rh^lh)&mask)
static const unsigned short minTrackerWord
Definition: HitPattern.h:442
static const unsigned short HitTypeOffset
Definition: HitPattern.h:423
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:678
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:489
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:286
static const unsigned short LayerOffset
Definition: HitPattern.h:431
#define UNLIKELY(x)
int reco::HitPattern::trackerLayersWithoutMeasurementOld ( HitCategory  category) const
inline

Definition at line 1042 of file HitPattern.h.

1043 {
1046 }
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1048
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1054
bool reco::HitPattern::validHitFilter ( uint16_t  pattern)
inlinestatic

Friends And Related Function Documentation

template<int N>
friend struct PatternSet
friend

Definition at line 486 of file HitPattern.h.

Member Data Documentation

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

Definition at line 167 of file HitPattern.h.

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

uint8_t reco::HitPattern::beginInner
private

Definition at line 478 of file HitPattern.h.

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

uint8_t reco::HitPattern::beginOuter
private

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

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

uint8_t reco::HitPattern::endInner
private

Definition at line 479 of file HitPattern.h.

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

uint8_t reco::HitPattern::endOuter
private

Definition at line 481 of file HitPattern.h.

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

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

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

Referenced by appendHit(), and appendMuonHit().

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

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

Referenced by encode().

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

Definition at line 427 of file HitPattern.h.

Referenced by encode().

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

Definition at line 440 of file HitPattern.h.

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

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

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

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