CMS 3D CMS Logo

TtFullLepHypKinSolution.cc
Go to the documentation of this file.
3 
6  nusToken_(consumes<std::vector<reco::LeafCandidate> >(cfg.getParameter<edm::InputTag>("Neutrinos"))),
7  nuBarsToken_(consumes<std::vector<reco::LeafCandidate> >(cfg.getParameter<edm::InputTag>("NeutrinoBars"))),
8  solWeightToken_(consumes<std::vector<double> >(cfg.getParameter<edm::InputTag>("solutionWeight"))) {}
9 
11 
13  const edm::Handle<std::vector<pat::Electron> >& elecs,
14  const edm::Handle<std::vector<pat::Muon> >& mus,
15  const edm::Handle<std::vector<pat::Jet> >& jets,
16  const edm::Handle<std::vector<pat::MET> >& mets,
17  std::vector<int>& match,
18  const unsigned int iComb) {
20  // edm::Handle<std::vector<std::vector<int> > > idcsVec;
23 
25  // evt.getByToken(particleIdcsToken_, idcsVec );
26  evt.getByToken(nusToken_, nus);
27  evt.getByToken(nuBarsToken_, nuBars);
28 
29  if ((*solWeight)[iComb] < 0) {
30  // create empty hypothesis if no solution exists
31  return;
32  }
33 
34  // -----------------------------------------------------
35  // add jets
36  // -----------------------------------------------------
37  if (!jets->empty()) {
40  }
41  // -----------------------------------------------------
42  // add leptons
43  // -----------------------------------------------------
44  if (!elecs->empty() && match[2] >= 0)
46 
47  if (!elecs->empty() && match[3] >= 0)
49 
50  if (!mus->empty() && match[4] >= 0 && match[2] < 0)
51  setCandidate(mus, match[4], leptonBar_);
52 
53  // this 'else' happens if you have a wrong charge electron-muon-
54  // solution so the indices are (b-idx, bbar-idx, 0, -1, 0, -1)
55  // so the mu^+ is stored as l^-
56  else if (!mus->empty() && match[4] >= 0)
57  setCandidate(mus, match[4], lepton_);
58 
59  if (!mus->empty() && match[5] >= 0 && match[3] < 0)
60  setCandidate(mus, match[5], lepton_);
61 
62  // this 'else' happens if you have a wrong charge electron-muon-
63  // solution so the indices are (b-idx, bbar-idx, -1, 0, -1, 0)
64  // so the mu^- is stored as l^+
65  else if (!mus->empty() && match[5] >= 0)
66  setCandidate(mus, match[5], leptonBar_);
67 
68  // -----------------------------------------------------
69  // add neutrinos
70  // -----------------------------------------------------
71  if (!nus->empty())
72  setCandidate(nus, iComb, neutrino_);
73 
74  if (!nuBars->empty())
75  setCandidate(nuBars, iComb, neutrinoBar_);
76 }
TtFullLepHypKinSolution.h
edm
HLT enums.
Definition: AlignableModifier.h:19
TtFullLepHypKinSolution::nuBarsToken_
edm::EDGetTokenT< std::vector< reco::LeafCandidate > > nuBarsToken_
Definition: TtFullLepHypKinSolution.h:25
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
TtFullLepEvtBuilder_cfi.solWeight
solWeight
Definition: TtFullLepEvtBuilder_cfi.py:37
TtFullLepHypothesis::neutrinoBar_
reco::ShallowClonePtrCandidate * neutrinoBar_
Definition: TtFullLepHypothesis.h:101
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
singleTopDQM_cfi.mets
mets
Definition: singleTopDQM_cfi.py:43
edm::Handle
Definition: AssociativeIterator.h:50
TtFullLepHypKinSolution::~TtFullLepHypKinSolution
~TtFullLepHypKinSolution() override
Definition: TtFullLepHypKinSolution.cc:10
singleTopDQM_cfi.elecs
elecs
Definition: singleTopDQM_cfi.py:41
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
TtFullLepHypothesis::lepton_
reco::ShallowClonePtrCandidate * lepton_
Definition: TtFullLepHypothesis.h:96
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
TtFullLepHypKinSolution::buildHypo
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
Definition: TtFullLepHypKinSolution.cc:12
looper.cfg
cfg
Definition: looper.py:297
std
Definition: JetResolutionObject.h:76
TtFullLepHypKinSolution::solWeightToken_
edm::EDGetTokenT< std::vector< double > > solWeightToken_
Definition: TtFullLepHypKinSolution.h:26
TtFullLepHypothesis::jetCorrectionLevel_
std::string jetCorrectionLevel_
Definition: TtFullLepHypothesis.h:91
TtFullLepHypKinSolution::nusToken_
edm::EDGetTokenT< std::vector< reco::LeafCandidate > > nusToken_
Definition: TtFullLepHypKinSolution.h:24
TtFullLepHypothesis::neutrino_
reco::ShallowClonePtrCandidate * neutrino_
Definition: TtFullLepHypothesis.h:100
TtFullLepHypothesis::leptonBar_
reco::ShallowClonePtrCandidate * leptonBar_
Definition: TtFullLepHypothesis.h:97
Particle.h
edm::Event
Definition: Event.h:73
TtFullLepHypothesis::bBar_
reco::ShallowClonePtrCandidate * bBar_
Definition: TtFullLepHypothesis.h:99
TtFullLepHypKinSolution::TtFullLepHypKinSolution
TtFullLepHypKinSolution(const edm::ParameterSet &)
Definition: TtFullLepHypKinSolution.cc:4