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/ParameterSet/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 00027 class Propagator; 00028 class TrajectoryStateUpdator; 00029 class MeasurementEstimator; 00030 class TrackerGeometry; 00031 class TrajectoryFitter; 00032 class TransientTrackingRecHitBuilder; 00033 00034 template <class T> 00035 class TrackProducerBase { 00036 public: 00037 typedef std::vector<T> TrackCollection; 00038 typedef std::pair<Trajectory*, std::pair<T*,PropagationDirection> > AlgoProduct; 00039 typedef std::vector< AlgoProduct > AlgoProductCollection; 00040 public: 00042 TrackProducerBase(bool trajectoryInEvent = false): 00043 trajectoryInEvent_(trajectoryInEvent), 00044 rekeyClusterRefs_(false) {} 00045 00047 virtual ~TrackProducerBase(); 00048 00050 virtual void getFromES(const edm::EventSetup&, 00051 edm::ESHandle<TrackerGeometry>& , 00052 edm::ESHandle<MagneticField>& , 00053 edm::ESHandle<TrajectoryFitter>& , 00054 edm::ESHandle<Propagator>& , 00055 edm::ESHandle<TransientTrackingRecHitBuilder>& ); 00056 00058 virtual void getFromEvt(edm::Event&, edm::Handle<TrackCandidateCollection>&, reco::BeamSpot&); 00060 virtual void getFromEvt(edm::Event&, edm::Handle<TrackCollection>&, reco::BeamSpot&); 00061 00063 virtual void produce(edm::Event&, const edm::EventSetup&) = 0; 00064 00066 void setConf(edm::ParameterSet conf){conf_=conf;} 00067 00069 void setSrc(edm::InputTag src, edm::InputTag bsSrc){src_=src;bsSrc_=bsSrc;} 00070 00072 void setAlias(std::string alias){ 00073 alias.erase(alias.size()-6,alias.size()); 00074 alias_=alias; 00075 } 00076 00078 void setClusterRemovalInfo(const edm::InputTag &clusterRemovalInfo) { 00079 rekeyClusterRefs_ = true; 00080 clusterRemovalInfo_ = clusterRemovalInfo; 00081 } 00082 00083 const edm::ParameterSet& getConf() const {return conf_;} 00084 private: 00085 edm::ParameterSet conf_; 00086 edm::InputTag src_; 00087 protected: 00088 std::string alias_; 00089 bool trajectoryInEvent_; 00090 edm::OrphanHandle<TrackCollection> rTracks_; 00091 edm::InputTag bsSrc_; 00092 00093 bool rekeyClusterRefs_; 00094 edm::InputTag clusterRemovalInfo_; 00095 }; 00096 00097 #include "RecoTracker/TrackProducer/interface/TrackProducerBase.icc" 00098 00099 #endif