Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-27 04:04:47

0001 #ifndef RecoEGAMMA_ConversionTrack_ConversionTrackFinder_h
0002 #define RecoEGAMMA_ConversionTrack_ConversionTrackFinder_h
0003 
0004 /** \class ConversionTrackFinder
0005  **  
0006  **
0007  **  \author Nancy Marinelli, U. of Notre Dame, US
0008  **
0009  ***/
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "FWCore/Framework/interface/EventSetup.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0014 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0015 //
0016 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0017 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
0018 //
0019 #include "RecoEgamma/EgammaPhotonAlgos/interface/ConversionSeedFinder.h"
0020 
0021 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
0022 #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h"
0023 
0024 // C/C++ headers
0025 #include <string>
0026 #include <vector>
0027 
0028 class TransientInitialStateEstimator;
0029 class TrackerGeometry;
0030 class CkfComponentsRecord;
0031 class TrackerDigiGeometryRecord;
0032 
0033 class ConversionTrackFinder {
0034 public:
0035   ConversionTrackFinder(const edm::ParameterSet& config,
0036                         const BaseCkfTrajectoryBuilder* trajectoryBuilder,
0037                         edm::ConsumesCollector iC);
0038 
0039   virtual ~ConversionTrackFinder();
0040 
0041   virtual std::vector<Trajectory> tracks(const TrajectorySeedCollection& seeds,
0042                                          TrackCandidateCollection& candidate) const = 0;
0043 
0044   /// Initialize EventSetup objects at each event
0045   void setEventSetup(const edm::EventSetup& es);
0046 
0047 protected:
0048   const MagneticField* theMF_;
0049 
0050   std::string theMeasurementTrackerName_;
0051   const MeasurementTracker* theMeasurementTracker_;
0052   const BaseCkfTrajectoryBuilder* theCkfTrajectoryBuilder_;
0053 
0054   std::unique_ptr<TransientInitialStateEstimator> theInitialState_;
0055   const TrackerGeometry* theTrackerGeom_;
0056   KFUpdator* theUpdator_;
0057 
0058   edm::ESHandle<Propagator> thePropagator_;
0059 
0060   edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> theMeasurementTrackerToken_;
0061   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> theTrackerGeomToken_;
0062   edm::ESGetToken<Propagator, TrackerDigiGeometryRecord> thePropagatorToken_;
0063 
0064   bool useSplitHits_;
0065 
0066   struct ExtractNumOfHits {
0067     typedef int result_type;
0068     result_type operator()(const Trajectory& t) const { return t.foundHits(); }
0069     result_type operator()(const Trajectory* t) const { return t->foundHits(); }
0070   };
0071 
0072   struct ExtractChi2 {
0073     typedef float result_type;
0074     result_type operator()(const Trajectory& t) const { return t.chiSquared(); }
0075     result_type operator()(const Trajectory* t) const { return t->chiSquared(); }
0076   };
0077 };
0078 
0079 #endif