Go to the documentation of this file.00001 #ifndef HICaloCompatibleTrackSelector_H
00002 #define HICaloCompatibleTrackSelector_H
00003
00012 #include <utility>
00013 #include <vector>
00014 #include <memory>
00015 #include <algorithm>
00016 #include <map>
00017 #include "FWCore/Framework/interface/EDProducer.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020 #include "FWCore/Utilities/interface/InputTag.h"
00021
00022 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00023 #include "DataFormats/TrackReco/interface/Track.h"
00024 #include "DataFormats/TrackReco/interface/TrackExtra.h"
00025 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00026 #include "DataFormats/VertexReco/interface/Vertex.h"
00027 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00028 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00029 #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
00030
00031 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
00032 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
00033
00034
00035 #include "TF1.h"
00036
00037 namespace reco { namespace modules {
00038
00039 class HICaloCompatibleTrackSelector : public edm::EDProducer {
00040
00041 public:
00043 explicit HICaloCompatibleTrackSelector(const edm::ParameterSet& cfg);
00045 virtual ~HICaloCompatibleTrackSelector() ;
00046
00047 private:
00048 typedef math::XYZPoint Point;
00049 typedef reco::PFCandidateCollection::const_iterator CI;
00050 typedef reco::TrackCollection::const_iterator TI;
00051
00053 void produce( edm::Event& evt, const edm::EventSetup& es ) ;
00054
00055 void matchByDrAllowReuse(const reco::Track & trk, const edm::Handle<CaloTowerCollection> & towers, double & bestdr, double & bestpt);
00056
00057 double matchPFCandToTrack(const edm::Handle<PFCandidateCollection> & pfCandidates, unsigned it, double trkPt);
00058
00059 bool selectByPFCands(TI ti, const edm::Handle<TrackCollection> hSrcTrack, const edm::Handle<PFCandidateCollection> pfCandidates, bool isPFThere);
00060 bool selectByTowers(TI ti, const edm::Handle<TrackCollection> hSrcTrack, const edm::Handle<CaloTowerCollection> towers, bool isTowerThere);
00061
00063 edm::InputTag srcTracks_;
00064 edm::InputTag srcPFCands_;
00065 edm::InputTag srcTower_;
00066
00067
00068 bool applyPtDepCut_;
00069 bool usePFCandMatching_;
00070 double trkMatchPtMin_;
00071 double trkCompPtMin_;
00072 double trkEtaMax_;
00073 double towerPtMin_;
00074 double matchConeRadius_;
00075
00076 bool keepAllTracks_;
00078 bool copyExtras_;
00080 bool copyTrajectories_;
00081
00082 std::string qualityToSet_;
00083 std::string qualityToSkip_;
00084 std::string qualityToMatch_;
00085 std::string minimumQuality_;
00086 bool resetQuality_;
00087
00088 bool passMuons_;
00089 bool passElectrons_;
00090
00091
00092 std::string funcDeltaRTowerMatch_;
00093 std::string funcCaloComp_;
00094
00096 std::auto_ptr<reco::TrackCollection> selTracks_;
00097 std::auto_ptr<reco::TrackExtraCollection> selTrackExtras_;
00098 std::auto_ptr< TrackingRecHitCollection> selHits_;
00099 std::auto_ptr< std::vector<Trajectory> > selTrajs_;
00100 std::auto_ptr< std::vector<const Trajectory *> > selTrajPtrs_;
00101 std::auto_ptr< TrajTrackAssociationCollection > selTTAss_;
00102 reco::TrackRefProd rTracks_;
00103 reco::TrackExtraRefProd rTrackExtras_;
00104 TrackingRecHitRefProd rHits_;
00105 edm::RefProd< std::vector<Trajectory> > rTrajectories_;
00106 std::vector<reco::TrackRef> trackRefs_;
00107
00108
00109 TF1 *fDeltaRTowerMatch, *fCaloComp;
00110
00111
00112 };
00113
00114 }
00115 }
00116
00117 #endif