1 #ifndef Mixing_Base_PileUp_h 2 #define Mixing_Base_PileUp_h 22 class HepRandomEngine;
30 class SecondaryEventProvider;
46 const std::shared_ptr<PileUpConfig>&
config,
48 const bool mixingConfigFromDB);
53 std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
59 void playPileUp(std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator begin,
60 std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator end,
61 std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
66 std::vector<edm::EventID>::const_iterator end,
67 std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
80 input_->dropUnwantedBranches(wantedBranches);
98 std::vector<int>& PileupSelection,
99 std::vector<float>& TrueNumInteractions,
143 std::unique_ptr<VectorInputSource>
const input_;
168 template <
typename T>
171 std::vector<edm::SecondaryEventIDAndFileInfo>&
ids_;
176 RecordEventID(std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
T& eventOperator)
182 ids_.emplace_back(eventPrincipal.
id(), fileNameHash);
198 template <
typename T>
200 std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
202 int const pileEventCnt,
206 ids.reserve(pileEventCnt);
211 if (
read != pileEventCnt)
212 edm::LogWarning(
"PileUp") <<
"Could not read enough pileup events: only " <<
read <<
" out of " << pileEventCnt
216 template <
typename T>
218 std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator end,
219 std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
226 template <
typename T>
228 std::vector<edm::EventID>::const_iterator end,
229 std::vector<edm::SecondaryEventIDAndFileInfo>& ids,
std::unique_ptr< SecondaryEventProvider > provider_
std::shared_ptr< ProcessConfiguration > processConfiguration_
double averageNumber() const
bool operator()(EventPrincipal const &eventPrincipal, size_t fileNameHash)
std::shared_ptr< TH1F > histo_
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)
void beginStream(edm::StreamID)
std::optional< ServiceToken > serviceToken_
PileUp(ParameterSet const &pset, const std::shared_ptr< PileUpConfig > &config, edm::ConsumesCollector iC, const bool mixingConfigFromDB)
std::unique_ptr< CLHEP::RandPoissonQ > const & poissonDistribution(StreamID const &streamID)
std::shared_ptr< TH1F > histo_
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)
PileupRandomNumberGenerator * randomGenerator_
std::unique_ptr< VectorInputSource > const input_
void input(unsigned int s)
void beginJob(eventsetup::ESRecordsToProxyIndices const &)
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
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)
std::unique_ptr< CLHEP::RandPoisson > const & poissonDistr_OOT(StreamID const &streamID)
std::unique_ptr< CLHEP::RandPoisson > PoissonDistr_OOT_
CLHEP::HepRandomEngine * randomEngine_
void setupPileUpEvent(const edm::EventSetup &setup)
const unsigned int & input() const
std::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal_
void endRun(const edm::Run &run, const edm::EventSetup &setup)
std::vector< edm::SecondaryEventIDAndFileInfo > & ids_
void setRandomEngine(StreamID)
std::shared_ptr< ProductRegistry > productRegistry_
void reload(const edm::EventSetup &setup)
CLHEP::HepRandomEngine * randomEngine(StreamID const &streamID)
std::unique_ptr< CLHEP::RandPoissonQ > PoissonDistribution_
std::shared_ptr< ProcessContext > processContext_
Log< level::Warning, false > LogWarning
std::unique_ptr< EventPrincipal > eventPrincipal_
EventID const & id() const
std::shared_ptr< RunPrincipal > runPrincipal_
std::shared_ptr< StreamContext > streamContext_
void readPileUp(edm::EventID const &signal, std::vector< edm::SecondaryEventIDAndFileInfo > &ids, T eventOperator, int const NumPU, StreamID const &)
edm::ESGetToken< MixingModuleConfig, MixingRcd > configToken_
PileUpConfig(std::string sourcename, double averageNumber, std::unique_ptr< TH1F > &histo, const bool playback)