101 usesResource(
"TFileService");
104 m_hnvtx = tfserv->
make<TH1F>(
"nvtx",
"Number of pileup vertices", 400, -0.5, 399.5);
105 m_hnvtx->GetXaxis()->SetTitle(
"Number of Interactions");
107 m_hnvtxvsbx = tfserv->
make<TH2F>(
"nvtxvsbx",
"Number of pileup vertices vs BX", 9, -4.5, 4.5, 400, -0.5, 399.5);
109 m_hnvtxvsbx->GetYaxis()->SetTitle(
"Number of Interactions");
111 m_hlumi = tfserv->
make<TH1F>(
"lumi",
"BX luminosity*xsect", 200, 0., 50.);
112 m_hlumi->GetXaxis()->SetTitle(
"Average Number of Interactions");
114 m_hnvtxvslumi = tfserv->
make<TH2F>(
"nvtxvslumi",
"Npileup vs BX luminosity*xsect", 200, 0., 50., 400, -0.5, 399.5);
115 m_hnvtxvslumi->GetXaxis()->SetTitle(
"Average Number of Interactions");
116 m_hnvtxvslumi->GetYaxis()->SetTitle(
"Number of Interactions");
119 m_hnvtxweight = tfserv->
make<TH1F>(
"nvtxweight",
"Number of pileup vertices (1-w)", 400, -0.5, 399.5);
120 m_hnvtxweight->GetXaxis()->SetTitle(
"Number of Interactions");
122 tfserv->
make<TProfile>(
"nvtxweightprof",
"Mean (1-w) vs Number of pileup interactions", 400, -0.5, 399.5);
126 m_hmainvtxx = tfserv->
make<TH1F>(
"mainvtxx",
"Main vertex x position", 200, -.5, .5);
128 m_hmainvtxy = tfserv->
make<TH1F>(
"mainvtxy",
"Main vertex y position", 200, -.5, .5);
130 m_hmainvtxz = tfserv->
make<TH1F>(
"mainvtxz",
"Main vertex z position", 600, -30., 30.);
132 m_hpileupvtxz = tfserv->
make<TH1F>(
"pileupvtxz",
"PileUp vertices z position", 600, -30., 30.);
153 weight = *weightprod;
164 std::vector<PileupSummaryInfo>::const_iterator pileupinfo;
166 for (pileupinfo = pileupinfos->begin(); pileupinfo != pileupinfos->end(); ++pileupinfo) {
167 m_hnvtxvsbx->Fill(pileupinfo->getBunchCrossing(), pileupinfo->getPU_NumInteractions(),
weight);
170 for (pileupinfo = pileupinfos->begin(); pileupinfo != pileupinfos->end(); ++pileupinfo) {
171 if (pileupinfo->getBunchCrossing() == 0)
177 if (pileupinfo->getBunchCrossing() != 0) {
178 edm::LogError(
"NoInTimePileUpInfo") <<
"Cannot find the in-time pileup info " << pileupinfo->getBunchCrossing();
182 m_hnvtxvslumi->Fill(pileupinfo->getTrueNumInteractions(), pileupinfo->getPU_NumInteractions(),
weight);
189 const std::vector<float>& zpositions = pileupinfo->getPU_zpositions();
191 for (std::vector<float>::const_iterator zpos = zpositions.begin(); zpos != zpositions.end(); ++zpos) {
206 if (Evt->vertices_begin() != Evt->vertices_end()) {
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TProfile * m_hnvtxweightprof
T * make(const Args &...args) const
make new ROOT object
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< double > m_doubleToken
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > m_vecPileupSummaryInfoToken
edm::EDGetTokenT< edm::HepMCProduct > m_hepMCProductToken
~MCVerticesAnalyzer() override
MCVerticesAnalyzer(const edm::ParameterSet &)
const HepMC::GenEvent * GetEvent() const
void analyze(const edm::Event &, const edm::EventSetup &) override