Skip to content

Commit

Permalink
Merge CMSSW_7_4_X into CMSSW_7_5_X.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Feb 25, 2015
2 parents 5af7927 + 251bf11 commit bbe8694
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion FastSimulation/PileUpProducer/plugins/PileUpProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
PileUpProducer::PileUpProducer(edm::ParameterSet const & p) : hprob(0), currentValuesWereSet(false)
{

// This producer produces an object PileupMixingContent, needed by PileupSummaryInfo
// This producer produces an object PileupMixingContent and PileupVertexContent, needed by PileupSummaryInfo
produces<PileupMixingContent>();
produces<PileupVertexContent>();
// This producer produces a HepMCProduct, with all pileup vertices/particles
produces<edm::HepMCProduct>("PileUpEvents");

Expand Down Expand Up @@ -257,6 +258,7 @@ void PileUpProducer::produce(edm::Event & iEvent, const edm::EventSetup & es)
// Save this information in the PileupMixingContent object
// IMPORTANT: the bunch crossing number is always 0 because FastSim has no out-of-time PU
std::auto_ptr< PileupMixingContent > PileupMixing_;
std::auto_ptr< PileupVertexContent > PileupVertexing_;

std::vector<int> bunchCrossingList;
bunchCrossingList.push_back(0);
Expand All @@ -268,10 +270,26 @@ void PileUpProducer::produce(edm::Event & iEvent, const edm::EventSetup & es)
trueInteractionList.push_back(truePUevts);

std::vector<edm::EventID> eventInfoList;

std::vector<float> pThatList;
std::vector<float> zposList;

// generate fake EventID list to prevent crash in PileupInfo

for(uint32_t index=0; index!=uint(PUevts); ++index) {
edm::EventID Fake(index,index,index);
eventInfoList.push_back(Fake);
pThatList.push_back(0.);
zposList.push_back(0.);
}

PileupMixing_ = std::auto_ptr< PileupMixingContent >(new PileupMixingContent(bunchCrossingList,numInteractionList,trueInteractionList,eventInfoList,450)); // it shouldn't matter what the assumed bunchspacing is if there is no OOT PU. Add argument for compatibility.
iEvent.put(PileupMixing_);

PileupVertexing_ = std::auto_ptr< PileupVertexContent >(new PileupVertexContent(pThatList, zposList));

iEvent.put(PileupVertexing_);

// Get N events from random files
for ( int ievt=0; ievt<PUevts; ++ievt ) {

Expand Down
1 change: 1 addition & 0 deletions FastSimulation/PileUpProducer/plugins/PileUpProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "SimDataFormats/PileupSummaryInfo/interface/PileupMixingContent.h"
#include "SimDataFormats/PileupSummaryInfo/interface/PileupVertexContent.h"

#include <vector>
#include <string>
Expand Down

0 comments on commit bbe8694

Please sign in to comment.