test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
reco::HitPattern Class Reference

#include <HitPattern.h>

Public Types

enum  { MONO = 1, STEREO = 2 }
 
enum  HIT_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)
 
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 hasValidHitInFirstPixelBarrel () const
 
bool hasValidHitInFirstPixelEndcap () 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 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 numberOfHits (HitCategory category) 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 numberOfTrackerHits (HitCategory category) 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 () const
 
int pixelBarrelLayersWithMeasurement () const
 
int pixelBarrelLayersWithoutMeasurement (HitCategory category) const
 
int pixelEndcapLayersNull () const
 
int pixelEndcapLayersTotallyOffOrBad () const
 
int pixelEndcapLayersWithMeasurement () const
 
int pixelEndcapLayersWithoutMeasurement (HitCategory category) const
 
int pixelLayersNull () const
 
int pixelLayersTotallyOffOrBad () 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 () const
 
int stripLayersWithMeasurement () const
 
int stripLayersWithoutMeasurement (HitCategory category) const
 
int stripTECLayersNull () const
 
int stripTECLayersTotallyOffOrBad () const
 
int stripTECLayersWithMeasurement () const
 
int stripTECLayersWithoutMeasurement (HitCategory category) const
 
int stripTIBLayersNull () const
 
int stripTIBLayersTotallyOffOrBad () const
 
int stripTIBLayersWithMeasurement () const
 
int stripTIBLayersWithoutMeasurement (HitCategory category) const
 
int stripTIDLayersNull () const
 
int stripTIDLayersTotallyOffOrBad () const
 
int stripTIDLayersWithMeasurement () const
 
int stripTIDLayersWithoutMeasurement (HitCategory category) const
 
int stripTOBLayersNull () const
 
int stripTOBLayersTotallyOffOrBad () const
 
int stripTOBLayersWithMeasurement () const
 
int stripTOBLayersWithoutMeasurement (HitCategory category) const
 
int trackerLayersNull () const
 
int trackerLayersTotallyOffOrBad () 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

bool appendHit (const uint16_t pattern, TrackingRecHit::Type hitType)
 
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 454 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 22 of file HitPattern.cc.

References ARRAY_LENGTH, EMPTY_PATTERN, and hitPattern.

22  :
23  hitCount(0),
24  beginTrackHits(0),
25  endTrackHits(0),
26  beginInner(0),
27  endInner(0),
28  beginOuter(0),
29  endOuter(0)
30 {
32 }
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 46 of file HitPattern.cc.

47 {
48  ;
49 }
HitPattern::HitPattern ( const HitPattern other)

Definition at line 34 of file HitPattern.cc.

References ARRAY_LENGTH, and hitPattern.

34  :
35  hitCount(other.hitCount),
38  beginInner(other.beginInner),
39  endInner(other.endInner),
40  beginOuter(other.beginOuter),
41  endOuter(other.endOuter)
42 {
43  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
44 }
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 189 of file HitPattern.cc.

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

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

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

Definition at line 86 of file HitPattern.cc.

References appendHit().

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

Definition at line 194 of file HitPattern.cc.

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

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

Definition at line 206 of file HitPattern.cc.

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

207 {
208  //if HitPattern is full, journey ends no matter what.
210  return false;
211  }
212 
213  switch (hitType) {
217  case TrackingRecHit::bad:
218  // hitCount != endT => we are not inserting T type of hits but of T'
219  // 0 != beginT || 0 != endT => we already have hits of T type
220  // so we already have hits of T in the vector and we don't want to
221  // mess them with T' hits.
222  if unlikely(((hitCount != endTrackHits) && (0 != beginTrackHits || 0 != endTrackHits))) {
223  cms::Exception("HitPattern")
224  << "TRACK_HITS"
225  << " were stored on this object before hits of some other category were inserted "
226  << "but hits of the same category should be inserted in a row. "
227  << "Please rework the code so it inserts all "
228  << "TRACK_HITS"
229  << " in a row.";
230  return false;
231  }
232  return insertTrackHit(pattern);
233  break;
235  if unlikely(((hitCount != endInner) && (0 != beginInner || 0 != endInner))) {
236  cms::Exception("HitPattern")
237  << "MISSING_INNER_HITS"
238  << " were stored on this object before hits of some other category were inserted "
239  << "but hits of the same category should be inserted in a row. "
240  << "Please rework the code so it inserts all "
241  << "MISSING_INNER_HITS"
242  << " in a row.";
243  return false;
244  }
246  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:1052
#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:1039
bool insertTrackHit(const uint16_t pattern)
Definition: HitPattern.cc:1020
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 appendHit(), 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:189
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:189
uint8_t hitCount
Definition: HitPattern.h:473
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:91
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:189
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
Definition: HitPattern.cc:91
bool reco::HitPattern::badHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 802 of file HitPattern.h.

References BAD, and getHitType().

Referenced by numberOfBadHits().

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, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), 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 }
int i
Definition: DBlmapReader.cc:9
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 73 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().

74 {
75  this->hitCount = 0;
76  this->beginTrackHits = 0;
77  this->endTrackHits = 0;
78  this->beginInner = 0;
79  this->endInner = 0;
80  this->beginOuter = 0;
81  this->endOuter = 0;
82 
83  memset(this->hitPattern, EMPTY_PATTERN, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
84 }
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(), alcazmumu_cfi::filter, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), and i.

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

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 }
int i
Definition: DBlmapReader.cc:9
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(), alcazmumu_cfi::filter, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), i, and listBenchmarks::pattern.

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

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 }
int i
Definition: DBlmapReader.cc:9
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.

References muonStations().

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:917
int reco::HitPattern::cscStationsWithBadHits ( ) const
inline

Definition at line 1136 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::cscStationsWithValidHits ( ) const
inline

Definition at line 1131 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::dtStationsWithAnyHits ( ) const
inline

Definition at line 1126 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::dtStationsWithBadHits ( ) const
inline

Definition at line 1121 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::dtStationsWithValidHits ( ) const
inline

Definition at line 1116 of file HitPattern.h.

References muonStations().

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:917
uint16_t HitPattern::encode ( const TrackingRecHit hit,
const TrackerTopology ttopo 
)
staticprivate

Definition at line 91 of file HitPattern.cc.

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

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

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

Definition at line 142 of file HitPattern.cc.

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

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

Definition at line 166 of file HitPattern.cc.

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

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

Definition at line 1171 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::gemStationsWithBadHits ( ) const
inline

Definition at line 1166 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::gemStationsWithValidHits ( ) const
inline

Definition at line 1161 of file HitPattern.h.

References muonStations().

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:917
std::pair< uint8_t, uint8_t > reco::HitPattern::getCategoryIndexRange ( HitCategory  category) const
inlineprivate

Definition at line 488 of file HitPattern.h.

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

Referenced by call(), countHits(), countTypedHits(), getHitPattern(), getTrackerLayerCase(), getTrackerMonoStereo(), numberOfHits(), 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.

References getSubSubStructure().

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.

References getSubSubStructure().

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.

References getSubSubStructure().

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.

References getSubSubStructure().

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 EMPTY_PATTERN, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), and unlikely.

Referenced by CheckHitPattern::analyze(), PFCheckHitPattern::analyze(), FixTrackHitPattern::analyze(), GetTrackTrajInfo::analyze(), GsfElectronAlgo::ElectronData::checkCtfTrack(), OniaPhotonConversionProducer::foundCompatibleInnerHits(), GsfElectronCoreBaseProducer::getCtfTrackRef(), index_to_hitpattern(), PFElecTkProducer::isInnerMost(), FWTrackResidualDetailView::prepareData(), reco::TrackResiduals::print(), CheckHitPattern::print(), PFCheckHitPattern::print(), print(), printHitPattern(), 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 call(), countHits(), countTypedHits(), getHitPattern(), getTrackerLayerCase(), getTrackerMonoStereo(), hasValidHitInFirstPixelBarrel(), hasValidHitInFirstPixelEndcap(), 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 EMPTY_PATTERN, HitTypeMask, HitTypeOffset, NULL_RETURN, and unlikely.

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

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:422
#define unlikely(x)
static const unsigned short HitTypeOffset
Definition: HitPattern.h:421
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.

References getSubSubStructure().

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 getSubSubStructure(), and 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.

References getSubSubStructure().

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 EMPTY_PATTERN, NULL_RETURN, SideMask, SideOffset, and 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:425
static const uint16_t EMPTY_PATTERN
Definition: HitPattern.h:171
#define unlikely(x)
static const unsigned short SideMask
Definition: HitPattern.h:426
uint32_t reco::HitPattern::getSubDetector ( uint16_t  pattern)
inlinestatic

Definition at line 714 of file HitPattern.h.

References EMPTY_PATTERN, NULL_RETURN, SubDetectorMask, SubDetectorOffset, and 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:438
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:437
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 EMPTY_PATTERN, LayerMask, LayerOffset, NULL_RETURN, and unlikely.

Referenced by getCSCRing(), getDTSuperLayer(), getGEMLayer(), getGEMStation(), getLayer(), getMuonStation(), getRPCLayer(), getRPCregion(), and 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:429
static const unsigned short LayerMask
Definition: HitPattern.h:430
uint32_t HitPattern::getTrackerLayerCase ( HitCategory  category,
uint16_t  substr,
uint16_t  layer 
) const

Definition at line 437 of file HitPattern.cc.

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

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

Definition at line 469 of file HitPattern.cc.

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

Referenced by OniaPhotonConversionProducer::foundCompatibleInnerHits().

470 {
471  uint16_t tk_substr_layer = (0x1 << SubDetectorOffset)
472  + ((substr & SubstrMask) << SubstrOffset)
473  + ((layer & LayerMask) << LayerOffset);
474  uint16_t mask = (SubDetectorMask << SubDetectorOffset)
475  + (SubstrMask << SubstrOffset)
476  + (LayerMask << LayerOffset);
477 
478  // 0: neither a valid mono nor a valid stereo hit
479  // MONO: valid mono hit
480  // STEREO: valid stereo hit
481  // MONO | STEREO: both
482  uint16_t monoStereo = 0x0;
483  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
484  for (int i = range.first; i < range.second; ++i) {
486  if ((pattern & mask) == tk_substr_layer) {
487  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
488  if (hitType == HIT_TYPE::VALID) {
489  switch (getSide(pattern)) {
490  case 0: // mono
491  monoStereo |= MONO;
492  break;
493  case 1: // stereo
494  monoStereo |= STEREO;
495  break;
496  }
497  }
498 
499  if (monoStereo == (MONO | STEREO)) {
500  break;
501  }
502  }
503  }
504  return monoStereo;
505 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short SubstrOffset
Definition: HitPattern.h:433
static const unsigned short HitTypeMask
Definition: HitPattern.h:422
static const unsigned short SubDetectorMask
Definition: HitPattern.h:438
static const unsigned short HitTypeOffset
Definition: HitPattern.h:421
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
Definition: HitPattern.h:488
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:437
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:434
static const unsigned short LayerOffset
Definition: HitPattern.h:429
static const unsigned short LayerMask
Definition: HitPattern.h:430
bool HitPattern::hasValidHitInFirstPixelBarrel ( ) const

Definition at line 326 of file HitPattern.cc.

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

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

327 {
328  for (int i = beginTrackHits; i < endTrackHits; ++i) {
330  if (pixelBarrelHitFilter(pattern) && (getLayer(pattern) == 1)
331  && validHitFilter(pattern)) {
332  return true;
333  }
334  }
335  return false;
336 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:700
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:575
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 HitPattern::hasValidHitInFirstPixelEndcap ( ) const

Definition at line 338 of file HitPattern.cc.

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

339 {
340  for (int i = beginTrackHits; i < endTrackHits; ++i) {
342  if (pixelEndcapHitFilter(pattern) && (getLayer(pattern) == 1)
343  && validHitFilter(pattern)) {
344  return true;
345  }
346  }
347  return false;
348 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:700
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
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 1201 of file HitPattern.h.

References innermostMuonStationWithHits().

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:932
int reco::HitPattern::innermostMuonStationWithBadHits ( ) const
inline

Definition at line 1196 of file HitPattern.h.

References innermostMuonStationWithHits().

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:932
int HitPattern::innermostMuonStationWithHits ( int  hitType) const

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

Definition at line 932 of file HitPattern.cc.

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

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

933 {
934  int ret = 0;
935  for (int i = beginTrackHits; i < endTrackHits; ++i) {
937  if (muonHitFilter(pattern)
938  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
939  int stat = getMuonStation(pattern);
940  if (ret == 0 || stat < ret) {
941  ret = stat;
942  }
943  }
944  }
945 
946  return ret;
947 }
int i
Definition: DBlmapReader.cc:9
tuple ret
prodAgent to be discontinued
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.

References innermostMuonStationWithHits().

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:932
bool HitPattern::insertExpectedInnerHit ( const uint16_t  pattern)
private

Definition at line 1039 of file HitPattern.cc.

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

Referenced by appendHit().

1040 {
1041  if unlikely((0 == beginInner && 0 == endInner)) {
1042  beginInner = hitCount;
1043  endInner = beginInner;
1044  }
1045 
1046  insertHit(pattern);
1047  endInner++;
1048 
1049  return true;
1050 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1008
#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 1052 of file HitPattern.cc.

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

Referenced by appendHit().

1053 {
1054  if unlikely((0 == beginOuter && 0 == endOuter)) {
1055  beginOuter = hitCount;
1056  endOuter = beginOuter;
1057  }
1058 
1059  insertHit(pattern);
1060  endOuter++;
1061 
1062  return true;
1063 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1008
#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 1008 of file HitPattern.cc.

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

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

1009 {
1010  int offset = hitCount * HIT_LENGTH;
1011  for (int i = 0; i < HIT_LENGTH; i++) {
1012  int pos = offset + i;
1013  uint16_t bit = (pattern >> i) & 0x1;
1014  //equivalent to hitPattern[pos / 16] += bit << ((offset + i) % 16);
1015  hitPattern[pos >> 4] += bit << ((offset + i) & (16 - 1));
1016  }
1017  hitCount++;
1018 }
int i
Definition: DBlmapReader.cc:9
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 1020 of file HitPattern.cc.

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

Referenced by appendHit().

1021 {
1022  // if begin is 0, this is the first hit of this type being inserted, so
1023  // we need to update begin so it points to the correct index, the first
1024  // empty index.
1025  // unlikely, because it will happen only when inserting
1026  // the first hit of this type
1027  if unlikely((0 == beginTrackHits && 0 == endTrackHits)) {
1029  // before the first hit of this type is inserted, there are no hits
1031  }
1032 
1033  insertHit(pattern);
1034  endTrackHits++;
1035 
1036  return true;
1037 }
void insertHit(const uint16_t pattern)
Definition: HitPattern.cc:1008
#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 894 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().

895 {
896  if (i.det() != DetId::Tracker) {
897  return 0;
898  }
899 
900  switch (i.subdetId()) {
903  return 0;
905  return ttopo.tibIsStereo(i);
907  return ttopo.tidIsStereo(i);
909  return ttopo.tobIsStereo(i);
911  return ttopo.tecIsStereo(i);
912  default:
913  return 0;
914  }
915 }
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.

References muonStations().

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:917
int reco::HitPattern::me0StationsWithBadHits ( ) const
inline

Definition at line 1181 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::me0StationsWithValidHits ( ) const
inline

Definition at line 1176 of file HitPattern.h.

References muonStations().

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:917
bool reco::HitPattern::missingHitFilter ( uint16_t  pattern)
inlinestatic
bool reco::HitPattern::muonCSCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 640 of file HitPattern.h.

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

Referenced by numberOfBadMuonCSCHits(), numberOfLostMuonCSCHits(), numberOfValidMuonCSCHits(), and 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, getSubStructure(), muonHitFilter(), and unlikely.

Referenced by numberOfBadMuonDTHits(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), numberOfLostMuonDTHits(), numberOfValidMuonDTHits(), 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, getSubStructure(), muonHitFilter(), and unlikely.

Referenced by numberOfBadMuonGEMHits(), numberOfLostMuonGEMHits(), numberOfValidMuonGEMHits(), and 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
bool reco::HitPattern::muonME0HitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 670 of file HitPattern.h.

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

Referenced by numberOfBadMuonME0Hits(), numberOfLostMuonME0Hits(), numberOfValidMuonME0Hits(), and 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
volatile std::atomic< bool > shutdown_flag false
bool reco::HitPattern::muonRPCHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 650 of file HitPattern.h.

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

Referenced by numberOfBadMuonRPCHits(), numberOfLostMuonRPCHits(), numberOfValidMuonRPCHits(), and 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 917 of file HitPattern.cc.

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

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

918 {
919  int stations[4] = {0, 0, 0, 0};
920  for (int i = beginTrackHits; i < endTrackHits; ++i) {
922  if (muonHitFilter(pattern)
923  && (subdet == 0 || int(getSubStructure(pattern)) == subdet)
924  && (hitType == -1 || int(getHitType(pattern)) == hitType)) {
925  stations[getMuonStation(pattern) - 1] = 1;
926  }
927  }
928 
929  return stations[0] + stations[1] + stations[2] + stations[3];
930 }
int i
Definition: DBlmapReader.cc:9
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.

References muonStations().

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:917
int reco::HitPattern::muonStationsWithBadHits ( ) const
inline

Definition at line 1106 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::muonStationsWithValidHits ( ) const
inline

Definition at line 1101 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 981 of file HitPattern.h.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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

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

993 {
994  int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
995  for (int i = beginTrackHits; i < endTrackHits; ++i) {
997  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
998  stations[getMuonStation(pattern) - 1][getDTSuperLayer(pattern) == 2] = 1;
999  }
1000  }
1001 
1002  return stations[0][0] * stations[0][1]
1003  + stations[1][0] * stations[1][1]
1004  + stations[2][0] * stations[2][1]
1005  + stations[3][0] * stations[3][1];
1006 }
int i
Definition: DBlmapReader.cc:9
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the &quot;hit&quot; was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h: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 965 of file HitPattern.cc.

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

966 {
967  int stations[4] = {0, 0, 0, 0};
968  for (int i = beginTrackHits; i < endTrackHits; ++i) {
970 
971  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
972  && getDTSuperLayer(pattern) != 2) {
973  stations[getMuonStation(pattern) - 1] = 1;
974  }
975  }
976  return stations[0] + stations[1] + stations[2] + stations[3];
977 }
int i
Definition: DBlmapReader.cc:9
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the &quot;hit&quot; was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h: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 979 of file HitPattern.cc.

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

980 {
981  int stations[4] = {0, 0, 0, 0};
982  for (int i = beginTrackHits; i < endTrackHits; ++i) {
984  if (muonDTHitFilter(pattern) && validHitFilter(pattern)
985  && getDTSuperLayer(pattern) == 2) {
986  stations[getMuonStation(pattern) - 1] = 1;
987  }
988  }
989  return stations[0] + stations[1] + stations[2] + stations[3];
990 }
int i
Definition: DBlmapReader.cc:9
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the &quot;hit&quot; was a DT segment, superlayer is 0. Only valid for muon DT patter...
Definition: HitPattern.h: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::numberOfHits ( HitCategory  category) const
inline
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 1015 of file HitPattern.h.

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

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.

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

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

Definition at line 902 of file HitPattern.h.

References countHits(), and missingHitFilter().

Referenced by PackedCandidateTrackValidator::analyze(), reco::TransientTrack::numberOfLostHits(), reco::TrackBase::numberOfLostHits(), and pat::PATPackedCandidateProducer::produce().

903 {
905 }
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
int countHits(HitCategory category, filterType filter) const
Definition: HitPattern.h:525
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 962 of file HitPattern.h.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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

Definition at line 907 of file HitPattern.h.

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

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

908 {
910 }
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 trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
int reco::HitPattern::numberOfMuonHits ( ) const
inline

Definition at line 818 of file HitPattern.h.

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

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::numberOfTrackerHits ( HitCategory  category) const
inline

Definition at line 813 of file HitPattern.h.

References countHits(), and trackerHitFilter().

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::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 883 of file HitPattern.h.

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

Referenced by 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.

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

Referenced by 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.

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

Referenced by 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.

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

Referenced by HLTMuonL3PreFilter::hltFilter(), 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.

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

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.

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

Referenced by 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.

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

Referenced by TrackTypeMonitor::analyze(), StandaloneTrackMonitor::analyze(), CheckHitPattern::analyze(), PackedCandidateTrackValidator::analyze(), IPTagPlotter< Container, Base >::analyzeTag(), PFRecoTauDiscriminationByHPSSelection::discriminate(), ZtoMMEventSelector::filter(), ZtoEEEventSelector::filter(), WtoLNuSelector::filter(), reco::tau::RecoTauQualityCuts::filterTrack_(), HLTTrackWithHits::hltFilter(), TrackClassFilter::operator()(), RecoTrackSelectorBase::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), reco::tau::RecoTauPiZeroStripPlugin3::operator()(), pat::PATLostTracks::produce(), TrackListMerger::produce(), IPProducer< Container, Base, Helper >::produce(), pat::PackedCandidate::setTrackProperties(), TrackWithVertexSelector::testTrack(), TrackVertexArbitration< VTX >::trackFilterArbitrator(), MuonBadTrackFilter::trackInfo(), reco::TrackSelector::trackSelection(), and reco::tau::qcuts::trkPixelHits().

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

Definition at line 853 of file HitPattern.h.

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

Referenced by TrackTypeMonitor::analyze(), StandaloneTrackMonitor::analyze(), PackedCandidateTrackValidator::analyze(), ZtoMMEventSelector::filter(), ZtoEEEventSelector::filter(), and WtoLNuSelector::filter().

854 {
856 }
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 stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:595
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( uint16_t  stripdet,
uint16_t  layer 
) const

Definition at line 350 of file HitPattern.cc.

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

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

351 {
352  bool hasMono[SubstrMask + 1][LayerMask + 1];
353  bool hasStereo[SubstrMask + 1][LayerMask + 1];
354  memset(hasMono, 0, sizeof(hasMono));
355  memset(hasStereo, 0, sizeof(hasStereo));
356 
357  // mark which layers have mono/stereo hits
358  for (int i = beginTrackHits; i < endTrackHits; ++i) {
360  uint16_t subStructure = getSubStructure(pattern);
361 
362  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
363  if (stripdet != 0 && subStructure != stripdet) {
364  continue;
365  }
366 
367  if (layer != 0 && getSubSubStructure(pattern) != layer) {
368  continue;
369  }
370 
371  switch (getSide(pattern)) {
372  case 0: // mono
373  hasMono[subStructure][getLayer(pattern)] = true;
374  break;
375  case 1: // stereo
376  hasStereo[subStructure][getLayer(pattern)] = true;
377  break;
378  default:
379  ;
380  break;
381  }
382  }
383  }
384 
385  // count how many layers have mono and stereo hits
386  int count = 0;
387  for (int i = 0; i < SubstrMask + 1; ++i) {
388  for (int j = 0; j < LayerMask + 1; ++j) {
389  if (hasMono[i][j] && hasStereo[i][j]) {
390  count++;
391  }
392  }
393  }
394  return count;
395 }
int i
Definition: DBlmapReader.cc:9
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
int j
Definition: DBlmapReader.cc:9
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:434
static uint32_t getSubSubStructure(uint16_t pattern)
Definition: HitPattern.h:705
static const unsigned short LayerMask
Definition: HitPattern.h:430
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( ) const

Definition at line 397 of file HitPattern.cc.

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

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

398 {
399  auto category = TRACK_HITS;
400  std::bitset<128> side[2];
401  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
402  for (int i = range.first; i < range.second; ++i) {
404  if (pattern<minStripWord) continue;
405  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
406  if (hitType != HIT_TYPE::VALID) continue;
407  auto apattern = (pattern-minTrackerWord) >> LayerOffset;
408  // assert(apattern<128);
409  side[getSide(pattern)].set(apattern);
410  }
411  // assert(numberOfValidStripLayersWithMonoAndStereo(0, 0)==int((side[0]&side[1]).count()));
412  return (side[0]&side[1]).count();
413 
414 
415 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short HitTypeMask
Definition: HitPattern.h:422
static const unsigned short minTrackerWord
Definition: HitPattern.h:440
static const unsigned short HitTypeOffset
Definition: HitPattern.h:421
static const unsigned short minStripWord
Definition: HitPattern.h:442
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:429
int reco::HitPattern::numberOfValidStripTECHits ( ) const
inline

Definition at line 873 of file HitPattern.h.

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

Referenced by PatTrackAnalyzer::analyze(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), 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

Definition at line 858 of file HitPattern.h.

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

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

859 {
861 }
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 stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:610
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 863 of file HitPattern.h.

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

Referenced by PatTrackAnalyzer::analyze(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), 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

Definition at line 868 of file HitPattern.h.

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

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

869 {
871 }
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 stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:620
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 51 of file HitPattern.cc.

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

52 {
53  if (this == &other) {
54  return *this;
55  }
56 
57  this->hitCount = other.hitCount;
58 
59  this->beginTrackHits = other.beginTrackHits;
60  this->endTrackHits = other.endTrackHits;
61 
62  this->beginInner = other.beginInner;
63  this->endInner = other.endInner;
64 
65  this->beginOuter = other.beginOuter;
66  this->endOuter = other.endOuter;
67 
68  memcpy(this->hitPattern, other.hitPattern, sizeof(uint16_t) * HitPattern::ARRAY_LENGTH);
69 
70  return *this;
71 }
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.

References outermostMuonStationWithHits().

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:949
int reco::HitPattern::outermostMuonStationWithBadHits ( ) const
inline

Definition at line 1211 of file HitPattern.h.

References outermostMuonStationWithHits().

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:949
int HitPattern::outermostMuonStationWithHits ( int  hitType) const

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

Definition at line 949 of file HitPattern.cc.

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

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

950 {
951  int ret = 0;
952  for (int i = beginTrackHits; i < endTrackHits; ++i) {
954  if (muonHitFilter(pattern) &&
955  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
956  int stat = getMuonStation(pattern);
957  if (ret == 0 || stat > ret) {
958  ret = stat;
959  }
960  }
961  }
962  return ret;
963 }
int i
Definition: DBlmapReader.cc:9
tuple ret
prodAgent to be discontinued
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.

References outermostMuonStationWithHits().

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:949
bool reco::HitPattern::pixelBarrelHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 575 of file HitPattern.h.

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

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

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

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

Referenced by pixelLayersNull().

774 {
775  int count = 0;
776  uint16_t NPixBarrel = 4;
777  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
779  count++;
780  }
781  }
782  return count;
783 }
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:437
int HitPattern::pixelBarrelLayersTotallyOffOrBad ( ) const

Definition at line 704 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

705 {
706  int count = 0;
707  uint16_t NPixBarrel = 4;
708  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
709  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::INACTIVE) {
710  count++;
711  }
712  }
713  return count;
714 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::pixelBarrelLayersWithMeasurement ( ) const

Definition at line 567 of file HitPattern.cc.

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

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

568 {
569  int count = 0;
570  uint16_t NPixBarrel = 4;
571  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
572  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::VALID) {
573  count++;
574  }
575  }
576  return count;
577 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::pixelBarrelLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 635 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

636 {
637  int count = 0;
638  uint16_t NPixBarrel = 4;
639  for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
640  if (getTrackerLayerCase(category, PixelSubdetector::PixelBarrel, layer) == HIT_TYPE::MISSING) {
641  count++;
642  }
643  }
644  return count;
645 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
bool reco::HitPattern::pixelEndcapHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 585 of file HitPattern.h.

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

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

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

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

Referenced by pixelLayersNull().

786 {
787  int count = 0;
788  uint16_t NPixForward = 3;
789  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
791  count++;
792  }
793  }
794  return count;
795 }
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:437
int HitPattern::pixelEndcapLayersTotallyOffOrBad ( ) const

Definition at line 716 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

717 {
718  int count = 0;
719  uint16_t NPixForward = 3;
720  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
721  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::INACTIVE) {
722  count++;
723  }
724  }
725  return count;
726 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::pixelEndcapLayersWithMeasurement ( ) const

Definition at line 579 of file HitPattern.cc.

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

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

580 {
581  int count = 0;
582  uint16_t NPixForward = 3;
583  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
584  if (getTrackerLayerCase(TRACK_HITS, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::VALID) {
585  count++;
586  }
587  }
588  return count;
589 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::pixelEndcapLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 647 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

648 {
649  int count = 0;
650  uint16_t NPixForward = 3;
651  for (uint16_t layer = 1; layer <= NPixForward; layer++) {
652  if (getTrackerLayerCase(category, PixelSubdetector::PixelEndcap, layer) == HIT_TYPE::MISSING) {
653  count++;
654  }
655  }
656  return count;
657 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
bool reco::HitPattern::pixelHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 564 of file HitPattern.h.

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

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef(), numberOfLostPixelHits(), numberOfValidPixelHits(), FWConvTrackHitsDetailView::setTextInfo(), and QcdUeDQM::trackSelection().

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.

References pixelBarrelLayersNull(), and pixelEndcapLayersNull().

Referenced by trackerLayersNull().

1088 {
1089  return pixelBarrelLayersNull() +
1091 }
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:773
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:785
int reco::HitPattern::pixelLayersTotallyOffOrBad ( ) const
inline

Definition at line 1067 of file HitPattern.h.

References pixelBarrelLayersTotallyOffOrBad(), and pixelEndcapLayersTotallyOffOrBad().

Referenced by trackerLayersTotallyOffOrBad().

1068 {
1071 }
int pixelBarrelLayersTotallyOffOrBad() const
Definition: HitPattern.cc:704
int pixelEndcapLayersTotallyOffOrBad() const
Definition: HitPattern.cc:716
int HitPattern::pixelLayersWithMeasurement ( ) const

Definition at line 508 of file HitPattern.cc.

References python.rootplot.argparse::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, i, LayerOffset, minStripWord, minTrackerWord, listBenchmarks::pattern, TRACK_HITS, trackerHitFilter(), and unlikely.

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

508  {
509  auto category = TRACK_HITS;
510  std::bitset<128> layerOk;
511  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
512  for (int i = range.first; i < range.second; ++i) {
514  if unlikely(!trackerHitFilter(pattern)) continue;
515  if (pattern>minStripWord) continue;
516  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
517  if (hitType != HIT_TYPE::VALID) continue;
519  // assert(pattern<128);
520  layerOk.set(pattern);
521  }
522  // assert(pixelLayersWithMeasurementOld()==int(layerOk.count()));
523  return layerOk.count();
524 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short HitTypeMask
Definition: HitPattern.h:422
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:440
static const unsigned short HitTypeOffset
Definition: HitPattern.h:421
static bool trackerHitFilter(uint16_t pattern)
Definition: HitPattern.h:677
static const unsigned short minStripWord
Definition: HitPattern.h:442
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:429
int reco::HitPattern::pixelLayersWithMeasurementOld ( ) const
inline

Definition at line 1030 of file HitPattern.h.

References pixelBarrelLayersWithMeasurement(), and pixelEndcapLayersWithMeasurement().

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

Definition at line 1047 of file HitPattern.h.

References pixelBarrelLayersWithoutMeasurement(), and pixelEndcapLayersWithoutMeasurement().

Referenced by trackerLayersWithoutMeasurementOld().

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

Definition at line 877 of file HitPattern.cc.

References flags, getHitPattern(), i, numberOfHits(), and printHitPattern().

878 {
879  stream << "HitPattern" << std::endl;
880  for (int i = 0; i < numberOfHits(category); ++i) {
881  printHitPattern(category, i, stream);
882  }
883  std::ios_base::fmtflags flags = stream.flags();
884  stream.setf(std::ios_base::hex, std::ios_base::basefield);
885  stream.setf(std::ios_base::showbase);
886 
887  for (int i = 0; i < this->numberOfHits(category); ++i) {
888  stream << getHitPattern(category, i) << std::endl;
889  }
890 
891  stream.flags(flags);
892 }
int i
Definition: DBlmapReader.cc:9
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
Definition: HitPattern.cc:841
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:515
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:807
void HitPattern::printHitPattern ( HitCategory  category,
int  position,
std::ostream &  stream 
) const

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

842 {
843  uint16_t pattern = getHitPattern(category, position);
844  stream << "\t";
845  if (muonHitFilter(pattern)) {
846  stream << "muon";
847  } else if (trackerHitFilter(pattern)) {
848  stream << "tracker";
849  }
850 
851  stream << "\tsubstructure " << getSubStructure(pattern);
852  if (muonHitFilter(pattern)) {
853  stream << "\tstation " << getMuonStation(pattern);
854  if (muonDTHitFilter(pattern)) {
855  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
856  } else if (muonCSCHitFilter(pattern)) {
857  stream << "\tcsc ring " << getCSCRing(pattern);
858  } else if (muonRPCHitFilter(pattern)) {
859  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel")
860  << ", layer " << getRPCLayer(pattern);
861  } else if (muonGEMHitFilter(pattern)) {
862  stream << "\tgem " << (getGEMLayer(pattern) ? "layer1" : "layer2")
863  << ", station " << getGEMStation(pattern);
864  } else if (muonME0HitFilter(pattern)) {
865  stream << "\tme0 ";
866  } else {
867  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure "
868  << getSubStructure(pattern);
869  }
870  } else {
871  stream << "\tlayer " << getLayer(pattern);
872  }
873  stream << "\thit type " << getHitType(pattern);
874  stream << std::endl;
875 }
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 &quot;hit&quot; 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.

References muonStations().

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:917
int reco::HitPattern::rpcStationsWithBadHits ( ) const
inline

Definition at line 1151 of file HitPattern.h.

References muonStations().

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:917
int reco::HitPattern::rpcStationsWithValidHits ( ) const
inline

Definition at line 1146 of file HitPattern.h.

References muonStations().

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:917
bool reco::HitPattern::stripHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 595 of file HitPattern.h.

References minStripWord.

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

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

Definition at line 1093 of file HitPattern.h.

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

Referenced by trackerLayersNull().

1094 {
1095  return stripTIBLayersNull() +
1096  stripTIDLayersNull() +
1097  stripTOBLayersNull() +
1099 }
int stripTIBLayersNull() const
Definition: HitPattern.cc:797
int stripTECLayersNull() const
Definition: HitPattern.cc:830
int stripTIDLayersNull() const
Definition: HitPattern.cc:808
int stripTOBLayersNull() const
Definition: HitPattern.cc:819
int reco::HitPattern::stripLayersTotallyOffOrBad ( ) const
inline
int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline
int reco::HitPattern::stripLayersWithoutMeasurement ( HitCategory  category) const
inline

Definition at line 1053 of file HitPattern.h.

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

Referenced by trackerLayersWithoutMeasurementOld().

1054 {
1059 }
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:681
int stripTIDLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:670
int stripTECLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:692
int stripTIBLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:659
bool reco::HitPattern::stripSubdetectorHitFilter ( uint16_t  pattern,
StripSubdetector::SubDetector  substructure 
)
inlinestaticprivate

Definition at line 601 of file HitPattern.h.

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

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

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 stripSubdetectorHitFilter(), and StripSubdetector::TEC.

Referenced by numberOfLostStripTECHits(), and numberOfValidStripTECHits().

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

Definition at line 830 of file HitPattern.cc.

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

Referenced by stripLayersNull().

831 {
832  int count = 0;
833  for (uint16_t layer = 1; layer <= 9; layer++) {
835  count++;
836  }
837  }
838  return count;
839 }
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:437
int HitPattern::stripTECLayersTotallyOffOrBad ( ) const

Definition at line 762 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

763 {
764  int count = 0;
765  for (uint16_t layer = 1; layer <= 9; layer++) {
766  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::INACTIVE) {
767  count++;
768  }
769  }
770  return count;
771 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::stripTECLayersWithMeasurement ( ) const

Definition at line 624 of file HitPattern.cc.

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

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

625 {
626  int count = 0;
627  for (uint16_t layer = 1; layer <= 9; layer++) {
628  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TEC, layer) == HIT_TYPE::VALID) {
629  count++;
630  }
631  }
632  return count;
633 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::stripTECLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 692 of file HitPattern.cc.

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

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

693 {
694  int count = 0;
695  for (uint16_t layer = 1; layer <= 9; layer++) {
696  if (getTrackerLayerCase(category, StripSubdetector::TEC, layer) == HIT_TYPE::MISSING) {
697  count++;
698  }
699  }
700  return count;
701 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
bool reco::HitPattern::stripTIBHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 610 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TIB.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef(), numberOfLostStripTIBHits(), and numberOfValidStripTIBHits().

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

Definition at line 797 of file HitPattern.cc.

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

Referenced by stripLayersNull().

798 {
799  int count = 0;
800  for (uint16_t layer = 1; layer <= 4; layer++) {
802  count++;
803  }
804  }
805  return count;
806 }
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:437
int HitPattern::stripTIBLayersTotallyOffOrBad ( ) const

Definition at line 728 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

729 {
730  int count = 0;
731  for (uint16_t layer = 1; layer <= 4; layer++) {
732  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::INACTIVE) {
733  count++;
734  }
735  }
736  return count;
737 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::stripTIBLayersWithMeasurement ( ) const

Definition at line 591 of file HitPattern.cc.

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

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

592 {
593  int count = 0;
594  for (uint16_t layer = 1; layer <= 4; layer++) {
595  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TIB, layer) == HIT_TYPE::VALID) {
596  count++;
597  }
598  }
599  return count;
600 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::stripTIBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 659 of file HitPattern.cc.

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

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

660 {
661  int count = 0;
662  for (uint16_t layer = 1; layer <= 4; layer++) {
663  if (getTrackerLayerCase(category, StripSubdetector::TIB, layer) == HIT_TYPE::MISSING) {
664  count++;
665  }
666  }
667  return count;
668 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
bool reco::HitPattern::stripTIDHitFilter ( uint16_t  pattern)
inlinestatic

Definition at line 615 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TID.

Referenced by GsfElectronCoreBaseProducer::getCtfTrackRef(), numberOfLostStripTIDHits(), and numberOfValidStripTIDHits().

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

Definition at line 808 of file HitPattern.cc.

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

Referenced by stripLayersNull().

809 {
810  int count = 0;
811  for (uint16_t layer = 1; layer <= 3; layer++) {
813  count++;
814  }
815  }
816  return count;
817 }
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:437
int HitPattern::stripTIDLayersTotallyOffOrBad ( ) const

Definition at line 739 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

740 {
741  int count = 0;
742  for (uint16_t layer = 1; layer <= 3; layer++) {
743  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::INACTIVE) {
744  count++;
745  }
746  }
747  return count;
748 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::stripTIDLayersWithMeasurement ( ) const

Definition at line 602 of file HitPattern.cc.

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

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

603 {
604  int count = 0;
605  for (uint16_t layer = 1; layer <= 3; layer++) {
606  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TID, layer) == HIT_TYPE::VALID) {
607  count++;
608  }
609  }
610  return count;
611 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::stripTIDLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 670 of file HitPattern.cc.

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

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

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

Definition at line 620 of file HitPattern.h.

References stripSubdetectorHitFilter(), and StripSubdetector::TOB.

Referenced by numberOfLostStripTOBHits(), and numberOfValidStripTOBHits().

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

Definition at line 819 of file HitPattern.cc.

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

Referenced by stripLayersNull().

820 {
821  int count = 0;
822  for (uint16_t layer = 1; layer <= 6; layer++) {
824  count++;
825  }
826  }
827  return count;
828 }
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:437
int HitPattern::stripTOBLayersTotallyOffOrBad ( ) const

Definition at line 750 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

751 {
752  int count = 0;
753  for (uint16_t layer = 1; layer <= 6; layer++) {
754 
755  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::INACTIVE) {
756  count++;
757  }
758  }
759  return count;
760 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::stripTOBLayersWithMeasurement ( ) const

Definition at line 613 of file HitPattern.cc.

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

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

614 {
615  int count = 0;
616  for (uint16_t layer = 1; layer <= 6; layer++) {
617  if (getTrackerLayerCase(TRACK_HITS, StripSubdetector::TOB, layer) == HIT_TYPE::VALID) {
618  count++;
619  }
620  }
621  return count;
622 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
int HitPattern::stripTOBLayersWithoutMeasurement ( HitCategory  category) const

Definition at line 681 of file HitPattern.cc.

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

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

682 {
683  int count = 0;
684  for (uint16_t layer = 1; layer <= 6; layer++) {
685  if (getTrackerLayerCase(category, StripSubdetector::TOB, layer) == HIT_TYPE::MISSING) {
686  count++;
687  }
688  }
689  return count;
690 }
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
Definition: HitPattern.cc:437
bool reco::HitPattern::trackerHitFilter ( uint16_t  pattern)
inlinestatic
int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 1081 of file HitPattern.h.

References pixelLayersNull(), and stripLayersNull().

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 ( ) const
inline

Definition at line 1061 of file HitPattern.h.

References pixelLayersTotallyOffOrBad(), and stripLayersTotallyOffOrBad().

Referenced by TrackAnalyzer::analyze().

1062 {
1063  return pixelLayersTotallyOffOrBad() +
1065 }
int pixelLayersTotallyOffOrBad() const
Definition: HitPattern.h:1067
int stripLayersTotallyOffOrBad() const
Definition: HitPattern.h:1073
int HitPattern::trackerLayersWithMeasurement ( ) const

Definition at line 527 of file HitPattern.cc.

References python.rootplot.argparse::category, getCategoryIndexRange(), getHitPatternByAbsoluteIndex(), HitTypeMask, HitTypeOffset, i, LayerOffset, minTrackerWord, listBenchmarks::pattern, TRACK_HITS, trackerHitFilter(), and unlikely.

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

527  {
528  auto category = TRACK_HITS;
529  std::bitset<128> layerOk;
530  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
531  for (int i = range.first; i < range.second; ++i) {
533  if unlikely(!trackerHitFilter(pattern)) continue;
534  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
535  if (hitType != HIT_TYPE::VALID) continue;
537  // assert(pattern<128);
538  layerOk.set(pattern);
539  }
540  // assert(trackerLayersWithMeasurementOld()==int(layerOk.count()));
541  return layerOk.count();
542 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short HitTypeMask
Definition: HitPattern.h:422
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:440
static const unsigned short HitTypeOffset
Definition: HitPattern.h:421
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:429
int reco::HitPattern::trackerLayersWithMeasurementOld ( ) const
inline

Definition at line 1025 of file HitPattern.h.

References pixelLayersWithMeasurement(), and stripLayersWithMeasurement().

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

Definition at line 544 of file HitPattern.cc.

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

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

544  {
545  std::bitset<128> layerOk;
546  std::bitset<128> layerMissed;
547  std::pair<uint8_t, uint8_t> range = getCategoryIndexRange(category);
548  for (int i = range.first; i < range.second; ++i) {
550  if unlikely(!trackerHitFilter(pattern)) continue;
551  uint16_t hitType = (pattern >> HitTypeOffset) & HitTypeMask;
553  // assert(pattern<128);
554  if (hitType == HIT_TYPE::VALID) layerOk.set(pattern);
555  if (hitType == HIT_TYPE::MISSING) layerMissed.set(pattern);
556  }
557  layerMissed &= ~layerOk;
558 
559  // assert(trackerLayersWithoutMeasurementOld(category)==int(layerMissed.count()));
560 
561  return layerMissed.count();
562 
563 
564 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short HitTypeMask
Definition: HitPattern.h:422
#define unlikely(x)
static const unsigned short minTrackerWord
Definition: HitPattern.h:440
static const unsigned short HitTypeOffset
Definition: HitPattern.h:421
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:429
int reco::HitPattern::trackerLayersWithoutMeasurementOld ( HitCategory  category) const
inline

Definition at line 1041 of file HitPattern.h.

References pixelLayersWithoutMeasurement(), and stripLayersWithoutMeasurement().

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
uint8_t reco::HitPattern::beginOuter
private
uint8_t reco::HitPattern::beginTrackHits
private
const uint16_t reco::HitPattern::EMPTY_PATTERN = 0x0
static
uint8_t reco::HitPattern::endInner
private
uint8_t reco::HitPattern::endOuter
private
uint8_t reco::HitPattern::endTrackHits
private
const unsigned short reco::HitPattern::HIT_LENGTH = 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 441 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 426 of file HitPattern.h.

Referenced by encode(), and getSide().

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

Definition at line 425 of file HitPattern.h.

Referenced by encode(), and getSide().

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

Definition at line 433 of file HitPattern.h.

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