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 | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
reco::HitPattern Class Reference

#include <HitPattern.h>

Public Types

enum  { MONO = 1, STEREO = 2 }
 
typedef bool filterType (unsigned int)
 

Public Member Functions

void appendHit (const TrackingRecHit &hit)
 
int countHits (filterType filter) const
 
int countTypedHits (filterType typeFilter, filterType filter) const
 
int cscStationsWithAnyHits () const
 
int cscStationsWithBadHits () const
 
int cscStationsWithValidHits () const
 
int dtStationsWithAnyHits () const
 
int dtStationsWithBadHits () const
 
int dtStationsWithValidHits () const
 
uint32_t getHitPattern (int position) const
 
uint32_t getTrackerLayerCase (uint32_t substr, uint32_t layer) const
 
uint32_t getTrackerMonoStereo (uint32_t substr, uint32_t layer) const
 
bool hasValidHitInFirstPixelBarrel () const
 
bool hasValidHitInFirstPixelEndcap () const
 
 HitPattern ()
 
template<typename I >
 HitPattern (const I &begin, const I &end)
 
template<typename C >
 HitPattern (const C &c)
 
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 muonStations (int subdet, int hitType) const
 subdet = 0(all), 1(DT), 2(CSC), 3(RPC); 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 numberOfBadMuonHits () const
 
int numberOfBadMuonRPCHits () const
 
int numberOfDTStationsWithBothViews () const
 
int numberOfDTStationsWithRPhiView () const
 
int numberOfDTStationsWithRZView () const
 
int numberOfHits () const
 
int numberOfInactiveHits () const
 
int numberOfInactiveTrackerHits () const
 
int numberOfLostHits () const
 
int numberOfLostMuonCSCHits () const
 
int numberOfLostMuonDTHits () const
 
int numberOfLostMuonHits () const
 
int numberOfLostMuonRPCHits () const
 
int numberOfLostPixelBarrelHits () const
 
int numberOfLostPixelEndcapHits () const
 
int numberOfLostPixelHits () const
 
int numberOfLostStripHits () const
 
int numberOfLostStripTECHits () const
 
int numberOfLostStripTIBHits () const
 
int numberOfLostStripTIDHits () const
 
int numberOfLostStripTOBHits () const
 
int numberOfLostTrackerHits () const
 
int numberOfValidHits () const
 
int numberOfValidMuonCSCHits () const
 
int numberOfValidMuonDTHits () const
 
int numberOfValidMuonHits () const
 
int numberOfValidMuonRPCHits () const
 
int numberOfValidPixelBarrelHits () const
 
int numberOfValidPixelEndcapHits () const
 
int numberOfValidPixelHits () const
 
int numberOfValidStripHits () const
 
int numberOfValidStripLayersWithMonoAndStereo () const
 
int numberOfValidStripTECHits () const
 
int numberOfValidStripTIBHits () const
 
int numberOfValidStripTIDHits () const
 
int numberOfValidStripTOBHits () const
 
int numberOfValidTrackerHits () const
 
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 () const
 
int pixelEndcapLayersNull () const
 
int pixelEndcapLayersTotallyOffOrBad () const
 
int pixelEndcapLayersWithMeasurement () const
 
int pixelEndcapLayersWithoutMeasurement () const
 
int pixelLayersNull () const
 
int pixelLayersTotallyOffOrBad () const
 
int pixelLayersWithMeasurement () const
 
int pixelLayersWithoutMeasurement () const
 
void print (std::ostream &stream=std::cout) const
 
void printHitPattern (int position, std::ostream &stream) const
 
int rpcStationsWithAnyHits () const
 
int rpcStationsWithBadHits () const
 
int rpcStationsWithValidHits () const
 
template<typename I >
void set (const I &begin, const I &end)
 
void set (const TrackingRecHit &hit, unsigned int i)
 
int stripLayersNull () const
 
int stripLayersTotallyOffOrBad () const
 
int stripLayersWithMeasurement () const
 
int stripLayersWithoutMeasurement () const
 
int stripTECLayersNull () const
 
int stripTECLayersTotallyOffOrBad () const
 
int stripTECLayersWithMeasurement () const
 
int stripTECLayersWithoutMeasurement () const
 
int stripTIBLayersNull () const
 
int stripTIBLayersTotallyOffOrBad () const
 
int stripTIBLayersWithMeasurement () const
 
int stripTIBLayersWithoutMeasurement () const
 
int stripTIDLayersNull () const
 
int stripTIDLayersTotallyOffOrBad () const
 
int stripTIDLayersWithMeasurement () const
 
int stripTIDLayersWithoutMeasurement () const
 
int stripTOBLayersNull () const
 
int stripTOBLayersTotallyOffOrBad () const
 
int stripTOBLayersWithMeasurement () const
 
int stripTOBLayersWithoutMeasurement () const
 
int trackerLayersNull () const
 
int trackerLayersTotallyOffOrBad () const
 
int trackerLayersWithMeasurement () const
 
int trackerLayersWithoutMeasurement () const
 

Static Public Member Functions

static uint32_t getCSCRing (uint32_t pattern)
 CSC ring (1-4). Only valid for muon CSC patterns, of course. More...
 
static uint32_t getDTSuperLayer (uint32_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 uint32_t getHitType (uint32_t pattern)
 
static uint32_t getLayer (uint32_t pattern)
 
static uint32_t getMuonStation (uint32_t pattern)
 Muon station (1-4). Only valid for muon patterns, of course. More...
 
static uint32_t getRPCLayer (uint32_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 uint32_t getRPCregion (uint32_t pattern)
 RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course. More...
 
static uint32_t getSide (uint32_t pattern)
 
static uint32_t getSubStructure (uint32_t pattern)
 
static uint32_t getSubSubStructure (uint32_t pattern)
 
static bool muonCSCHitFilter (uint32_t pattern)
 
static bool muonDTHitFilter (uint32_t pattern)
 
static bool muonHitFilter (uint32_t pattern)
 
static bool muonRPCHitFilter (uint32_t pattern)
 
static bool pixelBarrelHitFilter (uint32_t pattern)
 
static bool pixelEndcapHitFilter (uint32_t pattern)
 
static bool pixelHitFilter (uint32_t pattern)
 
static bool stripHitFilter (uint32_t pattern)
 
static bool stripTECHitFilter (uint32_t pattern)
 
static bool stripTIBHitFilter (uint32_t pattern)
 
static bool stripTIDHitFilter (uint32_t pattern)
 
static bool stripTOBHitFilter (uint32_t pattern)
 
static bool trackerHitFilter (uint32_t pattern)
 
static bool type_1_HitFilter (uint32_t pattern)
 
static bool type_2_HitFilter (uint32_t pattern)
 
static bool type_3_HitFilter (uint32_t pattern)
 
static bool validHitFilter (uint32_t pattern)
 

Private Member Functions

uint32_t encode (const TrackingRecHit &, unsigned int)
 
void set (const TrackingRecHitRef &ref, unsigned int i)
 
void setHitPattern (int position, uint32_t pattern)
 

Static Private Member Functions

static uint32_t isStereo (DetId)
 

Private Attributes

uint32_t hitPattern_ [PatternSize]
 

Static Private Attributes

static const unsigned short HitSize = 11
 
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 PatternSize = 25
 
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
 

Detailed Description

Definition at line 119 of file HitPattern.h.

Member Typedef Documentation

typedef bool reco::HitPattern::filterType(unsigned int)

Definition at line 149 of file HitPattern.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MONO 
STEREO 

Definition at line 121 of file HitPattern.h.

Constructor & Destructor Documentation

reco::HitPattern::HitPattern ( )
inline

Definition at line 125 of file HitPattern.h.

References hitPattern_, i, and PatternSize.

125 { for (int i=0; i<PatternSize; i++) hitPattern_[i] = 0; }
int i
Definition: DBlmapReader.cc:9
uint32_t hitPattern_[PatternSize]
Definition: HitPattern.h:367
static const unsigned short PatternSize
Definition: HitPattern.h:341
template<typename I >
reco::HitPattern::HitPattern ( const I &  begin,
const I &  end 
)
inline

Definition at line 129 of file HitPattern.h.

References set().

129 { set(begin, end); }
void set(const I &begin, const I &end)
Definition: HitPattern.h:139
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
template<typename C >
reco::HitPattern::HitPattern ( const C &  c)
inline

Definition at line 133 of file HitPattern.h.

References set().

133 { set(c); }
void set(const I &begin, const I &end)
Definition: HitPattern.h:139

Member Function Documentation

void HitPattern::appendHit ( const TrackingRecHit hit)

Definition at line 88 of file HitPattern.cc.

References filterCSVwithJSON::copy, MuonSubdetId::CSC, cond::rpcobgas::detid, TrackingRecHit::dimension(), MuonSubdetId::DT, TrackingRecHit::geographicalId(), i, DetId::Muon, numberOfHits(), TrackingRecHit::recHits(), MuonSubdetId::RPC, set(), and DetId::Tracker.

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

88  {
89 
90  // get rec hit det id and rec hit type
91  DetId id = hit.geographicalId();
92  uint32_t detid = id.det();
93  uint32_t subdet = id.subdetId();
94 
95  std::vector<const TrackingRecHit*> hits;
96 
97 
98  if (detid == DetId::Tracker)
99  hits.push_back(&hit);
100 
101  if (detid == DetId::Muon) {
102 
103  if (subdet == (uint32_t) MuonSubdetId::DT){
104 
105  // DT rechit (granularity 2)
106  if(hit.dimension() == 1)
107  hits.push_back(&hit);
108 
109  // 4D segment (granularity 0)
110  else if(hit.dimension() > 1){ // Both 2 and 4 dim cases. MB4s have 2D, but formatted in 4D segments
111  std::vector<const TrackingRecHit*> seg2D = hit.recHits(); // 4D --> 2D
112  // load 1D hits (2D --> 1D)
113  for(std::vector<const TrackingRecHit*>::const_iterator it = seg2D.begin(); it != seg2D.end(); ++it){
114  std::vector<const TrackingRecHit*> hits1D = (*it)->recHits();
115  copy(hits1D.begin(),hits1D.end(),back_inserter(hits));
116  }
117  }
118  }
119 
120  else if (subdet == (uint32_t) MuonSubdetId::CSC){
121 
122  // CSC rechit (granularity 2)
123  if(hit.dimension() == 2)
124  hits.push_back(&hit);
125 
126  // 4D segment (granularity 0)
127  if(hit.dimension() == 4)
128  hits = hit.recHits(); // load 2D hits (4D --> 1D)
129  }
130 
131  else if (subdet == (uint32_t) MuonSubdetId::RPC) {
132  hits.push_back(&hit);
133  }
134  }
135 
136  unsigned int i = numberOfHits();
137  for(std::vector<const TrackingRecHit*>::const_iterator it = hits.begin(); it != hits.end(); ++it)
138  set(**it,i++);
139 
140 
141 }
int i
Definition: DBlmapReader.cc:9
virtual int dimension() const =0
void set(const I &begin, const I &end)
Definition: HitPattern.h:139
static const int CSC
Definition: MuonSubdetId.h:15
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
int numberOfHits() const
Definition: HitPattern.cc:213
Definition: DetId.h:20
static const int RPC
Definition: MuonSubdetId.h:16
static const int DT
Definition: MuonSubdetId.h:14
DetId geographicalId() const
int reco::HitPattern::countHits ( filterType  filter) const
inline

Definition at line 150 of file HitPattern.h.

References prof2calltree::count, alcazmumu_cfi::filter, getHitPattern(), HitSize, i, listBenchmarks::pattern, and PatternSize.

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

150  {
151  int count = 0;
152  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
153  uint32_t pattern = getHitPattern(i);
154  if (pattern == 0) break;
155  if (filter(pattern)) ++count;
156  }
157  return count;
158  }
int i
Definition: DBlmapReader.cc:9
static const unsigned short PatternSize
Definition: HitPattern.h:341
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::countTypedHits ( filterType  typeFilter,
filterType  filter 
) const
inline

Definition at line 160 of file HitPattern.h.

References prof2calltree::count, alcazmumu_cfi::filter, getHitPattern(), HitSize, i, listBenchmarks::pattern, and PatternSize.

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

160  {
161  int count = 0;
162  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
163  uint32_t pattern = getHitPattern(i);
164  if (pattern == 0) break;
165  if (typeFilter(pattern)&&filter(pattern)) ++count;
166  }
167  return count;
168  }
int i
Definition: DBlmapReader.cc:9
static const unsigned short PatternSize
Definition: HitPattern.h:341
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::cscStationsWithAnyHits ( ) const
inline

Definition at line 784 of file HitPattern.h.

References muonStations().

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

Definition at line 783 of file HitPattern.h.

References muonStations().

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

Definition at line 782 of file HitPattern.h.

References muonStations().

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

Definition at line 781 of file HitPattern.h.

References muonStations().

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

Definition at line 780 of file HitPattern.h.

References muonStations().

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

Definition at line 779 of file HitPattern.h.

References muonStations().

779 { return muonStations(1, 0); }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:635
uint32_t HitPattern::encode ( const TrackingRecHit hit,
unsigned int  i 
)
private

Definition at line 15 of file HitPattern.cc.

References abs, MuonSubdetId::CSC, CSCDetId, cond::rpcobgas::detid, PXFDetId::disk(), MuonSubdetId::DT, DTLayerId, TrackingRecHit::geographicalId(), TrackingRecHit::getType(), HitSize, HitTypeMask, HitTypeOffset, isStereo(), PXBDetId::layer(), TOBDetId::layer(), TIBDetId::layer(), RPCDetId::layer(), LayerMask, LayerOffset, DetId::Muon, listBenchmarks::pattern, PatternSize, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, RPCDetId::region(), MuonSubdetId::RPC, SideMask, SideOffset, RPCDetId::station(), SubDetectorMask, SubDetectorOffset, SubstrMask, SubstrOffset, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, DetId::Tracker, TIDDetId::wheel(), and TECDetId::wheel().

Referenced by BeautifulSoup.Tag::_invert(), and set().

15  {
16 
17  // ignore the rec hit if the number of hit is larger than the max
18  if (i >= 32 * PatternSize / HitSize) return 0;
19 
20  // get rec hit det id and rec hit type
21  DetId id = hit.geographicalId();
22  uint32_t detid = id.det();
23  uint32_t hitType = (uint32_t) hit.getType();
24 
25  // init pattern of this hit to 0
26  uint32_t pattern = 0;
27 
28  // adding tracker/muon detector bit
29  pattern += ((detid)&SubDetectorMask)<<SubDetectorOffset;
30 
31  // adding substructure (PXB,PXF,TIB,TID,TOB,TEC, or DT,CSC,RPC) bits
32  uint32_t subdet = id.subdetId();
33  pattern += ((subdet)&SubstrMask)<<SubstrOffset;
34 
35  // adding layer/disk/wheel bits
36  uint32_t layer = 0;
37  if (detid == DetId::Tracker) {
38  if (subdet == PixelSubdetector::PixelBarrel)
39  layer = PXBDetId(id).layer();
40  else if (subdet == PixelSubdetector::PixelEndcap)
41  layer = PXFDetId(id).disk();
42  else if (subdet == StripSubdetector::TIB)
43  layer = TIBDetId(id).layer();
44  else if (subdet == StripSubdetector::TID)
45  layer = TIDDetId(id).wheel();
46  else if (subdet == StripSubdetector::TOB)
47  layer = TOBDetId(id).layer();
48  else if (subdet == StripSubdetector::TEC)
49  layer = TECDetId(id).wheel();
50  } else if (detid == DetId::Muon) {
51  if (subdet == (uint32_t) MuonSubdetId::DT)
52  layer = ((DTLayerId(id.rawId()).station()-1)<<2) + DTLayerId(id.rawId()).superLayer();
53  else if (subdet == (uint32_t) MuonSubdetId::CSC)
54  layer = ((CSCDetId(id.rawId()).station()-1)<<2) + (CSCDetId(id.rawId()).ring()-1);
55  else if (subdet == (uint32_t) MuonSubdetId::RPC) {
56  RPCDetId rpcid(id.rawId());
57  layer = ((rpcid.station()-1)<<2) + abs(rpcid.region());
58  if (rpcid.station() <= 2) layer += 2*(rpcid.layer()-1);
59  }
60  }
61  pattern += (layer&LayerMask)<<LayerOffset;
62 
63  // adding mono/stereo bit
64  uint32_t side = 0;
65  if (detid == DetId::Tracker) {
66  side = isStereo(id);
67  } else if (detid == DetId::Muon) {
68  side = 0;
69  }
70  pattern += (side&SideMask)<<SideOffset;
71 
72  // adding hit type bits
73  pattern += (hitType&HitTypeMask)<<HitTypeOffset;
74 
75  return pattern;
76 }
int i
Definition: DBlmapReader.cc:9
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
static uint32_t isStereo(DetId)
Definition: HitPattern.cc:598
static const unsigned short SideOffset
Definition: HitPattern.h:359
static const unsigned short SubstrOffset
Definition: HitPattern.h:351
#define abs(x)
Definition: mlp_lapack.h:159
static const unsigned short PatternSize
Definition: HitPattern.h:341
static const unsigned short HitTypeMask
Definition: HitPattern.h:364
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
static const int CSC
Definition: MuonSubdetId.h:15
static const unsigned short SubDetectorMask
Definition: HitPattern.h:348
static const unsigned short HitTypeOffset
Definition: HitPattern.h:363
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
static const unsigned short HitSize
Definition: HitPattern.h:344
Definition: DetId.h:20
Type getType() const
static const unsigned short SideMask
Definition: HitPattern.h:360
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:347
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
static const unsigned short SubstrMask
Definition: HitPattern.h:352
static const int RPC
Definition: MuonSubdetId.h:16
static const unsigned short LayerOffset
Definition: HitPattern.h:355
static const int DT
Definition: MuonSubdetId.h:14
DetId geographicalId() const
static const unsigned short LayerMask
Definition: HitPattern.h:356
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
uint32_t reco::HitPattern::getCSCRing ( uint32_t  pattern)
inlinestatic

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

Definition at line 514 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

514  {
515  return (getSubSubStructure(pattern) & 3) + 1;
516  }
static uint32_t getSubSubStructure(uint32_t pattern)
Definition: HitPattern.h:490
uint32_t reco::HitPattern::getDTSuperLayer ( uint32_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 510 of file HitPattern.h.

References getSubSubStructure().

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

510  {
511  return (getSubSubStructure(pattern) & 3);
512  }
static uint32_t getSubSubStructure(uint32_t pattern)
Definition: HitPattern.h:490
uint32_t HitPattern::getHitPattern ( int  position) const

Definition at line 144 of file HitPattern.cc.

References hitPattern_, and HitSize.

Referenced by CheckHitPattern::analyze(), PFCheckHitPattern::analyze(), FixTrackHitPattern::analyze(), GetTrackTrajInfo::analyze(), GsfElectronAlgo::ElectronData::checkCtfTrack(), countHits(), countTypedHits(), GsfElectronCoreBaseProducer::getCtfTrackRef(), getTrackerLayerCase(), getTrackerMonoStereo(), PrimaryVertexValidation::hasFirstLayerPixelHits(), hasValidHitInFirstPixelBarrel(), hasValidHitInFirstPixelEndcap(), index_to_hitpattern(), innermostMuonStationWithHits(), SoftPFElectronTagInfoProducer::isElecClean(), PFElecTkProducer::isInnerMost(), muonStations(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), numberOfHits(), numberOfValidStripLayersWithMonoAndStereo(), EgAmbiguityTools::isInnerMost::operator()(), outermostMuonStationWithHits(), FWTrackResidualDetailView::prepareData(), reco::TrackResiduals::print(), CheckHitPattern::print(), PFCheckHitPattern::print(), print(), printHitPattern(), FWConvTrackHitsDetailView::setTextInfo(), EgAmbiguityTools::sharedDets(), EgAmbiguityTools::sharedHits(), and QcdUeDQM::trackSelection().

144  {
145 /* Note: you are not taking a consecutive sequence of HitSize bits starting from position*HitSize
146  as the bit order in the words are reversed.
147  e.g. if position = 0 you take the lowest 10 bits of the first word.
148 
149  I hope this can clarify what is the memory layout of such thing
150 
151  straight 01234567890123456789012345678901 | 23456789012345678901234567890123 | 4567
152  (global) 0 1 2 3 | 3 4 5 6 | 6
153  words [--------------0---------------] | [--------------1---------------] | [---
154  word 01234567890123456789012345678901 | 01234567890123456789012345678901 | 0123
155  (str) 0 1 2 3 | 0 1 2 3 | 0
156  [--------------0---------------] | [--------------1---------------] | [---
157  word 10987654321098765432109876543210 | 10987654321098765432109876543210 | 1098
158  (rev) 32 21 10 0 | 32 21 10 0 | 32
159  reverse 10987654321098765432109876543210 | 32109876543210987654321098765432 | 5432
160  32 21 10 0 | 6 65 54 43 3 9
161 
162  ugly enough, but it's not my fault, I was not even in CMS at that time [gpetrucc] */
163  uint16_t bitEndOffset = (position+1) * HitSize;
164  uint8_t secondWord = (bitEndOffset >> 5);
165  uint8_t secondWordBits = bitEndOffset & (32-1); // that is, bitEndOffset % 32
166  if (secondWordBits >= HitSize) { // full block is in this word
167  uint8_t lowBitsToTrash = secondWordBits - HitSize;
168  uint32_t myResult = (hitPattern_[secondWord] >> lowBitsToTrash) & ((1 << HitSize)-1);
169  return myResult;
170  } else {
171  uint8_t firstWordBits = HitSize - secondWordBits;
172  uint32_t firstWordBlock = hitPattern_[secondWord-1] >> (32-firstWordBits);
173  uint32_t secondWordBlock = hitPattern_[secondWord] & ((1<<secondWordBits)-1);
174  uint32_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
175  return myResult;
176  }
177 }
uint32_t hitPattern_[PatternSize]
Definition: HitPattern.h:367
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t reco::HitPattern::getHitType ( uint32_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getLayer ( uint32_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getMuonStation ( uint32_t  pattern)
inlinestatic

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

Definition at line 506 of file HitPattern.h.

References getSubSubStructure().

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

506  {
507  return (getSubSubStructure(pattern)>>2) + 1;
508  }
static uint32_t getSubSubStructure(uint32_t pattern)
Definition: HitPattern.h:490
uint32_t reco::HitPattern::getRPCLayer ( uint32_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 518 of file HitPattern.h.

References getSubSubStructure(), and likely.

Referenced by printHitPattern().

518  {
519  uint32_t sss = getSubSubStructure(pattern), stat = sss >> 2;
520  if likely(stat <= 1) return ((sss >> 1) & 1) + 1;
521  return 0;
522  }
static uint32_t getSubSubStructure(uint32_t pattern)
Definition: HitPattern.h:490
#define likely(x)
Definition: Likely.h:20
uint32_t reco::HitPattern::getRPCregion ( uint32_t  pattern)
inlinestatic

RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.

Definition at line 524 of file HitPattern.h.

References getSubSubStructure().

Referenced by printHitPattern().

524  {
525  return getSubSubStructure(pattern) & 1;
526  }
static uint32_t getSubSubStructure(uint32_t pattern)
Definition: HitPattern.h:490
uint32_t reco::HitPattern::getSide ( uint32_t  pattern)
inlinestatic

Definition at line 496 of file HitPattern.h.

References SideMask, SideOffset, and unlikely.

Referenced by getTrackerMonoStereo(), and numberOfValidStripLayersWithMonoAndStereo().

496  {
497  if unlikely(pattern == 0) return 999999;
499  }
static const unsigned short SideOffset
Definition: HitPattern.h:359
#define unlikely(x)
Definition: Likely.h:21
static const unsigned short SideMask
Definition: HitPattern.h:360
uint32_t reco::HitPattern::getSubStructure ( uint32_t  pattern)
inlinestatic
uint32_t reco::HitPattern::getSubSubStructure ( uint32_t  pattern)
inlinestatic

Definition at line 490 of file HitPattern.h.

References LayerMask, LayerOffset, and unlikely.

Referenced by getCSCRing(), getDTSuperLayer(), getMuonStation(), getRPCLayer(), and getRPCregion().

490  {
491  if unlikely(pattern == 0) return 999999;
493  }
#define unlikely(x)
Definition: Likely.h:21
static const unsigned short LayerOffset
Definition: HitPattern.h:355
static const unsigned short LayerMask
Definition: HitPattern.h:356
uint32_t HitPattern::getTrackerLayerCase ( uint32_t  substr,
uint32_t  layer 
) const

Definition at line 260 of file HitPattern.cc.

References getHitPattern(), HitSize, HitTypeMask, HitTypeOffset, i, LayerMask, LayerOffset, listBenchmarks::pattern, PatternSize, 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().

260  {
261  uint32_t tk_substr_layer =
262  (1 << SubDetectorOffset) +
263  ((substr & SubstrMask) << SubstrOffset) +
264  ((layer & LayerMask) << LayerOffset);
265 
266  uint32_t mask =
268  (SubstrMask << SubstrOffset) +
269  (LayerMask << LayerOffset);
270 
271  // crossed
272  // layer case 0: valid + (missing, off, bad) ==> with measurement
273  // layer case 1: missing + (off, bad) ==> without measurement
274  // layer case 2: off, bad ==> totally off or bad, cannot say much
275  // not crossed
276  // layer case 999999: track outside acceptance or in gap ==> null
277 
278  uint32_t layerCase = 999999;
279  for (int i=0; i<(PatternSize * 32) / HitSize; i++)
280  {
281  uint32_t pattern = getHitPattern(i);
282  if (pattern == 0) break;
283  if ((pattern & mask) == tk_substr_layer) {
284  uint32_t hitType = (pattern >> HitTypeOffset) & HitTypeMask; // 0,1,2,3
285  if (hitType < layerCase) {
286  layerCase = hitType;
287  if (hitType == 3) layerCase = 2;
288  }
289  }
290  }
291  return layerCase;
292 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short SubstrOffset
Definition: HitPattern.h:351
static const unsigned short PatternSize
Definition: HitPattern.h:341
static const unsigned short HitTypeMask
Definition: HitPattern.h:364
static const unsigned short SubDetectorMask
Definition: HitPattern.h:348
static const unsigned short HitTypeOffset
Definition: HitPattern.h:363
static const unsigned short HitSize
Definition: HitPattern.h:344
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:347
static const unsigned short SubstrMask
Definition: HitPattern.h:352
static const unsigned short LayerOffset
Definition: HitPattern.h:355
static const unsigned short LayerMask
Definition: HitPattern.h:356
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
uint32_t HitPattern::getTrackerMonoStereo ( uint32_t  substr,
uint32_t  layer 
) const

Definition at line 294 of file HitPattern.cc.

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

295 {
296  uint32_t tk_substr_layer =
297  (1 << SubDetectorOffset) +
298  ((substr & SubstrMask) << SubstrOffset) +
299  ((layer & LayerMask) << LayerOffset);
300 
301  uint32_t mask =
303  (SubstrMask << SubstrOffset) +
304  (LayerMask << LayerOffset);
305 
306  // 0: neither a valid mono nor a valid stereo hit
307  // MONO: valid mono hit
308  // STEREO: valid stereo hit
309  // MONO | STEREO: both
310  uint32_t monoStereo = 0;
311  for (int i=0; i<(PatternSize * 32) / HitSize; i++)
312  {
313  uint32_t pattern = getHitPattern(i);
314  if (pattern == 0) break;
315  if ((pattern & mask) == tk_substr_layer)
316  {
317  uint32_t hitType = (pattern >> HitTypeOffset) & HitTypeMask; // 0,1,2,3
318  if (hitType == 0) { // valid hit
319  switch (getSide(pattern)) {
320  case 0: // mono
321  monoStereo |= MONO;
322  break;
323  case 1: // stereo
324  monoStereo |= STEREO;
325  break;
326  default:
327  break;
328  }
329  }
330  }
331  }
332  return monoStereo;
333 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short SubstrOffset
Definition: HitPattern.h:351
static const unsigned short PatternSize
Definition: HitPattern.h:341
static const unsigned short HitTypeMask
Definition: HitPattern.h:364
static const unsigned short SubDetectorMask
Definition: HitPattern.h:348
static const unsigned short HitTypeOffset
Definition: HitPattern.h:363
static const unsigned short HitSize
Definition: HitPattern.h:344
static uint32_t getSide(uint32_t pattern)
Definition: HitPattern.h:496
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:347
static const unsigned short SubstrMask
Definition: HitPattern.h:352
static const unsigned short LayerOffset
Definition: HitPattern.h:355
static const unsigned short LayerMask
Definition: HitPattern.h:356
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
bool HitPattern::hasValidHitInFirstPixelBarrel ( ) const

Definition at line 183 of file HitPattern.cc.

References getHitPattern(), getLayer(), HitSize, i, listBenchmarks::pattern, PatternSize, pixelBarrelHitFilter(), and validHitFilter().

Referenced by TrackClassFilter::operator()().

183  {
184  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
185  uint32_t pattern = getHitPattern(i);
186  if (pattern == 0) break;
187  if (pixelBarrelHitFilter(pattern)) {
188  if (getLayer(pattern) == 1) {
189  if (validHitFilter(pattern)) {
190  return true;
191  }
192  }
193  }
194  }
195  return false;
196 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint32_t pattern)
Definition: HitPattern.h:485
static const unsigned short PatternSize
Definition: HitPattern.h:341
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
static bool pixelBarrelHitFilter(uint32_t pattern)
Definition: HitPattern.h:392
bool HitPattern::hasValidHitInFirstPixelEndcap ( ) const

Definition at line 198 of file HitPattern.cc.

References getHitPattern(), getLayer(), HitSize, i, listBenchmarks::pattern, PatternSize, pixelEndcapHitFilter(), and validHitFilter().

198  {
199  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
200  uint32_t pattern = getHitPattern(i);
201  if (pattern == 0) break;
202  if (pixelEndcapHitFilter(pattern)) {
203  if (getLayer(pattern) == 1) {
204  if (validHitFilter(pattern)) {
205  return true;
206  }
207  }
208  }
209  }
210  return false;
211 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint32_t pattern)
Definition: HitPattern.h:485
static const unsigned short PatternSize
Definition: HitPattern.h:341
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static const unsigned short HitSize
Definition: HitPattern.h:344
static bool pixelEndcapHitFilter(uint32_t pattern)
Definition: HitPattern.h:399
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::innermostMuonStationWithAnyHits ( ) const
inline

Definition at line 791 of file HitPattern.h.

References innermostMuonStationWithHits().

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

Definition at line 790 of file HitPattern.h.

References innermostMuonStationWithHits().

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

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

Definition at line 650 of file HitPattern.cc.

References getHitPattern(), getHitType(), getMuonStation(), HitSize, i, muonHitFilter(), listBenchmarks::pattern, PatternSize, and run_regression::ret.

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

650  {
651  int ret = 0;
652  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
653  uint32_t pattern = getHitPattern(i);
654  if (pattern == 0) break;
655  if (muonHitFilter(pattern) &&
656  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
657  int stat = getMuonStation(pattern);
658  if (ret == 0 || stat < ret) ret = stat;
659  }
660  }
661  return ret;
662 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getHitType(uint32_t pattern)
Definition: HitPattern.h:501
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.h:506
static const unsigned short PatternSize
Definition: HitPattern.h:341
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::innermostMuonStationWithValidHits ( ) const
inline

Definition at line 789 of file HitPattern.h.

References innermostMuonStationWithHits().

789 { return innermostMuonStationWithHits(0); }
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Definition: HitPattern.cc:650
uint32_t HitPattern::isStereo ( DetId  i)
staticprivate

Definition at line 598 of file HitPattern.cc.

References DetId::det(), i, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, and DetId::Tracker.

Referenced by encode().

599 {
600  switch (i.det()) {
601  case DetId::Tracker:
602  switch (i.subdetId()) {
605  return 0;
607  {
608  TIBDetId id = i;
609  return id.isStereo();
610  }
612  {
613  TIDDetId id = i;
614  return id.isStereo();
615  }
617  {
618  TOBDetId id = i;
619  return id.isStereo();
620  }
622  {
623  TECDetId id = i;
624  return id.isStereo();
625  }
626  default:
627  return 0;
628  }
629  break;
630  default:
631  return 0;
632  }
633 }
int i
Definition: DBlmapReader.cc:9
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
bool reco::HitPattern::muonCSCHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 451 of file HitPattern.h.

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

Referenced by numberOfBadMuonCSCHits(), numberOfLostMuonCSCHits(), numberOfValidMuonCSCHits(), and printHitPattern().

451  {
453  uint32_t substructure = getSubStructure(pattern);
454  if (substructure == (uint32_t) MuonSubdetId::CSC) return true;
455  return false;
456  }
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
</a ></td >< td >< ahref="RecoLocalMuon_CSCRecHit.html"> csc2DRecHits</a ></td >< tdclass="description"> CSC(x, y) rechits</td >< td >T.Cox</td ></tr >< tr >< td >< a href
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
bool reco::HitPattern::muonDTHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 444 of file HitPattern.h.

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

Referenced by numberOfBadMuonDTHits(), numberOfDTStationsWithBothViews(), numberOfDTStationsWithRPhiView(), numberOfDTStationsWithRZView(), numberOfLostMuonDTHits(), numberOfValidMuonDTHits(), and printHitPattern().

444  {
446  uint32_t substructure = getSubStructure(pattern);
447  if (substructure == (uint32_t) MuonSubdetId::DT) return true;
448  return false;
449  }
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
bool reco::HitPattern::muonHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 472 of file HitPattern.h.

References SubDetectorMask, SubDetectorOffset, and unlikely.

Referenced by innermostMuonStationWithHits(), muonCSCHitFilter(), muonDTHitFilter(), muonRPCHitFilter(), muonStations(), numberOfBadMuonHits(), numberOfLostMuonHits(), numberOfValidMuonHits(), outermostMuonStationWithHits(), and printHitPattern().

472  {
473  if unlikely(pattern == 0) return false;
475  return false;
476  }
#define unlikely(x)
Definition: Likely.h:21
static const unsigned short SubDetectorMask
Definition: HitPattern.h:348
static const unsigned short SubDetectorOffset
Definition: HitPattern.h:347
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
bool reco::HitPattern::muonRPCHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 458 of file HitPattern.h.

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

Referenced by numberOfBadMuonRPCHits(), numberOfLostMuonRPCHits(), numberOfValidMuonRPCHits(), and printHitPattern().

458  {
460  uint32_t substructure = getSubStructure(pattern);
461  if (substructure == (uint32_t) MuonSubdetId::RPC) return true;
462  return false;
463  }
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
int HitPattern::muonStations ( int  subdet,
int  hitType 
) const

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

Definition at line 635 of file HitPattern.cc.

References getHitPattern(), getHitType(), getMuonStation(), getSubStructure(), HitSize, i, muonHitFilter(), listBenchmarks::pattern, PatternSize, and mergeVDriftHistosByStation::stations.

Referenced by cscStationsWithAnyHits(), cscStationsWithBadHits(), cscStationsWithValidHits(), dtStationsWithAnyHits(), dtStationsWithBadHits(), dtStationsWithValidHits(), muonStationsWithAnyHits(), muonStationsWithBadHits(), muonStationsWithValidHits(), rpcStationsWithAnyHits(), rpcStationsWithBadHits(), and rpcStationsWithValidHits().

635  {
636  int stations[4] = { 0,0,0,0 };
637  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
638  uint32_t pattern = getHitPattern(i);
639  if (pattern == 0) break;
640  if (muonHitFilter(pattern) &&
641  (subdet == 0 || int(getSubStructure(pattern)) == subdet) &&
642  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
643  stations[getMuonStation(pattern)-1] = 1;
644  }
645  }
646  return stations[0]+stations[1]+stations[2]+stations[3];
647 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getHitType(uint32_t pattern)
Definition: HitPattern.h:501
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.h:506
static const unsigned short PatternSize
Definition: HitPattern.h:341
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::muonStationsWithAnyHits ( ) const
inline

Definition at line 778 of file HitPattern.h.

References muonStations().

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

Definition at line 777 of file HitPattern.h.

References muonStations().

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

Definition at line 776 of file HitPattern.h.

References muonStations().

776 { return muonStations(0, 0); }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:635
int reco::HitPattern::numberOfBadHits ( ) const
inline

Definition at line 669 of file HitPattern.h.

References countHits(), and type_3_HitFilter().

669  {
670  return countHits(type_3_HitFilter);
671 }
static bool type_3_HitFilter(uint32_t pattern)
Definition: HitPattern.h:544
int countHits(filterType filter) const
Definition: HitPattern.h:150
int reco::HitPattern::numberOfBadMuonCSCHits ( ) const
inline

Definition at line 681 of file HitPattern.h.

References countTypedHits(), muonCSCHitFilter(), and type_2_HitFilter().

681  {
683 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_2_HitFilter(uint32_t pattern)
Definition: HitPattern.h:539
static bool muonCSCHitFilter(uint32_t pattern)
Definition: HitPattern.h:451
int reco::HitPattern::numberOfBadMuonDTHits ( ) const
inline

Definition at line 677 of file HitPattern.h.

References countTypedHits(), muonDTHitFilter(), and type_2_HitFilter().

677  {
679 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool muonDTHitFilter(uint32_t pattern)
Definition: HitPattern.h:444
static bool type_2_HitFilter(uint32_t pattern)
Definition: HitPattern.h:539
int reco::HitPattern::numberOfBadMuonHits ( ) const
inline

Definition at line 673 of file HitPattern.h.

References countTypedHits(), muonHitFilter(), and type_2_HitFilter().

673  {
675 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_2_HitFilter(uint32_t pattern)
Definition: HitPattern.h:539
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
int reco::HitPattern::numberOfBadMuonRPCHits ( ) const
inline

Definition at line 685 of file HitPattern.h.

References countTypedHits(), muonRPCHitFilter(), and type_2_HitFilter().

685  {
687 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_2_HitFilter(uint32_t pattern)
Definition: HitPattern.h:539
static bool muonRPCHitFilter(uint32_t pattern)
Definition: HitPattern.h:458
int HitPattern::numberOfDTStationsWithBothViews ( ) const

Definition at line 703 of file HitPattern.cc.

References getDTSuperLayer(), getHitPattern(), getMuonStation(), HitSize, i, muonDTHitFilter(), listBenchmarks::pattern, PatternSize, mergeVDriftHistosByStation::stations, and validHitFilter().

703  {
704  int stations[4][2] = { {0,0}, {0,0}, {0,0}, {0,0} };
705  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
706  uint32_t pattern = getHitPattern(i);
707  if (pattern == 0) break;
708  if (muonDTHitFilter(pattern) && validHitFilter(pattern)) {
709  stations[getMuonStation(pattern)-1][getDTSuperLayer(pattern) == 2] = 1;
710  }
711  }
712  return stations[0][0]*stations[0][1] + stations[1][0]*stations[1][1] + stations[2][0]*stations[2][1] + stations[3][0]*stations[3][1];
713 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getDTSuperLayer(uint32_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:510
static bool muonDTHitFilter(uint32_t pattern)
Definition: HitPattern.h:444
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.h:506
static const unsigned short PatternSize
Definition: HitPattern.h:341
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int HitPattern::numberOfDTStationsWithRPhiView ( ) const

Definition at line 679 of file HitPattern.cc.

References getDTSuperLayer(), getHitPattern(), getMuonStation(), HitSize, i, muonDTHitFilter(), listBenchmarks::pattern, PatternSize, mergeVDriftHistosByStation::stations, and validHitFilter().

679  {
680  int stations[4] = { 0,0,0,0 };
681  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
682  uint32_t pattern = getHitPattern(i);
683  if (pattern == 0) break;
684  if (muonDTHitFilter(pattern) && validHitFilter(pattern) && getDTSuperLayer(pattern) != 2) {
685  stations[getMuonStation(pattern)-1] = 1;
686  }
687  }
688  return stations[0]+stations[1]+stations[2]+stations[3];
689 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getDTSuperLayer(uint32_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:510
static bool muonDTHitFilter(uint32_t pattern)
Definition: HitPattern.h:444
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.h:506
static const unsigned short PatternSize
Definition: HitPattern.h:341
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int HitPattern::numberOfDTStationsWithRZView ( ) const

Definition at line 691 of file HitPattern.cc.

References getDTSuperLayer(), getHitPattern(), getMuonStation(), HitSize, i, muonDTHitFilter(), listBenchmarks::pattern, PatternSize, mergeVDriftHistosByStation::stations, and validHitFilter().

691  {
692  int stations[4] = { 0,0,0,0 };
693  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
694  uint32_t pattern = getHitPattern(i);
695  if (pattern == 0) break;
696  if (muonDTHitFilter(pattern) && validHitFilter(pattern) && getDTSuperLayer(pattern) == 2) {
697  stations[getMuonStation(pattern)-1] = 1;
698  }
699  }
700  return stations[0]+stations[1]+stations[2]+stations[3];
701 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getDTSuperLayer(uint32_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:510
static bool muonDTHitFilter(uint32_t pattern)
Definition: HitPattern.h:444
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.h:506
static const unsigned short PatternSize
Definition: HitPattern.h:341
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int HitPattern::numberOfHits ( void  ) const

Definition at line 213 of file HitPattern.cc.

References prof2calltree::count, getHitPattern(), HitSize, i, listBenchmarks::pattern, and PatternSize.

Referenced by TrackAnalyzer::analyze(), CheckHitPattern::analyze(), PFCheckHitPattern::analyze(), TkConvValidator::analyze(), FixTrackHitPattern::analyze(), GetTrackTrajInfo::analyze(), appendHit(), PrimaryVertexAnalyzer4PU::fillTrackHistos(), spr::goodTrack(), PrimaryVertexValidation::hasFirstLayerPixelHits(), index_to_hitpattern(), PFDisplacedVertexHelper::isTrackSelected(), TCMETAlgo::nExpectedInnerHits(), TCMETAlgo::nExpectedOuterHits(), FWTrackResidualDetailView::prepareData(), reco::TrackResiduals::print(), CheckHitPattern::print(), PFCheckHitPattern::print(), print(), PrimaryVertexAnalyzer4PU::printRecTrks(), IsolatedTracksCone::printTrack(), IsolatedTracksNxN::printTrack(), FWConvTrackHitsDetailView::setTextInfo(), and QcdUeDQM::trackSelection().

213  {
214  int count = 0;
215  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
216  uint32_t pattern = getHitPattern(i);
217  if (pattern == 0) break;
218  ++count;
219  }
220  return count;
221 }
int i
Definition: DBlmapReader.cc:9
static const unsigned short PatternSize
Definition: HitPattern.h:341
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::numberOfInactiveHits ( ) const
inline

Definition at line 691 of file HitPattern.h.

References countHits(), and type_2_HitFilter().

691  {
692  return countHits(type_2_HitFilter);
693 }
static bool type_2_HitFilter(uint32_t pattern)
Definition: HitPattern.h:539
int countHits(filterType filter) const
Definition: HitPattern.h:150
int reco::HitPattern::numberOfInactiveTrackerHits ( ) const
inline

Definition at line 695 of file HitPattern.h.

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

695  {
697 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
static bool type_2_HitFilter(uint32_t pattern)
Definition: HitPattern.h:539
int reco::HitPattern::numberOfLostHits ( ) const
inline

Definition at line 611 of file HitPattern.h.

References countHits(), and type_1_HitFilter().

Referenced by reco::TransientTrack::numberOfLostHits(), and reco::TrackBase::numberOfLostHits().

611  {
612  return countHits(type_1_HitFilter);
613 }
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
int countHits(filterType filter) const
Definition: HitPattern.h:150
int reco::HitPattern::numberOfLostMuonCSCHits ( ) const
inline

Definition at line 659 of file HitPattern.h.

References countTypedHits(), muonCSCHitFilter(), and type_1_HitFilter().

659  {
661 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
static bool muonCSCHitFilter(uint32_t pattern)
Definition: HitPattern.h:451
int reco::HitPattern::numberOfLostMuonDTHits ( ) const
inline

Definition at line 655 of file HitPattern.h.

References countTypedHits(), muonDTHitFilter(), and type_1_HitFilter().

655  {
657 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool muonDTHitFilter(uint32_t pattern)
Definition: HitPattern.h:444
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
int reco::HitPattern::numberOfLostMuonHits ( ) const
inline

Definition at line 619 of file HitPattern.h.

References countTypedHits(), muonHitFilter(), and type_1_HitFilter().

619  {
621 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
int reco::HitPattern::numberOfLostMuonRPCHits ( ) const
inline

Definition at line 663 of file HitPattern.h.

References countTypedHits(), muonRPCHitFilter(), and type_1_HitFilter().

663  {
665 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
static bool muonRPCHitFilter(uint32_t pattern)
Definition: HitPattern.h:458
int reco::HitPattern::numberOfLostPixelBarrelHits ( ) const
inline

Definition at line 627 of file HitPattern.h.

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

627  {
629 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
static bool pixelBarrelHitFilter(uint32_t pattern)
Definition: HitPattern.h:392
int reco::HitPattern::numberOfLostPixelEndcapHits ( ) const
inline

Definition at line 631 of file HitPattern.h.

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

631  {
633 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
static bool pixelEndcapHitFilter(uint32_t pattern)
Definition: HitPattern.h:399
int reco::HitPattern::numberOfLostPixelHits ( ) const
inline

Definition at line 623 of file HitPattern.h.

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

623  {
625 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
static bool pixelHitFilter(uint32_t pattern)
Definition: HitPattern.h:384
int reco::HitPattern::numberOfLostStripHits ( ) const
inline

Definition at line 635 of file HitPattern.h.

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

635  {
637 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
static bool stripHitFilter(uint32_t pattern)
Definition: HitPattern.h:406
int reco::HitPattern::numberOfLostStripTECHits ( ) const
inline

Definition at line 651 of file HitPattern.h.

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

651  {
653 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool stripTECHitFilter(uint32_t pattern)
Definition: HitPattern.h:437
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
int reco::HitPattern::numberOfLostStripTIBHits ( ) const
inline

Definition at line 639 of file HitPattern.h.

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

639  {
641 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
static bool stripTIBHitFilter(uint32_t pattern)
Definition: HitPattern.h:416
int reco::HitPattern::numberOfLostStripTIDHits ( ) const
inline

Definition at line 643 of file HitPattern.h.

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

643  {
645 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool stripTIDHitFilter(uint32_t pattern)
Definition: HitPattern.h:423
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
int reco::HitPattern::numberOfLostStripTOBHits ( ) const
inline

Definition at line 647 of file HitPattern.h.

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

647  {
649 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
static bool stripTOBHitFilter(uint32_t pattern)
Definition: HitPattern.h:430
int reco::HitPattern::numberOfLostTrackerHits ( ) const
inline

Definition at line 615 of file HitPattern.h.

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

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

615  {
617 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
static bool type_1_HitFilter(uint32_t pattern)
Definition: HitPattern.h:534
int reco::HitPattern::numberOfValidHits ( ) const
inline
int reco::HitPattern::numberOfValidMuonCSCHits ( ) const
inline

Definition at line 602 of file HitPattern.h.

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

Referenced by MuonTrackValidator::analyze().

602  {
604 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static bool muonCSCHitFilter(uint32_t pattern)
Definition: HitPattern.h:451
int reco::HitPattern::numberOfValidMuonDTHits ( ) const
inline

Definition at line 598 of file HitPattern.h.

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

Referenced by MuonTrackValidator::analyze().

598  {
600 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool muonDTHitFilter(uint32_t pattern)
Definition: HitPattern.h:444
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
int reco::HitPattern::numberOfValidMuonHits ( ) const
inline

Definition at line 562 of file HitPattern.h.

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

Referenced by HLTMuonL3PreFilter::hltFilter(), BPhysicsOniaDQM::selGlobalMuon(), MuScleFitMuonSelector::selGlobalMuon(), and MuScleFit::selGlobalMuon().

562  {
564 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
int reco::HitPattern::numberOfValidMuonRPCHits ( ) const
inline

Definition at line 606 of file HitPattern.h.

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

Referenced by MuonTrackValidator::analyze().

606  {
608 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool muonRPCHitFilter(uint32_t pattern)
Definition: HitPattern.h:458
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
int reco::HitPattern::numberOfValidPixelBarrelHits ( ) const
inline

Definition at line 570 of file HitPattern.h.

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

Referenced by TrackAnalyzer::doTrackerSpecificFillHists(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), HLTTrackWithHits::hltFilter(), and HIPAlignmentAlgorithm::run().

570  {
572 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static bool pixelBarrelHitFilter(uint32_t pattern)
Definition: HitPattern.h:392
int reco::HitPattern::numberOfValidPixelEndcapHits ( ) const
inline

Definition at line 574 of file HitPattern.h.

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

Referenced by TrackAnalyzer::doTrackerSpecificFillHists(), MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), HLTTrackWithHits::hltFilter(), and HIPAlignmentAlgorithm::run().

574  {
576 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static bool pixelEndcapHitFilter(uint32_t pattern)
Definition: HitPattern.h:399
int reco::HitPattern::numberOfValidPixelHits ( ) const
inline
int reco::HitPattern::numberOfValidStripHits ( ) const
inline

Definition at line 578 of file HitPattern.h.

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

578  {
580 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static bool stripHitFilter(uint32_t pattern)
Definition: HitPattern.h:406
int HitPattern::numberOfValidStripLayersWithMonoAndStereo ( ) const

Definition at line 224 of file HitPattern.cc.

References prof2calltree::count, getHitPattern(), getLayer(), getSide(), getSubStructure(), HitSize, i, j, LayerMask, listBenchmarks::pattern, PatternSize, stripHitFilter(), SubstrMask, and validHitFilter().

Referenced by MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos(), RecoTrackSelector::operator()(), reco::modules::CosmicTrackSelector::select(), reco::modules::MultiTrackSelector::select(), and QcdUeDQM::trackSelection().

224  {
225  static const int nHits = (PatternSize * 32) / HitSize;
226  bool hasMono[SubstrMask + 1][LayerMask + 1];
227  // printf("sizeof(hasMono) = %d\n", sizeof(hasMono));
228  memset(hasMono, 0, sizeof(hasMono));
229  bool hasStereo[SubstrMask + 1][LayerMask + 1];
230  memset(hasStereo, 0, sizeof(hasStereo));
231  // mark which layers have mono/stereo hits
232  for (int i = 0; i < nHits; i++) {
233  uint32_t pattern = getHitPattern(i);
234  if (pattern == 0) break;
235  if (validHitFilter(pattern) && stripHitFilter(pattern)) {
236  switch (getSide(pattern)) {
237  case 0: // mono
238  hasMono[getSubStructure(pattern)][getLayer(pattern)]
239  = true;
240  break;
241  case 1: // stereo
242  hasStereo[getSubStructure(pattern)][getLayer(pattern)]
243  = true;
244  break;
245  default:
246  break;
247  }
248  }
249 
250  }
251  // count how many layers have mono and stereo hits
252  int count = 0;
253  for (int i = 0; i < SubstrMask + 1; ++i)
254  for (int j = 0; j < LayerMask + 1; ++j)
255  if (hasMono[i][j] && hasStereo[i][j])
256  count++;
257  return count;
258 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint32_t pattern)
Definition: HitPattern.h:485
static const unsigned short PatternSize
Definition: HitPattern.h:341
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
int j
Definition: DBlmapReader.cc:9
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static const unsigned short HitSize
Definition: HitPattern.h:344
static uint32_t getSide(uint32_t pattern)
Definition: HitPattern.h:496
static const unsigned short SubstrMask
Definition: HitPattern.h:352
static bool stripHitFilter(uint32_t pattern)
Definition: HitPattern.h:406
static const unsigned short LayerMask
Definition: HitPattern.h:356
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::numberOfValidStripTECHits ( ) const
inline

Definition at line 594 of file HitPattern.h.

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

Referenced by TrackAnalyzer::doTrackerSpecificFillHists(), and MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos().

594  {
596 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool stripTECHitFilter(uint32_t pattern)
Definition: HitPattern.h:437
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
int reco::HitPattern::numberOfValidStripTIBHits ( ) const
inline

Definition at line 582 of file HitPattern.h.

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

Referenced by CheckHitPattern::analyze(), TrackAnalyzer::doTrackerSpecificFillHists(), and MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos().

582  {
584 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static bool stripTIBHitFilter(uint32_t pattern)
Definition: HitPattern.h:416
int reco::HitPattern::numberOfValidStripTIDHits ( ) const
inline

Definition at line 586 of file HitPattern.h.

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

Referenced by TrackAnalyzer::doTrackerSpecificFillHists(), and MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos().

586  {
588 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool stripTIDHitFilter(uint32_t pattern)
Definition: HitPattern.h:423
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
int reco::HitPattern::numberOfValidStripTOBHits ( ) const
inline

Definition at line 590 of file HitPattern.h.

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

Referenced by CheckHitPattern::analyze(), TrackAnalyzer::doTrackerSpecificFillHists(), and MTVHistoProducerAlgoForTracker::fill_simAssociated_recoTrack_histos().

590  {
592 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
static bool stripTOBHitFilter(uint32_t pattern)
Definition: HitPattern.h:430
int reco::HitPattern::numberOfValidTrackerHits ( ) const
inline

Definition at line 558 of file HitPattern.h.

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

Referenced by CSCSkim::doBFieldStudySelection(), PFMuonAlgo::isTrackerTightMuon(), PFMuonAlgo::printMuonProperties(), PFAlgo::reconstructTrack(), and reco::TrackBase::validFraction().

558  {
560 }
int countTypedHits(filterType typeFilter, filterType filter) const
Definition: HitPattern.h:160
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:529
int reco::HitPattern::outermostMuonStationWithAnyHits ( ) const
inline

Definition at line 794 of file HitPattern.h.

References outermostMuonStationWithHits().

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

Definition at line 793 of file HitPattern.h.

References outermostMuonStationWithHits().

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

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

Definition at line 664 of file HitPattern.cc.

References getHitPattern(), getHitType(), getMuonStation(), HitSize, i, muonHitFilter(), listBenchmarks::pattern, PatternSize, and run_regression::ret.

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

664  {
665  int ret = 0;
666  for (int i=0; i<(PatternSize * 32) / HitSize; i++) {
667  uint32_t pattern = getHitPattern(i);
668  if (pattern == 0) break;
669  if (muonHitFilter(pattern) &&
670  (hitType == -1 || int(getHitType(pattern)) == hitType)) {
671  int stat = getMuonStation(pattern);
672  if (ret == 0 || stat > ret) ret = stat;
673  }
674  }
675  return ret;
676 }
int i
Definition: DBlmapReader.cc:9
static uint32_t getHitType(uint32_t pattern)
Definition: HitPattern.h:501
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.h:506
static const unsigned short PatternSize
Definition: HitPattern.h:341
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
static const unsigned short HitSize
Definition: HitPattern.h:344
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::outermostMuonStationWithValidHits ( ) const
inline

Definition at line 792 of file HitPattern.h.

References outermostMuonStationWithHits().

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

Definition at line 392 of file HitPattern.h.

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

Referenced by PrimaryVertexValidation::hasFirstLayerPixelHits(), hasValidHitInFirstPixelBarrel(), SoftPFElectronTagInfoProducer::isElecClean(), numberOfLostPixelBarrelHits(), and numberOfValidPixelBarrelHits().

392  {
394  uint32_t substructure = getSubStructure(pattern);
395  if (substructure == PixelSubdetector::PixelBarrel) return true;
396  return false;
397  }
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
int HitPattern::pixelBarrelLayersNull ( ) const

Definition at line 502 of file HitPattern.cc.

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

Referenced by pixelLayersNull().

502  {
503  int count = 0;
504  uint32_t substr = PixelSubdetector::PixelBarrel;
505  for (uint32_t layer=1; layer<=3; layer++) {
506  if (getTrackerLayerCase(substr, layer) == 999999) count++;
507  }
508  return count;
509 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::pixelBarrelLayersTotallyOffOrBad ( ) const

Definition at line 447 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

447  {
448  int count = 0;
449  uint32_t substr = PixelSubdetector::PixelBarrel;
450  for (uint32_t layer=1; layer<=3; layer++) {
451  if (getTrackerLayerCase(substr, layer) == 2) count++;
452  }
453  return count;
454 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::pixelBarrelLayersWithMeasurement ( ) const

Definition at line 337 of file HitPattern.cc.

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

Referenced by TrackAnalyzer::doTrackerSpecificFillHists(), PrimaryVertexAnalyzer4PU::fillTrackHistos(), pixelLayersWithMeasurement(), IsolatedTracksNxN::printTrack(), and BeamFitter::readEvent().

337  {
338  int count = 0;
339  uint32_t substr = PixelSubdetector::PixelBarrel;
340  for (uint32_t layer=1; layer<=3; layer++) {
341  if (getTrackerLayerCase(substr, layer) == 0) count++;
342  }
343  return count;
344 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::pixelBarrelLayersWithoutMeasurement ( ) const

Definition at line 392 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

392  {
393  int count = 0;
394  uint32_t substr = PixelSubdetector::PixelBarrel;
395  for (uint32_t layer=1; layer<=3; layer++) {
396  if (getTrackerLayerCase(substr, layer) == 1) count++;
397  }
398  return count;
399 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
bool reco::HitPattern::pixelEndcapHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 399 of file HitPattern.h.

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

Referenced by PrimaryVertexValidation::hasFirstLayerPixelHits(), hasValidHitInFirstPixelEndcap(), SoftPFElectronTagInfoProducer::isElecClean(), numberOfLostPixelEndcapHits(), and numberOfValidPixelEndcapHits().

399  {
401  uint32_t substructure = getSubStructure(pattern);
402  if (substructure == PixelSubdetector::PixelEndcap) return true;
403  return false;
404  }
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
int HitPattern::pixelEndcapLayersNull ( ) const

Definition at line 511 of file HitPattern.cc.

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

Referenced by pixelLayersNull().

511  {
512  int count = 0;
513  uint32_t substr = PixelSubdetector::PixelEndcap;
514  for (uint32_t layer=1; layer<=2; layer++) {
515  if (getTrackerLayerCase(substr, layer) == 999999) count++;
516  }
517  return count;
518 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::pixelEndcapLayersTotallyOffOrBad ( ) const

Definition at line 456 of file HitPattern.cc.

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

Referenced by pixelLayersTotallyOffOrBad().

456  {
457  int count = 0;
458  uint32_t substr = PixelSubdetector::PixelEndcap;
459  for (uint32_t layer=1; layer<=2; layer++) {
460  if (getTrackerLayerCase(substr, layer) == 2) count++;
461  }
462  return count;
463 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::pixelEndcapLayersWithMeasurement ( ) const

Definition at line 346 of file HitPattern.cc.

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

Referenced by TrackAnalyzer::doTrackerSpecificFillHists(), pixelLayersWithMeasurement(), IsolatedTracksNxN::printTrack(), and BeamFitter::readEvent().

346  {
347  int count = 0;
348  uint32_t substr = PixelSubdetector::PixelEndcap;
349  for (uint32_t layer=1; layer<=2; layer++) {
350  if (getTrackerLayerCase(substr, layer) == 0) count++;
351  }
352  return count;
353 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::pixelEndcapLayersWithoutMeasurement ( ) const

Definition at line 401 of file HitPattern.cc.

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

Referenced by pixelLayersWithoutMeasurement().

401  {
402  int count = 0;
403  uint32_t substr = PixelSubdetector::PixelEndcap;
404  for (uint32_t layer=1; layer<=2; layer++) {
405  if (getTrackerLayerCase(substr, layer) == 1) count++;
406  }
407  return count;
408 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
bool reco::HitPattern::pixelHitFilter ( uint32_t  pattern)
inlinestatic
int reco::HitPattern::pixelLayersNull ( ) const
inline

Definition at line 763 of file HitPattern.h.

References pixelBarrelLayersNull(), and pixelEndcapLayersNull().

Referenced by trackerLayersNull().

763  {
764  return pixelBarrelLayersNull() +
766  }
int pixelBarrelLayersNull() const
Definition: HitPattern.cc:502
int pixelEndcapLayersNull() const
Definition: HitPattern.cc:511
int reco::HitPattern::pixelLayersTotallyOffOrBad ( ) const
inline

Definition at line 746 of file HitPattern.h.

References pixelBarrelLayersTotallyOffOrBad(), and pixelEndcapLayersTotallyOffOrBad().

Referenced by trackerLayersTotallyOffOrBad().

746  {
749  }
int pixelBarrelLayersTotallyOffOrBad() const
Definition: HitPattern.cc:447
int pixelEndcapLayersTotallyOffOrBad() const
Definition: HitPattern.cc:456
int reco::HitPattern::pixelLayersWithMeasurement ( ) const
inline
int reco::HitPattern::pixelLayersWithoutMeasurement ( ) const
inline

Definition at line 728 of file HitPattern.h.

References pixelBarrelLayersWithoutMeasurement(), and pixelEndcapLayersWithoutMeasurement().

Referenced by trackerLayersWithoutMeasurement().

728  {
731  }
int pixelBarrelLayersWithoutMeasurement() const
Definition: HitPattern.cc:392
int pixelEndcapLayersWithoutMeasurement() const
Definition: HitPattern.cc:401
void HitPattern::print ( std::ostream &  stream = std::cout) const

Definition at line 583 of file HitPattern.cc.

References flags, getHitPattern(), i, numberOfHits(), listBenchmarks::pattern, and printHitPattern().

584 {
585  stream << "HitPattern" << std::endl;
586  for (int i = 0; i < numberOfHits(); i++)
587  printHitPattern(i, stream);
588  std::ios_base::fmtflags flags = stream.flags();
589  stream.setf ( std::ios_base::hex, std::ios_base::basefield );
590  stream.setf ( std::ios_base::showbase );
591  for (int i = 0; i < numberOfHits(); i++) {
592  uint32_t pattern = getHitPattern(i);
593  stream << pattern << std::endl;
594  }
595  stream.flags(flags);
596 }
int i
Definition: DBlmapReader.cc:9
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
int numberOfHits() const
Definition: HitPattern.cc:213
void printHitPattern(int position, std::ostream &stream) const
Definition: HitPattern.cc:556
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
void HitPattern::printHitPattern ( int  position,
std::ostream &  stream 
) const

Definition at line 556 of file HitPattern.cc.

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

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

557 {
558  uint32_t pattern = getHitPattern(position);
559  stream << "\t";
560  if (muonHitFilter(pattern))
561  stream << "muon";
562  if (trackerHitFilter(pattern))
563  stream << "tracker";
564  stream << "\tsubstructure " << getSubStructure(pattern);
565  if (muonHitFilter(pattern)) {
566  stream << "\tstation " << getMuonStation(pattern);
567  if (muonDTHitFilter(pattern)) {
568  stream << "\tdt superlayer " << getDTSuperLayer(pattern);
569  } else if (muonCSCHitFilter(pattern)) {
570  stream << "\tcsc ring " << getCSCRing(pattern);
571  } else if (muonRPCHitFilter(pattern)) {
572  stream << "\trpc " << (getRPCregion(pattern) ? "endcaps" : "barrel") << ", layer " << getRPCLayer(pattern);
573  } else {
574  stream << "(UNKNOWN Muon SubStructure!) \tsubsubstructure " << getSubStructure(pattern);
575  }
576  } else {
577  stream << "\tlayer " << getLayer(pattern);
578  }
579  stream << "\thit type " << getHitType(pattern);
580  stream << std::endl;
581 }
static uint32_t getRPCLayer(uint32_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:518
static uint32_t getDTSuperLayer(uint32_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:510
static uint32_t getLayer(uint32_t pattern)
Definition: HitPattern.h:485
static uint32_t getCSCRing(uint32_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
Definition: HitPattern.h:514
static bool muonDTHitFilter(uint32_t pattern)
Definition: HitPattern.h:444
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
static uint32_t getHitType(uint32_t pattern)
Definition: HitPattern.h:501
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
Definition: HitPattern.h:506
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
static bool muonHitFilter(uint32_t pattern)
Definition: HitPattern.h:472
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
static bool muonRPCHitFilter(uint32_t pattern)
Definition: HitPattern.h:458
static uint32_t getRPCregion(uint32_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
Definition: HitPattern.h:524
static bool muonCSCHitFilter(uint32_t pattern)
Definition: HitPattern.h:451
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
int reco::HitPattern::rpcStationsWithAnyHits ( ) const
inline

Definition at line 787 of file HitPattern.h.

References muonStations().

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

Definition at line 786 of file HitPattern.h.

References muonStations().

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

Definition at line 785 of file HitPattern.h.

References muonStations().

785 { return muonStations(3, 0); }
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC); hitType=-1(all), 0=valid, 3=bad
Definition: HitPattern.cc:635
template<typename I >
void reco::HitPattern::set ( const I &  begin,
const I &  end 
)
inline

Definition at line 139 of file HitPattern.h.

References hitPattern_, HitSize, Exhume::I, i, and PatternSize.

Referenced by FixTrackHitPattern::analyze(), appendHit(), betterConfigParser.BetterConfigParser::getGeneral(), HitPattern(), reco::TrackBase::setHitPattern(), reco::TrackBase::setTrackerExpectedHitsInner(), and reco::TrackBase::setTrackerExpectedHitsOuter().

139  {
140  for (int i=0; i<PatternSize; i++) hitPattern_[i] = 0;
141  unsigned int counter = 0;
142  for (I hit=begin; hit!=end && counter<32*PatternSize/HitSize;
143  hit++, counter++)
144  set(*hit, counter);
145  }
int i
Definition: DBlmapReader.cc:9
uint32_t hitPattern_[PatternSize]
Definition: HitPattern.h:367
void set(const I &begin, const I &end)
Definition: HitPattern.h:139
static const unsigned short PatternSize
Definition: HitPattern.h:341
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:38
static const unsigned short HitSize
Definition: HitPattern.h:344
#define begin
Definition: vmac.h:31
void reco::HitPattern::set ( const TrackingRecHit hit,
unsigned int  i 
)
inline

Definition at line 175 of file HitPattern.h.

References encode(), and setHitPattern().

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

175 {setHitPattern(i, encode(hit,i));}
int i
Definition: DBlmapReader.cc:9
uint32_t encode(const TrackingRecHit &, unsigned int)
Definition: HitPattern.cc:15
void setHitPattern(int position, uint32_t pattern)
Definition: HitPattern.cc:79
void reco::HitPattern::set ( const TrackingRecHitRef ref,
unsigned int  i 
)
inlineprivate

Definition at line 373 of file HitPattern.h.

References set().

Referenced by betterConfigParser.BetterConfigParser::getGeneral(), and set().

373 { set(* ref, i); }
int i
Definition: DBlmapReader.cc:9
void set(const I &begin, const I &end)
Definition: HitPattern.h:139
void HitPattern::setHitPattern ( int  position,
uint32_t  pattern 
)
private

Definition at line 79 of file HitPattern.cc.

References hitPattern_, HitSize, i, evf::evtn::offset(), and pos.

Referenced by set().

79  {
80  int offset = position * HitSize;
81  for (int i=0; i<HitSize; i++) {
82  int pos = offset + i;
83  uint32_t bit = (pattern >> i) & 0x1;
84  hitPattern_[pos / 32] += bit << ((offset + i) % 32);
85  }
86 }
int i
Definition: DBlmapReader.cc:9
uint32_t hitPattern_[PatternSize]
Definition: HitPattern.h:367
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
unsigned int offset(bool)
static const unsigned short HitSize
Definition: HitPattern.h:344
bool reco::HitPattern::stripHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 406 of file HitPattern.h.

References getSubStructure(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, trackerHitFilter(), and unlikely.

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

406  {
408  uint32_t substructure = getSubStructure(pattern);
409  if (substructure == StripSubdetector::TIB ||
410  substructure == StripSubdetector::TID ||
411  substructure == StripSubdetector::TOB ||
412  substructure == StripSubdetector::TEC) return true;
413  return false;
414  }
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
int reco::HitPattern::stripLayersNull ( ) const
inline

Definition at line 768 of file HitPattern.h.

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

Referenced by trackerLayersNull().

768  {
769  return stripTIBLayersNull() +
771  stripTOBLayersNull() +
773  }
int stripTIBLayersNull() const
Definition: HitPattern.cc:520
int stripTECLayersNull() const
Definition: HitPattern.cc:547
int stripTIDLayersNull() const
Definition: HitPattern.cc:529
int stripTOBLayersNull() const
Definition: HitPattern.cc:538
int reco::HitPattern::stripLayersTotallyOffOrBad ( ) const
inline
int reco::HitPattern::stripLayersWithMeasurement ( ) const
inline
int reco::HitPattern::stripLayersWithoutMeasurement ( ) const
inline
bool reco::HitPattern::stripTECHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 437 of file HitPattern.h.

References getSubStructure(), StripSubdetector::TEC, trackerHitFilter(), and unlikely.

Referenced by numberOfLostStripTECHits(), numberOfValidStripTECHits(), EgAmbiguityTools::sharedDets(), and EgAmbiguityTools::sharedHits().

437  {
439  uint32_t substructure = getSubStructure(pattern);
440  if (substructure == StripSubdetector::TEC) return true;
441  return false;
442  }
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
int HitPattern::stripTECLayersNull ( ) const

Definition at line 547 of file HitPattern.cc.

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

Referenced by stripLayersNull().

547  {
548  int count = 0;
549  uint32_t substr = StripSubdetector::TEC;
550  for (uint32_t layer=1; layer<=9; layer++) {
551  if (getTrackerLayerCase(substr, layer) == 999999) count++;
552  }
553  return count;
554 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTECLayersTotallyOffOrBad ( ) const

Definition at line 492 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

492  {
493  int count = 0;
494  uint32_t substr = StripSubdetector::TEC;
495  for (uint32_t layer=1; layer<=9; layer++) {
496  if (getTrackerLayerCase(substr, layer) == 2) count++;
497  }
498  return count;
499 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTECLayersWithMeasurement ( ) const

Definition at line 382 of file HitPattern.cc.

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

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

382  {
383  int count = 0;
384  uint32_t substr = StripSubdetector::TEC;
385  for (uint32_t layer=1; layer<=9; layer++) {
386  if (getTrackerLayerCase(substr, layer) == 0) count++;
387  }
388  return count;
389 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTECLayersWithoutMeasurement ( ) const

Definition at line 437 of file HitPattern.cc.

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

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

437  {
438  int count = 0;
439  uint32_t substr = StripSubdetector::TEC;
440  for (uint32_t layer=1; layer<=9; layer++) {
441  if (getTrackerLayerCase(substr, layer) == 1) count++;
442  }
443  return count;
444 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
bool reco::HitPattern::stripTIBHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 416 of file HitPattern.h.

References getSubStructure(), StripSubdetector::TIB, trackerHitFilter(), and unlikely.

Referenced by GsfElectronAlgo::ElectronData::checkCtfTrack(), GsfElectronCoreBaseProducer::getCtfTrackRef(), numberOfLostStripTIBHits(), numberOfValidStripTIBHits(), EgAmbiguityTools::sharedDets(), and EgAmbiguityTools::sharedHits().

416  {
418  uint32_t substructure = getSubStructure(pattern);
419  if (substructure == StripSubdetector::TIB) return true;
420  return false;
421  }
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
int HitPattern::stripTIBLayersNull ( ) const

Definition at line 520 of file HitPattern.cc.

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

Referenced by stripLayersNull().

520  {
521  int count = 0;
522  uint32_t substr = StripSubdetector::TIB;
523  for (uint32_t layer=1; layer<=4; layer++) {
524  if (getTrackerLayerCase(substr, layer) == 999999) count++;
525  }
526  return count;
527 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTIBLayersTotallyOffOrBad ( ) const

Definition at line 465 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

465  {
466  int count = 0;
467  uint32_t substr = StripSubdetector::TIB;
468  for (uint32_t layer=1; layer<=4; layer++) {
469  if (getTrackerLayerCase(substr, layer) == 2) count++;
470  }
471  return count;
472 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTIBLayersWithMeasurement ( ) const

Definition at line 355 of file HitPattern.cc.

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

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

355  {
356  int count = 0;
357  uint32_t substr = StripSubdetector::TIB;
358  for (uint32_t layer=1; layer<=4; layer++) {
359  if (getTrackerLayerCase(substr, layer) == 0) count++;
360  }
361  return count;
362 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTIBLayersWithoutMeasurement ( ) const

Definition at line 410 of file HitPattern.cc.

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

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

410  {
411  int count = 0;
412  uint32_t substr = StripSubdetector::TIB;
413  for (uint32_t layer=1; layer<=4; layer++) {
414  if (getTrackerLayerCase(substr, layer) == 1) count++;
415  }
416  return count;
417 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
bool reco::HitPattern::stripTIDHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 423 of file HitPattern.h.

References getSubStructure(), StripSubdetector::TID, trackerHitFilter(), and unlikely.

Referenced by GsfElectronAlgo::ElectronData::checkCtfTrack(), GsfElectronCoreBaseProducer::getCtfTrackRef(), numberOfLostStripTIDHits(), numberOfValidStripTIDHits(), EgAmbiguityTools::sharedDets(), and EgAmbiguityTools::sharedHits().

423  {
425  uint32_t substructure = getSubStructure(pattern);
426  if (substructure == StripSubdetector::TID) return true;
427  return false;
428  }
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
int HitPattern::stripTIDLayersNull ( ) const

Definition at line 529 of file HitPattern.cc.

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

Referenced by stripLayersNull().

529  {
530  int count = 0;
531  uint32_t substr = StripSubdetector::TID;
532  for (uint32_t layer=1; layer<=3; layer++) {
533  if (getTrackerLayerCase(substr, layer) == 999999) count++;
534  }
535  return count;
536 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTIDLayersTotallyOffOrBad ( ) const

Definition at line 474 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

474  {
475  int count = 0;
476  uint32_t substr = StripSubdetector::TID;
477  for (uint32_t layer=1; layer<=3; layer++) {
478  if (getTrackerLayerCase(substr, layer) == 2) count++;
479  }
480  return count;
481 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTIDLayersWithMeasurement ( ) const

Definition at line 364 of file HitPattern.cc.

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

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

364  {
365  int count = 0;
366  uint32_t substr = StripSubdetector::TID;
367  for (uint32_t layer=1; layer<=3; layer++) {
368  if (getTrackerLayerCase(substr, layer) == 0) count++;
369  }
370  return count;
371 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTIDLayersWithoutMeasurement ( ) const

Definition at line 419 of file HitPattern.cc.

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

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

419  {
420  int count = 0;
421  uint32_t substr = StripSubdetector::TID;
422  for (uint32_t layer=1; layer<=3; layer++) {
423  if (getTrackerLayerCase(substr, layer) == 1) count++;
424  }
425  return count;
426 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
bool reco::HitPattern::stripTOBHitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 430 of file HitPattern.h.

References getSubStructure(), StripSubdetector::TOB, trackerHitFilter(), and unlikely.

Referenced by numberOfLostStripTOBHits(), numberOfValidStripTOBHits(), EgAmbiguityTools::sharedDets(), and EgAmbiguityTools::sharedHits().

430  {
432  uint32_t substructure = getSubStructure(pattern);
433  if (substructure == StripSubdetector::TOB) return true;
434  return false;
435  }
static bool trackerHitFilter(uint32_t pattern)
Definition: HitPattern.h:466
#define unlikely(x)
Definition: Likely.h:21
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:479
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
int HitPattern::stripTOBLayersNull ( ) const

Definition at line 538 of file HitPattern.cc.

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

Referenced by stripLayersNull().

538  {
539  int count = 0;
540  uint32_t substr = StripSubdetector::TOB;
541  for (uint32_t layer=1; layer<=6; layer++) {
542  if (getTrackerLayerCase(substr, layer) == 999999) count++;
543  }
544  return count;
545 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTOBLayersTotallyOffOrBad ( ) const

Definition at line 483 of file HitPattern.cc.

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

Referenced by stripLayersTotallyOffOrBad().

483  {
484  int count = 0;
485  uint32_t substr = StripSubdetector::TOB;
486  for (uint32_t layer=1; layer<=6; layer++) {
487  if (getTrackerLayerCase(substr, layer) == 2) count++;
488  }
489  return count;
490 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTOBLayersWithMeasurement ( ) const

Definition at line 373 of file HitPattern.cc.

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

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

373  {
374  int count = 0;
375  uint32_t substr = StripSubdetector::TOB;
376  for (uint32_t layer=1; layer<=6; layer++) {
377  if (getTrackerLayerCase(substr, layer) == 0) count++;
378  }
379  return count;
380 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
int HitPattern::stripTOBLayersWithoutMeasurement ( ) const

Definition at line 428 of file HitPattern.cc.

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

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

428  {
429  int count = 0;
430  uint32_t substr = StripSubdetector::TOB;
431  for (uint32_t layer=1; layer<=6; layer++) {
432  if (getTrackerLayerCase(substr, layer) == 1) count++;
433  }
434  return count;
435 }
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
Definition: HitPattern.cc:260
bool reco::HitPattern::trackerHitFilter ( uint32_t  pattern)
inlinestatic
int reco::HitPattern::trackerLayersNull ( ) const
inline

Definition at line 758 of file HitPattern.h.

References pixelLayersNull(), and stripLayersNull().

758  {
759  return pixelLayersNull() +
760  stripLayersNull();
761  }
int pixelLayersNull() const
Definition: HitPattern.h:763
int stripLayersNull() const
Definition: HitPattern.h:768
int reco::HitPattern::trackerLayersTotallyOffOrBad ( ) const
inline

Definition at line 741 of file HitPattern.h.

References pixelLayersTotallyOffOrBad(), and stripLayersTotallyOffOrBad().

741  {
742  return pixelLayersTotallyOffOrBad() +
744  }
int pixelLayersTotallyOffOrBad() const
Definition: HitPattern.h:746
int stripLayersTotallyOffOrBad() const
Definition: HitPattern.h:751
int reco::HitPattern::trackerLayersWithMeasurement ( ) const
inline
int reco::HitPattern::trackerLayersWithoutMeasurement ( ) const
inline
bool reco::HitPattern::type_1_HitFilter ( uint32_t  pattern)
inlinestatic
bool reco::HitPattern::type_2_HitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 539 of file HitPattern.h.

References getHitType().

Referenced by numberOfBadMuonCSCHits(), numberOfBadMuonDTHits(), numberOfBadMuonHits(), numberOfBadMuonRPCHits(), numberOfInactiveHits(), and numberOfInactiveTrackerHits().

539  {
540  if (getHitType(pattern) == 2) return true;
541  return false;
542  }
static uint32_t getHitType(uint32_t pattern)
Definition: HitPattern.h:501
bool reco::HitPattern::type_3_HitFilter ( uint32_t  pattern)
inlinestatic

Definition at line 544 of file HitPattern.h.

References getHitType().

Referenced by numberOfBadHits().

544  {
545  if (getHitType(pattern) == 3) return true;
546  return false;
547  }
static uint32_t getHitType(uint32_t pattern)
Definition: HitPattern.h:501
bool reco::HitPattern::validHitFilter ( uint32_t  pattern)
inlinestatic

Member Data Documentation

uint32_t reco::HitPattern::hitPattern_[PatternSize]
private

Definition at line 367 of file HitPattern.h.

Referenced by getHitPattern(), HitPattern(), set(), and setHitPattern().

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

Definition at line 364 of file HitPattern.h.

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

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

Definition at line 363 of file HitPattern.h.

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

const unsigned short reco::HitPattern::LayerMask = 0xF
staticprivate
const unsigned short reco::HitPattern::LayerOffset = 3
staticprivate
const unsigned short reco::HitPattern::PatternSize = 25
staticprivate
const unsigned short reco::HitPattern::SideMask = 0x1
staticprivate

Definition at line 360 of file HitPattern.h.

Referenced by encode(), and getSide().

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

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

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