CMS 3D CMS Logo

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  * FIXME: as it stands it is pretty inefficient for numerous reasons
9  * if used seriously it needs to be optimized and used properly...
10  */
11 
16 #include <utility>
17 #include <map>
18 
19 class DetId;
20 
21 class TrackerTopology;
22 class TrackerGeometry;
23 
25 public:
26  struct Result {
27  // Number of hits track has in front of the vertex.
28  unsigned int hitsInFrontOfVert;
29  // Number of missing hits between the vertex position and the innermost valid hit on the track.
30  unsigned int missHitsAfterVert;
31  };
32 
33  // Check if hit pattern of this track is consistent with it being produced
34  // at given vertex. See comments above for "Result" struct for details of returned information.
35  Result operator()(const reco::Track& track, const VertexState& vert) const;
36 
37  // Print hit pattern on track
38  static void print(const reco::Track& track);
39 
40  // Create map indicating r/z values of all layers/disks.
41  void init(const TrackerTopology* tTopo, const TrackerGeometry& geom, const TransientTrackBuilder& builder);
42 
43  // Return a pair<uint32, uint32> consisting of the numbers used by HitPattern to
44  // identify subdetector and layer number respectively.
45  typedef std::pair<uint32_t, uint32_t> DetInfo;
46  static DetInfo interpretDetId(DetId detId, const TrackerTopology* tTopo);
47 
48  // Return a bool indicating if a given subdetector is in the barrel.
49  static bool barrel(uint32_t subDet);
50 
52 
53 private:
54  // Note if geometry info is already initialized.
55  bool geomInitDone_ = false;
56 
57  // For a given subdetector & layer number, this stores the minimum and maximum
58  // r (or z) values if it is barrel (or endcap) respectively.
59  typedef std::map<DetInfo, std::pair<double, double> > RZrangeMap;
61 
62  // Makes TransientTracks needed for vertex fitting.
63  const TransientTrackBuilder* trkTool_ = nullptr;
64 };
65 
66 #endif
const TransientTrackBuilder * trkTool_
void init(const TrackerTopology *tTopo, const TrackerGeometry &geom, const TransientTrackBuilder &builder)
std::pair< uint32_t, uint32_t > DetInfo
std::map< DetInfo, std::pair< double, double > > RZrangeMap
unsigned int missHitsAfterVert
unsigned int hitsInFrontOfVert
Result operator()(const reco::Track &track, const VertexState &vert) const
Definition: DetId.h:17
static DetInfo interpretDetId(DetId detId, const TrackerTopology *tTopo)
static void print(const reco::Track &track)
static bool barrel(uint32_t subDet)
RZrangeMap rangeRorZ_