CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Member Functions
TtFullHadHypGenMatch Class Reference

#include <TtFullHadHypGenMatch.h>

Inheritance diagram for TtFullHadHypGenMatch:
TtFullHadHypothesis edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TtFullHadHypGenMatch (const edm::ParameterSet &cfg)
 
 ~TtFullHadHypGenMatch () override
 
- Public Member Functions inherited from TtFullHadHypothesis
 TtFullHadHypothesis (const edm::ParameterSet &cfg)
 default constructor More...
 
 ~TtFullHadHypothesis () override
 default destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Attributes

edm::EDGetTokenT< TtGenEventgenEvtToken_
 
- Protected Attributes inherited from TtFullHadHypothesis
reco::ShallowClonePtrCandidateb_
 
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...
 
reco::ShallowClonePtrCandidatelightP_
 
reco::ShallowClonePtrCandidatelightPBar_
 
reco::ShallowClonePtrCandidatelightQ_
 
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::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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...
 
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...
 
template<typename C >
void setCandidate (const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
 use one object in a collection to set a ShallowClonePtrCandidate More...
 
void setCandidate (const edm::Handle< std::vector< pat::Jet > > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone, const std::string &correctionLevel)
 use one object in a jet collection to set a ShallowClonePtrCandidate with proper jet corrections More...
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 7 of file TtFullHadHypGenMatch.h.

Constructor & Destructor Documentation

◆ TtFullHadHypGenMatch()

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

Definition at line 4 of file TtFullHadHypGenMatch.cc.

5  : TtFullHadHypothesis(cfg), genEvtToken_(consumes<TtGenEvent>(edm::InputTag("genEvt"))) {}

◆ ~TtFullHadHypGenMatch()

TtFullHadHypGenMatch::~TtFullHadHypGenMatch ( )
override

Definition at line 7 of file TtFullHadHypGenMatch.cc.

7 {}

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 9 of file TtFullHadHypGenMatch.cc.

12  {
13  // -----------------------------------------------------
14  // get genEvent (to distinguish between uds and c quarks)
15  // -----------------------------------------------------
18 
19  // -----------------------------------------------------
20  // add jets
21  // -----------------------------------------------------
22  for (unsigned idx = 0; idx < match.size(); ++idx) {
23  if (isValid(match[idx], jets)) {
24  switch (idx) {
26  if (std::abs(genEvt->daughterQuarkOfWPlus()->pdgId()) == 4)
28  else
30  break;
32  if (std::abs(genEvt->daughterQuarkBarOfWPlus()->pdgId()) == 4)
34  else
36  break;
39  break;
41  if (std::abs(genEvt->daughterQuarkOfWMinus()->pdgId()) == 4)
43  else
45  break;
47  if (std::abs(genEvt->daughterQuarkBarOfWMinus()->pdgId()) == 4)
49  else
51  break;
54  break;
55  }
56  }
57  }
58 }

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

◆ buildKey()

void TtFullHadHypGenMatch::buildKey ( )
inlineoverrideprivatevirtual

build the event hypothesis key

Implements TtFullHadHypothesis.

Definition at line 14 of file TtFullHadHypGenMatch.h.

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

Member Data Documentation

◆ genEvtToken_

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

Definition at line 22 of file TtFullHadHypGenMatch.h.

Referenced by buildHypo().

TtFullHadHypothesis::isValid
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
Definition: TtFullHadHypothesis.h:57
TtFullHadHypothesis::lightP_
reco::ShallowClonePtrCandidate * lightP_
Definition: TtFullHadHypothesis.h:92
TtFullHadHypGenMatch::genEvtToken_
edm::EDGetTokenT< TtGenEvent > genEvtToken_
Definition: TtFullHadHypGenMatch.h:22
TtFullHadEvtPartons::LightQ
Definition: TtFullHadEvtPartons.h:25
TtFullHadHypothesis::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: TtFullHadHypothesis.h:99
TtFullHadEvtPartons::LightP
Definition: TtFullHadEvtPartons.h:25
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
TtFullHadHypothesis::bBar_
reco::ShallowClonePtrCandidate * bBar_
Definition: TtFullHadHypothesis.h:91
edm::Handle
Definition: AssociativeIterator.h:50
training_settings.idx
idx
Definition: training_settings.py:16
TtFullHadHypothesis::lightPBar_
reco::ShallowClonePtrCandidate * lightPBar_
Definition: TtFullHadHypothesis.h:93
TtFullHadHypothesis::b_
reco::ShallowClonePtrCandidate * b_
Definition: TtFullHadHypothesis.h:90
TtFullHadHypothesis::key_
int key_
hypothesis key (to be set by the buildKey function)
Definition: TtFullHadHypothesis.h:85
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
TtFullHadHypothesis::TtFullHadHypothesis
TtFullHadHypothesis(const edm::ParameterSet &cfg)
default constructor
Definition: TtFullHadHypothesis.cc:5
TtFullHadEvtPartons::LightPBar
Definition: TtFullHadEvtPartons.h:25
TtFullHadEvtPartons::LightQBar
Definition: TtFullHadEvtPartons.h:25
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
looper.cfg
cfg
Definition: looper.py:297
TtEvent::kGenMatch
Definition: TtEvent.h:34
TtFullHadEvtPartons::BBar
Definition: TtFullHadEvtPartons.h:25
TtFullHadHypothesis::lightQ_
reco::ShallowClonePtrCandidate * lightQ_
Definition: TtFullHadHypothesis.h:88
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TtFullHadHypothesis::jetCorrectionLevel
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType
Definition: TtFullHadHypothesis.cc:127
TtFullHadEvtPartons::B
Definition: TtFullHadEvtPartons.h:25
edm::InputTag
Definition: InputTag.h:15
TtGenEvtProducer_cfi.genEvt
genEvt
Definition: TtGenEvtProducer_cfi.py:7
TtFullHadHypothesis::lightQBar_
reco::ShallowClonePtrCandidate * lightQBar_
Definition: TtFullHadHypothesis.h:89