CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CheckHitPattern.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_RecoUtils_CheckHitPattern_H
2 #define PhysicsTools_RecoUtils_CheckHitPattern_H
3 
4 /*
5  * Determine if a track has hits in front of its assumed production point.
6  * Also determine if it misses hits between its assumed production point and its innermost hit.
7  */
8 
9 // standard EDAnalyser include files
10 #include <memory>
17 
22 
23 #include <utility>
24 #include <map>
25 
26 class DetId;
27 
28 class TrackerTopology;
29 
31 
32 public:
33 
34  struct Result {
35  // Number of hits track has in front of the vertex.
36  unsigned int hitsInFrontOfVert;
37  // Number of missing hits between the vertex position and the innermost valid hit on the track.
38  unsigned int missHitsAfterVert;
39  };
40 
42 
44 
45  // Check if hit pattern of this track is consistent with it being produced
46  // at given vertex. See comments above for "Result" struct for details of returned information.
47  // N.B. If FixHitPattern = true, then Result.missHitsAfterVert will be calculated after rederiving
48  // the missing hit pattern. This rederivation is sometimes a good idea, since otherwise the
49  // number of missing hits can be substantially underestimated. See comments in FixTrackHitPattern.h
50  // for details.
51  Result analyze(const edm::EventSetup& iSetup,
52  const reco::Track& track, const VertexState& vert, bool fixHitPattern=true);
53 
54  // Print hit pattern on track
55  void print(const reco::Track& track) const;
56 
57 private:
58  // Create map indicating r/z values of all layers/disks.
59  void init (const edm::EventSetup& iSetup);
60 
61  // Return a pair<uint32, uint32> consisting of the numbers used by HitPattern to
62  // identify subdetector and layer number respectively.
63  typedef std::pair<uint32_t, uint32_t> DetInfo;
64  static DetInfo interpretDetId(DetId detId, const TrackerTopology* tTopo);
65 
66  // Return a bool indicating if a given subdetector is in the barrel.
67  static bool barrel(uint32_t subDet);
68 
69  void print(const reco::HitPattern& hp) const;
70 
71 private:
72  // Note if geometry info is already initialized.
74 
75  // For a given subdetector & layer number, this stores the minimum and maximum
76  // r (or z) values if it is barrel (or endcap) respectively.
77  typedef std::map< DetInfo, std::pair< double, double> > RZrangeMap;
79 
80  // Makes TransientTracks needed for vertex fitting.
82 };
83 
84 #endif
std::map< DetInfo, std::pair< double, double > > RZrangeMap
Result analyze(const edm::EventSetup &iSetup, const reco::Track &track, const VertexState &vert, bool fixHitPattern=true)
std::pair< uint32_t, uint32_t > DetInfo
unsigned int missHitsAfterVert
unsigned int hitsInFrontOfVert
Definition: DetId.h:20
void init(const edm::EventSetup &iSetup)
static DetInfo interpretDetId(DetId detId, const TrackerTopology *tTopo)
static RZrangeMap rangeRorZ_
edm::ESHandle< TransientTrackBuilder > trkTool_
static bool barrel(uint32_t subDet)
void print(const reco::Track &track) const