CMS 3D CMS Logo

TtSemiLepHypothesis.h
Go to the documentation of this file.
1 #ifndef TtSemiLepHypothesis_h
2 #define TtSemiLepHypothesis_h
3 
4 #include <memory>
5 #include <vector>
6 
11 
16 
18 
19 /*
20  \class TtSemiLepHypothesis TtSemiLepHypothesis.h "TopQuarkAnalysis/TopJetCombination/interface/TtSemiLepHypothesis.h"
21 
22  \brief Interface class for the creation of semi-leptonic ttbar event hypotheses
23 
24  The class provides an interface for the creation of semi-leptonic ttbar event hypotheses. Input information is read
25  from the event content and the proper candidate creation is taken care of. Hypotheses are characterized by the
26  CompositeCandidate made of a ttbar pair (including all its decay products in a parton level interpretation) and an
27  enumerator type key to specify the algorithm that was used to determine the candidate (the "hypothesis class").
28  The buildKey and the buildHypo methods have to implemented by derived classes.
29 **/
30 
32 
33  public:
35  explicit TtSemiLepHypothesis(const edm::ParameterSet&);
37  ~TtSemiLepHypothesis() override;
38 
39  protected:
41  void produce(edm::Event&, const edm::EventSetup&) override;
43  void resetCandidates();
46  std::string jetCorrectionLevel(const std::string& quarkType);
48  template <typename C>
51  void setCandidate(const edm::Handle<std::vector<pat::Jet> >& handle, const int& idx, reco::ShallowClonePtrCandidate*& clone, const std::string& correctionLevel);
53  void setNeutrino(const edm::Handle<std::vector<pat::MET> >& met, const edm::Handle<edm::View<reco::RecoCandidate> >& leps, const int& idx, const int& type);
57  const edm::Handle<std::vector<pat::MET> >& mets,
58  const edm::Handle<std::vector<pat::Jet> >& jets,
59  std::vector<int>& jetPartonAssociation);
60  int key() const { return key_; };
64  bool isValid(const int& idx, const edm::Handle<std::vector<pat::Jet> >& jets){ return (0<=idx && idx<(int)jets->size()); };
67 
68  // -----------------------------------------
69  // implemet the following two functions
70  // for a concrete event hypothesis
71  // -----------------------------------------
72 
74  virtual void buildKey() = 0;
76  virtual void buildHypo(edm::Event& event,
78  const edm::Handle<std::vector<pat::MET> >& neutrino,
79  const edm::Handle<std::vector<pat::Jet> >& jets,
80  std::vector<int>& jetPartonAssociation,
81  const unsigned int iComb) = 0;
82 
83  protected:
86  bool getMatch_;
97  int key_;
111 };
112 
113 // has to be placed in the header since otherwise the function template
114 // would cause unresolved references in classes derived from this base class
115 template<typename C>
116 void
118  typedef typename C::value_type O;
120  clone = new reco::ShallowClonePtrCandidate( ptr, ptr->charge(), ptr->p4(), ptr->vertex() );
121 }
122 
123 #endif
std::string jetCorrectionLevel_
type
Definition: HCALResponse.h:21
edm::EDGetTokenT< int > nJetsConsideredToken_
WDecay::LeptonType leptonType(const reco::RecoCandidate *cand)
determine lepton type of reco candidate and return a corresponding WDecay::LeptonType; the type is kN...
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
reco::ShallowClonePtrCandidate * lepton_
reco::ShallowClonePtrCandidate * lightQBar_
void buildHypo(const edm::Handle< edm::View< reco::RecoCandidate > > &leps, const edm::Handle< std::vector< pat::MET > > &mets, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &jetPartonAssociation)
minimalistic build function for simple hypotheses
TtSemiLepHypothesis(const edm::ParameterSet &)
default constructor
reco::ShallowClonePtrCandidate * neutrino_
void resetCandidates()
reset candidate pointers before hypo build process
vector< PseudoJet > jets
virtual void buildKey()=0
build the event hypothesis key
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
input label for all necessary collections
reco::ShallowClonePtrCandidate * hadronicB_
met
===> hadronic RAZOR
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void setNeutrino(const edm::Handle< std::vector< pat::MET > > &met, const edm::Handle< edm::View< reco::RecoCandidate > > &leps, const int &idx, const int &type)
set neutrino, using mW = 80.4 to calculate the neutrino pz
reco::CompositeCandidate hypo()
return event hypothesis
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
edm::EDGetTokenT< edm::View< reco::RecoCandidate > > lepsToken_
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
int neutrinoSolutionType_
algorithm used to calculate neutrino solutions (see cfi for further details)
void produce(edm::Event &, const edm::EventSetup &) override
produce the event hypothesis as CompositeCandidate and Key
reco::ShallowClonePtrCandidate * lightQ_
~TtSemiLepHypothesis() override
default destructor
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
Definition: event.py:1
reco::ShallowClonePtrCandidate * leptonicB_
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType ...
int key_
hypothesis key (to be set by the buildKey function)