CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TtFullLepHypKinSolution Class Reference
Inheritance diagram for TtFullLepHypKinSolution:
TtFullLepHypothesis edm::stream::EDProducer<>

Public Member Functions

 TtFullLepHypKinSolution (const edm::ParameterSet &)
 
- Public Member Functions inherited from TtFullLepHypothesis
 TtFullLepHypothesis (const edm::ParameterSet &)
 default constructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

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) override
 build event hypothesis from the reco objects of a full-leptonic event More...
 
void buildKey () override
 build the event hypothesis key More...
 

Private Attributes

edm::EDGetTokenT< std::vector
< reco::LeafCandidate > > 
nuBarsToken_
 
edm::EDGetTokenT< std::vector
< reco::LeafCandidate > > 
nusToken_
 
edm::EDGetTokenT< std::vector
< double > > 
solWeightToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Member Functions inherited from TtFullLepHypothesis
reco::CompositeCandidate hypo ()
 return event hypothesis More...
 
bool isValid (const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
 check if index is in valid range of selected jets More...
 
int key () const
 return key More...
 
template<typename C >
std::unique_ptr
< reco::ShallowClonePtrCandidate
makeCandidate (const edm::Handle< C > &handle, const int &idx)
 use one object in a collection to set a ShallowClonePtrCandidate More...
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
makeCandidate (const edm::Handle< std::vector< pat::Jet > > &handle, const int &idx, const std::string &correctionLevel)
 use one object in a jet collection to set a ShallowClonePtrCandidate with proper jet corrections More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 produce the event hypothesis as CompositeCandidate and Key More...
 
void resetCandidates ()
 reset candidate pointers before hypo build process More...
 
- Protected Attributes inherited from TtFullLepHypothesis
std::unique_ptr
< reco::ShallowClonePtrCandidate
b_
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
bBar_
 
edm::EDGetTokenT< std::vector
< pat::Electron > > 
elecsToken_
 
bool getMatch_
 
std::string jetCorrectionLevel_
 
edm::EDGetTokenT< std::vector
< pat::Jet > > 
jetsToken_
 
int key_
 hypothesis key (to be set by the buildKey function) More...
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
lepton_
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
leptonBar_
 
edm::EDGetTokenT< std::vector
< std::vector< int > > > 
matchToken_
 input label for all necessary collections More...
 
edm::EDGetTokenT< std::vector
< pat::MET > > 
metsToken_
 
edm::EDGetTokenT< std::vector
< pat::Muon > > 
musToken_
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
neutrino_
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
neutrinoBar_
 
std::unique_ptr
< reco::LeafCandidate
recNu
 candidates needed for the genmatch hypothesis More...
 
std::unique_ptr
< reco::LeafCandidate
recNuBar
 

Detailed Description

Definition at line 4 of file TtFullLepHypKinSolution.cc.

Constructor & Destructor Documentation

TtFullLepHypKinSolution::TtFullLepHypKinSolution ( const edm::ParameterSet cfg)
explicit

Definition at line 26 of file TtFullLepHypKinSolution.cc.

27  : TtFullLepHypothesis(cfg),
28  nusToken_(consumes<std::vector<reco::LeafCandidate> >(cfg.getParameter<edm::InputTag>("Neutrinos"))),
29  nuBarsToken_(consumes<std::vector<reco::LeafCandidate> >(cfg.getParameter<edm::InputTag>("NeutrinoBars"))),
30  solWeightToken_(consumes<std::vector<double> >(cfg.getParameter<edm::InputTag>("solutionWeight"))) {}
edm::EDGetTokenT< std::vector< reco::LeafCandidate > > nuBarsToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< std::vector< reco::LeafCandidate > > nusToken_
edm::EDGetTokenT< std::vector< double > > solWeightToken_
TtFullLepHypothesis(const edm::ParameterSet &)
default constructor

Member Function Documentation

void TtFullLepHypKinSolution::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 
)
overrideprivatevirtual

build event hypothesis from the reco objects of a full-leptonic event

Implements TtFullLepHypothesis.

Definition at line 32 of file TtFullLepHypKinSolution.cc.

References TtFullLepHypothesis::b_, TtFullLepHypothesis::bBar_, edm::Event::getByToken(), TtFullLepHypothesis::jetCorrectionLevel_, fwrapper::jets, TtFullLepHypothesis::lepton_, TtFullLepHypothesis::leptonBar_, TtFullLepHypothesis::makeCandidate(), TtFullLepHypothesis::neutrino_, TtFullLepHypothesis::neutrinoBar_, nuBarsToken_, nusToken_, and solWeightToken_.

38  {
40  // edm::Handle<std::vector<std::vector<int> > > idcsVec;
43 
44  evt.getByToken(solWeightToken_, solWeight);
45  // evt.getByToken(particleIdcsToken_, idcsVec );
46  evt.getByToken(nusToken_, nus);
47  evt.getByToken(nuBarsToken_, nuBars);
48 
49  if ((*solWeight)[iComb] < 0) {
50  // create empty hypothesis if no solution exists
51  return;
52  }
53 
54  // -----------------------------------------------------
55  // add jets
56  // -----------------------------------------------------
57  if (!jets->empty()) {
60  }
61  // -----------------------------------------------------
62  // add leptons
63  // -----------------------------------------------------
64  if (!elecs->empty() && match[2] >= 0)
65  leptonBar_ = makeCandidate(elecs, match[2]);
66 
67  if (!elecs->empty() && match[3] >= 0)
68  lepton_ = makeCandidate(elecs, match[3]);
69 
70  if (!mus->empty() && match[4] >= 0 && match[2] < 0)
71  leptonBar_ = makeCandidate(mus, match[4]);
72 
73  // this 'else' happens if you have a wrong charge electron-muon-
74  // solution so the indices are (b-idx, bbar-idx, 0, -1, 0, -1)
75  // so the mu^+ is stored as l^-
76  else if (!mus->empty() && match[4] >= 0)
77  lepton_ = makeCandidate(mus, match[4]);
78 
79  if (!mus->empty() && match[5] >= 0 && match[3] < 0)
80  lepton_ = makeCandidate(mus, match[5]);
81 
82  // this 'else' happens if you have a wrong charge electron-muon-
83  // solution so the indices are (b-idx, bbar-idx, -1, 0, -1, 0)
84  // so the mu^- is stored as l^+
85  else if (!mus->empty() && match[5] >= 0)
86  leptonBar_ = makeCandidate(mus, match[5]);
87 
88  // -----------------------------------------------------
89  // add neutrinos
90  // -----------------------------------------------------
91  if (!nus->empty())
92  neutrino_ = makeCandidate(nus, iComb);
93 
94  if (!nuBars->empty())
95  neutrinoBar_ = makeCandidate(nuBars, iComb);
96 }
std::unique_ptr< reco::ShallowClonePtrCandidate > leptonBar_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< std::vector< reco::LeafCandidate > > nuBarsToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > neutrino_
std::unique_ptr< reco::ShallowClonePtrCandidate > neutrinoBar_
std::string jetCorrectionLevel_
edm::EDGetTokenT< std::vector< reco::LeafCandidate > > nusToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > lepton_
edm::EDGetTokenT< std::vector< double > > solWeightToken_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
std::unique_ptr< reco::ShallowClonePtrCandidate > b_
std::unique_ptr< reco::ShallowClonePtrCandidate > makeCandidate(const edm::Handle< C > &handle, const int &idx)
use one object in a collection to set a ShallowClonePtrCandidate
std::unique_ptr< reco::ShallowClonePtrCandidate > bBar_
void TtFullLepHypKinSolution::buildKey ( )
inlineoverrideprivatevirtual

build the event hypothesis key

Implements TtFullLepHypothesis.

Definition at line 10 of file TtFullLepHypKinSolution.cc.

References TtFullLepHypothesis::key_, and TtEvent::kKinSolution.

int key_
hypothesis key (to be set by the buildKey function)

Member Data Documentation

edm::EDGetTokenT<std::vector<reco::LeafCandidate> > TtFullLepHypKinSolution::nuBarsToken_
private

Definition at line 22 of file TtFullLepHypKinSolution.cc.

Referenced by buildHypo().

edm::EDGetTokenT<std::vector<reco::LeafCandidate> > TtFullLepHypKinSolution::nusToken_
private

Definition at line 21 of file TtFullLepHypKinSolution.cc.

Referenced by buildHypo().

edm::EDGetTokenT<std::vector<double> > TtFullLepHypKinSolution::solWeightToken_
private

Definition at line 23 of file TtFullLepHypKinSolution.cc.

Referenced by buildHypo().