42 for (
unsigned int i = 0;
i < dets.size();
i++) {
45 DetInfo detInfo = this->interpretDetId(dets[
i]->geographicalId());
46 uint32_t subDet = detInfo.first;
50 if (this->
barrel(subDet)) {
51 r_or_z = dets[
i]->position().perp();
59 if (rangeRorZ_.find(detInfo) != rangeRorZ_.end()) {
60 minRZ = rangeRorZ_[detInfo].first;
61 maxRZ = rangeRorZ_[detInfo].second;
65 if (minRZ > r_or_z) minRZ = r_or_z;
66 if (maxRZ < r_or_z) maxRZ = r_or_z;
67 rangeRorZ_[detInfo] = pair<double, double>(minRZ, maxRZ);
72 RZrangeMap::const_iterator d;
73 for (d = rangeRorZ_.begin(); d != rangeRorZ_.end(); d++) {
75 pair<double, double> rangeRZ = d->second;
96 throw Genexception(
"Found DetId that is not in Tracker");
107 pair< PFCheckHitPattern::PFTrackHitInfo, PFCheckHitPattern::PFTrackHitInfo>
118 if (!geomInitDone_) this->
init(tkerGeomHandle_);
126 unsigned int nHitBefore = 0;
127 unsigned int nHitAfter = 0;
134 DetInfo detInfo(subDet, layer);
135 double maxRZ = rangeRorZ_[detInfo].second;
137 if (this->
barrel(subDet)) {
141 if (fabs(vert.
position().
z()) > maxRZ) nHitBefore++;
149 unsigned int nMissHitAfter = 0;
150 unsigned int nMissHitBefore = 0;
157 DetInfo detInfo(subDet, layer);
158 double minRZ = rangeRorZ_[detInfo].first;
162 if (this->
barrel(subDet)) {
164 else nMissHitBefore++;
166 if (fabs(vert.
position().
z()) < minRZ) nMissHitAfter++;
167 else nMissHitBefore++;
177 return pair< PFTrackHitInfo, PFTrackHitInfo>(trackToVertex, trackFromVertex);
185 cout<<
"=== Hits on Track ==="<<endl;
187 cout<<
"=== Hits before track ==="<<endl;
197 cout<<
"hit "<<
i<<
" subdet="<<subdet<<
" layer="<<layer<<
" type "<<hp.
getHitType(hit)<<endl;
static RZrangeMap rangeRorZ_
unsigned int layer() const
layer id
static uint32_t getLayer(uint32_t pattern)
static bool trackerHitFilter(uint32_t pattern)
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
static uint32_t getHitType(uint32_t pattern)
void print(const reco::TrackBaseRef track) const
Print hit pattern on track.
std::vector< GeomDet * > DetContainer
static int position[TOTALCHAMBERS][3]
unsigned int layer() const
layer id
PFTrackHitFullInfo analyze(edm::ESHandle< TrackerGeometry >, const reco::TrackBaseRef track, const TransientVertex &vert)
std::pair< unsigned int, unsigned int > PFTrackHitInfo
static DetInfo interpretDetId(DetId detId)
GlobalPoint position() const
static uint32_t getSubStructure(uint32_t pattern)
const HitPattern & trackerExpectedHitsInner() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers before the fir...
static bool validHitFilter(uint32_t pattern)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int disk() const
disk id
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
std::pair< uint32_t, uint32_t > DetInfo
std::map< DetInfo, std::pair< double, double > > RZrangeMap
void init(edm::ESHandle< TrackerGeometry >)
Create map indicating r/z values of all layers/disks.
uint32_t getHitPattern(int position) const
value_type const * get() const
static bool barrel(uint32_t subDet)
Return a bool indicating if a given subdetector is in the barrel.
unsigned int wheel() const
wheel id