Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:36

0001 #ifndef RecoParticleFlow_PFTracking_PFCheckHitPattern_H
0002 #define RecoParticleFlow_PFTracking_PFCheckHitPattern_H
0003 
0004 // standard EDAnalyser include files
0005 #include <memory>
0006 #include "FWCore/Framework/interface/Frameworkfwd.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "FWCore/Framework/interface/MakerMacros.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 
0011 #include "FWCore/Framework/interface/EventSetup.h"
0012 #include "DataFormats/TrackReco/interface/Track.h"
0013 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0014 #include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
0015 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0016 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0017 
0018 #define DEBUG_CHECKHITPATTERN
0019 
0020 class DetId;
0021 
0022 /// \brief PFCheckHitPatter
0023 /*!
0024 \author Ian Tomalin, modified by Maxime Gouzevitch
0025 \date October 2009
0026 */
0027 
0028 /*
0029  * Determine if a track has hits in front of its assumed production point.
0030  * Also determine if it misses hits between its assumed production point and its innermost hit.
0031  */
0032 
0033 class PFCheckHitPattern {
0034 public:
0035   PFCheckHitPattern() : geomInitDone_(false) {}
0036 
0037   ~PFCheckHitPattern() {}
0038 
0039   typedef std::pair<unsigned int, unsigned int> PFTrackHitInfo;
0040   typedef std::pair<PFTrackHitInfo, PFTrackHitInfo> PFTrackHitFullInfo;
0041 
0042   /// PFCheck if hit pattern of this track is consistent with it being produced
0043   /// at given vertex. Pair.first gives number of hits on track in front of vertex.
0044   /// Pair.second gives number of missing hits between vertex and innermost hit
0045   /// on track.
0046 
0047   PFTrackHitFullInfo analyze(const TrackerTopology* tkerTopo,
0048                              const TrackerGeometry* tkerGeom,
0049                              const reco::TrackBaseRef track,
0050                              const TransientVertex& vert);
0051 
0052   /// Print hit pattern on track
0053   void print(const reco::TrackBaseRef track) const;
0054 
0055 private:
0056   /// Create map indicating r/z values of all layers/disks.
0057   void init(const TrackerTopology*, const TrackerGeometry*);
0058 
0059   /// a pair<uint32, uint32> consisting of the numbers used by HitPattern to
0060   /// identify subdetector and layer number respectively.
0061   typedef std::pair<uint32_t, uint32_t> DetInfo;
0062 
0063   /// Return a bool indicating if a given subdetector is in the barrel.
0064   static bool barrel(uint32_t subDet);
0065 
0066   void print(const reco::HitPattern::HitCategory, const reco::HitPattern& hp) const;
0067 
0068 private:
0069   /// Note if geometry info is already initialized.
0070   bool geomInitDone_;
0071 
0072   /// For a given subdetector & layer number, this stores the minimum and maximum
0073   /// r (or z) values if it is barrel (or endcap) respectively.
0074   typedef std::map<DetInfo, std::pair<double, double> > RZrangeMap;
0075   RZrangeMap rangeRorZ_;
0076 };
0077 
0078 #endif