CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ElectronGeneralAnalyzer Class Reference

#include <ElectronGeneralAnalyzer.h>

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

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 ElectronGeneralAnalyzer (const edm::ParameterSet &conf)
 
 ~ElectronGeneralAnalyzer () 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

edm::EDGetTokenT< reco::BeamSpotbeamSpotTag_
 
edm::EDGetTokenT< reco::GsfElectronCollectionelectronCollection_
 
edm::EDGetTokenT< reco::GsfTrackCollectiongsftrackCollection_
 
MonitorElementh2_ele_beamSpotXvsY
 
edm::EDGetTokenT< reco::SuperClusterCollectionmatchingObjectCollection_
 
MonitorElementpy_ele_nClustersVsLs
 
MonitorElementpy_ele_nElectronsVsLs
 
MonitorElementpy_ele_nGsfTracksVsLs
 
MonitorElementpy_ele_nTracksVsLs
 
MonitorElementpy_ele_nVerticesVsLs
 
edm::EDGetTokenT< reco::TrackCollectiontrackCollection_
 
edm::EDGetTokenT< reco::VertexCollectionvertexCollection_
 

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< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from ElectronDqmAnalyzerBase
MonitorElementbookH1 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookH2withSumw2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookP1 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
 
MonitorElementcloneH1 (DQMStore::IBooker &iBooker, const std::string &name, MonitorElement *original, const std::string &title="")
 
MonitorElementcloneH1 (DQMStore::IBooker &iBooker, const std::string &name, const std::string &original, const std::string &title="")
 
 ElectronDqmAnalyzerBase (const edm::ParameterSet &conf)
 
void setBookEfficiencyFlag (const bool &)
 
void setBookIndex (short)
 
void setBookPrefix (const std::string &)
 
void setBookStatOverflowFlag (const bool &)
 
int verbosity ()
 
 ~ElectronDqmAnalyzerBase () override
 
- 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

Definition at line 21 of file ElectronGeneralAnalyzer.h.

Constructor & Destructor Documentation

◆ ElectronGeneralAnalyzer()

ElectronGeneralAnalyzer::ElectronGeneralAnalyzer ( const edm::ParameterSet conf)
explicit

Definition at line 26 of file ElectronGeneralAnalyzer.cc.

References beamSpotTag_, electronCollection_, edm::ParameterSet::getParameter(), gsftrackCollection_, matchingObjectCollection_, trackCollection_, and vertexCollection_.

26  : ElectronDqmAnalyzerBase(conf) {
27  // collection input tags
28  electronCollection_ = consumes<GsfElectronCollection>(conf.getParameter<edm::InputTag>("ElectronCollection"));
30  consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("MatchingObjectCollection"));
31  trackCollection_ = consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("TrackCollection"));
32  vertexCollection_ = consumes<reco::VertexCollection>(conf.getParameter<edm::InputTag>("VertexCollection"));
33  gsftrackCollection_ = consumes<reco::GsfTrackCollection>(conf.getParameter<edm::InputTag>("GsfTrackCollection"));
34  beamSpotTag_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("BeamSpot"));
35 }
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< reco::TrackCollection > trackCollection_
edm::EDGetTokenT< reco::GsfElectronCollection > electronCollection_
ElectronDqmAnalyzerBase(const edm::ParameterSet &conf)
edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
edm::EDGetTokenT< reco::GsfTrackCollection > gsftrackCollection_
edm::EDGetTokenT< reco::SuperClusterCollection > matchingObjectCollection_

◆ ~ElectronGeneralAnalyzer()

ElectronGeneralAnalyzer::~ElectronGeneralAnalyzer ( )
override

Definition at line 37 of file ElectronGeneralAnalyzer.cc.

37 {}

Member Function Documentation

◆ analyze()

void ElectronGeneralAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Reimplemented from ElectronDqmAnalyzerBase.

Definition at line 53 of file ElectronGeneralAnalyzer.cc.

References beamSpotTag_, cms::cuda::bs, electronCollection_, dqm::impl::MonitorElement::Fill(), electronIsolatorFromEffectiveArea_cfi::gsfElectrons, gsftrackCollection_, ecalDrivenGsfElectronCoresHGC_cff::gsfTracks, h2_ele_beamSpotXvsY, iEvent, matchingObjectCollection_, py_ele_nClustersVsLs, py_ele_nElectronsVsLs, py_ele_nGsfTracksVsLs, py_ele_nTracksVsLs, py_ele_nVerticesVsLs, trackCollection_, DiMuonV_cfg::tracks, vertexCollection_, and AlignmentTracksFromVertexSelector_cfi::vertices.

53  {
57  iEvent.getByToken(matchingObjectCollection_, recoClusters);
59  iEvent.getByToken(trackCollection_, tracks);
63  iEvent.getByToken(vertexCollection_, vertices);
64  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
65  iEvent.getByToken(beamSpotTag_, recoBeamSpotHandle);
66  const BeamSpot bs = *recoBeamSpotHandle;
67 
68  edm::EventNumber_t ievt = iEvent.id().event();
69  edm::RunNumber_t irun = iEvent.id().run();
70  edm::LuminosityBlockNumber_t ils = iEvent.luminosityBlock();
71 
72  edm::LogInfo("ElectronGeneralAnalyzer::analyze")
73  << "Treating " << gsfElectrons.product()->size() << " electrons"
74  << " from event " << ievt << " in run " << irun << " and lumiblock " << ils;
75 
76  h2_ele_beamSpotXvsY->Fill(bs.position().x(), bs.position().y());
77  py_ele_nElectronsVsLs->Fill(float(ils), (*gsfElectrons).size());
78  py_ele_nClustersVsLs->Fill(float(ils), (*recoClusters).size());
79  py_ele_nGsfTracksVsLs->Fill(float(ils), (*gsfTracks).size());
80  py_ele_nTracksVsLs->Fill(float(ils), (*tracks).size());
81  py_ele_nVerticesVsLs->Fill(float(ils), (*vertices).size());
82 }
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
MonitorElement * py_ele_nGsfTracksVsLs
MonitorElement * h2_ele_beamSpotXvsY
MonitorElement * py_ele_nVerticesVsLs
MonitorElement * py_ele_nElectronsVsLs
unsigned long long EventNumber_t
unsigned int LuminosityBlockNumber_t
MonitorElement * py_ele_nClustersVsLs
void Fill(long long x)
edm::EDGetTokenT< reco::TrackCollection > trackCollection_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::GsfElectronCollection > electronCollection_
edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
Log< level::Info, false > LogInfo
unsigned int RunNumber_t
edm::EDGetTokenT< reco::GsfTrackCollection > gsftrackCollection_
edm::EDGetTokenT< reco::SuperClusterCollection > matchingObjectCollection_

◆ bookHistograms()

void ElectronGeneralAnalyzer::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ElectronDqmAnalyzerBase.

Definition at line 39 of file ElectronGeneralAnalyzer.cc.

References ElectronDqmAnalyzerBase::bookH2(), ElectronDqmAnalyzerBase::bookP1(), h2_ele_beamSpotXvsY, py_ele_nClustersVsLs, py_ele_nElectronsVsLs, py_ele_nGsfTracksVsLs, py_ele_nTracksVsLs, and py_ele_nVerticesVsLs.

39  {
41  bookH2(iBooker, "beamSpotXvsY", "beam spot x vs y", 100, -0.2, 0.2, 100, -0.2, 0.2, "x (cm)", "y (cm)");
43  bookP1(iBooker, "nElectronsVsLs", "# gsf electrons vs LS", 150, 0., 1500., 0., 20., "LS", "<N_{ele}>");
45  bookP1(iBooker, "nClustersVsLs", "# clusters vs LS", 150, 0., 1500., 0., 100., "LS", "<N_{SC}>");
47  bookP1(iBooker, "nGsfTracksVsLs", "# gsf tracks vs LS", 150, 0., 1500., 0., 20., "LS", "<N_{GSF tk}>");
48  py_ele_nTracksVsLs = bookP1(iBooker, "nTracksVsLs", "# tracks vs LS", 150, 0., 1500., 0., 100., "LS", "<N_{gen tk}>");
50  bookP1(iBooker, "nVerticesVsLs", "# vertices vs LS", 150, 0., 1500., 0., 10., "LS", "<N_{vert}>");
51 }
MonitorElement * py_ele_nGsfTracksVsLs
MonitorElement * h2_ele_beamSpotXvsY
MonitorElement * py_ele_nVerticesVsLs
MonitorElement * py_ele_nElectronsVsLs
MonitorElement * py_ele_nClustersVsLs
MonitorElement * bookP1(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
MonitorElement * bookH2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")

Member Data Documentation

◆ beamSpotTag_

edm::EDGetTokenT<reco::BeamSpot> ElectronGeneralAnalyzer::beamSpotTag_
private

Definition at line 40 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

◆ electronCollection_

edm::EDGetTokenT<reco::GsfElectronCollection> ElectronGeneralAnalyzer::electronCollection_
private

Definition at line 35 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

◆ gsftrackCollection_

edm::EDGetTokenT<reco::GsfTrackCollection> ElectronGeneralAnalyzer::gsftrackCollection_
private

Definition at line 37 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

◆ h2_ele_beamSpotXvsY

MonitorElement* ElectronGeneralAnalyzer::h2_ele_beamSpotXvsY
private

Definition at line 46 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

◆ matchingObjectCollection_

edm::EDGetTokenT<reco::SuperClusterCollection> ElectronGeneralAnalyzer::matchingObjectCollection_
private

Definition at line 36 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

◆ py_ele_nClustersVsLs

MonitorElement* ElectronGeneralAnalyzer::py_ele_nClustersVsLs
private

Definition at line 48 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

◆ py_ele_nElectronsVsLs

MonitorElement* ElectronGeneralAnalyzer::py_ele_nElectronsVsLs
private

Definition at line 47 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

◆ py_ele_nGsfTracksVsLs

MonitorElement* ElectronGeneralAnalyzer::py_ele_nGsfTracksVsLs
private

Definition at line 49 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

◆ py_ele_nTracksVsLs

MonitorElement* ElectronGeneralAnalyzer::py_ele_nTracksVsLs
private

Definition at line 50 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

◆ py_ele_nVerticesVsLs

MonitorElement* ElectronGeneralAnalyzer::py_ele_nVerticesVsLs
private

Definition at line 51 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

◆ trackCollection_

edm::EDGetTokenT<reco::TrackCollection> ElectronGeneralAnalyzer::trackCollection_
private

Definition at line 38 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

◆ vertexCollection_

edm::EDGetTokenT<reco::VertexCollection> ElectronGeneralAnalyzer::vertexCollection_
private

Definition at line 39 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().