CMS 3D CMS Logo

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 public:
37  explicit TtFullLepHypothesis(const edm::ParameterSet&);
39  ~TtFullLepHypothesis() override;
40 
41 protected:
43  void produce(edm::Event&, const edm::EventSetup&) override;
45  void resetCandidates();
47  template <typename C>
50  void setCandidate(const edm::Handle<std::vector<pat::Jet> >& handle,
51  const int& idx,
53  const std::string& correctionLevel);
55  int key() const { return key_; };
59  bool isValid(const int& idx, const edm::Handle<std::vector<pat::Jet> >& jets) {
60  return (0 <= idx && idx < (int)jets->size());
61  };
62 
63  // -----------------------------------------
64  // implemet the following two functions
65  // for a concrete event hypothesis
66  // -----------------------------------------
67 
69  virtual void buildKey() = 0;
71  virtual void buildHypo(edm::Event& evt,
72  const edm::Handle<std::vector<pat::Electron> >& elecs,
73  const edm::Handle<std::vector<pat::Muon> >& mus,
74  const edm::Handle<std::vector<pat::Jet> >& jets,
75  const edm::Handle<std::vector<pat::MET> >& mets,
76  std::vector<int>& match,
77  const unsigned int iComb) = 0;
78 
79 protected:
82  bool getMatch_;
93  int key_;
102  //reco::ShallowClonePtrCandidate *met_;
103 
107 };
108 
109 // unfortunately this has to be placed in the header since otherwise the function template
110 // would cause unresolved references in classes derived from this base class
111 template <typename C>
113  const int& idx,
115  typedef typename C::value_type O;
117  clone = new reco::ShallowClonePtrCandidate(ptr, ptr->charge(), ptr->p4(), ptr->vertex());
118 }
119 
120 #endif
MessageLogger.h
EDProducer.h
TtFullLepHypothesis::jetsToken_
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
Definition: TtFullLepHypothesis.h:87
TtFullLeptonicEvent.h
patZpeak.handle
handle
Definition: patZpeak.py:23
edm::EDGetTokenT
Definition: EDGetToken.h:33
Muon.h
TtFullLepHypothesis::isValid
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
Definition: TtFullLepHypothesis.h:59
TtFullLepHypothesis::setCandidate
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
Definition: TtFullLepHypothesis.h:112
TtFullLepHypothesis
Definition: TtFullLepHypothesis.h:34
TtFullLepHypothesis::b_
reco::ShallowClonePtrCandidate * b_
Definition: TtFullLepHypothesis.h:98
TtFullLepHypothesis::buildKey
virtual void buildKey()=0
build the event hypothesis key
TtFullLepHypothesis::neutrinoBar_
reco::ShallowClonePtrCandidate * neutrinoBar_
Definition: TtFullLepHypothesis.h:101
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
singleTopDQM_cfi.mets
mets
Definition: singleTopDQM_cfi.py:43
edm::Handle
Definition: AssociativeIterator.h:50
RecoCandidate.h
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TtFullLepHypothesis::resetCandidates
void resetCandidates()
reset candidate pointers before hypo build process
Definition: TtFullLepHypothesis.cc:102
TtFullLepHypothesis::hypo
reco::CompositeCandidate hypo()
return event hypothesis
Definition: TtFullLepHypothesis.cc:113
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TtFullLepHypothesis::~TtFullLepHypothesis
~TtFullLepHypothesis() override
default destructor
Definition: TtFullLepHypothesis.cc:34
TtFullLepHypothesis::getMatch_
bool getMatch_
Definition: TtFullLepHypothesis.h:82
TtFullLepHypothesis::produce
void produce(edm::Event &, const edm::EventSetup &) override
produce the event hypothesis as CompositeCandidate and Key
Definition: TtFullLepHypothesis.cc:51
singleTopDQM_cfi.elecs
elecs
Definition: singleTopDQM_cfi.py:41
TtFullLepHypothesis::key
int key() const
return key
Definition: TtFullLepHypothesis.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TtFullLepHypothesis::recNuBar
reco::LeafCandidate * recNuBar
Definition: TtFullLepHypothesis.h:106
TtFullLepHypothesis::matchToken_
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
input label for all necessary collections
Definition: TtFullLepHypothesis.h:84
edm::ParameterSet
Definition: ParameterSet.h:47
TtFullLepHypothesis::musToken_
edm::EDGetTokenT< std::vector< pat::Muon > > musToken_
Definition: TtFullLepHypothesis.h:86
TtFullLepHypothesis::lepton_
reco::ShallowClonePtrCandidate * lepton_
Definition: TtFullLepHypothesis.h:96
Event.h
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
TtFullLepHypothesis::metsToken_
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
Definition: TtFullLepHypothesis.h:88
ShallowClonePtrCandidate.h
edm::EventSetup
Definition: EventSetup.h:57
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
MET.h
Jet.h
edm::Ptr
Definition: AssociationVector.h:31
TtFullLepHypothesis::elecsToken_
edm::EDGetTokenT< std::vector< pat::Electron > > elecsToken_
Definition: TtFullLepHypothesis.h:85
TtFullLepHypothesis::TtFullLepHypothesis
TtFullLepHypothesis(const edm::ParameterSet &)
default constructor
Definition: TtFullLepHypothesis.cc:5
Frameworkfwd.h
TtFullLepHypothesis::recNu
reco::LeafCandidate * recNu
candidates needed for the genmatch hypothesis
Definition: TtFullLepHypothesis.h:105
TtFullLepHypothesis::jetCorrectionLevel_
std::string jetCorrectionLevel_
Definition: TtFullLepHypothesis.h:91
edm::EDProducer
Definition: EDProducer.h:35
TtFullLepHypothesis::neutrino_
reco::ShallowClonePtrCandidate * neutrino_
Definition: TtFullLepHypothesis.h:100
Electron.h
TtFullLepHypothesis::leptonBar_
reco::ShallowClonePtrCandidate * leptonBar_
Definition: TtFullLepHypothesis.h:97
reco::LeafCandidate
Definition: LeafCandidate.h:16
ParameterSet.h
reco::ShallowClonePtrCandidate
Definition: ShallowClonePtrCandidate.h:15
TtFullLepHypothesis::buildHypo
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::Event
Definition: Event.h:73
TtFullLepHypothesis::bBar_
reco::ShallowClonePtrCandidate * bBar_
Definition: TtFullLepHypothesis.h:99
TtFullLepHypothesis::key_
int key_
hypothesis key (to be set by the buildKey function)
Definition: TtFullLepHypothesis.h:93
reco::CompositeCandidate
Definition: CompositeCandidate.h:21