CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Member Functions
TtFullHadHypGenMatch Class Reference
Inheritance diagram for TtFullHadHypGenMatch:
TtFullHadHypothesis edm::stream::EDProducer<>

Public Member Functions

 TtFullHadHypGenMatch (const edm::ParameterSet &cfg)
 
- 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
 

Protected Attributes

edm::EDGetTokenT< TtGenEventgenEvtToken_
 
- Protected Attributes inherited from TtFullHadHypothesis
std::unique_ptr< reco::ShallowClonePtrCandidateb_
 
std::unique_ptr< reco::ShallowClonePtrCandidatebBar_
 
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::ShallowClonePtrCandidatelightP_
 
std::unique_ptr< reco::ShallowClonePtrCandidatelightPBar_
 
std::unique_ptr< reco::ShallowClonePtrCandidatelightQ_
 
std::unique_ptr< reco::ShallowClonePtrCandidatelightQBar_
 
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
 

Private Member Functions

void buildHypo (edm::Event &evt, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &match, const unsigned int iComb) override
 build event hypothesis from the reco objects of a semi-leptonic event More...
 
void buildKey () override
 build the event hypothesis key More...
 

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::ShallowClonePtrCandidatemakeCandidate (const edm::Handle< C > &handle, const int &idx)
 use one object in a collection to set a ShallowClonePtrCandidate More...
 
std::unique_ptr< reco::ShallowClonePtrCandidatemakeCandidate (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...
 

Detailed Description

Definition at line 5 of file TtFullHadHypGenMatch.cc.

Constructor & Destructor Documentation

◆ TtFullHadHypGenMatch()

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

Definition at line 22 of file TtFullHadHypGenMatch.cc.

23  : TtFullHadHypothesis(cfg), genEvtToken_(consumes<TtGenEvent>(edm::InputTag("genEvt"))) {}
TtFullHadHypothesis(const edm::ParameterSet &cfg)
default constructor
edm::EDGetTokenT< TtGenEvent > genEvtToken_

Member Function Documentation

◆ buildHypo()

void TtFullHadHypGenMatch::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 semi-leptonic event

Implements TtFullHadHypothesis.

Definition at line 25 of file TtFullHadHypGenMatch.cc.

References funct::abs(), TtFullHadEvtPartons::B, TtFullHadHypothesis::b_, TtFullHadEvtPartons::BBar, TtFullHadHypothesis::bBar_, TtGenEvtProducer_cfi::genEvt, genEvtToken_, edm::Event::getByToken(), heavyIonCSV_trainingSettings::idx, TtFullHadHypothesis::isValid(), TtFullHadHypothesis::jetCorrectionLevel(), PDWG_EXODelayedJetMET_cff::jets, TtFullHadEvtPartons::LightP, TtFullHadHypothesis::lightP_, TtFullHadEvtPartons::LightPBar, TtFullHadHypothesis::lightPBar_, TtFullHadEvtPartons::LightQ, TtFullHadHypothesis::lightQ_, TtFullHadEvtPartons::LightQBar, TtFullHadHypothesis::lightQBar_, TtFullHadHypothesis::makeCandidate(), and match().

28  {
29  // -----------------------------------------------------
30  // get genEvent (to distinguish between uds and c quarks)
31  // -----------------------------------------------------
34 
35  // -----------------------------------------------------
36  // add jets
37  // -----------------------------------------------------
38  for (unsigned idx = 0; idx < match.size(); ++idx) {
39  if (isValid(match[idx], jets)) {
40  switch (idx) {
42  if (std::abs(genEvt->daughterQuarkOfWPlus()->pdgId()) == 4)
44  else
46  break;
48  if (std::abs(genEvt->daughterQuarkBarOfWPlus()->pdgId()) == 4)
50  else
52  break;
55  break;
57  if (std::abs(genEvt->daughterQuarkOfWMinus()->pdgId()) == 4)
59  else
61  break;
63  if (std::abs(genEvt->daughterQuarkBarOfWMinus()->pdgId()) == 4)
65  else
67  break;
70  break;
71  }
72  }
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
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType ...
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:536
std::unique_ptr< reco::ShallowClonePtrCandidate > b_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightP_
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::unique_ptr< reco::ShallowClonePtrCandidate > bBar_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQ_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightPBar_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
edm::EDGetTokenT< TtGenEvent > genEvtToken_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQBar_

◆ buildKey()

void TtFullHadHypGenMatch::buildKey ( )
inlineoverrideprivatevirtual

build the event hypothesis key

Implements TtFullHadHypothesis.

Definition at line 11 of file TtFullHadHypGenMatch.cc.

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

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

Member Data Documentation

◆ genEvtToken_

edm::EDGetTokenT<TtGenEvent> TtFullHadHypGenMatch::genEvtToken_
protected

Definition at line 19 of file TtFullHadHypGenMatch.cc.

Referenced by buildHypo().