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 Attributes
PythiaFilterTTBar Class Reference

#include <GeneratorInterface/GenFilter/src/PythiaFilterTTBar.cc>

Inheritance diagram for PythiaFilterTTBar:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 PythiaFilterTTBar (const edm::ParameterSet &)
 
 ~PythiaFilterTTBar ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

unsigned int decayType_
 
std::string label_
 
unsigned int leptonFlavour_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: edmFilter to select a TTBar decay channel

Implementation: decayType: 1 + leptonFlavour: 0 -> Semi-leptonic leptonFlavour: 1 -> Semi-e leptonFlavour: 2 -> Semi-mu leptonFlavour: 3 -> Semi-tau decayType: 2 -> di-leptonic (no seperate channels implemented yet)

decayType: 3 -> fully-hadronic

Definition at line 56 of file PythiaFilterTTBar.h.

Constructor & Destructor Documentation

PythiaFilterTTBar::PythiaFilterTTBar ( const edm::ParameterSet iConfig)
explicit

Definition at line 16 of file PythiaFilterTTBar.cc.

16  :
17  label_(iConfig.getUntrackedParameter("moduleLabel",std::string("generator"))),
18  decayType_(iConfig.getUntrackedParameter("decayType",1)),
19  leptonFlavour_(iConfig.getUntrackedParameter("leptonFlavour",0))
20 {
21 }
T getUntrackedParameter(std::string const &, T const &) const
unsigned int leptonFlavour_
unsigned int decayType_
PythiaFilterTTBar::~PythiaFilterTTBar ( )

Definition at line 24 of file PythiaFilterTTBar.cc.

25 {
26 
27  // do anything here that needs to be done at desctruction time
28  // (e.g. close files, deallocate resources etc.)
29 
30 }

Member Function Documentation

bool PythiaFilterTTBar::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDFilter.

Definition at line 39 of file PythiaFilterTTBar.cc.

References accept(), decayType_, edm::Event::getByLabel(), label_, leptonFlavour_, AlCaHLTBitMon_ParallelJobs::p, and ntuplemaker::status.

40 {
41 
42  bool accept=false;
43 
45  iEvent.getByLabel(label_, evt);
46 
47  const HepMC::GenEvent * myGenEvent = evt->GetEvent();
48 
49  unsigned int iE=0, iMu=0, iTau=0;
50 
51  unsigned int iNuE=0, iNuMu=0, iNuTau=0;
52 
53  unsigned int iLep=0, iNu=0;
54 
55 
56  for ( HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end(); ++p ) {
57 
58  int pdgID = (*p)->pdg_id();
59 
60  int status = (*p)->status();
61 
62  if ( status == 3 ) {
63 
64  // count the final state leptons
65 
66  if (fabs(pdgID) == 11)
67  iE++;
68 
69  if(fabs(pdgID) == 13)
70  iMu++;
71 
72  if(fabs(pdgID) == 15)
73  iTau++;
74 
75  // count the final state neutrinos
76 
77  if(fabs(pdgID) == 12)
78  iNuE++;
79 
80  if(fabs(pdgID) == 14)
81  iNuMu++;
82 
83  if(fabs(pdgID) == 16)
84  iNuTau++;
85 
86  }
87 
88  }
89 
90  iLep = (iE+iMu+iTau);
91  iNu = (iNuE+iNuMu+iNuTau);
92 
93  if (decayType_ == 1) { // semi-leptonic decay
94 
95  // l = e,mu,tau
96 
97  if (leptonFlavour_ == 0 && iLep == 1 && iNu == 1)
98  accept=true;
99 
100  // l = e
101 
102  else if (leptonFlavour_ == 1 && iE == 1 && iNuE == 1 && iLep == 1 && iNu == 1)
103  accept=true;
104 
105  // l = mu
106 
107  else if (leptonFlavour_ == 2 && iMu == 1 && iNuMu == 1 && iLep == 1 && iNu == 1)
108  accept=true;
109 
110  // l = tau
111 
112  else if (leptonFlavour_ == 3 && iTau == 1 && iNuTau == 1 && iLep == 1 && iNu == 1)
113  accept=true;
114 
115  }
116 
117  else if (decayType_ == 2) { // di-leptonic decay (inclusive)
118 
119  if (iLep == 2 && iNu == 2)
120  accept=true;
121 
122  }
123 
124  else if (decayType_ == 3) { // fully-hadronic decay
125 
126  if (iLep == 0 && iNu == 0)
127  accept=true;
128  }
129 
130  else
131  accept=false;
132 
133 
134  return accept;
135 }
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:22
unsigned int leptonFlavour_
unsigned int decayType_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple status
Definition: ntuplemaker.py:245

Member Data Documentation

unsigned int PythiaFilterTTBar::decayType_
private

Definition at line 67 of file PythiaFilterTTBar.h.

Referenced by filter().

std::string PythiaFilterTTBar::label_
private
unsigned int PythiaFilterTTBar::leptonFlavour_
private

Definition at line 69 of file PythiaFilterTTBar.h.

Referenced by filter().