CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtFullLepHypothesis.h
Go to the documentation of this file.
1 #ifndef TtFullLepHypothesis_h
2 #define TtFullLepHypothesis_h
3 
4 #include <memory>
5 #include <vector>
6 
12 
19 
21 
22 /*
23  \class TtFullLepHypothesis TtFullLepHypothesis.h "TopQuarkAnalysis/TopJetCombination/interface/TtFullLepHypothesis.h"
24 
25  \brief Interface class for the creation of full leptonic ttbar event hypotheses
26 
27  The class provides an interface for the creation of full leptonic ttbar event hypotheses. Input information is read
28  from the event content and the proper candidate creation is taken care of. Hypotheses are characterized by the
29  CompositeCandidate made of a ttbar pair (including all its decay products in a parton level interpretation) and an
30  enumerator type key to specify the algorithm to determine the candidate (hypothesis class). The buildKey and the
31  buildHypo class have to implemented by derived classes.
32 **/
33 
35 
36  public:
38  explicit TtFullLepHypothesis(const edm::ParameterSet&);
41 
42  protected:
44  virtual void produce(edm::Event&, const edm::EventSetup&);
46  void resetCandidates();
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  int key() const { return key_; };
57  bool isValid(const int& idx, const edm::Handle<std::vector<pat::Jet> >& jets){ return (0<=idx && idx<(int)jets->size()); };
58 
59  // -----------------------------------------
60  // implemet the following two functions
61  // for a concrete event hypothesis
62  // -----------------------------------------
63 
65  virtual void buildKey() = 0;
67  virtual void buildHypo(edm::Event& evt,
68  const edm::Handle<std::vector<pat::Electron > >& elecs,
69  const edm::Handle<std::vector<pat::Muon> >& mus,
70  const edm::Handle<std::vector<pat::Jet> >& jets,
71  const edm::Handle<std::vector<pat::MET> >& mets,
72  std::vector<int>& match,
73  const unsigned int iComb) = 0;
74 
75  protected:
78  bool getMatch_;
89  int key_;
98  //reco::ShallowClonePtrCandidate *met_;
99 
103 };
104 
105 // unfortunately this has to be placed in the header since otherwise the function template
106 // would cause unresolved references in classes derived from this base class
107 template<typename C>
108 void
110  typedef typename C::value_type O;
112  clone = new reco::ShallowClonePtrCandidate( ptr, ptr->charge(), ptr->p4(), ptr->vertex() );
113 }
114 
115 #endif
reco::ShallowClonePtrCandidate * neutrino_
reco::ShallowClonePtrCandidate * leptonBar_
reco::LeafCandidate * recNuBar
int key_
hypothesis key (to be set by the buildKey function)
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
virtual void buildKey()=0
build the event hypothesis key
reco::LeafCandidate * recNu
candidates needed for the genmatch hypothesis
vector< PseudoJet > jets
tuple handle
Definition: patZpeak.py:22
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
Container::value_type value_type
void resetCandidates()
reset candidate pointers before hypo build process
reco::CompositeCandidate hypo()
return event hypothesis
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
input label for all necessary collections
virtual void buildHypo(edm::Event &evt, const edm::Handle< std::vector< pat::Electron > > &elecs, const edm::Handle< std::vector< pat::Muon > > &mus, const edm::Handle< std::vector< pat::Jet > > &jets, const edm::Handle< std::vector< pat::MET > > &mets, std::vector< int > &match, const unsigned int iComb)=0
build event hypothesis from the reco objects of a semi-leptonic event
edm::EDGetTokenT< std::vector< pat::Electron > > elecsToken_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
reco::ShallowClonePtrCandidate * lepton_
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
reco::ShallowClonePtrCandidate * bBar_
std::string jetCorrectionLevel_
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
int key() const
return key
~TtFullLepHypothesis()
default destructor
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
reco::ShallowClonePtrCandidate * b_
TtFullLepHypothesis(const edm::ParameterSet &)
default constructor
virtual void produce(edm::Event &, const edm::EventSetup &)
produce the event hypothesis as CompositeCandidate and Key
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 * neutrinoBar_
edm::EDGetTokenT< std::vector< pat::Muon > > musToken_