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 public:
34  explicit TtSemiLepHypothesis(const edm::ParameterSet&);
36  ~TtSemiLepHypothesis() override;
37 
38 protected:
40  void produce(edm::Event&, const edm::EventSetup&) override;
42  void resetCandidates();
45  std::string jetCorrectionLevel(const std::string& quarkType);
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  void setNeutrino(const edm::Handle<std::vector<pat::MET> >& met,
57  const int& idx,
58  const int& type);
62  const edm::Handle<std::vector<pat::MET> >& mets,
63  const edm::Handle<std::vector<pat::Jet> >& jets,
64  std::vector<int>& jetPartonAssociation);
65  int key() const { return key_; };
69  bool isValid(const int& idx, const edm::Handle<std::vector<pat::Jet> >& jets) {
70  return (0 <= idx && idx < (int)jets->size());
71  };
74 
75  // -----------------------------------------
76  // implemet the following two functions
77  // for a concrete event hypothesis
78  // -----------------------------------------
79 
81  virtual void buildKey() = 0;
83  virtual void buildHypo(edm::Event& event,
85  const edm::Handle<std::vector<pat::MET> >& neutrino,
86  const edm::Handle<std::vector<pat::Jet> >& jets,
87  std::vector<int>& jetPartonAssociation,
88  const unsigned int iComb) = 0;
89 
90 protected:
93  bool getMatch_;
104  int key_;
118 };
119 
120 // has to be placed in the header since otherwise the function template
121 // would cause unresolved references in classes derived from this base class
122 template <typename C>
124  const int& idx,
126  typedef typename C::value_type O;
128  clone = new reco::ShallowClonePtrCandidate(ptr, ptr->charge(), ptr->p4(), ptr->vertex());
129 }
130 
131 #endif
TtSemiLepHypothesis::jetsToken_
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
input label for all necessary collections
Definition: TtSemiLepHypothesis.h:95
EDProducer.h
TtSemiLepHypothesis::hypo
reco::CompositeCandidate hypo()
return event hypothesis
Definition: TtSemiLepHypothesis.cc:128
TtSemiLepHypothesis::key_
int key_
hypothesis key (to be set by the buildKey function)
Definition: TtSemiLepHypothesis.h:104
patZpeak.handle
handle
Definition: patZpeak.py:23
edm::EDGetTokenT
Definition: EDGetToken.h:33
TtSemiLepHypothesis::neutrinoSolutionType_
int neutrinoSolutionType_
algorithm used to calculate neutrino solutions (see cfi for further details)
Definition: TtSemiLepHypothesis.h:106
TtSemiLepHypothesis::buildKey
virtual void buildKey()=0
build the event hypothesis key
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
TtSemiLepHypothesis::getMatch_
bool getMatch_
Definition: TtSemiLepHypothesis.h:93
TtSemiLepHypothesis::setNeutrino
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
Definition: TtSemiLepHypothesis.cc:227
TtSemiLepHypothesis::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: TtSemiLepHypothesis.h:123
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TtSemiLepHitFitProducer_Electrons_cfi.leps
leps
Definition: TtSemiLepHitFitProducer_Electrons_cfi.py:5
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TtSemiLepHypothesis
Definition: TtSemiLepHypothesis.h:31
TtSemiLeptonicEvent.h
TtSemiLepHypothesis::leptonicB_
reco::ShallowClonePtrCandidate * leptonicB_
Definition: TtSemiLepHypothesis.h:115
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TtSemiLepHypothesis::lepsToken_
edm::EDGetTokenT< edm::View< reco::RecoCandidate > > lepsToken_
Definition: TtSemiLepHypothesis.h:96
TtSemiLepHypothesis::lightQBar_
reco::ShallowClonePtrCandidate * lightQBar_
Definition: TtSemiLepHypothesis.h:113
edm::View
Definition: CaloClusterFwd.h:14
edm::ParameterSet
Definition: ParameterSet.h:47
TtSemiLepHypothesis::matchToken_
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
Definition: TtSemiLepHypothesis.h:98
Event.h
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
TtSemiLepHypothesis::produce
void produce(edm::Event &, const edm::EventSetup &) override
produce the event hypothesis as CompositeCandidate and Key
Definition: TtSemiLepHypothesis.cc:57
cand
Definition: decayParser.h:32
TtSemiLepHypothesis::lightQ_
reco::ShallowClonePtrCandidate * lightQ_
Definition: TtSemiLepHypothesis.h:112
ShallowClonePtrCandidate.h
TtSemiLepHypothesis::~TtSemiLepHypothesis
~TtSemiLepHypothesis() override
default destructor
Definition: TtSemiLepHypothesis.cc:41
TtSemiLepHypothesis::jetCorrectionLevel
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType
Definition: TtSemiLepHypothesis.cc:174
edm::EventSetup
Definition: EventSetup.h:58
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
reco::RecoCandidate
Definition: RecoCandidate.h:20
MET.h
Jet.h
TtSemiLepHypothesis::jetCorrectionLevel_
std::string jetCorrectionLevel_
Definition: TtSemiLepHypothesis.h:102
edm::Ptr
Definition: AssociationVector.h:31
WDecay::LeptonType
LeptonType
Definition: TopGenEvent.h:27
TtSemiLepHypothesis::hadronicB_
reco::ShallowClonePtrCandidate * hadronicB_
Definition: TtSemiLepHypothesis.h:114
Frameworkfwd.h
TtSemiLepHypothesis::key
int key() const
Definition: TtSemiLepHypothesis.h:65
edm::EDProducer
Definition: EDProducer.h:35
TtSemiLepHypothesis::metsToken_
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
Definition: TtSemiLepHypothesis.h:97
TtSemiLepHypothesis::lepton_
reco::ShallowClonePtrCandidate * lepton_
Definition: TtSemiLepHypothesis.h:117
ParameterSet.h
TtSemiLepHypothesis::nJetsConsideredToken_
edm::EDGetTokenT< int > nJetsConsideredToken_
Definition: TtSemiLepHypothesis.h:99
reco::ShallowClonePtrCandidate
Definition: ShallowClonePtrCandidate.h:15
TtSemiLepHypothesis::TtSemiLepHypothesis
TtSemiLepHypothesis(const edm::ParameterSet &)
default constructor
Definition: TtSemiLepHypothesis.cc:10
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
TtSemiLepHypothesis::neutrino_
reco::ShallowClonePtrCandidate * neutrino_
Definition: TtSemiLepHypothesis.h:116
TtSemiLepHypothesis::numberOfRealNeutrinoSolutions_
int numberOfRealNeutrinoSolutions_
Definition: TtSemiLepHypothesis.h:109
TtSemiLepHypothesis::buildHypo
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
Definition: TtSemiLepHypothesis.cc:249
reco::CompositeCandidate
Definition: CompositeCandidate.h:21
TtSemiLepHypothesis::resetCandidates
void resetCandidates()
reset candidate pointers before hypo build process
Definition: TtSemiLepHypothesis.cc:117
TtSemiLepHypothesis::leptonType
WDecay::LeptonType leptonType(const reco::RecoCandidate *cand)
determine lepton type of reco candidate and return a corresponding WDecay::LeptonType; the type is kN...
Definition: TtSemiLepHypothesis.cc:162
TtSemiLepHypothesis::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: TtSemiLepHypothesis.h:69