CMS 3D CMS Logo

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

#include <TTbar_GenLepAnalyzer.h>

Inheritance diagram for TTbar_GenLepAnalyzer:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
 TTbar_GenLepAnalyzer (const edm::ParameterSet &)
 
 ~TTbar_GenLepAnalyzer () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

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_
 
edm::EDGetTokenT< edm::View
< reco::Candidate > > 
lepsToken_
 
int pdgid
 
double pt_cut_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 51 of file TTbar_GenLepAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file TTbar_GenLepAnalyzer.cc.

References leps_, and lepsToken_.

8  : leps_(iConfig.getParameter<edm::InputTag>("leptons")) {
9  lepsToken_ = consumes<edm::View<reco::Candidate> >(leps_);
10 }
edm::EDGetTokenT< edm::View< reco::Candidate > > lepsToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TTbar_GenLepAnalyzer::~TTbar_GenLepAnalyzer ( )
override

Definition at line 12 of file TTbar_GenLepAnalyzer.cc.

12  {
13  // do anything here that needs to be done at desctruction time
14  // (e.g. close files, deallocate resources etc.)
15 }

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 22 of file TTbar_GenLepAnalyzer.cc.

References edm::Event::getByToken(), hists_, edm::HandleBase::isValid(), and lepsToken_.

22  {
23  // Handle to the Leptons collections
25  iEvent.getByToken(lepsToken_, leps);
26  if (!leps.isValid())
27  return;
28 
29  // loop Jet collection and fill histograms
30  int nleps = 0;
31  for (edm::View<reco::Candidate>::const_iterator lep_it = leps->begin(); lep_it != leps->end(); ++lep_it) {
32  ++nleps;
33 
34  if (nleps > 0) {
35  hists_["lepPtAll"]->Fill(lep_it->p4().pt());
36  hists_["lepEtaAll"]->Fill(lep_it->p4().eta());
37  }
38  if (nleps == 1) {
39  hists_["lepPt1"]->Fill(lep_it->p4().pt());
40  hists_["lepEta1"]->Fill(lep_it->p4().eta());
41  }
42  if (nleps == 2) {
43  hists_["lepPt2"]->Fill(lep_it->p4().pt());
44  hists_["lepEta2"]->Fill(lep_it->p4().eta());
45  }
46  if (nleps == 3) {
47  hists_["lepPt3"]->Fill(lep_it->p4().pt());
48  hists_["lepEta3"]->Fill(lep_it->p4().eta());
49  }
50  if (nleps == 4) {
51  hists_["lepPt4"]->Fill(lep_it->p4().pt());
52  hists_["lepEta4"]->Fill(lep_it->p4().eta());
53  }
54  }
55 
56  hists_["lepN"]->Fill(nleps);
57 }
edm::EDGetTokenT< edm::View< reco::Candidate > > lepsToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
bool isValid() const
Definition: HandleBase.h:70
std::map< std::string, MonitorElement * > hists_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
void TTbar_GenLepAnalyzer::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  r,
edm::EventSetup const &  e 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 59 of file TTbar_GenLepAnalyzer.cc.

References DQMHelper::book1dHisto(), hists_, edm::InputTag::label(), leps_, and dqm::implementation::NavigatorBase::setCurrentFolder().

59  {
60  DQMHelper dqm(&i);
61  i.setCurrentFolder("Generator/TTbar");
62  hists_["lepN"] = dqm.book1dHisto(
63  "TTbar_lepN" + leps_.label(), "N", 10, -.5, 9.5, "Number of " + leps_.label(), "Number of Events");
64 
65  hists_["lepPtAll"] = dqm.book1dHisto("TTbar_lepPtAll_" + leps_.label(),
66  "pt",
67  1000,
68  0.,
69  1000.,
70  "P_{t}^{All-" + leps_.label() + "} (GeV)",
71  "Number of Events");
72  hists_["lepPt1"] = dqm.book1dHisto("TTbar_lepPt1_" + leps_.label(),
73  "pt",
74  1000,
75  0.,
76  1000.,
77  "P_{t}^{1st-" + leps_.label() + "} (GeV)",
78  "Number of Events");
79  hists_["lepPt2"] = dqm.book1dHisto("TTbar_lepPt2_" + leps_.label(),
80  "pt",
81  1000,
82  0.,
83  1000.,
84  "P_{t}^{2nd-" + leps_.label() + "} (GeV)",
85  "Number of Events");
86  hists_["lepPt3"] = dqm.book1dHisto("TTbar_lepPt3_" + leps_.label(),
87  "pt",
88  1000,
89  0.,
90  1000.,
91  "P_{t}^{3rd-" + leps_.label() + "} (GeV)",
92  "Number of Events");
93  hists_["lepPt4"] = dqm.book1dHisto("TTbar_lepPt4_" + leps_.label(),
94  "pt",
95  1000,
96  0.,
97  1000.,
98  "P_{t}^{4th-" + leps_.label() + "} (GeV)",
99  "Number of Events");
100 
101  hists_["lepEtaAll"] = dqm.book1dHisto(
102  "TTbar_lepEtaAll" + leps_.label(), "eta", 100, -5., 5., "#eta^{All-" + leps_.label() + "}", "Number of Events");
103  hists_["lepEta1"] = dqm.book1dHisto(
104  "TTbar_lepEta1" + leps_.label(), "eta", 100, -5., 5., "#eta^{1st-" + leps_.label() + "}", "Number of Events");
105  hists_["lepEta2"] = dqm.book1dHisto(
106  "TTbar_lepEta2" + leps_.label(), "eta", 100, -5., 5., "#eta^{2nd-" + leps_.label() + "}", "Number of Events");
107  hists_["lepEta3"] = dqm.book1dHisto(
108  "TTbar_lepEta3" + leps_.label(), "eta", 100, -5., 5., "#eta^{3rd-" + leps_.label() + "}", "Number of Events");
109  hists_["lepEta4"] = dqm.book1dHisto(
110  "TTbar_lepEta4" + leps_.label(), "eta", 100, -5., 5., "#eta^{4th-" + leps_.label() + "}", "Number of Events");
111 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::string const & label() const
Definition: InputTag.h:36
std::map< std::string, MonitorElement * > hists_

Member Data Documentation

bool TTbar_GenLepAnalyzer::do_e_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_mu_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_nu_e_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_nu_mu_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_nu_tau_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

bool TTbar_GenLepAnalyzer::do_tau_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

double TTbar_GenLepAnalyzer::eta_cut_
private

Definition at line 66 of file TTbar_GenLepAnalyzer.h.

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

Definition at line 63 of file TTbar_GenLepAnalyzer.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag TTbar_GenLepAnalyzer::leps_
private

Definition at line 62 of file TTbar_GenLepAnalyzer.h.

Referenced by bookHistograms(), and TTbar_GenLepAnalyzer().

edm::EDGetTokenT<edm::View<reco::Candidate> > TTbar_GenLepAnalyzer::lepsToken_
private

Definition at line 69 of file TTbar_GenLepAnalyzer.h.

Referenced by analyze(), and TTbar_GenLepAnalyzer().

int TTbar_GenLepAnalyzer::pdgid
private

Definition at line 67 of file TTbar_GenLepAnalyzer.h.

double TTbar_GenLepAnalyzer::pt_cut_
private

Definition at line 66 of file TTbar_GenLepAnalyzer.h.