CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/RecoTracker/TrackProducer/interface/TrackProducerBase.h

Go to the documentation of this file.
00001 #ifndef TrackProducerBase_h
00002 #define TrackProducerBase_h
00003 
00012 #include "FWCore/Framework/interface/EDProducer.h"
00013 #include "FWCore/Framework/interface/Event.h"
00014 #include "FWCore/Framework/interface/EventSetup.h"
00015 #include "FWCore/Framework/interface/ESHandle.h"
00016 
00017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00018 #include "FWCore/Utilities/interface/InputTag.h"
00019 
00020 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00021 
00022 #include "DataFormats/TrackReco/interface/TrackExtra.h"
00023 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
00024 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00025 #include "DataFormats/TrackerRecHit2D/interface/ClusterRemovalInfo.h"
00026 #include <RecoTracker/MeasurementDet/interface/MeasurementTracker.h>
00027 
00028 class Propagator;
00029 class TrajectoryStateUpdator;
00030 class MeasurementEstimator;
00031 class TrackerGeometry;
00032 class TrajectoryFitter;
00033 class TransientTrackingRecHitBuilder;
00034 class NavigationSchool;
00035 
00036 template <class T>
00037 class TrackProducerBase {
00038 public:
00039   typedef std::vector<T> TrackCollection;
00040   typedef std::pair<Trajectory*, std::pair<T*,PropagationDirection> > AlgoProduct;
00041   typedef std::vector< AlgoProduct >  AlgoProductCollection;
00042 public:
00044   TrackProducerBase(bool trajectoryInEvent = false):
00045      trajectoryInEvent_(trajectoryInEvent),
00046         rekeyClusterRefs_(false) {}
00047 
00049   virtual ~TrackProducerBase();
00050   
00052   virtual void getFromES(const edm::EventSetup&,
00053                          edm::ESHandle<TrackerGeometry>& ,
00054                          edm::ESHandle<MagneticField>& ,
00055                          edm::ESHandle<TrajectoryFitter>& ,
00056                          edm::ESHandle<Propagator>& ,
00057                          edm::ESHandle<MeasurementTracker>& ,
00058                          edm::ESHandle<TransientTrackingRecHitBuilder>& );
00059 
00061   virtual void getFromEvt(edm::Event&, edm::Handle<TrackCandidateCollection>&, reco::BeamSpot&);
00063   virtual void getFromEvt(edm::Event&, edm::Handle<TrackCollection>&, reco::BeamSpot&);
00064 
00066   virtual void produce(edm::Event&, const edm::EventSetup&) = 0;
00067 
00069   void setConf(edm::ParameterSet conf){conf_=conf;}
00070 
00072   void setSrc(edm::InputTag src, edm::InputTag bsSrc){src_=src;bsSrc_=bsSrc;}
00073 
00075   void setAlias(std::string alias){
00076     alias.erase(alias.size()-6,alias.size());
00077     alias_=alias;
00078   }
00079 
00081   void setClusterRemovalInfo(const edm::InputTag &clusterRemovalInfo) {
00082     rekeyClusterRefs_ = true;
00083     clusterRemovalInfo_ = clusterRemovalInfo;
00084   }
00085 
00086   void setSecondHitPattern(Trajectory* traj, T& track, 
00087                            const Propagator* prop, const MeasurementTracker* measTk );
00088 
00089   const edm::ParameterSet& getConf() const {return conf_;}
00090  private:
00091   edm::ParameterSet conf_;
00092   edm::InputTag src_;
00093  protected:
00094   std::string alias_;
00095   bool trajectoryInEvent_;
00096   edm::OrphanHandle<TrackCollection> rTracks_;
00097   edm::InputTag bsSrc_;
00098 
00099   bool rekeyClusterRefs_;
00100   edm::InputTag clusterRemovalInfo_;
00101 
00102   edm::ESHandle<NavigationSchool> theSchool;
00103 
00104 };
00105 
00106 #include "RecoTracker/TrackProducer/interface/TrackProducerBase.icc"
00107 
00108 #endif