Go to the documentation of this file.00001 #ifndef TtSemiLepHypothesis_h
00002 #define TtSemiLepHypothesis_h
00003
00004 #include <memory>
00005 #include <vector>
00006
00007 #include "FWCore/Framework/interface/Event.h"
00008 #include "FWCore/Framework/interface/EDProducer.h"
00009 #include "FWCore/Framework/interface/Frameworkfwd.h"
00010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00011
00012 #include "DataFormats/PatCandidates/interface/Jet.h"
00013 #include "DataFormats/PatCandidates/interface/MET.h"
00014 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
00015 #include "DataFormats/Candidate/interface/ShallowClonePtrCandidate.h"
00016
00017 #include "AnalysisDataFormats/TopObjects/interface/TtSemiLeptonicEvent.h"
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 class TtSemiLepHypothesis : public edm::EDProducer {
00032
00033 public:
00035 explicit TtSemiLepHypothesis(const edm::ParameterSet&);
00037 ~TtSemiLepHypothesis();
00038
00039 protected:
00041 virtual void produce(edm::Event&, const edm::EventSetup&);
00043 void resetCandidates();
00046 std::string jetCorrectionLevel(const std::string& quarkType);
00048 template <typename C>
00049 void setCandidate(const edm::Handle<C>& handle, const int& idx, reco::ShallowClonePtrCandidate*& clone);
00051 void setCandidate(const edm::Handle<std::vector<pat::Jet> >& handle, const int& idx, reco::ShallowClonePtrCandidate*& clone, const std::string& correctionLevel);
00053 void setNeutrino(const edm::Handle<std::vector<pat::MET> >& met, const edm::Handle<edm::View<reco::RecoCandidate> >& leps, const int& idx, const int& type);
00055 int key() const { return key_; };
00057 reco::CompositeCandidate hypo();
00059 bool isValid(const int& idx, const edm::Handle<std::vector<pat::Jet> >& jets){ return (0<=idx && idx<(int)jets->size()); };
00061 WDecay::LeptonType leptonType(const reco::RecoCandidate* cand);
00062
00063
00064
00065
00066
00067
00069 virtual void buildKey() = 0;
00071 virtual void buildHypo(edm::Event& event,
00072 const edm::Handle<edm::View<reco::RecoCandidate> >& lepton,
00073 const edm::Handle<std::vector<pat::MET> >& neutrino,
00074 const edm::Handle<std::vector<pat::Jet> >& jets,
00075 std::vector<int>& jetPartonAssociation,
00076 const unsigned int iComb) = 0;
00077
00078 protected:
00081 bool getMatch_;
00083 edm::InputTag jets_;
00084 edm::InputTag leps_;
00085 edm::InputTag mets_;
00086 edm::InputTag match_;
00089 std::string jetCorrectionLevel_;
00091 int key_;
00094 int numberOfRealNeutrinoSolutions_;
00097 reco::ShallowClonePtrCandidate *lightQ_;
00098 reco::ShallowClonePtrCandidate *lightQBar_;
00099 reco::ShallowClonePtrCandidate *hadronicB_;
00100 reco::ShallowClonePtrCandidate *leptonicB_;
00101 reco::ShallowClonePtrCandidate *neutrino_;
00102 reco::ShallowClonePtrCandidate *lepton_;
00103 };
00104
00105
00106
00107 template<typename C>
00108 void
00109 TtSemiLepHypothesis::setCandidate(const edm::Handle<C>& handle, const int& idx, reco::ShallowClonePtrCandidate* &clone) {
00110 typedef typename C::value_type O;
00111 edm::Ptr<O> ptr = edm::Ptr<O>(handle, idx);
00112 clone = new reco::ShallowClonePtrCandidate( ptr, ptr->charge(), ptr->p4(), ptr->vertex() );
00113 }
00114
00115 #endif