CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultiplicityInvestigator.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: MultiplicityInvestigator
4 // Class: MultiplicityInvestigator
5 //
13 //
14 // Original Author: Andrea Venturi
15 // Created: Mon Oct 27 17:37:53 CET 2008
16 // $Id: MultiplicityInvestigator.cc,v 1.5 2012/02/15 11:13:25 venturia Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
25 
26 #include <vector>
27 #include <map>
28 #include <limits>
29 
38 
41 
46 
47 //
48 // class decleration
49 //
50 
52  public:
55 
56 
57 private:
58  virtual void beginJob() ;
59  virtual void analyze(const edm::Event&, const edm::EventSetup&);
60  virtual void beginRun(const edm::Run&, const edm::EventSetup&);
61  virtual void endRun(const edm::Run&, const edm::EventSetup&);
62  virtual void endJob() ;
63 
64  // ----------member data ---------------------------
65 
66  const bool m_wantInvestHist;
67  const bool m_wantVtxCorrHist;
68  const bool m_wantLumiCorrHist;
74 
77 
78 };
79 
80 //
81 // constants, enums and typedefs
82 //
83 
84 //
85 // static data member definitions
86 //
87 
88 //
89 // constructors and destructor
90 //
92  // m_digiinvesthmevent(iConfig.getParameter<edm::ParameterSet>("digiInvestConfig")),
93  m_wantInvestHist(iConfig.getParameter<bool>("wantInvestHist")),
94  m_wantVtxCorrHist(iConfig.getParameter<bool>("wantVtxCorrHist")),
95  m_wantLumiCorrHist(iConfig.getParameter<bool>("wantLumiCorrHist")),
96  m_wantPileupCorrHist(iConfig.getParameter<bool>("wantPileupCorrHist")),
97  m_digiinvesthmevent(iConfig),
98  m_digivtxcorrhmevent(iConfig.getParameter<edm::ParameterSet>("digiVtxCorrConfig")),
99  m_digilumicorrhmevent(iConfig.getParameter<edm::ParameterSet>("digiLumiCorrConfig")),
100  m_digipileupcorrhmevent(iConfig.getParameter<edm::ParameterSet>("digiPileupCorrConfig")),
101  m_multiplicityMap(iConfig.getParameter<edm::InputTag>("multiplicityMap")),
102  m_vertexCollection(iConfig.getParameter<edm::InputTag>("vertexCollection"))
103 {
104  //now do what ever initialization is needed
105 
106 
107  if(m_wantInvestHist) m_digiinvesthmevent.book("EventProcs");
111 
112 }
113 
114 
116 {
117 
118  // do anything here that needs to be done at desctruction time
119  // (e.g. close files, deallocate resources etc.)
120 
121 }
122 
123 
124 //
125 // member functions
126 //
127 
128 // ------------ method called to for each event ------------
129 void
131 {
132  using namespace edm;
133 
135  iEvent.getByLabel(m_multiplicityMap,mults);
136 
138 
139  if(m_wantVtxCorrHist) {
141  iEvent.getByLabel(m_vertexCollection,vertices);
142 
143  m_digivtxcorrhmevent.fill(iEvent,vertices->size(),*mults);
144  }
145 
146  if(m_wantLumiCorrHist) m_digilumicorrhmevent.fill(iEvent,*mults);
148 
149 }
150 
151 
152 // ------------ method called once each job just before starting event loop ------------
153 void
155 {
156 
157 }
158 
159 void
161 
165 
166 }
167 
168 void
170 }
171 // ------------ method called once each job just after ending the event loop ------------
172 void
174 }
175 //define this as a plug-in
DigiPileupCorrHistogramMaker m_digipileupcorrhmevent
virtual void endRun(const edm::Run &, const edm::EventSetup &)
RunNumber_t run() const
Definition: RunBase.h:42
void fill(const edm::Event &iEvent, const std::map< unsigned int, int > &ndigi)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels)
int iEvent
Definition: GenABIO.cc:243
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels)
void fill(const edm::Event &iEvent, const std::map< unsigned int, int > &ndigi)
int orbitNumber() const
Definition: EventBase.h:63
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void fill(const unsigned int orbit, const std::map< unsigned int, int > &ndigi)
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels)
void fill(const edm::Event &iEvent, const unsigned int nvtx, const std::map< unsigned int, int > &ndigi)
DigiLumiCorrHistogramMaker m_digilumicorrhmevent
MultiplicityInvestigator(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
DigiVertexCorrHistogramMaker m_digivtxcorrhmevent
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels)
DigiInvestigatorHistogramMaker m_digiinvesthmevent
Definition: Run.h:33
void beginRun(const edm::Run &iRun)