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.6 2013/02/27 19:49:46 wmtan 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&) override;
60  virtual void beginRun(const edm::Run&, const edm::EventSetup&) override;
61  virtual void endJob() ;
62 
63  // ----------member data ---------------------------
64 
65  const bool m_wantInvestHist;
66  const bool m_wantVtxCorrHist;
67  const bool m_wantLumiCorrHist;
73 
76 
77 };
78 
79 //
80 // constants, enums and typedefs
81 //
82 
83 //
84 // static data member definitions
85 //
86 
87 //
88 // constructors and destructor
89 //
91  // m_digiinvesthmevent(iConfig.getParameter<edm::ParameterSet>("digiInvestConfig")),
92  m_wantInvestHist(iConfig.getParameter<bool>("wantInvestHist")),
93  m_wantVtxCorrHist(iConfig.getParameter<bool>("wantVtxCorrHist")),
94  m_wantLumiCorrHist(iConfig.getParameter<bool>("wantLumiCorrHist")),
95  m_wantPileupCorrHist(iConfig.getParameter<bool>("wantPileupCorrHist")),
96  m_digiinvesthmevent(iConfig),
97  m_digivtxcorrhmevent(iConfig.getParameter<edm::ParameterSet>("digiVtxCorrConfig")),
98  m_digilumicorrhmevent(iConfig.getParameter<edm::ParameterSet>("digiLumiCorrConfig")),
99  m_digipileupcorrhmevent(iConfig.getParameter<edm::ParameterSet>("digiPileupCorrConfig")),
100  m_multiplicityMap(iConfig.getParameter<edm::InputTag>("multiplicityMap")),
101  m_vertexCollection(iConfig.getParameter<edm::InputTag>("vertexCollection"))
102 {
103  //now do what ever initialization is needed
104 
105 
106  if(m_wantInvestHist) m_digiinvesthmevent.book("EventProcs");
110 
111 }
112 
113 
115 {
116 
117  // do anything here that needs to be done at desctruction time
118  // (e.g. close files, deallocate resources etc.)
119 
120 }
121 
122 
123 //
124 // member functions
125 //
126 
127 // ------------ method called to for each event ------------
128 void
130 {
131  using namespace edm;
132 
134  iEvent.getByLabel(m_multiplicityMap,mults);
135 
137 
138  if(m_wantVtxCorrHist) {
140  iEvent.getByLabel(m_vertexCollection,vertices);
141 
142  m_digivtxcorrhmevent.fill(iEvent,vertices->size(),*mults);
143  }
144 
145  if(m_wantLumiCorrHist) m_digilumicorrhmevent.fill(iEvent,*mults);
147 
148 }
149 
150 
151 // ------------ method called once each job just before starting event loop ------------
152 void
154 {
155 
156 }
157 
158 void
160 
164 
165 }
166 // ------------ method called once each job just after ending the event loop ------------
167 void
169 }
170 //define this as a plug-in
DigiPileupCorrHistogramMaker m_digipileupcorrhmevent
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)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
int orbitNumber() const
Definition: EventBase.h:63
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
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)
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
void fill(const edm::Event &iEvent, const unsigned int nvtx, const std::map< unsigned int, int > &ndigi)
DigiLumiCorrHistogramMaker m_digilumicorrhmevent
MultiplicityInvestigator(const edm::ParameterSet &)
DigiVertexCorrHistogramMaker m_digivtxcorrhmevent
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels)
DigiInvestigatorHistogramMaker m_digiinvesthmevent
Definition: Run.h:36
void beginRun(const edm::Run &iRun)