CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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  * 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 
18 #include <utility>
19 #include <map>
20 
21 class DetId;
22 
23 class TrackerTopology;
24 
26 public:
27  struct Result {
28  // Number of hits track has in front of the vertex.
29  unsigned int hitsInFrontOfVert;
30  // Number of missing hits between the vertex position and the innermost valid hit on the track.
31  unsigned int missHitsAfterVert;
32  };
33 
34  // Check if hit pattern of this track is consistent with it being produced
35  // at given vertex. See comments above for "Result" struct for details of returned information.
36  Result operator()(const reco::Track& track, const VertexState& vert) const;
37 
38  // Print hit pattern on track
39  static void print(const reco::Track& track);
40 
41  // Create map indicating r/z values of all layers/disks.
42  void init(const edm::EventSetup& iSetup);
43 
44  // Return a pair<uint32, uint32> consisting of the numbers used by HitPattern to
45  // identify subdetector and layer number respectively.
46  typedef std::pair<uint32_t, uint32_t> DetInfo;
47  static DetInfo interpretDetId(DetId detId, const TrackerTopology* tTopo);
48 
49  // Return a bool indicating if a given subdetector is in the barrel.
50  static bool barrel(uint32_t subDet);
51 
52  static void print(const reco::HitPattern::HitCategory category, const reco::HitPattern& hp);
53 
54 private:
55  // Note if geometry info is already initialized.
56  bool geomInitDone_ = false;
57 
58  // For a given subdetector & layer number, this stores the minimum and maximum
59  // r (or z) values if it is barrel (or endcap) respectively.
60  typedef std::map<DetInfo, std::pair<double, double> > RZrangeMap;
62 
63  // Makes TransientTracks needed for vertex fitting.
65 };
66 
67 #endif
std::pair< uint32_t, uint32_t > DetInfo
static const char category[]
Result operator()(const reco::Track &track, const VertexState &vert) const
std::map< DetInfo, std::pair< double, double > > RZrangeMap
unsigned int missHitsAfterVert
unsigned int hitsInFrontOfVert
Definition: DetId.h:17
void init(const edm::EventSetup &iSetup)
static DetInfo interpretDetId(DetId detId, const TrackerTopology *tTopo)
static void print(const reco::Track &track)
edm::ESHandle< TransientTrackBuilder > trkTool_
static bool barrel(uint32_t subDet)
RZrangeMap rangeRorZ_