32 for (
unsigned int i = 0;
i < dets.size();
i++) {
35 auto detId = dets[
i]->geographicalId();
36 auto detInfo =
DetInfo(detId.subdetId(), tkerTopo->
layer(detId));
37 uint32_t subDet = detInfo.first;
41 if (this->
barrel(subDet)) {
42 r_or_z = dets[
i]->position().perp();
50 if (rangeRorZ_.find(detInfo) != rangeRorZ_.end()) {
51 minRZ = rangeRorZ_[detInfo].first;
52 maxRZ = rangeRorZ_[detInfo].second;
56 if (minRZ > r_or_z) minRZ = r_or_z;
57 if (maxRZ < r_or_z) maxRZ = r_or_z;
58 rangeRorZ_[detInfo] = pair<double, double>(minRZ, maxRZ);
63 RZrangeMap::const_iterator
d;
64 for (d = rangeRorZ_.begin(); d != rangeRorZ_.end(); d++) {
66 pair<double, double> rangeRZ = d->second;
78 pair< PFCheckHitPattern::PFTrackHitInfo, PFCheckHitPattern::PFTrackHitInfo>
89 if (!geomInitDone_) this->
init(tkerTopo, tkerGeom);
96 unsigned int nHitBefore = 0;
97 unsigned int nHitAfter = 0;
104 DetInfo detInfo(subDet, layer);
105 double maxRZ = rangeRorZ_[detInfo].second;
107 if (this->
barrel(subDet)) {
111 if (fabs(vert.
position().
z()) > maxRZ) nHitBefore++;
119 unsigned int nMissHitAfter = 0;
120 unsigned int nMissHitBefore = 0;
127 DetInfo detInfo(subDet, layer);
128 double minRZ = rangeRorZ_[detInfo].first;
132 if (this->
barrel(subDet)) {
134 else nMissHitBefore++;
136 if (fabs(vert.
position().
z()) < minRZ) nMissHitAfter++;
137 else nMissHitBefore++;
147 return pair< PFTrackHitInfo, PFTrackHitInfo>(trackToVertex, trackFromVertex);
154 cout<<
"=== Hits on Track ==="<<endl;
156 cout<<
"=== Hits before track ==="<<endl;
166 cout<<
"hit "<<
i<<
" subdet="<<subdet<<
" layer="<<layer<<
" type "<<hp.
getHitType(hit)<<endl;
value_type const * get() const
static uint32_t getLayer(uint16_t pattern)
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
void print(const reco::TrackBaseRef track) const
Print hit pattern on track.
static bool validHitFilter(uint16_t pattern)
std::pair< unsigned int, unsigned int > PFTrackHitInfo
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
PFTrackHitFullInfo analyze(const TrackerTopology *tkerTopo, const TrackerGeometry *tkerGeom, const reco::TrackBaseRef track, const TransientVertex &vert)
static uint32_t getHitType(uint16_t pattern)
GlobalPoint position() const
void init(const TrackerTopology *, const TrackerGeometry *)
Create map indicating r/z values of all layers/disks.
static uint32_t getSubStructure(uint16_t pattern)
static bool trackerHitFilter(uint16_t pattern)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
unsigned int layer(const DetId &id) const
std::pair< uint32_t, uint32_t > DetInfo
static int position[264][3]
uint16_t getHitPattern(HitCategory category, int position) const
std::vector< GeomDet const * > DetContainer
static bool barrel(uint32_t subDet)
Return a bool indicating if a given subdetector is in the barrel.
int numberOfHits(HitCategory category) const