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)
 

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
 
int test::TestHitPattern::test ()
 

Detailed Description

Definition at line 145 of file HitPattern.h.

Member Typedef Documentation

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

Definition at line 455 of file HitPattern.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MONO 
STEREO 

Definition at line 149 of file HitPattern.h.

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

Definition at line 154 of file HitPattern.h.

Enumerator
TRACK_HITS 
MISSING_INNER_HITS 
MISSING_OUTER_HITS 

Definition at line 161 of file HitPattern.h.

Constructor & Destructor Documentation

HitPattern::HitPattern ( )

Definition at line 16 of file HitPattern.cc.

References ARRAY_LENGTH, EMPTY_PATTERN, and hitPattern.

16  :
17  hitCount(0),
18  beginTrackHits(0),
19  endTrackHits(0),
20  beginInner(0),
21  endInner(0),
22  beginOuter(0),
23  endOuter(0)
24 {
26 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:166
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:171
uint8_t endInner
Definition: HitPattern.h:478
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:472
uint8_t beginInner
Definition: HitPattern.h:477
uint8_t beginTrackHits
Definition: HitPattern.h:475
uint8_t endTrackHits
Definition: HitPattern.h:476
uint8_t hitCount
Definition: HitPattern.h:473
uint8_t beginOuter
Definition: HitPattern.h:479
uint8_t endOuter
Definition: HitPattern.h:480
HitPattern::~HitPattern ( )

Definition at line 40 of file HitPattern.cc.

41 {
42  ;
43 }
HitPattern::HitPattern ( const HitPattern other)

Definition at line 28 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

28  :
29  hitCount(other.hitCount),
32  beginInner(other.beginInner),
33  endInner(other.endInner),
34  beginOuter(other.beginOuter),
35  endOuter(other.endOuter)
36 {
37  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
38 }
static const unsigned short ARRAY_LENGTH
Definition: HitPattern.h:166
uint8_t endInner
Definition: HitPattern.h:478
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:472
uint8_t beginInner
Definition: HitPattern.h:477
uint8_t beginTrackHits
Definition: HitPattern.h:475
uint8_t endTrackHits
Definition: HitPattern.h:476
uint8_t hitCount
Definition: HitPattern.h:473
uint8_t beginOuter
Definition: HitPattern.h:479
uint8_t endOuter
Definition: HitPattern.h:480

Member Function Documentation

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

Definition at line 187 of file HitPattern.cc.

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

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

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

Definition at line 80 of file HitPattern.cc.

References appendHit().

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

Definition at line 192 of file HitPattern.cc.

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

193 {
194  //if HitPattern is full, journey ends no matter what.
196  return false;
197  }
198 
199  uint16_t pattern = HitPattern::encode(id, hitType, ttopo);
200 
201  return appendHit(pattern, hitType);
202 }
static const unsigned short MaxHits
Definition: HitPattern.h:168
#define unlikely(x)
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:187
uint8_t hitCount
Definition: HitPattern.h:473
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:85
bool HitPattern::appendHit ( const uint16_t  pattern,
TrackingRecHit::Type  hitType 
)

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

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

Definition at line 505 of file HitPattern.h.

References end, Exhume::I, and unlikely.

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

506 {
507  for (I hit = begin; hit != end; hit++) {
508  if unlikely((!appendHit(*hit, ttopo))) {
509  return false;
510  }
511  }
512  return true;
513 }
#define unlikely(x)
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:187
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
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 269 of file HitPattern.cc.

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

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

269  {
270  //if HitPattern is full, journey ends no matter what.
272  return false;
273  }
274 
275  if unlikely(id.det() != DetId::Muon) {
276  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";
277  }
278 
279  uint16_t detid = id.det();
280  uint16_t subdet = id.subdetId();
281  return appendHit(encode(detid, subdet, encodeMuonLayer(id), 0, hitType), hitType);
282 }
static const unsigned short MaxHits
Definition: HitPattern.h:168
#define unlikely(x)
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:187
uint8_t hitCount
Definition: HitPattern.h:473
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:85
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 265 of file HitPattern.cc.

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

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

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

Definition at line 802 of file HitPattern.h.

References hcaldqm::constants::BAD.

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

Definition at line 539 of file HitPattern.h.

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

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

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

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

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

Definition at line 525 of file HitPattern.h.

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

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

Definition at line 551 of file HitPattern.h.

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

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

Definition at line 1141 of file HitPattern.h.

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

Definition at line 1136 of file HitPattern.h.

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

Definition at line 1131 of file HitPattern.h.

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

Definition at line 1126 of file HitPattern.h.

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

Definition at line 1121 of file HitPattern.h.

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

Definition at line 1116 of file HitPattern.h.

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

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

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

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

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

Definition at line 1171 of file HitPattern.h.

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

Definition at line 1166 of file HitPattern.h.

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

Definition at line 1161 of file HitPattern.h.

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

Definition at line 488 of file HitPattern.h.

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

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

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

Definition at line 752 of file HitPattern.h.

Referenced by printHitPattern().

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

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

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

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

Definition at line 782 of file HitPattern.h.

Referenced by printHitPattern().

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

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

Definition at line 775 of file HitPattern.h.

Referenced by printHitPattern().

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

Definition at line 515 of file HitPattern.h.

References unlikely.

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

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

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

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

Definition at line 733 of file HitPattern.h.

References unlikely.

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

734 {
736  return NULL_RETURN;
737  }
738 
739  return ((pattern >> HitTypeOffset) & HitTypeMask);
740 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:170
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:171
static const unsigned short HitTypeMask
Definition: HitPattern.h:423
#define unlikely(x)
static const unsigned short HitTypeOffset
Definition: HitPattern.h:422
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 742 of file HitPattern.h.

Referenced by innermostMuonStationWithHits(), muonStations(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), outermostMuonStationWithHits(), and printHitPattern().

743 {
744  return (getSubSubStructure(pattern) >> 2) + 1;
745 }
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:705
uint16_t reco::HitPattern::getRPCLayer ( uint16_t  pattern)
inlinestatic

RPC layer: for station 1 and 2, layer = 1(inner) or 2(outer); for station 3, 4 layer is always 0. Only valid for muon RPC patterns, of course.

Definition at line 757 of file HitPattern.h.

References likely.

Referenced by printHitPattern().

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

Referenced by printHitPattern().

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

Definition at line 724 of file HitPattern.h.

References unlikely.

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

725 {
727  return NULL_RETURN;
728  }
729 
730  return (pattern >> SideOffset) & SideMask;
731 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:170
static const unsigned short SideOffset
Definition: HitPattern.h:426
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:171
#define unlikely(x)
static const unsigned short SideMask
Definition: HitPattern.h:427
uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 714 of file HitPattern.h.

References unlikely.

715 {
717  return NULL_RETURN;
718  }
719 
720  return ((pattern >> SubDetectorOffset) & SubDetectorMask);
721 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:170
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:171
#define unlikely(x)
static const unsigned short SubDetectorMask
Definition: HitPattern.h:439
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:438
uint32_t reco::HitPattern::getSubStructure ( uint16_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getSubSubStructure ( uint16_t  pattern)
inlinestatic

Definition at line 705 of file HitPattern.h.

References unlikely.

Referenced by numberOfValidStripLayersWithMonoAndStereo().

706 {
708  return NULL_RETURN;
709  }
710 
711  return ((pattern >> LayerOffset) & LayerMask);
712 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:170
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:171
#define unlikely(x)
static const unsigned short LayerOffset
Definition: HitPattern.h:430
static const unsigned short LayerMask
Definition: HitPattern.h:431
uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

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

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

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

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

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

328 {
329  for (int i = beginTrackHits; i < endTrackHits; ++i) {
331  bool pixelHitFilter = ( (det==1 && pixelBarrelHitFilter(pattern)) ||
332  (det==2 && pixelEndcapHitFilter(pattern)) );
333  if (pixelHitFilter && (getLayer(pattern) == layer) && validHitFilter(pattern)) {
334  return true;
335  }
336  }
337  return false;
338 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:700
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:564
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:575
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:585
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
uint8_t beginTrackHits
Definition: HitPattern.h:475
uint8_t endTrackHits
Definition: HitPattern.h:476
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
bool reco::HitPattern::inactiveHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 797 of file HitPattern.h.

798 {
800 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:733
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1201 of file HitPattern.h.

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

Definition at line 1196 of file HitPattern.h.

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

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

Definition at line 923 of file HitPattern.cc.

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

924 {
925  int ret = 0;
926  for (int i = beginTrackHits; i < endTrackHits; ++i) {
928  if (muonHitFilter(pattern)
929  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
930  int stat = getMuonStation(pattern);
931  if (ret == 0 || stat < ret) {
932  ret = stat;
933  }
934  }
935  }
936 
937  return ret;
938 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:733
uint8_t beginTrackHits
Definition: HitPattern.h:475
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
uint8_t endTrackHits
Definition: HitPattern.h:476
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
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:742
int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 1191 of file HitPattern.h.

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

Definition at line 1030 of file HitPattern.cc.

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

Referenced by appendHit().

1031 {
1032  if unlikely((0 == beginInner && 0 == endInner)) {
1033  beginInner = hitCount;
1034  endInner = beginInner;
1035  }
1036 
1037  insertHit(pattern);
1038  endInner++;
1039 
1040  return true;
1041 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:999
#define unlikely(x)
uint8_t endInner
Definition: HitPattern.h:478
uint8_t beginInner
Definition: HitPattern.h:477
uint8_t hitCount
Definition: HitPattern.h:473
bool HitPattern::insertExpectedOuterHit ( const uint16_t  pattern)
private

Definition at line 1043 of file HitPattern.cc.

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

Referenced by appendHit().

1044 {
1045  if unlikely((0 == beginOuter && 0 == endOuter)) {
1046  beginOuter = hitCount;
1047  endOuter = beginOuter;
1048  }
1049 
1050  insertHit(pattern);
1051  endOuter++;
1052 
1053  return true;
1054 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:999
#define unlikely(x)
uint8_t hitCount
Definition: HitPattern.h:473
uint8_t beginOuter
Definition: HitPattern.h:479
uint8_t endOuter
Definition: HitPattern.h:480
void HitPattern::insertHit ( const uint16_t  pattern)
private

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

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

Definition at line 1011 of file HitPattern.cc.

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

Referenced by appendHit().

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

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

886 {
887  if (i.det() != DetId::Tracker) {
888  return 0;
889  }
890 
891  switch (i.subdetId()) {
894  return 0;
896  return ttopo.tibIsStereo(i);
898  return ttopo.tidIsStereo(i);
900  return ttopo.tobIsStereo(i);
902  return ttopo.tecIsStereo(i);
903  default:
904  return 0;
905  }
906 }
bool tobIsStereo(const DetId &id) const
bool tidIsStereo(const DetId &id) const
bool tecIsStereo(const DetId &id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool tibIsStereo(const DetId &id) const
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
int reco::HitPattern::me0StationsWithAnyHits ( ) const
inline

Definition at line 1186 of file HitPattern.h.

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

Definition at line 1181 of file HitPattern.h.

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

Definition at line 1176 of file HitPattern.h.

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

Definition at line 792 of file HitPattern.h.

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

793 {
795 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:733
bool reco::HitPattern::muonCSCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 640 of file HitPattern.h.

References MuonSubdetId::CSC, and unlikely.

Referenced by printHitPattern().

641 {
643  return false;
644  }
645 
646  uint32_t substructure = getSubStructure(pattern);
647  return (substructure == (uint32_t) MuonSubdetId::CSC);
648 }
#define unlikely(x)
static const int CSC
Definition: MuonSubdetId.h:13
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
bool reco::HitPattern::muonDTHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 630 of file HitPattern.h.

References MuonSubdetId::DT, and unlikely.

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

631 {
633  return false;
634  }
635 
636  uint32_t substructure = getSubStructure(pattern);
637  return (substructure == (uint32_t) MuonSubdetId::DT);
638 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
static const int DT
Definition: MuonSubdetId.h:12
bool reco::HitPattern::muonGEMHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 660 of file HitPattern.h.

References MuonSubdetId::GEM, and unlikely.

Referenced by printHitPattern().

661 {
663  return false;
664  }
665 
666  uint32_t substructure = getSubStructure(pattern);
667  return (substructure == (uint32_t) MuonSubdetId::GEM);
668 }
static const int GEM
Definition: MuonSubdetId.h:15
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
bool reco::HitPattern::muonHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 682 of file HitPattern.h.

References unlikely.

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

683 {
685  return false;
686  }
687 
688  return (((pattern >> SubDetectorOffset) & SubDetectorMask) == 0);
689 }
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:171
#define unlikely(x)
static const unsigned short SubDetectorMask
Definition: HitPattern.h:439
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:438
bool reco::HitPattern::muonME0HitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 670 of file HitPattern.h.

References MuonSubdetId::ME0, and unlikely.

Referenced by printHitPattern().

670  {
672  uint16_t substructure = getSubStructure(pattern);
673  return (substructure == (uint16_t) MuonSubdetId::ME0);
674 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
return(e1-e2)*(e1-e2)+dp *dp
bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 650 of file HitPattern.h.

References MuonSubdetId::RPC, and unlikely.

Referenced by printHitPattern().

651 {
653  return false;
654  }
655 
656  uint32_t substructure = getSubStructure(pattern);
657  return (substructure == (uint32_t) MuonSubdetId::RPC);
658 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
static const int RPC
Definition: MuonSubdetId.h:14
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 908 of file HitPattern.cc.

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

909 {
910  int stations[4] = {0, 0, 0, 0};
911  for (int i = beginTrackHits; i < endTrackHits; ++i) {
913  if (muonHitFilter(pattern)
914  && (subdet == 0 || int(getSubStructure(pattern)) == subdet)
915  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
916  stations[getMuonStation(pattern) - 1] = 1;
917  }
918  }
919 
920  return stations[0] + stations[1] + stations[2] + stations[3];
921 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:733
uint8_t beginTrackHits
Definition: HitPattern.h:475
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
uint8_t endTrackHits
Definition: HitPattern.h:476
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
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:742
int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 1111 of file HitPattern.h.

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

Definition at line 1106 of file HitPattern.h.

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

Definition at line 1101 of file HitPattern.h.

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

Definition at line 813 of file HitPattern.h.

814 {
816 }
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:525
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 981 of file HitPattern.h.

982 {
984 }
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:802
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:525
int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 996 of file HitPattern.h.

997 {
999 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:640
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 991 of file HitPattern.h.

992 {
994 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
int reco::HitPattern::numberOfBadMuonGEMHits ( ) const
inline

Definition at line 1006 of file HitPattern.h.

1007 {
1009 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 986 of file HitPattern.h.

987 {
989 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
int reco::HitPattern::numberOfBadMuonME0Hits ( ) const
inline

Definition at line 1011 of file HitPattern.h.

1011  {
1013 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:670
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 1001 of file HitPattern.h.

1002 {
1004 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:650
int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 983 of file HitPattern.cc.

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

984 {
985  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
986  for (int i = beginTrackHits; i < endTrackHits; ++i) {
988  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
989  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
990  }
991  }
992 
993  return stations[0][0] * stations[0][1]
994  + stations[1][0] * stations[1][1]
995  + stations[2][0] * stations[2][1]
996  + stations[3][0] * stations[3][1];
997 }
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:747
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
uint8_t beginTrackHits
Definition: HitPattern.h:475
uint8_t endTrackHits
Definition: HitPattern.h:476
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
Definition: HitPattern.h:742
int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 956 of file HitPattern.cc.

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

957 {
958  int stations[4] = {0, 0, 0, 0};
959  for (int i = beginTrackHits; i < endTrackHits; ++i) {
961 
962  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
963  && getDTSuperLayer(pattern) != 2) {
964  stations[getMuonStation(pattern) - 1] = 1;
965  }
966  }
967  return stations[0] + stations[1] + stations[2] + stations[3];
968 }
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:747
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
uint8_t beginTrackHits
Definition: HitPattern.h:475
uint8_t endTrackHits
Definition: HitPattern.h:476
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
Definition: HitPattern.h:742
int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 970 of file HitPattern.cc.

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

971 {
972  int stations[4] = {0, 0, 0, 0};
973  for (int i = beginTrackHits; i < endTrackHits; ++i) {
975  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
976  && getDTSuperLayer(pattern) == 2) {
977  stations[getMuonStation(pattern) - 1] = 1;
978  }
979  }
980  return stations[0] + stations[1] + stations[2] + stations[3];
981 }
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:747
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
uint8_t beginTrackHits
Definition: HitPattern.h:475
uint8_t endTrackHits
Definition: HitPattern.h:476
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
Definition: HitPattern.h:742
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 1015 of file HitPattern.h.

1016 {
1018 }
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:525
int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 1020 of file HitPattern.h.

1021 {
1023 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int reco::HitPattern::numberOfLostHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 962 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

963 {
965 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:640
int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 957 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

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

Definition at line 972 of file HitPattern.h.

973 {
975 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 912 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

913 {
915 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
int reco::HitPattern::numberOfLostMuonME0Hits ( ) const
inline

Definition at line 977 of file HitPattern.h.

977  {
979 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:670
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 967 of file HitPattern.h.

Referenced by MuonBadTrackFilter::trackInfo().

968 {
970 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:650
int reco::HitPattern::numberOfLostPixelBarrelHits ( HitCategory  category) const
inline

Definition at line 922 of file HitPattern.h.

923 {
925 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:575
int reco::HitPattern::numberOfLostPixelEndcapHits ( HitCategory  category) const
inline

Definition at line 927 of file HitPattern.h.

928 {
930 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:585
int reco::HitPattern::numberOfLostPixelHits ( HitCategory  category) const
inline

Definition at line 917 of file HitPattern.h.

918 {
920 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:564
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::numberOfLostStripHits ( HitCategory  category) const
inline

Definition at line 932 of file HitPattern.h.

933 {
935 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:595
int reco::HitPattern::numberOfLostStripTECHits ( HitCategory  category) const
inline

Definition at line 952 of file HitPattern.h.

953 {
955 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:625
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int reco::HitPattern::numberOfLostStripTIBHits ( HitCategory  category) const
inline

Definition at line 937 of file HitPattern.h.

938 {
940 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:610
int reco::HitPattern::numberOfLostStripTIDHits ( HitCategory  category) const
inline

Definition at line 942 of file HitPattern.h.

943 {
945 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:615
int reco::HitPattern::numberOfLostStripTOBHits ( HitCategory  category) const
inline

Definition at line 947 of file HitPattern.h.

948 {
950 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:620
int reco::HitPattern::numberOfLostTrackerHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 818 of file HitPattern.h.

819 {
821 }
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:525
int reco::HitPattern::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 883 of file HitPattern.h.

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

884 {
886 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:640
int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 878 of file HitPattern.h.

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

879 {
881 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
int reco::HitPattern::numberOfValidMuonGEMHits ( ) const
inline

Definition at line 893 of file HitPattern.h.

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

894 {
896 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
int reco::HitPattern::numberOfValidMuonHits ( ) const
inline

Definition at line 833 of file HitPattern.h.

Referenced by HLTMuonL3PreFilter::applySelection(), HLTMuonL2SelectorForL3IO::produce(), BPhysicsOniaDQM::selGlobalMuon(), MuScleFitMuonSelector::selGlobalMuon(), MuScleFit::selGlobalMuon(), and MuonBadTrackFilter::trackInfo().

834 {
836 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
int reco::HitPattern::numberOfValidMuonME0Hits ( ) const
inline

Definition at line 898 of file HitPattern.h.

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

898  {
900 }
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:670
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 888 of file HitPattern.h.

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

889 {
891 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:650
int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline
int reco::HitPattern::numberOfValidPixelHits ( ) const
inline

Definition at line 838 of file HitPattern.h.

Referenced by TrackTypeMonitor::analyze(), StandaloneTrackMonitor::analyze(), CheckHitPattern::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()(), 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().

839 {
841 }
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:564
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
int reco::HitPattern::numberOfValidStripHits ( ) const
inline
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

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

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

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

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

Definition at line 873 of file HitPattern.h.

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

874 {
876 }
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:625
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 863 of file HitPattern.h.

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

864 {
866 }
int countTypedHits(HitCategory category, filterType typeFilter, filterType filter) const
Definition: HitPattern.h:551
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:615
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 45 of file HitPattern.cc.

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

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

Definition at line 1216 of file HitPattern.h.

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

Definition at line 1211 of file HitPattern.h.

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

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

Definition at line 940 of file HitPattern.cc.

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

941 {
942  int ret = 0;
943  for (int i = beginTrackHits; i < endTrackHits; ++i) {
945  if (muonHitFilter(pattern) &&
946  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
947  int stat = getMuonStation(pattern);
948  if (ret == 0 || stat > ret) {
949  ret = stat;
950  }
951  }
952  }
953  return ret;
954 }
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:733
uint8_t beginTrackHits
Definition: HitPattern.h:475
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
uint8_t endTrackHits
Definition: HitPattern.h:476
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
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:742
int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 1206 of file HitPattern.h.

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

Definition at line 575 of file HitPattern.h.

References PixelSubdetector::PixelBarrel, and unlikely.

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

576 {
578  return false;
579  }
580 
581  uint32_t substructure = getSubStructure(pattern);
582  return (substructure == PixelSubdetector::PixelBarrel);
583 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 764 of file HitPattern.cc.

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

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

Definition at line 695 of file HitPattern.cc.

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

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

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

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

Definition at line 626 of file HitPattern.cc.

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

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

Definition at line 585 of file HitPattern.h.

References PixelSubdetector::PixelEndcap, and unlikely.

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

586 {
588  return false;
589  }
590 
591  uint32_t substructure = getSubStructure(pattern);
592  return (substructure == PixelSubdetector::PixelEndcap);
593 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 776 of file HitPattern.cc.

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

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

Definition at line 707 of file HitPattern.cc.

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

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

Definition at line 570 of file HitPattern.cc.

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

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

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

Definition at line 638 of file HitPattern.cc.

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

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

Definition at line 564 of file HitPattern.h.

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

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

565 {
567  return false;
568  }
569 
570  uint32_t substructure = getSubStructure(pattern);
571  return (substructure == PixelSubdetector::PixelBarrel ||
572  substructure == PixelSubdetector::PixelEndcap);
573 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 1087 of file HitPattern.h.

1088 {
1089  return pixelBarrelLayersNull() +
1091 }
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:764
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:776
int reco::HitPattern::pixelLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1067 of file HitPattern.h.

1068 {
1071 }
int pixelBarrelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:695
int pixelEndcapLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:707
int HitPattern::pixelLayersWithMeasurement ( ) const

Definition at line 499 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(), NewMuonTrackValidator::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().

499  {
500  auto category = TRACK_HITS;
501  std::bitset<128> layerOk;
502  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
503  for (int i = range.first; i < range.second; ++i) {
505  if unlikely(!trackerHitFilter(pattern)) continue;
506  if (pattern>minStripWord) continue;
507  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
508  if (hitType != HIT_TYPE::VALID) continue;
510  // assert(pattern<128);
511  layerOk.set(pattern);
512  }
513  // assert(pixelLayersWithMeasurementOld()==int(layerOk.count()));
514  return layerOk.count();
515 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:423
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:441
static const unsigned short HitTypeOffset
Definition: HitPattern.h:422
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
static const unsigned short minStripWord
Definition: HitPattern.h:443
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:488
return(e1-e2)*(e1-e2)+dp *dp
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
if(dp >Float(M_PI)) dp-
static const unsigned short LayerOffset
Definition: HitPattern.h:430
int reco::HitPattern::pixelLayersWithMeasurementOld ( ) const
inline

Definition at line 1030 of file HitPattern.h.

1031 {
1033 }
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:570
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:558
int reco::HitPattern::pixelLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1047 of file HitPattern.h.

1048 {
1051 }
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:626
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:638
void HitPattern::print ( HitCategory  category,
std::ostream &  stream = std::cout 
) const

Definition at line 868 of file HitPattern.cc.

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

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

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

833 {
834  uint16_t pattern = getHitPattern(category, position);
835  stream << "\t";
836  if (muonHitFilter(pattern)) {
837  stream << "muon";
838  } else if (trackerHitFilter(pattern)) {
839  stream << "tracker";
840  }
841 
842  stream << "\tsubstructure " << getSubStructure(pattern);
843  if (muonHitFilter(pattern)) {
844  stream << "\tstation " << getMuonStation(pattern);
845  if (muonDTHitFilter(pattern)) {
846  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
847  } else if (muonCSCHitFilter(pattern)) {
848  stream << "\tcsc ring " << getCSCRing(pattern);
849  } else if (muonRPCHitFilter(pattern)) {
850  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel")
851  << ", layer " << getRPCLayer(pattern);
852  } else if (muonGEMHitFilter(pattern)) {
853  stream << "\tgem " << (getGEMLayer(pattern) ? "layer1" : "layer2")
854  << ", station " << getGEMStation(pattern);
855  } else if (muonME0HitFilter(pattern)) {
856  stream << "\tme0 ";
857  } else {
858  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure "
859  << getSubStructure(pattern);
860  }
861  } else {
862  stream << "\tlayer " << getLayer(pattern);
863  }
864  stream << "\thit type " << getHitType(pattern);
865  stream << std::endl;
866 }
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:752
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:700
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:747
static bool muonME0HitFilter(uint16_t pattern)
Definition: HitPattern.h:670
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:782
static bool muonCSCHitFilter(uint16_t pattern)
Definition: HitPattern.h:640
static uint32_t getHitType(uint16_t pattern)
Definition: HitPattern.h:733
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:769
static bool muonGEMHitFilter(uint16_t pattern)
Definition: HitPattern.h:660
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
Definition: HitPattern.h:775
static bool muonHitFilter(uint16_t pattern)
Definition: HitPattern.h:682
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
static bool muonDTHitFilter(uint16_t pattern)
Definition: HitPattern.h:630
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:757
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
Definition: HitPattern.h:742
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:515
static bool muonRPCHitFilter(uint16_t pattern)
Definition: HitPattern.h:650
int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 1156 of file HitPattern.h.

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

Definition at line 1151 of file HitPattern.h.

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

Definition at line 1146 of file HitPattern.h.

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

Definition at line 595 of file HitPattern.h.

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

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

Definition at line 1093 of file HitPattern.h.

1094 {
1095  return stripTIBLayersNull() +
1096  stripTIDLayersNull() +
1097  stripTOBLayersNull() +
1099 }
int stripTIBLayersNull() const
Definition: HitPattern.cc:788
int stripTECLayersNull() const
Definition: HitPattern.cc:821
int stripTIDLayersNull() const
Definition: HitPattern.cc:799
int stripTOBLayersNull() const
Definition: HitPattern.cc:810
int reco::HitPattern::stripLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const
inline

Definition at line 1073 of file HitPattern.h.

1074 {
1079 }
int stripTOBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:741
int stripTIBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:719
int stripTIDLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:730
int stripTECLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.cc:753
int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline
int reco::HitPattern::stripLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1053 of file HitPattern.h.

1054 {
1059 }
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:672
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:661
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:683
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:650
bool reco::HitPattern::stripSubdetectorHitFilter ( uint16_t  pattern,
StripSubdetector::SubDetector  substructure 
)
inlinestaticprivate

Definition at line 601 of file HitPattern.h.

References unlikely.

602 {
604  return false;
605  }
606 
607  return substructure == getSubStructure(pattern);
608 }
#define unlikely(x)
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:691
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
bool reco::HitPattern::stripTECHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 625 of file HitPattern.h.

References StripSubdetector::TEC.

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

Definition at line 821 of file HitPattern.cc.

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

822 {
823  int count = 0;
824  for (uint16_t layer = 1; layer <= 9; layer++) {
826  count++;
827  }
828  }
829  return count;
830 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:170
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:428
int HitPattern::stripTECLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 753 of file HitPattern.cc.

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

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

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

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

Definition at line 683 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

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

Definition at line 610 of file HitPattern.h.

References StripSubdetector::TIB.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef().

611 {
613 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:601
int HitPattern::stripTIBLayersNull ( ) const

Definition at line 788 of file HitPattern.cc.

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

789 {
790  int count = 0;
791  for (uint16_t layer = 1; layer <= 4; layer++) {
793  count++;
794  }
795  }
796  return count;
797 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:170
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:428
int HitPattern::stripTIBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 719 of file HitPattern.cc.

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

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

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

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

Definition at line 650 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

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

Definition at line 615 of file HitPattern.h.

References StripSubdetector::TID.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef().

616 {
618 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:601
int HitPattern::stripTIDLayersNull ( ) const

Definition at line 799 of file HitPattern.cc.

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

800 {
801  int count = 0;
802  for (uint16_t layer = 1; layer <= 3; layer++) {
804  count++;
805  }
806  }
807  return count;
808 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:170
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:428
int HitPattern::stripTIDLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 730 of file HitPattern.cc.

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

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

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

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

Definition at line 661 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

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

Definition at line 620 of file HitPattern.h.

References StripSubdetector::TOB.

621 {
623 }
static bool stripSubdetectorHitFilter(uint16_t pattern, StripSubdetector::SubDetector substructure)
Definition: HitPattern.h:601
int HitPattern::stripTOBLayersNull ( ) const

Definition at line 810 of file HitPattern.cc.

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

811 {
812  int count = 0;
813  for (uint16_t layer = 1; layer <= 6; layer++) {
815  count++;
816  }
817  }
818  return count;
819 }
static const uint32_t NULL_RETURN
Definition: HitPattern.h:170
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:428
int HitPattern::stripTOBLayersTotallyOffOrBad ( HitCategory  category = TRACK_HITS) const

Definition at line 741 of file HitPattern.cc.

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

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

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

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

Definition at line 672 of file HitPattern.cc.

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

Referenced by IsolatedTracksNxN::analyze().

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

Definition at line 1081 of file HitPattern.h.

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

Definition at line 1061 of file HitPattern.h.

Referenced by dqm::TrackAnalyzer::analyze().

1062 {
1065 }
int pixelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1067
int stripLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1073
int HitPattern::trackerLayersWithMeasurement ( ) const

Definition at line 518 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(), IsolatedTracksCone::analyze(), IsolatedTracksNxN::analyze(), NewMuonTrackValidator::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(), TrackMultiSelector::select(), MultiTrackSelector::select(), HIMultiTrackSelector::select(), TrackVertexArbitration< VTX >::trackFilterArbitrator(), and QcdUeDQM::trackSelection().

518  {
519  auto category = TRACK_HITS;
520  std::bitset<128> layerOk;
521  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
522  for (int i = range.first; i < range.second; ++i) {
524  if unlikely(!trackerHitFilter(pattern)) continue;
525  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
526  if (hitType != HIT_TYPE::VALID) continue;
528  // assert(pattern<128);
529  layerOk.set(pattern);
530  }
531  // assert(trackerLayersWithMeasurementOld()==int(layerOk.count()));
532  return layerOk.count();
533 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:423
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:441
static const unsigned short HitTypeOffset
Definition: HitPattern.h:422
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:488
return(e1-e2)*(e1-e2)+dp *dp
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
if(dp >Float(M_PI)) dp-
static const unsigned short LayerOffset
Definition: HitPattern.h:430
int reco::HitPattern::trackerLayersWithMeasurementOld ( ) const
inline

Definition at line 1025 of file HitPattern.h.

1026 {
1028 }
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:499
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1035
int HitPattern::trackerLayersWithoutMeasurement ( HitCategory  category) const

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

535  {
536  std::bitset<128> layerOk;
537  std::bitset<128> layerMissed;
538  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
539  for (int i = range.first; i < range.second; ++i) {
541  if unlikely(!trackerHitFilter(pattern)) continue;
542  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
544  // assert(pattern<128);
545  if (hitType == HIT_TYPE::VALID) layerOk.set(pattern);
546  if (hitType == HIT_TYPE::MISSING) layerMissed.set(pattern);
547  }
548  layerMissed &= ~layerOk;
549 
550  // assert(trackerLayersWithoutMeasurementOld(category)==int(layerMissed.count()));
551 
552  return layerMissed.count();
553 
554 
555 }
static const unsigned short HitTypeMask
Definition: HitPattern.h:423
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:441
static const unsigned short HitTypeOffset
Definition: HitPattern.h:422
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:488
return(e1-e2)*(e1-e2)+dp *dp
uint16_t getHitPatternByAbsoluteIndex(int position) const
Definition: HitPattern.cc:284
if(dp >Float(M_PI)) dp-
static const unsigned short LayerOffset
Definition: HitPattern.h:430
int reco::HitPattern::trackerLayersWithoutMeasurementOld ( HitCategory  category) const
inline

Definition at line 1041 of file HitPattern.h.

1042 {
1045 }
int pixelLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1047
int stripLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.h:1053
bool reco::HitPattern::validHitFilter ( uint16_t  pattern)
inlinestatic

Friends And Related Function Documentation

template<int N>
friend struct PatternSet
friend

Definition at line 485 of file HitPattern.h.

Member Data Documentation

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

Definition at line 166 of file HitPattern.h.

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

uint8_t reco::HitPattern::beginInner
private

Definition at line 477 of file HitPattern.h.

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

uint8_t reco::HitPattern::beginOuter
private

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

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

uint8_t reco::HitPattern::endInner
private

Definition at line 478 of file HitPattern.h.

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

uint8_t reco::HitPattern::endOuter
private

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

Referenced by appendHit(), and appendMuonHit().

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

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

Referenced by encode().

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

Definition at line 426 of file HitPattern.h.

Referenced by encode().

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

Definition at line 439 of file HitPattern.h.

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

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

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

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