CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
TtFullLepEvtPartons Class Reference

Class to fill partons in a well defined order for fully-leptonic ttbar events. More...

#include "AnalysisDataFormats/TopObjects/interface/TtFullLepEvtPartons.h"

Inheritance diagram for TtFullLepEvtPartons:
TtEventPartons

Public Types

enum  { B, BBar, Lepton, LeptonBar }
 

Public Member Functions

 TtFullLepEvtPartons (const std::vector< std::string > &partonsToIgnore=std::vector< std::string >())
 default constructor More...
 
std::vector< const reco::Candidate * > vec (const TtGenEvent &genEvt) override
 return vector of partons in the order defined in the corresponding enum More...
 
 ~TtFullLepEvtPartons () override
 default destructor More...
 
- Public Member Functions inherited from TtEventPartons
void expand (std::vector< int > &vec)
 insert dummy index -3 for all partons that were chosen to be ignored More...
 
 TtEventPartons ()
 default constructor More...
 
virtual ~TtEventPartons ()
 default destructor More...
 

Additional Inherited Members

- Protected Member Functions inherited from TtEventPartons
reco::CandidatedummyCandidatePtr () const
 return pointer to an empty reco::Candidate More...
 
void prune (std::vector< const reco::Candidate * > &vec)
 erase partons from vector if they where chosen to be ignored More...
 
- Protected Attributes inherited from TtEventPartons
std::vector< bool > ignorePartons_
 flag partons that were chosen not to be used More...
 

Detailed Description

Class to fill partons in a well defined order for fully-leptonic ttbar events.

This class is mainly used for the jet-parton matching in TopTools.

Definition at line 21 of file TtFullLepEvtPartons.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

fully-leptonic parton enum used to define the order in the vector for lepton and jet combinatorics

Enumerator
BBar 
Lepton 
LeptonBar 

Definition at line 25 of file TtFullLepEvtPartons.h.

25 { B, BBar, Lepton, LeptonBar };

Constructor & Destructor Documentation

◆ TtFullLepEvtPartons()

TtFullLepEvtPartons::TtFullLepEvtPartons ( const std::vector< std::string > &  partonsToIgnore = std::vector<std::string>())

default constructor

Definition at line 6 of file TtFullLepEvtPartons.cc.

6  {
7  // default: use all partons
8  for (unsigned int i = 0; i < 2; i++)
9  ignorePartons_.push_back(false);
10  // read vector of strings and flag partons to be ignored
11  for (std::vector<std::string>::const_iterator str = partonsToIgnore.begin(); str != partonsToIgnore.end(); ++str) {
12  if ((*str) == "B")
13  ignorePartons_[B] = true;
14  else if ((*str) == "BBar")
15  ignorePartons_[BBar] = true;
16  else
17  throw cms::Exception("Configuration")
18  << "The following string in partonsToIgnore is not supported: " << (*str) << "\n";
19  }
20 }

References B, BBar, Exception, mps_fire::i, TtEventPartons::ignorePartons_, TtFullHadJetPartonMatch_cfi::partonsToIgnore, and str.

◆ ~TtFullLepEvtPartons()

TtFullLepEvtPartons::~TtFullLepEvtPartons ( )
inlineoverride

default destructor

Definition at line 31 of file TtFullLepEvtPartons.h.

31 {};

Member Function Documentation

◆ vec()

std::vector< const reco::Candidate * > TtFullLepEvtPartons::vec ( const TtGenEvent genEvt)
overridevirtual

return vector of partons in the order defined in the corresponding enum

Implements TtEventPartons.

Definition at line 22 of file TtFullLepEvtPartons.cc.

22  {
23  std::vector<const reco::Candidate*> vec;
24 
25  if (genEvt.isFullLeptonic()) {
26  // fill vector with partons from genEvent
27  // (use enum for positions of the partons in the vector)
28  vec.resize(2);
29  vec[B] = genEvt.b() ? genEvt.b() : dummyCandidatePtr();
30  vec[BBar] = genEvt.bBar() ? genEvt.bBar() : dummyCandidatePtr();
31  } else {
32  // fill vector with dummy objects if the event is not fully-leptonic ttbar
33  for (unsigned i = 0; i < 2; i++)
34  vec.push_back(dummyCandidatePtr());
35  }
36 
37  // erase partons from vector if they where chosen to be ignored
38  prune(vec);
39 
40  return vec;
41 }

References B, BBar, TtEventPartons::dummyCandidatePtr(), TtGenEvtProducer_cfi::genEvt, mps_fire::i, and TtEventPartons::prune().

mps_fire.i
i
Definition: mps_fire.py:355
TtFullLepEvtPartons::BBar
Definition: TtFullLepEvtPartons.h:25
TtEventPartons::dummyCandidatePtr
reco::Candidate * dummyCandidatePtr() const
return pointer to an empty reco::Candidate
Definition: TtEventPartons.h:35
TtEventPartons::prune
void prune(std::vector< const reco::Candidate * > &vec)
erase partons from vector if they where chosen to be ignored
Definition: TtEventPartons.cc:13
TtFullLepEvtPartons::vec
std::vector< const reco::Candidate * > vec(const TtGenEvent &genEvt) override
return vector of partons in the order defined in the corresponding enum
Definition: TtFullLepEvtPartons.cc:22
str
#define str(s)
Definition: TestProcessor.cc:48
TtFullLepEvtPartons::Lepton
Definition: TtFullLepEvtPartons.h:25
TtFullLepEvtPartons::LeptonBar
Definition: TtFullLepEvtPartons.h:25
TtEventPartons::ignorePartons_
std::vector< bool > ignorePartons_
flag partons that were chosen not to be used
Definition: TtEventPartons.h:43
TtFullHadJetPartonMatch_cfi.partonsToIgnore
partonsToIgnore
Definition: TtFullHadJetPartonMatch_cfi.py:57
TtFullLepEvtPartons::B
Definition: TtFullLepEvtPartons.h:25
Exception
Definition: hltDiff.cc:246
TtGenEvtProducer_cfi.genEvt
genEvt
Definition: TtGenEvtProducer_cfi.py:7