CMS 3D CMS Logo

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (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::TTbar_GenLepAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 7 of file TTbar_GenLepAnalyzer.cc.

8  : leps_(iConfig.getParameter<edm::InputTag>("leptons")) {
9  lepsToken_ = consumes<edm::View<reco::Candidate> >(leps_);
10 }

References leps_, and lepsToken_.

◆ ~TTbar_GenLepAnalyzer()

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

◆ analyze()

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.

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 }

References hists_, iEvent, TtSemiLepHitFitProducer_Electrons_cfi::leps, and lepsToken_.

◆ bookHistograms()

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.

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 }

References hists_, mps_fire::i, edm::InputTag::label(), and leps_.

Member Data Documentation

◆ do_e_

bool TTbar_GenLepAnalyzer::do_e_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

◆ do_mu_

bool TTbar_GenLepAnalyzer::do_mu_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

◆ do_nu_e_

bool TTbar_GenLepAnalyzer::do_nu_e_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

◆ do_nu_mu_

bool TTbar_GenLepAnalyzer::do_nu_mu_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

◆ do_nu_tau_

bool TTbar_GenLepAnalyzer::do_nu_tau_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

◆ do_tau_

bool TTbar_GenLepAnalyzer::do_tau_
private

Definition at line 65 of file TTbar_GenLepAnalyzer.h.

◆ eta_cut_

double TTbar_GenLepAnalyzer::eta_cut_
private

Definition at line 66 of file TTbar_GenLepAnalyzer.h.

◆ hists_

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

Definition at line 63 of file TTbar_GenLepAnalyzer.h.

Referenced by analyze(), and bookHistograms().

◆ leps_

edm::InputTag TTbar_GenLepAnalyzer::leps_
private

Definition at line 62 of file TTbar_GenLepAnalyzer.h.

Referenced by bookHistograms(), and TTbar_GenLepAnalyzer().

◆ lepsToken_

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().

◆ pdgid

int TTbar_GenLepAnalyzer::pdgid
private

Definition at line 67 of file TTbar_GenLepAnalyzer.h.

◆ pt_cut_

double TTbar_GenLepAnalyzer::pt_cut_
private

Definition at line 66 of file TTbar_GenLepAnalyzer.h.

mps_fire.i
i
Definition: mps_fire.py:355
TTbar_GenLepAnalyzer::lepsToken_
edm::EDGetTokenT< edm::View< reco::Candidate > > lepsToken_
Definition: TTbar_GenLepAnalyzer.h:69
edm::Handle
Definition: AssociativeIterator.h:50
TtSemiLepHitFitProducer_Electrons_cfi.leps
leps
Definition: TtSemiLepHitFitProducer_Electrons_cfi.py:5
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
TTbar_GenLepAnalyzer::hists_
std::map< std::string, MonitorElement * > hists_
Definition: TTbar_GenLepAnalyzer.h:63
iEvent
int iEvent
Definition: GenABIO.cc:224
DQMHelper
Definition: DQMHelper.h:15
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TTbar_GenLepAnalyzer::leps_
edm::InputTag leps_
Definition: TTbar_GenLepAnalyzer.h:62
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
dqm
Definition: DQMStore.h:18
edm::InputTag
Definition: InputTag.h:15