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
TtFullHadHypKinFit Class Reference
Inheritance diagram for TtFullHadHypKinFit:
TtFullHadHypothesis edm::stream::EDProducer<>

Public Member Functions

 TtFullHadHypKinFit (const edm::ParameterSet &)
 
- Public Member Functions inherited from TtFullHadHypothesis
 TtFullHadHypothesis (const edm::ParameterSet &cfg)
 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 &, const edm::Handle< std::vector< pat::Jet > > &, std::vector< int > &, const unsigned int iComb) override
 build event hypothesis from the reco objects of a full-hadronic event More...
 
void buildKey () override
 build the event hypothesis key More...
 

Private Attributes

edm::EDGetTokenT< std::vector
< pat::Particle > > 
bBarToken_
 
edm::EDGetTokenT< std::vector
< pat::Particle > > 
bToken_
 
edm::EDGetTokenT< std::vector
< pat::Particle > > 
lightPBarToken_
 
edm::EDGetTokenT< std::vector
< pat::Particle > > 
lightPToken_
 
edm::EDGetTokenT< std::vector
< pat::Particle > > 
lightQBarToken_
 
edm::EDGetTokenT< std::vector
< pat::Particle > > 
lightQToken_
 
edm::EDGetTokenT< std::vector
< int > > 
statusToken_
 

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 TtFullHadHypothesis
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...
 
std::string jetCorrectionLevel (const std::string &quarkType)
 helper function to construct the proper correction level string for corresponding quarkType 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 TtFullHadHypothesis
std::unique_ptr
< reco::ShallowClonePtrCandidate
b_
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
bBar_
 
bool getMatch_
 
std::string jetCorrectionLevel_
 
edm::EDGetTokenT< std::vector
< pat::Jet > > 
jetsToken_
 input label for all necessary collections More...
 
int key_
 hypothesis key (to be set by the buildKey function) More...
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
lightP_
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
lightPBar_
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
lightQ_
 
std::unique_ptr
< reco::ShallowClonePtrCandidate
lightQBar_
 
edm::EDGetTokenT< std::vector
< std::vector< int > > > 
matchToken_
 

Detailed Description

Definition at line 5 of file TtFullHadHypKinFit.cc.

Constructor & Destructor Documentation

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

Definition at line 27 of file TtFullHadHypKinFit.cc.

28  : TtFullHadHypothesis(cfg),
29  statusToken_(consumes<std::vector<int> >(cfg.getParameter<edm::InputTag>("status"))),
30  lightQToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightQTag"))),
31  lightQBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightQBarTag"))),
32  bToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("bTag"))),
33  bBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("bBarTag"))),
34  lightPToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightPTag"))),
35  lightPBarToken_(consumes<std::vector<pat::Particle> >(cfg.getParameter<edm::InputTag>("lightPBarTag"))) {}
edm::EDGetTokenT< std::vector< pat::Particle > > lightQToken_
edm::EDGetTokenT< std::vector< int > > statusToken_
edm::EDGetTokenT< std::vector< pat::Particle > > bBarToken_
edm::EDGetTokenT< std::vector< pat::Particle > > lightQBarToken_
edm::EDGetTokenT< std::vector< pat::Particle > > lightPToken_
edm::EDGetTokenT< std::vector< pat::Particle > > bToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TtFullHadHypothesis(const edm::ParameterSet &cfg)
default constructor
edm::EDGetTokenT< std::vector< pat::Particle > > lightPBarToken_

Member Function Documentation

void TtFullHadHypKinFit::buildHypo ( edm::Event evt,
const edm::Handle< std::vector< pat::Jet > > &  jets,
std::vector< int > &  match,
const unsigned int  iComb 
)
overrideprivatevirtual

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

Implements TtFullHadHypothesis.

Definition at line 37 of file TtFullHadHypKinFit.cc.

References b, TtFullHadHypothesis::b_, TtFullHadHypothesis::bBar_, bBarToken_, bToken_, edm::Event::getByToken(), TtFullHadHypothesis::lightP_, TtFullHadHypothesis::lightPBar_, lightPBarToken_, lightPToken_, TtFullHadHypothesis::lightQ_, TtFullHadHypothesis::lightQBar_, lightQBarToken_, lightQToken_, TtFullHadHypothesis::makeCandidate(), mps_update::status, and statusToken_.

40  {
42  evt.getByToken(statusToken_, status);
43  if ((*status)[iComb] != 0) {
44  // create empty hypothesis if kinematic fit did not converge
45  return;
46  }
47 
54 
55  evt.getByToken(lightQToken_, lightQ);
56  evt.getByToken(lightQBarToken_, lightQBar);
57  evt.getByToken(bToken_, b);
58  evt.getByToken(bBarToken_, bBar);
59  evt.getByToken(lightPToken_, lightP);
60  evt.getByToken(lightPBarToken_, lightPBar);
61 
62  // -----------------------------------------------------
63  // add jets
64  // -----------------------------------------------------
65  if (!(lightQ->empty() || lightQBar->empty() || b->empty() || bBar->empty() || lightP->empty() ||
66  lightPBar->empty())) {
67  lightQ_ = makeCandidate(lightQ, iComb);
68  lightQBar_ = makeCandidate(lightQBar, iComb);
69  b_ = makeCandidate(b, iComb);
70  bBar_ = makeCandidate(bBar, iComb);
71  lightP_ = makeCandidate(lightP, iComb);
72  lightPBar_ = makeCandidate(lightPBar, iComb);
73  }
74 }
std::unique_ptr< reco::ShallowClonePtrCandidate > makeCandidate(const edm::Handle< C > &handle, const int &idx)
use one object in a collection to set a ShallowClonePtrCandidate
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< std::vector< pat::Particle > > lightQToken_
list status
Definition: mps_update.py:107
std::unique_ptr< reco::ShallowClonePtrCandidate > b_
edm::EDGetTokenT< std::vector< int > > statusToken_
edm::EDGetTokenT< std::vector< pat::Particle > > bBarToken_
edm::EDGetTokenT< std::vector< pat::Particle > > lightQBarToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightP_
edm::EDGetTokenT< std::vector< pat::Particle > > lightPToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > bBar_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQ_
edm::EDGetTokenT< std::vector< pat::Particle > > bToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightPBar_
double b
Definition: hdecay.h:118
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQBar_
edm::EDGetTokenT< std::vector< pat::Particle > > lightPBarToken_
void TtFullHadHypKinFit::buildKey ( )
inlineoverrideprivatevirtual

build the event hypothesis key

Implements TtFullHadHypothesis.

Definition at line 11 of file TtFullHadHypKinFit.cc.

References TtFullHadHypothesis::key_, and TtEvent::kKinFit.

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

Member Data Documentation

edm::EDGetTokenT<std::vector<pat::Particle> > TtFullHadHypKinFit::bBarToken_
private

Definition at line 22 of file TtFullHadHypKinFit.cc.

Referenced by buildHypo().

edm::EDGetTokenT<std::vector<pat::Particle> > TtFullHadHypKinFit::bToken_
private

Definition at line 21 of file TtFullHadHypKinFit.cc.

Referenced by buildHypo().

edm::EDGetTokenT<std::vector<pat::Particle> > TtFullHadHypKinFit::lightPBarToken_
private

Definition at line 24 of file TtFullHadHypKinFit.cc.

Referenced by buildHypo().

edm::EDGetTokenT<std::vector<pat::Particle> > TtFullHadHypKinFit::lightPToken_
private

Definition at line 23 of file TtFullHadHypKinFit.cc.

Referenced by buildHypo().

edm::EDGetTokenT<std::vector<pat::Particle> > TtFullHadHypKinFit::lightQBarToken_
private

Definition at line 20 of file TtFullHadHypKinFit.cc.

Referenced by buildHypo().

edm::EDGetTokenT<std::vector<pat::Particle> > TtFullHadHypKinFit::lightQToken_
private

Definition at line 19 of file TtFullHadHypKinFit.cc.

Referenced by buildHypo().

edm::EDGetTokenT<std::vector<int> > TtFullHadHypKinFit::statusToken_
private

Definition at line 18 of file TtFullHadHypKinFit.cc.

Referenced by buildHypo().