103 : m_useweight( iConfig.getParameter< bool >(
"useWeight" ) )
104 , m_doubleToken( consumes< double >( iConfig.getParameter< edm::InputTag >(
"weightProduct" ) ) )
105 , m_vecPileupSummaryInfoToken( consumes< std::vector<
PileupSummaryInfo> >( iConfig.getParameter< edm::InputTag >(
"pileupSummaryCollection" ) ) )
106 , m_hepMCProductToken( consumes< edm::
HepMCProduct >( iConfig.getParameter< edm::InputTag >(
"mcTruthCollection" ) ) )
114 m_hnvtx = tfserv->
make<TH1F>(
"nvtx",
"Number of pileup vertices",60,-0.5,59.5);
115 m_hnvtx->GetXaxis()->SetTitle(
"Number of Interactions");
117 m_hlumi = tfserv->
make<TH1F>(
"lumi",
"BX luminosity*xsect",200,0.,50.);
118 m_hlumi->GetXaxis()->SetTitle(
"Average Number of Interactions");
120 m_hnvtxvslumi = tfserv->
make<TH2F>(
"nvtxvslumi",
"Npileup vs BX luminosity*xsect",200,0.,50.,60,-0.5,59.5);
121 m_hnvtxvslumi->GetXaxis()->SetTitle(
"Average Number of Interactions");
m_hnvtxvslumi->GetYaxis()->SetTitle(
"Number of Interactions");
124 m_hnvtxweight = tfserv->
make<TH1F>(
"nvtxweight",
"Number of pileup vertices (1-w)",60,-0.5,59.5);
125 m_hnvtxweight->GetXaxis()->SetTitle(
"Number of Interactions");
126 m_hnvtxweightprof = tfserv->
make<TProfile>(
"nvtxweightprof",
"Mean (1-w) vs Number of pileup interactions",60,-0.5,59.5);
130 m_hmainvtxx = tfserv->
make<TH1F>(
"mainvtxx",
"Main vertex x position",200,-.5,.5);
132 m_hmainvtxy = tfserv->
make<TH1F>(
"mainvtxy",
"Main vertex y position",200,-.5,.5);
134 m_hmainvtxz = tfserv->
make<TH1F>(
"mainvtxz",
"Main vertex z position",600,-30.,30.);
136 m_hpileupvtxz = tfserv->
make<TH1F>(
"pileupvtxz",
"PileUp vertices z position",600,-30.,30.);
166 weight = *weightprod;
180 std::vector<PileupSummaryInfo>::const_iterator pileupinfo;
181 for(pileupinfo = pileupinfos->begin(); pileupinfo != pileupinfos->end() ; ++pileupinfo) {
182 if(pileupinfo->getBunchCrossing()==0)
break;
187 if(pileupinfo->getBunchCrossing()!=0) {
188 edm::LogError(
"NoInTimePileUpInfo") <<
"Cannot find the in-time pileup info " << pileupinfo->getBunchCrossing();
194 m_hnvtxvslumi->Fill(pileupinfo->getTrueNumInteractions(),pileupinfo->getPU_NumInteractions(),
weight);
201 const std::vector<float>& zpositions = pileupinfo->getPU_zpositions();
203 for(std::vector<float>::const_iterator zpos = zpositions.begin() ; zpos != zpositions.end() ; ++zpos) {
217 const HepMC::GenEvent* Evt = EvtHandle->GetEvent();
221 if(Evt->vertices_begin() != Evt->vertices_end()) {
edm::EDGetTokenT< double > m_doubleToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
TProfile * m_hnvtxweightprof
T * make(const Args &...args) const
make new ROOT object
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > m_vecPileupSummaryInfoToken
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
MCVerticesAnalyzer(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< edm::HepMCProduct > m_hepMCProductToken
virtual void endRun(const edm::Run &, const edm::EventSetup &)