1 #ifndef Mixing_Base_PileUp_h
2 #define Mixing_Base_PileUp_h
23 class HepRandomEngine;
27 class SecondaryEventProvider;
39 void playPileUp(std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator
begin, std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator
end, std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
T eventOperator);
42 void playOldFormatPileUp(std::vector<edm::EventID>::const_iterator begin, std::vector<edm::EventID>::const_iterator end, std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
T eventOperator);
55 input_->dropUnwantedBranches(wantedBranches);
70 void CalculatePileup(
int MinBunch,
int MaxBunch, std::vector<int>& PileupSelection, std::vector<float>& TrueNumInteractions,
StreamID const&);
112 std::unique_ptr<VectorInputSource>
const input_;
142 std::vector<edm::SecondaryEventIDAndFileInfo>&
ids_;
146 RecordEventID(std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
T& eventOperator)
150 ids_.emplace_back(eventPrincipal.
id(), fileNameHash);
168 int const pileEventCnt,
StreamID const& streamID) {
172 ids.reserve(pileEventCnt);
177 if (read != pileEventCnt)
178 edm::LogWarning(
"PileUp") <<
"Could not read enough pileup events: only " << read <<
" out of " << pileEventCnt <<
" requested.";
183 PileUp::playPileUp(std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator
begin, std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator
end, std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
T eventOperator) {
191 PileUp::playOldFormatPileUp(std::vector<edm::EventID>::const_iterator
begin, std::vector<edm::EventID>::const_iterator
end, std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
T eventOperator) {
const unsigned int & input() const
std::unique_ptr< SecondaryEventProvider > provider_
void operator()(EventPrincipal const &eventPrincipal, size_t fileNameHash)
std::shared_ptr< ProcessConfiguration > processConfiguration_
void playPileUp(std::vector< edm::SecondaryEventIDAndFileInfo >::const_iterator begin, std::vector< edm::SecondaryEventIDAndFileInfo >::const_iterator end, std::vector< edm::SecondaryEventIDAndFileInfo > &ids, T eventOperator)
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
EventID const & id() const
PileUp(ParameterSet const &pset, std::string sourcename, double averageNumber, TH1F *const histo, const bool playback)
std::vector< CLHEP::HepRandomEngine * > randomEngines_
bool probFunctionDistribution_
void playOldFormatPileUp(std::vector< edm::EventID >::const_iterator begin, std::vector< edm::EventID >::const_iterator end, std::vector< edm::SecondaryEventIDAndFileInfo > &ids, T eventOperator)
RecordEventID(std::vector< edm::SecondaryEventIDAndFileInfo > &ids, T &eventOperator)
void endLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
double averageNumber() const
std::vector< std::unique_ptr< CLHEP::RandPoissonQ > > vPoissonDistribution_
std::unique_ptr< VectorInputSource > const input_
void input(unsigned int s)
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
std::unique_ptr< CLHEP::RandPoissonQ > const & poissonDistribution(StreamID const &streamID)
void CalculatePileup(int MinBunch, int MaxBunch, std::vector< int > &PileupSelection, std::vector< float > &TrueNumInteractions, StreamID const &)
void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
void setupPileUpEvent(const edm::EventSetup &setup)
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
void endRun(const edm::Run &run, const edm::EventSetup &setup)
std::vector< edm::SecondaryEventIDAndFileInfo > & ids_
std::shared_ptr< ProductRegistry > productRegistry_
std::unique_ptr< CLHEP::RandPoisson > const & poissonDistr_OOT(StreamID const &streamID)
void reload(const edm::EventSetup &setup)
CLHEP::HepRandomEngine * randomEngine(StreamID const &streamID)
std::vector< std::unique_ptr< CLHEP::RandPoisson > > vPoissonDistr_OOT_
std::unique_ptr< EventPrincipal > eventPrincipal_
std::shared_ptr< RunPrincipal > runPrincipal_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void readPileUp(edm::EventID const &signal, std::vector< edm::SecondaryEventIDAndFileInfo > &ids, T eventOperator, int const NumPU, StreamID const &)