CMS 3D CMS Logo

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

#include <ElectronGeneralAnalyzer.h>

Inheritance diagram for ElectronGeneralAnalyzer:
ElectronDqmAnalyzerBase edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 
virtual void book ()
 
 ElectronGeneralAnalyzer (const edm::ParameterSet &conf)
 
virtual ~ElectronGeneralAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

edm::InputTag beamSpotTag_
 
edm::InputTag electronCollection_
 
edm::InputTag gsftrackCollection_
 
MonitorElementh1_ele_triggers
 
MonitorElementh2_ele_beamSpotXvsY
 
edm::InputTag matchingObjectCollection_
 
MonitorElementpy_ele_nClustersVsLs
 
MonitorElementpy_ele_nElectronsVsLs
 
MonitorElementpy_ele_nGsfTracksVsLs
 
MonitorElementpy_ele_nTracksVsLs
 
MonitorElementpy_ele_nVerticesVsLs
 
edm::InputTag trackCollection_
 
edm::InputTag triggerResults_
 
edm::InputTag vertexCollection_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from ElectronDqmAnalyzerBase
void beginJob ()
 
MonitorElementbookH1 (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")
 
MonitorElementbookH1andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1andDivide (const std::string &name, const std::string &num, const std::string &denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1withSumw2 (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 (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")
 
MonitorElementbookH2andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH2andDivide (const std::string &name, const std::string &num, const std::string &denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH2withSumw2 (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 (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 (const std::string &name, MonitorElement *original, const std::string &title="")
 
MonitorElementcloneH1 (const std::string &name, const std::string &original, const std::string &title="")
 
 ElectronDqmAnalyzerBase (const edm::ParameterSet &conf)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
virtual void finalize ()
 
bool finalStepDone ()
 
MonitorElementget (const std::string &name)
 
MonitorElementprofileX (MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileX (const std::string &me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (const std::string &me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
void remove (const std::string &name)
 
void remove_other_dirs ()
 
void setBookIndex (short)
 
void setBookPrefix (const std::string &)
 
int verbosity ()
 
virtual ~ElectronDqmAnalyzerBase ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 19 of file ElectronGeneralAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file ElectronGeneralAnalyzer.cc.

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

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

Definition at line 46 of file ElectronGeneralAnalyzer.cc.

47  {}

Member Function Documentation

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

Reimplemented from ElectronDqmAnalyzerBase.

Definition at line 60 of file ElectronGeneralAnalyzer.cc.

References beamSpotTag_, electronCollection_, edm::EventID::event(), MonitorElement::Fill(), edm::Event::getByLabel(), gsfElectrons_cfi::gsfElectrons, gsftrackCollection_, h1_ele_triggers, h2_ele_beamSpotXvsY, i, edm::EventBase::id(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), matchingObjectCollection_, 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(), trackCollection_, testEve_cfg::tracks, patRefSel_triggerSelection_cff::triggerResults, triggerResults_, and vertexCollection_.

61  {
63  iEvent.getByLabel(electronCollection_,gsfElectrons) ;
65  iEvent.getByLabel(matchingObjectCollection_,recoClusters) ;
67  iEvent.getByLabel(trackCollection_,tracks);
69  iEvent.getByLabel(gsftrackCollection_,gsfTracks);
71  iEvent.getByLabel(vertexCollection_,vertices);
72  edm::Handle<reco::BeamSpot> recoBeamSpotHandle ;
73  iEvent.getByLabel(beamSpotTag_,recoBeamSpotHandle) ;
74  const BeamSpot bs = *recoBeamSpotHandle ;
75 
76  int ievt = iEvent.id().event();
77  int irun = iEvent.id().run();
78  int ils = iEvent.luminosityBlock();
79 
80  edm::LogInfo("ElectronGeneralAnalyzer::analyze")
81  <<"Treating "<<gsfElectrons.product()->size()<<" electrons"
82  <<" from event "<<ievt<<" in run "<<irun<<" and lumiblock "<<ils ;
83 
84  h2_ele_beamSpotXvsY->Fill(bs.position().x(),bs.position().y());
85  py_ele_nElectronsVsLs->Fill(float(ils),(*gsfElectrons).size());
86  py_ele_nClustersVsLs->Fill(float(ils),(*recoClusters).size());
87  py_ele_nGsfTracksVsLs->Fill(float(ils),(*gsfTracks).size());
88  py_ele_nTracksVsLs->Fill(float(ils),(*tracks).size());
89  py_ele_nVerticesVsLs->Fill(float(ils),(*vertices).size());
90 
91  // trigger
93  iEvent.getByLabel(triggerResults_,triggerResults) ;
94  if (triggerResults.isValid())
95  {
96  unsigned int i, n = triggerResults->size() ;
97  for ( i=0 ; i!=n ; ++i )
98  {
99  if (triggerResults->accept(i))
100  { h1_ele_triggers->Fill(float(i)) ; }
101  }
102  }
103  }
MonitorElement * py_ele_nGsfTracksVsLs
int i
Definition: DBlmapReader.cc:9
MonitorElement * h2_ele_beamSpotXvsY
MonitorElement * py_ele_nVerticesVsLs
MonitorElement * py_ele_nElectronsVsLs
MonitorElement * py_ele_nClustersVsLs
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:243
bool isValid() const
Definition: HandleBase.h:76
tuple tracks
Definition: testEve_cfg.py:39
T const * product() const
Definition: Handle.h:74
const Point & position() const
position
Definition: BeamSpot.h:63
void ElectronGeneralAnalyzer::book ( )
virtual

Reimplemented from ElectronDqmAnalyzerBase.

Definition at line 49 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.

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

edm::InputTag ElectronGeneralAnalyzer::beamSpotTag_
private

Definition at line 41 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

edm::InputTag ElectronGeneralAnalyzer::electronCollection_
private

Definition at line 36 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

edm::InputTag ElectronGeneralAnalyzer::gsftrackCollection_
private

Definition at line 38 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

MonitorElement* ElectronGeneralAnalyzer::h1_ele_triggers
private

Definition at line 64 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and book().

MonitorElement* ElectronGeneralAnalyzer::h2_ele_beamSpotXvsY
private

Definition at line 58 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and book().

edm::InputTag ElectronGeneralAnalyzer::matchingObjectCollection_
private

Definition at line 37 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nClustersVsLs
private

Definition at line 60 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and book().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nElectronsVsLs
private

Definition at line 59 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and book().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nGsfTracksVsLs
private

Definition at line 61 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and book().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nTracksVsLs
private

Definition at line 62 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and book().

MonitorElement* ElectronGeneralAnalyzer::py_ele_nVerticesVsLs
private

Definition at line 63 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and book().

edm::InputTag ElectronGeneralAnalyzer::trackCollection_
private

Definition at line 39 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

edm::InputTag ElectronGeneralAnalyzer::triggerResults_
private

Definition at line 44 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().

edm::InputTag ElectronGeneralAnalyzer::vertexCollection_
private

Definition at line 40 of file ElectronGeneralAnalyzer.h.

Referenced by analyze(), and ElectronGeneralAnalyzer().