CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TTbar_GenLepAnalyzer Class Reference

#include <TTbar_GenLepAnalyzer.h>

Inheritance diagram for TTbar_GenLepAnalyzer:
edm::EDAnalyzer

Public Member Functions

 TTbar_GenLepAnalyzer (const edm::ParameterSet &)
 
 ~TTbar_GenLepAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 

Private Attributes

DQMStoredbe
 ME's "container". More...
 
bool do_e_
 
bool do_mu_
 
bool do_nu_e_
 
bool do_nu_mu_
 
bool do_nu_tau_
 
bool do_tau_
 
double eta_cut_
 
std::map< std::string,
MonitorElement * > 
hists_
 
edm::InputTag leps_
 
int pdgid
 
double pt_cut_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 55 of file TTbar_GenLepAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file TTbar_GenLepAnalyzer.cc.

References dbe, and cppFunctionSkipper::operator.

6  :
7  leps_(iConfig.getParameter<edm::InputTag>("leptons"))
8 {
9  //now do what ever initialization is needed
10  dbe = 0;
12 
13 }
T getParameter(std::string const &) const
DQMStore * dbe
ME&#39;s &quot;container&quot;.
TTbar_GenLepAnalyzer::~TTbar_GenLepAnalyzer ( )

Definition at line 16 of file TTbar_GenLepAnalyzer.cc.

17 {
18 
19  // do anything here that needs to be done at desctruction time
20  // (e.g. close files, deallocate resources etc.)
21 
22 }

Member Function Documentation

void TTbar_GenLepAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 31 of file TTbar_GenLepAnalyzer.cc.

References edm::Event::getByLabel(), hists_, edm::HandleBase::isValid(), and leps_.

32 {
33 
34  // Handle to the Leptons collections
36  iEvent.getByLabel(leps_, leps);
37  if(!leps.isValid()) return;
38 
39  // loop Jet collection and fill histograms
40  int nleps = 0;
41  for(edm::View<reco::Candidate>::const_iterator lep_it=leps->begin(); lep_it!=leps->end(); ++lep_it){
42 
43  ++nleps;
44 
45  if (nleps > 0) { hists_["lepPtAll" ]->Fill( lep_it->p4().pt() );
46  hists_["lepEtaAll"]->Fill( lep_it->p4().eta() );
47  }
48  if (nleps == 1) { hists_["lepPt1" ]->Fill( lep_it->p4().pt() );
49  hists_["lepEta1"]->Fill( lep_it->p4().eta() );
50  }
51  if (nleps == 2) { hists_["lepPt2" ]->Fill( lep_it->p4().pt() );
52  hists_["lepEta2"]->Fill( lep_it->p4().eta() );
53  }
54  if (nleps == 3) { hists_["lepPt3" ]->Fill( lep_it->p4().pt() );
55  hists_["lepEta3"]->Fill( lep_it->p4().eta() );
56  }
57  if (nleps == 4) { hists_["lepPt4" ]->Fill( lep_it->p4().pt() );
58  hists_["lepEta4"]->Fill( lep_it->p4().eta() );
59  }
60  }
61 
62  hists_["lepN" ]->Fill( nleps ) ;
63 
64 
65 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::map< std::string, MonitorElement * > hists_
void TTbar_GenLepAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file TTbar_GenLepAnalyzer.cc.

References DQMStore::book1D(), dbe, hists_, edm::InputTag::label(), leps_, and DQMStore::setCurrentFolder().

71 {
72  if(!dbe) return;
73  dbe->setCurrentFolder("Generator/TTbar");
74  hists_["lepN" ] = dbe->book1D("TTbar_lepN" , "N" , 10, -.5, 9.5 );
75 
76  hists_["lepPtAll" ] = dbe->book1D("TTbar_lepPtAll_"+leps_.label() , "pt" , 1000, 0., 1000.);
77  hists_["lepPt1" ] = dbe->book1D("TTbar_lepPt1_"+leps_.label() , "pt" , 1000, 0., 1000.);
78  hists_["lepPt2" ] = dbe->book1D("TTbar_lepPt2_"+leps_.label() , "pt" , 1000, 0., 1000.);
79  hists_["lepPt3" ] = dbe->book1D("TTbar_lepPt3_"+leps_.label() , "pt" , 1000, 0., 1000.);
80  hists_["lepPt4" ] = dbe->book1D("TTbar_lepPt4_"+leps_.label() , "pt" , 1000, 0., 1000.);
81 
82  hists_["lepEtaAll"] = dbe->book1D("TTbar_lepEtaAll"+leps_.label(), "eta", 100, -5., 5.);
83  hists_["lepEta1" ] = dbe->book1D("TTbar_lepEta1"+leps_.label() , "eta", 100, -5., 5.);
84  hists_["lepEta2" ] = dbe->book1D("TTbar_lepEta2"+leps_.label() , "eta", 100, -5., 5.);
85  hists_["lepEta3" ] = dbe->book1D("TTbar_lepEta3"+leps_.label() , "eta", 100, -5., 5.);
86  hists_["lepEta4" ] = dbe->book1D("TTbar_lepEta4"+leps_.label() , "eta", 100, -5., 5.);
87 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::string const & label() const
Definition: InputTag.h:25
DQMStore * dbe
ME&#39;s &quot;container&quot;.
std::map< std::string, MonitorElement * > hists_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void TTbar_GenLepAnalyzer::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file TTbar_GenLepAnalyzer.cc.

110 {
111 }
void TTbar_GenLepAnalyzer::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 97 of file TTbar_GenLepAnalyzer.cc.

98 {
99 }
void TTbar_GenLepAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file TTbar_GenLepAnalyzer.cc.

92 {
93 }
void TTbar_GenLepAnalyzer::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 115 of file TTbar_GenLepAnalyzer.cc.

116 {
117 }
void TTbar_GenLepAnalyzer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 103 of file TTbar_GenLepAnalyzer.cc.

104 {
105 }
void TTbar_GenLepAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 121 of file TTbar_GenLepAnalyzer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

121  {
122  //The following says we do not know what parameters are allowed so do no validation
123  // Please change this to state exactly what you do use, even if it is no parameters
125  desc.setUnknown();
126  descriptions.addDefault(desc);
127 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

DQMStore* TTbar_GenLepAnalyzer::dbe
private

ME's "container".

Definition at line 75 of file TTbar_GenLepAnalyzer.h.

Referenced by beginJob(), and TTbar_GenLepAnalyzer().

bool TTbar_GenLepAnalyzer::do_e_
private

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_mu_
private

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_nu_e_
private

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_nu_mu_
private

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_nu_tau_
private

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_tau_
private

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

double TTbar_GenLepAnalyzer::eta_cut_
private

Definition at line 81 of file TTbar_GenLepAnalyzer.h.

std::map<std::string, MonitorElement*> TTbar_GenLepAnalyzer::hists_
private

Definition at line 78 of file TTbar_GenLepAnalyzer.h.

Referenced by analyze(), and beginJob().

edm::InputTag TTbar_GenLepAnalyzer::leps_
private

Definition at line 77 of file TTbar_GenLepAnalyzer.h.

Referenced by analyze(), and beginJob().

int TTbar_GenLepAnalyzer::pdgid
private

Definition at line 82 of file TTbar_GenLepAnalyzer.h.

double TTbar_GenLepAnalyzer::pt_cut_
private

Definition at line 81 of file TTbar_GenLepAnalyzer.h.