00001 // 00002 // $Id: PATTauProducer.h,v 1.23 2011/09/26 12:36:30 veelken Exp $ 00003 // 00004 00005 #ifndef PhysicsTools_PatAlgos_PATTauProducer_h 00006 #define PhysicsTools_PatAlgos_PATTauProducer_h 00007 00020 #include "FWCore/Framework/interface/EDProducer.h" 00021 #include "FWCore/Framework/interface/Event.h" 00022 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00023 #include "FWCore/Utilities/interface/InputTag.h" 00024 00025 #include "DataFormats/Common/interface/Handle.h" 00026 00027 #include "CommonTools/Utils/interface/PtComparator.h" 00028 00029 #include "PhysicsTools/PatAlgos/interface/MultiIsolator.h" 00030 #include "PhysicsTools/PatAlgos/interface/EfficiencyLoader.h" 00031 #include "PhysicsTools/PatAlgos/interface/KinResolutionsLoader.h" 00032 00033 #include "DataFormats/PatCandidates/interface/Tau.h" 00034 00035 #include "DataFormats/PatCandidates/interface/UserData.h" 00036 #include "PhysicsTools/PatAlgos/interface/PATUserDataMerger.h" 00037 #include "PhysicsTools/PatAlgos/interface/PATUserDataHelper.h" 00038 00039 #include "DataFormats/TauReco/interface/CaloTauDiscriminator.h" 00040 #include "DataFormats/TauReco/interface/PFTauDiscriminator.h" 00041 00042 #include <string> 00043 00044 00045 namespace pat { 00046 00047 class PATTauProducer : public edm::EDProducer { 00048 00049 public: 00050 00051 explicit PATTauProducer(const edm::ParameterSet & iConfig); 00052 ~PATTauProducer(); 00053 00054 virtual void produce(edm::Event & iEvent, const edm::EventSetup & iSetup); 00055 00056 static void fillDescriptions(edm::ConfigurationDescriptions & descriptions); 00057 00058 private: 00059 00060 // configurables 00061 edm::InputTag tauSrc_; 00062 bool embedIsolationTracks_; 00063 bool embedLeadTrack_; 00064 bool embedSignalTracks_; 00065 bool embedLeadPFCand_; 00066 bool embedLeadPFChargedHadrCand_; 00067 bool embedLeadPFNeutralCand_; 00068 bool embedSignalPFCands_; 00069 bool embedSignalPFChargedHadrCands_; 00070 bool embedSignalPFNeutralHadrCands_; 00071 bool embedSignalPFGammaCands_; 00072 bool embedIsolationPFCands_; 00073 bool embedIsolationPFChargedHadrCands_; 00074 bool embedIsolationPFNeutralHadrCands_; 00075 bool embedIsolationPFGammaCands_; 00076 00077 bool addGenMatch_; 00078 bool embedGenMatch_; 00079 std::vector<edm::InputTag> genMatchSrc_; 00080 00081 bool addGenJetMatch_; 00082 bool embedGenJetMatch_; 00083 edm::InputTag genJetMatchSrc_; 00084 00085 bool addTauJetCorrFactors_; 00086 std::vector<edm::InputTag> tauJetCorrFactorsSrc_; 00087 00088 bool addTauID_; 00089 typedef std::pair<std::string, edm::InputTag> NameTag; 00090 std::vector<NameTag> tauIDSrcs_; 00091 00092 // tools 00093 GreaterByPt<Tau> pTTauComparator_; 00094 00095 pat::helper::MultiIsolator isolator_; 00096 pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_; // better here than recreate at each event 00097 std::vector<std::pair<pat::IsolationKeys,edm::InputTag> > isoDepositLabels_; 00098 00099 bool addEfficiencies_; 00100 pat::helper::EfficiencyLoader efficiencyLoader_; 00101 00102 bool addResolutions_; 00103 pat::helper::KinResolutionsLoader resolutionLoader_; 00104 00105 bool useUserData_; 00106 pat::PATUserDataHelper<pat::Tau> userDataHelper_; 00107 00108 template <typename TauCollectionType, typename TauDiscrType> float getTauIdDiscriminator(const edm::Handle<TauCollectionType>&, size_t, const edm::Handle<TauDiscrType>&); 00109 }; 00110 00111 } 00112 00113 #endif