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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

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 beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotTag_
 
edm::EDGetTokenT< reco::GsfElectronCollectionelectronCollection_
 
edm::EDGetTokenT< reco::GsfTrackCollectiongsftrackCollection_
 
MonitorElementh1_ele_triggers
 
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< edm::TriggerResultstriggerResults_
 
edm::EDGetTokenT< reco::VertexCollectionvertexCollection_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
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
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from ElectronDqmAnalyzerBase
void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
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="")
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
 ElectronDqmAnalyzerBase (const edm::ParameterSet &conf)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
bool finalStepDone ()
 
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 edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 23 of file ElectronGeneralAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file ElectronGeneralAnalyzer.cc.

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

29  {
30  // collection input tags
31  electronCollection_ = consumes<GsfElectronCollection>(conf.getParameter<edm::InputTag>("ElectronCollection"));
32  matchingObjectCollection_ = consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("MatchingObjectCollection"));
33  trackCollection_ = consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("TrackCollection"));
34  vertexCollection_ = consumes<reco::VertexCollection>(conf.getParameter<edm::InputTag>("VertexCollection"));
35  gsftrackCollection_ = consumes<reco::GsfTrackCollection>(conf.getParameter<edm::InputTag>("GsfTrackCollection"));
36  beamSpotTag_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("BeamSpot"));
37  triggerResults_ = consumes<edm::TriggerResults>(conf.getParameter<edm::InputTag>("TriggerResults"));
38 
39 // // for trigger
40 // HLTPathsByName_= conf.getParameter<std::vector<std::string > >("HltPaths");
41 // HLTPathsByIndex_.resize(HLTPathsByName_.size());
42  }
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > trackCollection_
edm::EDGetTokenT< reco::GsfElectronCollection > electronCollection_
ElectronDqmAnalyzerBase(const edm::ParameterSet &conf)
edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
edm::EDGetTokenT< reco::GsfTrackCollection > gsftrackCollection_
edm::EDGetTokenT< reco::SuperClusterCollection > matchingObjectCollection_
ElectronGeneralAnalyzer::~ElectronGeneralAnalyzer ( )
override

Definition at line 44 of file ElectronGeneralAnalyzer.cc.

45  {}

Member Function Documentation

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

Definition at line 58 of file ElectronGeneralAnalyzer.cc.

References edm::HLTGlobalStatus::accept(), beamSpotTag_, electronCollection_, edm::EventID::event(), MonitorElement::Fill(), edm::Event::getByToken(), gsfElectrons_cfi::gsfElectrons, gsftrackCollection_, gedGsfElectronCores_cfi::gsfTracks, h1_ele_triggers, h2_ele_beamSpotXvsY, mps_fire::i, edm::EventBase::id(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), matchingObjectCollection_, gen::n, reco::BeamSpot::position(), edm::Handle< T >::product(), py_ele_nClustersVsLs, py_ele_nElectronsVsLs, py_ele_nGsfTracksVsLs, py_ele_nTracksVsLs, py_ele_nVerticesVsLs, edm::EventID::run(), edm::HLTGlobalStatus::size(), trackCollection_, l1t::tracks, triggerResults, triggerResults_, vertexCollection_, and electrons_cff::vertices.

59  {
61  iEvent.getByToken(electronCollection_,gsfElectrons) ;
63  iEvent.getByToken(matchingObjectCollection_,recoClusters) ;
65  iEvent.getByToken(trackCollection_,tracks);
67  iEvent.getByToken(gsftrackCollection_,gsfTracks);
69  iEvent.getByToken(vertexCollection_,vertices);
70  edm::Handle<reco::BeamSpot> recoBeamSpotHandle ;
71  iEvent.getByToken(beamSpotTag_,recoBeamSpotHandle) ;
72  const BeamSpot bs = *recoBeamSpotHandle ;
73 
74  edm::EventNumber_t ievt = iEvent.id().event();
75  edm::RunNumber_t irun = iEvent.id().run();
76  edm::LuminosityBlockNumber_t ils = iEvent.luminosityBlock();
77 
78  edm::LogInfo("ElectronGeneralAnalyzer::analyze")
79  <<"Treating "<<gsfElectrons.product()->size()<<" electrons"
80  <<" from event "<<ievt<<" in run "<<irun<<" and lumiblock "<<ils ;
81 
82  h2_ele_beamSpotXvsY->Fill(bs.position().x(),bs.position().y());
83  py_ele_nElectronsVsLs->Fill(float(ils),(*gsfElectrons).size());
84  py_ele_nClustersVsLs->Fill(float(ils),(*recoClusters).size());
85  py_ele_nGsfTracksVsLs->Fill(float(ils),(*gsfTracks).size());
86  py_ele_nTracksVsLs->Fill(float(ils),(*tracks).size());
87  py_ele_nVerticesVsLs->Fill(float(ils),(*vertices).size());
88 
89  // trigger
91  iEvent.getByToken(triggerResults_,triggerResults) ;
92  if (triggerResults.isValid())
93  {
94  unsigned int i, n = triggerResults->size() ;
95  for ( i=0 ; i!=n ; ++i )
96  {
97  if (triggerResults->accept(i))
98  { h1_ele_triggers->Fill(float(i)) ; }
99  }
100  }
101  }
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
MonitorElement * py_ele_nGsfTracksVsLs
MonitorElement * h2_ele_beamSpotXvsY
MonitorElement * py_ele_nVerticesVsLs
MonitorElement * py_ele_nElectronsVsLs
bool accept() const
Has at least one path accepted the event?
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:230
edm::EDGetTokenT< reco::GsfElectronCollection > electronCollection_
unsigned int size() const
Get number of paths stored.
static std::string const triggerResults
Definition: EdmProvDump.cc:41
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
const Point & position() const
position
Definition: BeamSpot.h:62
unsigned int RunNumber_t
edm::EDGetTokenT< reco::GsfTrackCollection > gsftrackCollection_
edm::EDGetTokenT< reco::SuperClusterCollection > matchingObjectCollection_
void ElectronGeneralAnalyzer::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ElectronDqmAnalyzerBase.

Definition at line 47 of file ElectronGeneralAnalyzer.cc.

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

48  {
49  h2_ele_beamSpotXvsY = bookH2(iBooker, "beamSpotXvsY","beam spot x vs y",100,-0.2,0.2,100,-0.2,0.2,"x (cm)","y (cm)") ;
50  py_ele_nElectronsVsLs = bookP1(iBooker, "nElectronsVsLs","# gsf electrons vs LS",150,0.,1500.,0.,20.,"LS","<N_{ele}>") ;
51  py_ele_nClustersVsLs = bookP1(iBooker, "nClustersVsLs","# clusters vs LS",150,0.,1500.,0.,100.,"LS","<N_{SC}>") ;
52  py_ele_nGsfTracksVsLs = bookP1(iBooker, "nGsfTracksVsLs","# gsf tracks vs LS",150,0.,1500.,0.,20.,"LS","<N_{GSF tk}>") ;
53  py_ele_nTracksVsLs = bookP1(iBooker, "nTracksVsLs","# tracks vs LS",150,0.,1500.,0.,100.,"LS","<N_{gen tk}>") ;
54  py_ele_nVerticesVsLs = bookP1(iBooker, "nVerticesVsLs","# vertices vs LS",150,0.,1500.,0.,10.,"LS","<N_{vert}>") ;
55  h1_ele_triggers = bookH1(iBooker, "triggers","hlt triggers",256,0.,256.,"HLT bit") ;
56  }
MonitorElement * py_ele_nGsfTracksVsLs
MonitorElement * h2_ele_beamSpotXvsY
MonitorElement * py_ele_nVerticesVsLs
MonitorElement * py_ele_nElectronsVsLs
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")
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 * bookH1(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")

Member Data Documentation

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

Definition at line 45 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

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

Definition at line 40 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

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

Definition at line 42 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

MonitorElement* ElectronGeneralAnalyzer::h1_ele_triggers
private

Definition at line 68 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ElectronGeneralAnalyzer::h2_ele_beamSpotXvsY
private

Definition at line 62 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 41 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nClustersVsLs
private

Definition at line 64 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nElectronsVsLs
private

Definition at line 63 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nGsfTracksVsLs
private

Definition at line 65 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nTracksVsLs
private

Definition at line 66 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nVerticesVsLs
private

Definition at line 67 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 43 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

edm::EDGetTokenT<edm::TriggerResults> ElectronGeneralAnalyzer::triggerResults_
private

Definition at line 48 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

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

Definition at line 44 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().