CMS 3D CMS Logo

TtFullHadHypothesis.h
Go to the documentation of this file.
1 #ifndef TtFullHadHypothesis_h
2 #define TtFullHadHypothesis_h
3 
4 #include <memory>
5 #include <vector>
6 
11 
14 
16 
17 /*
18  \class TtFullHadHypothesis TtFullHadHypothesis.h "TopQuarkAnalysis/TopJetCombination/interface/TtFullHadHypothesis.h"
19 
20  \brief Interface class for the creation of full-hadronic ttbar event hypotheses
21 
22  The class provides an interface for the creation of full-hadronic ttbar event hypotheses. Input information is read
23  from the event content and the proper candidate creation is taken care of. Hypotheses are characterized by the
24  CompositeCandidate made of a ttbar pair (including all its decay products in a parton level interpretation) and an
25  enumerator type key to specify the algorithm to determine the candidate (hypothesis cklass). The buildKey and the
26  buildHypo class have to implemented by derived classes.
27 **/
28 
30 public:
32  explicit TtFullHadHypothesis(const edm::ParameterSet& cfg);
34  ~TtFullHadHypothesis() override;
35 
36 protected:
38  void produce(edm::Event&, const edm::EventSetup&) override;
40  void resetCandidates();
43  std::string jetCorrectionLevel(const std::string& quarkType);
45  template <typename C>
48  void setCandidate(const edm::Handle<std::vector<pat::Jet> >& handle,
49  const int& idx,
51  const std::string& correctionLevel);
53  int key() const { return key_; };
57  bool isValid(const int& idx, const edm::Handle<std::vector<pat::Jet> >& jets) {
58  return (0 <= idx && idx < (int)jets->size());
59  };
60 
61  // -----------------------------------------
62  // implemet the following two functions
63  // for a concrete event hypothesis
64  // -----------------------------------------
65 
67  virtual void buildKey() = 0;
69  virtual void buildHypo(edm::Event& event,
70  const edm::Handle<std::vector<pat::Jet> >& jets,
71  std::vector<int>& jetPartonAssociation,
72  const unsigned int iComb) = 0;
73 
74 protected:
77  bool getMatch_;
85  int key_;
94 };
95 
96 // has to be placed in the header since otherwise the function template
97 // would cause unresolved references in classes derived from this base class
98 template <typename C>
100  const int& idx,
102  typedef typename C::value_type O;
104  clone = new reco::ShallowClonePtrCandidate(ptr, ptr->charge(), ptr->p4(), ptr->vertex());
105 }
106 #endif
TtFullHadHypothesis::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: TtFullHadHypothesis.h:57
TtFullHadHypothesis::lightP_
reco::ShallowClonePtrCandidate * lightP_
Definition: TtFullHadHypothesis.h:92
EDProducer.h
patZpeak.handle
handle
Definition: patZpeak.py:23
edm::EDGetTokenT
Definition: EDGetToken.h:33
TtFullHadHypothesis::buildKey
virtual void buildKey()=0
build the event hypothesis key
TtFullHadHypothesis::jetsToken_
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
input label for all necessary collections
Definition: TtFullHadHypothesis.h:79
TtFullHadHypothesis::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: TtFullHadHypothesis.h:99
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
TtFullHadHypothesis::buildHypo
virtual void buildHypo(edm::Event &event, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &jetPartonAssociation, const unsigned int iComb)=0
build event hypothesis from the reco objects of a full-hadronic event
TtFullHadHypothesis::bBar_
reco::ShallowClonePtrCandidate * bBar_
Definition: TtFullHadHypothesis.h:91
edm::Handle
Definition: AssociativeIterator.h:50
TtFullHadHypothesis::lightPBar_
reco::ShallowClonePtrCandidate * lightPBar_
Definition: TtFullHadHypothesis.h:93
TtFullHadHypothesis::produce
void produce(edm::Event &, const edm::EventSetup &) override
produce the event hypothesis as CompositeCandidate and Key
Definition: TtFullHadHypothesis.cc:42
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TtFullHadHypothesis::b_
reco::ShallowClonePtrCandidate * b_
Definition: TtFullHadHypothesis.h:90
TtFullHadHypothesis::key_
int key_
hypothesis key (to be set by the buildKey function)
Definition: TtFullHadHypothesis.h:85
TtFullHadHypothesis
Definition: TtFullHadHypothesis.h:29
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TtFullHadronicEvent.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
TtFullHadHypothesis::TtFullHadHypothesis
TtFullHadHypothesis(const edm::ParameterSet &cfg)
default constructor
Definition: TtFullHadHypothesis.cc:5
Event.h
TtFullHadHypothesis::hypo
reco::CompositeCandidate hypo()
return event hypothesis
Definition: TtFullHadHypothesis.cc:93
ShallowClonePtrCandidate.h
edm::EventSetup
Definition: EventSetup.h:58
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
TtFullHadHypothesis::~TtFullHadHypothesis
~TtFullHadHypothesis() override
default destructor
Definition: TtFullHadHypothesis.cc:26
Jet.h
TtFullHadHypothesis::getMatch_
bool getMatch_
Definition: TtFullHadHypothesis.h:77
edm::Ptr
Definition: AssociationVector.h:31
looper.cfg
cfg
Definition: looper.py:297
TtFullHadHypothesis::key
int key() const
return key
Definition: TtFullHadHypothesis.h:53
TtFullHadHypothesis::matchToken_
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
Definition: TtFullHadHypothesis.h:80
Frameworkfwd.h
edm::EDProducer
Definition: EDProducer.h:35
TtFullHadHypothesis::lightQ_
reco::ShallowClonePtrCandidate * lightQ_
Definition: TtFullHadHypothesis.h:88
TtFullHadHypothesis::resetCandidates
void resetCandidates()
reset candidate pointers before hypo build process
Definition: TtFullHadHypothesis.cc:83
ParameterSet.h
reco::ShallowClonePtrCandidate
Definition: ShallowClonePtrCandidate.h:15
event
Definition: event.py:1
TtFullHadHypothesis::jetCorrectionLevel
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType
Definition: TtFullHadHypothesis.cc:127
edm::Event
Definition: Event.h:73
TtFullHadHypothesis::jetCorrectionLevel_
std::string jetCorrectionLevel_
Definition: TtFullHadHypothesis.h:83
reco::CompositeCandidate
Definition: CompositeCandidate.h:21
TtFullHadHypothesis::lightQBar_
reco::ShallowClonePtrCandidate * lightQBar_
Definition: TtFullHadHypothesis.h:89