CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | 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 ()
 
- Public Member Functions inherited from TtFullHadHypothesis
 TtFullHadHypothesis (const edm::ParameterSet &cfg)
 default constructor More...
 
 ~TtFullHadHypothesis ()
 default destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from TtFullHadHypothesis
reco::ShallowClonePtrCandidateb_
 
reco::ShallowClonePtrCandidatebBar_
 
bool getMatch_
 
std::string jetCorrectionLevel_
 
edm::InputTag jets_
 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::InputTag match_
 

Detailed Description

Definition at line 7 of file TtFullHadHypGenMatch.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file TtFullHadHypGenMatch.cc.

4  :
5  TtFullHadHypothesis( cfg )
6 {
7 }
TtFullHadHypothesis(const edm::ParameterSet &cfg)
default constructor
TtFullHadHypGenMatch::~TtFullHadHypGenMatch ( )

Definition at line 9 of file TtFullHadHypGenMatch.cc.

9 { }

Member Function Documentation

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

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

Implements TtFullHadHypothesis.

Definition at line 12 of file TtFullHadHypGenMatch.cc.

References abs, TtFullHadEvtPartons::B, TtFullHadHypothesis::b_, TtFullHadEvtPartons::BBar, TtFullHadHypothesis::bBar_, TtGenEvtProducer_cfi::genEvt, edm::Event::getByLabel(), customizeTrackingMonitorSeedNumber::idx, TtFullHadHypothesis::isValid(), TtFullHadHypothesis::jetCorrectionLevel(), fwrapper::jets, TtFullHadEvtPartons::LightP, TtFullHadHypothesis::lightP_, TtFullHadEvtPartons::LightPBar, TtFullHadHypothesis::lightPBar_, TtFullHadEvtPartons::LightQ, TtFullHadHypothesis::lightQ_, TtFullHadEvtPartons::LightQBar, TtFullHadHypothesis::lightQBar_, and TtFullHadHypothesis::setCandidate().

16 {
17  // -----------------------------------------------------
18  // get genEvent (to distinguish between uds and c quarks)
19  // -----------------------------------------------------
21  evt.getByLabel("genEvt", genEvt);
22 
23  // -----------------------------------------------------
24  // add jets
25  // -----------------------------------------------------
26  for(unsigned idx=0; idx<match.size(); ++idx){
27  if( isValid(match[idx], jets) ){
28  switch(idx){
30  if( std::abs(genEvt->daughterQuarkOfWPlus()->pdgId())==4 )
31  setCandidate(jets, match[idx], lightQ_ , jetCorrectionLevel("cQuark"));
32  else
33  setCandidate(jets, match[idx], lightQ_ , jetCorrectionLevel("udsQuark"));
34  break;
36  if( std::abs(genEvt->daughterQuarkBarOfWPlus()->pdgId())==4 )
37  setCandidate(jets, match[idx], lightQBar_, jetCorrectionLevel("cQuark"));
38  else
39  setCandidate(jets, match[idx], lightQBar_, jetCorrectionLevel("udsQuark"));
40  break;
42  setCandidate(jets, match[idx], b_ , jetCorrectionLevel("bQuark")); break;
44  if( std::abs(genEvt->daughterQuarkOfWMinus()->pdgId())==4 )
45  setCandidate(jets, match[idx], lightP_ , jetCorrectionLevel("cQuark"));
46  else
47  setCandidate(jets, match[idx], lightP_ , jetCorrectionLevel("udsQuark"));
48  break;
50  if( std::abs(genEvt->daughterQuarkBarOfWMinus()->pdgId())==4 )
51  setCandidate(jets, match[idx], lightPBar_, jetCorrectionLevel("cQuark"));
52  else
53  setCandidate(jets, match[idx], lightPBar_, jetCorrectionLevel("udsQuark"));
54  break;
56  setCandidate(jets, match[idx], bBar_ , jetCorrectionLevel("bQuark")); break;
57  }
58  }
59  }
60 }
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
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 ...
#define abs(x)
Definition: mlp_lapack.h:159
reco::ShallowClonePtrCandidate * lightPBar_
reco::ShallowClonePtrCandidate * lightQBar_
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
reco::ShallowClonePtrCandidate * lightP_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
reco::ShallowClonePtrCandidate * bBar_
reco::ShallowClonePtrCandidate * b_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
reco::ShallowClonePtrCandidate * lightQ_
virtual void TtFullHadHypGenMatch::buildKey ( )
inlineprivatevirtual

build the event hypothesis key

Implements TtFullHadHypothesis.

Definition at line 17 of file TtFullHadHypGenMatch.h.

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

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