94 double computed_weight(1);
102 std::vector<PileupSummaryInfo>::const_iterator pileupinfo;
103 for(pileupinfo = pileupinfos->begin(); pileupinfo != pileupinfos->end() ; ++pileupinfo) {
104 if(pileupinfo->getBunchCrossing()==0)
break;
108 if(pileupinfo->getBunchCrossing()!=0) {
109 edm::LogError(
"NoInTimePileUpInfo") <<
"Cannot find the in-time pileup info " << pileupinfo->getBunchCrossing();
115 const std::vector<float>& zpositions = pileupinfo->getPU_zpositions();
126 const HepMC::GenEvent* Evt = EvtHandle->
GetEvent();
131 if(Evt->vertices_begin() != Evt->vertices_end()) {
132 zmain = (*Evt->vertices_begin())->point3d().z()/10.;
142 std::unique_ptr<double>
weight(
new double(computed_weight));
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
MCVerticesWeight(const edm::ParameterSet &)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual bool filter(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const HepMC::GenEvent * GetEvent() const
const VertexWeighter m_weighter
edm::EDGetTokenT< edm::HepMCProduct > m_hepMCProductToken
const double weight(const std::vector< float > &zpositions, const float &zmain) const
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > m_vecPileupSummaryInfoToken