CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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&);
38 
39  protected:
41  virtual void produce(edm::Event&, const edm::EventSetup&);
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_
tuple met
____________________________________________________________________________||
Definition: CaloMET_cfi.py:4
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()
default destructor
TtSemiLepHypothesis(const edm::ParameterSet &)
default constructor
reco::ShallowClonePtrCandidate * neutrino_
void resetCandidates()
reset candidate pointers before hypo build process
vector< PseudoJet > jets
tuple handle
Definition: patZpeak.py:22
virtual void buildKey()=0
build the event hypothesis key
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
input label for all necessary collections
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Container::value_type value_type
reco::ShallowClonePtrCandidate * hadronicB_
virtual void produce(edm::Event &, const edm::EventSetup &)
produce the event hypothesis as CompositeCandidate and Key
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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)
reco::ShallowClonePtrCandidate * lightQ_
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
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)