CMS 3D CMS Logo

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 // system include files
21 #include <memory>
22 
23 // user include files
24 
25 #include <vector>
26 #include <map>
27 #include <limits>
28 
37 
40 
46 
47 //
48 // class decleration
49 //
50 
52 public:
54  ~MultiplicityInvestigator() override;
55 
56 private:
57  void beginJob() override;
58  void analyze(const edm::Event&, const edm::EventSetup&) override;
59  void beginRun(const edm::Run&, const edm::EventSetup&) override;
60  void endJob() override;
61 
62  // ----------member data ---------------------------
63 
64  const bool m_wantInvestHist;
65  const bool m_wantVtxCorrHist;
66  const bool m_wantLumiCorrHist;
74 
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_wantVtxPosCorrHist(iConfig.getParameter<bool>("wantVtxPosCorrHist")),
97  m_digiinvesthmevent(m_wantInvestHist ? DigiInvestigatorHistogramMaker(iConfig, consumesCollector())
98  : DigiInvestigatorHistogramMaker(consumesCollector())),
99  m_digivtxcorrhmevent(m_wantVtxCorrHist ? iConfig.getParameter<edm::ParameterSet>("digiVtxCorrConfig")
101  m_digilumicorrhmevent(
102  m_wantLumiCorrHist ? DigiLumiCorrHistogramMaker(iConfig.getParameter<edm::ParameterSet>("digiLumiCorrConfig"),
103  consumesCollector())
104  : DigiLumiCorrHistogramMaker(consumesCollector())),
105  m_digipileupcorrhmevent(
106  m_wantPileupCorrHist
107  ? DigiPileupCorrHistogramMaker(iConfig.getParameter<edm::ParameterSet>("digiPileupCorrConfig"),
108  consumesCollector())
109  : DigiPileupCorrHistogramMaker(consumesCollector())),
110  m_digivtxposcorrhmevent(
111  m_wantVtxPosCorrHist
112  ? DigiVtxPosCorrHistogramMaker(iConfig.getParameter<edm::ParameterSet>("digiVtxPosCorrConfig"),
113  consumesCollector())
114  : DigiVtxPosCorrHistogramMaker(consumesCollector())),
115  m_multiplicityMapToken(
116  consumes<std::map<unsigned int, int> >(iConfig.getParameter<edm::InputTag>("multiplicityMap"))),
117  m_vertexCollectionToken(
118  mayConsume<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection"))) {
119  //now do what ever initialization is needed
120 
121  if (m_wantInvestHist) {
122  m_digiinvesthmevent.book("EventProcs");
123  }
124  if (m_wantVtxCorrHist) {
126  }
127  if (m_wantLumiCorrHist) {
129  }
130  if (m_wantPileupCorrHist) {
131  m_digipileupcorrhmevent.book("PileupCorr");
132  }
133  if (m_wantVtxPosCorrHist) {
134  m_digivtxposcorrhmevent.book("VtxPosCorr");
135  }
136 }
137 
139  // do anything here that needs to be done at desctruction time
140  // (e.g. close files, deallocate resources etc.)
141 }
142 
143 //
144 // member functions
145 //
146 
147 // ------------ method called to for each event ------------
149  using namespace edm;
150 
152  iEvent.getByToken(m_multiplicityMapToken, mults);
153 
154  if (m_wantInvestHist)
156  if (m_wantVtxCorrHist) {
159 
160  m_digivtxcorrhmevent.fill(iEvent, vertices->size(), *mults);
161  }
162 
163  if (m_wantLumiCorrHist)
169 }
170 
171 // ------------ method called once each job just before starting event loop ------------
173 
178 }
179 // ------------ method called once each job just after ending the event loop ------------
181 //define this as a plug-in
MultiplicityInvestigator::m_digiinvesthmevent
DigiInvestigatorHistogramMaker m_digiinvesthmevent
Definition: MultiplicityInvestigator.cc:69
DigiVertexCorrHistogramMaker::book
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels, edm::ConsumesCollector &&iC)
Definition: DigiVertexCorrHistogramMaker.cc:57
electrons_cff.bool
bool
Definition: electrons_cff.py:372
DigiVtxPosCorrHistogramMaker
Definition: DigiVtxPosCorrHistogramMaker.h:18
MessageLogger.h
DigiLumiCorrHistogramMaker
Definition: DigiLumiCorrHistogramMaker.h:21
MultiplicityInvestigator::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: MultiplicityInvestigator.cc:174
MultiplicityInvestigator::m_digipileupcorrhmevent
DigiPileupCorrHistogramMaker m_digipileupcorrhmevent
Definition: MultiplicityInvestigator.cc:72
MultiplicityInvestigator::m_digilumicorrhmevent
DigiLumiCorrHistogramMaker m_digilumicorrhmevent
Definition: MultiplicityInvestigator.cc:71
MultiplicityInvestigator::m_digivtxcorrhmevent
DigiVertexCorrHistogramMaker m_digivtxcorrhmevent
Definition: MultiplicityInvestigator.cc:70
edm::Run
Definition: Run.h:45
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
DigiLumiCorrHistogramMaker.h
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
DigiInvestigatorHistogramMaker::beginRun
void beginRun(const edm::Run &iRun)
Definition: DigiInvestigatorHistogramMaker.cc:128
MultiplicityInvestigator::~MultiplicityInvestigator
~MultiplicityInvestigator() override
Definition: MultiplicityInvestigator.cc:138
DigiVtxPosCorrHistogramMaker.h
MultiplicityInvestigator::m_wantVtxCorrHist
const bool m_wantVtxCorrHist
Definition: MultiplicityInvestigator.cc:65
MultiplicityInvestigator::m_wantLumiCorrHist
const bool m_wantLumiCorrHist
Definition: MultiplicityInvestigator.cc:66
MultiplicityInvestigator::m_wantPileupCorrHist
const bool m_wantPileupCorrHist
Definition: MultiplicityInvestigator.cc:67
DigiLumiCorrHistogramMaker::book
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels, edm::ConsumesCollector &&iC)
Definition: DigiLumiCorrHistogramMaker.cc:59
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
EDAnalyzer.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
MultiplicityInvestigator::m_wantInvestHist
const bool m_wantInvestHist
Definition: MultiplicityInvestigator.cc:64
edm::Handle
Definition: AssociativeIterator.h:50
MultiplicityInvestigator::MultiplicityInvestigator
MultiplicityInvestigator(const edm::ParameterSet &)
Definition: MultiplicityInvestigator.cc:90
edm::EDAnalyzer
Definition: EDAnalyzer.h:29
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
DigiVtxPosCorrHistogramMaker::book
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels)
Definition: DigiVtxPosCorrHistogramMaker.cc:54
DigiInvestigatorHistogramMaker
Definition: DigiInvestigatorHistogramMaker.h:18
DigiLumiCorrHistogramMaker::fill
void fill(const edm::Event &iEvent, const std::map< unsigned int, int > &ndigi)
Definition: DigiLumiCorrHistogramMaker.cc:136
Run.h
DigiInvestigatorHistogramMaker::fill
void fill(const edm::Event &iEvent, const std::map< unsigned int, int > &ndigi)
Definition: DigiInvestigatorHistogramMaker.cc:172
DigiVertexCorrHistogramMaker.h
MultiplicityInvestigator::beginJob
void beginJob() override
Definition: MultiplicityInvestigator.cc:172
DigiPileupCorrHistogramMaker::fill
void fill(const edm::Event &iEvent, const std::map< unsigned int, int > &ndigi)
Definition: DigiPileupCorrHistogramMaker.cc:139
Vertex.h
MultiplicityInvestigator::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: MultiplicityInvestigator.cc:148
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
DigiInvestigatorHistogramMaker.h
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
ParameterSet
Definition: Functions.h:16
MultiplicityInvestigator::m_digivtxposcorrhmevent
DigiVtxPosCorrHistogramMaker m_digivtxposcorrhmevent
Definition: MultiplicityInvestigator.cc:73
MultiplicityInvestigator::m_vertexCollectionToken
edm::EDGetTokenT< reco::VertexCollection > m_vertexCollectionToken
Definition: MultiplicityInvestigator.cc:76
MultiplicityInvestigator::m_wantVtxPosCorrHist
const bool m_wantVtxPosCorrHist
Definition: MultiplicityInvestigator.cc:68
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
DigiInvestigatorHistogramMaker::book
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels)
Definition: DigiInvestigatorHistogramMaker.cc:64
DigiVtxPosCorrHistogramMaker::fill
void fill(const edm::Event &iEvent, const std::map< unsigned int, int > &ndigi)
Definition: DigiVtxPosCorrHistogramMaker.cc:108
edm::EventSetup
Definition: EventSetup.h:57
MultiplicityInvestigator::endJob
void endJob() override
Definition: MultiplicityInvestigator.cc:180
DigiVertexCorrHistogramMaker
Definition: DigiVertexCorrHistogramMaker.h:19
DigiVertexCorrHistogramMaker::beginRun
void beginRun(const edm::Run &iRun)
Definition: DigiVertexCorrHistogramMaker.cc:127
InputTag.h
DigiPileupCorrHistogramMaker.h
VertexFwd.h
std
Definition: JetResolutionObject.h:76
DigiVertexCorrHistogramMaker::fill
void fill(const edm::Event &iEvent, const unsigned int nvtx, const std::map< unsigned int, int > &ndigi)
Definition: DigiVertexCorrHistogramMaker.cc:141
DigiPileupCorrHistogramMaker
Definition: DigiPileupCorrHistogramMaker.h:19
Frameworkfwd.h
DigiPileupCorrHistogramMaker::book
void book(const std::string dirname, const std::map< unsigned int, std::string > &labels)
Definition: DigiPileupCorrHistogramMaker.cc:67
MultiplicityInvestigator
Definition: MultiplicityInvestigator.cc:51
genParticles_cff.map
map
Definition: genParticles_cff.py:11
ParameterSet.h
edm::Event
Definition: Event.h:73
MultiplicityInvestigator::m_multiplicityMapToken
edm::EDGetTokenT< std::map< unsigned int, int > > m_multiplicityMapToken
Definition: MultiplicityInvestigator.cc:75
DigiLumiCorrHistogramMaker::beginRun
void beginRun(const edm::Run &iRun)
Definition: DigiLumiCorrHistogramMaker.cc:122
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7