11
11
#include " FWCore/Framework/interface/EventPrincipal.h"
12
12
#include " FWCore/MessageLogger/interface/MessageLogger.h"
13
13
14
- #include " CLHEP/Random/RandPoissonQ.h"
15
- #include " CLHEP/Random/RandFlat.h"
16
-
17
14
#include " boost/shared_ptr.hpp"
18
15
19
16
#include " TRandom.h"
@@ -26,20 +23,20 @@ class TH1F;
26
23
namespace CLHEP {
27
24
class RandPoissonQ ;
28
25
class RandPoisson ;
26
+ class HepRandomEngine ;
29
27
}
30
28
31
-
32
-
33
29
namespace edm {
34
30
class SecondaryEventProvider ;
31
+ class StreamID ;
35
32
36
33
class PileUp {
37
34
public:
38
35
explicit PileUp (ParameterSet const & pset, double averageNumber, TH1F* const histo, const bool playback);
39
36
~PileUp ();
40
37
41
38
template <typename T>
42
- void readPileUp (edm::EventID const & signal, std::vector<edm::EventID> &ids, T eventOperator, const int NumPU );
39
+ void readPileUp (edm::EventID const & signal, std::vector<edm::EventID> &ids, T eventOperator, const int NumPU, StreamID const & );
43
40
44
41
template <typename T>
45
42
void playPileUp (const std::vector<edm::EventID> &ids, T eventOperator);
@@ -63,7 +60,7 @@ namespace edm {
63
60
64
61
void reload (const edm::EventSetup & setup);
65
62
66
- void CalculatePileup (int MinBunch, int MaxBunch, std::vector<int >& PileupSelection, std::vector<float >& TrueNumInteractions);
63
+ void CalculatePileup (int MinBunch, int MaxBunch, std::vector<int >& PileupSelection, std::vector<float >& TrueNumInteractions, StreamID const & );
67
64
68
65
// template<typename T>
69
66
// void recordEventForPlayback(EventPrincipal const& eventPrincipal,
@@ -73,6 +70,11 @@ namespace edm {
73
70
void input (unsigned int s){inputType_=s;}
74
71
75
72
private:
73
+
74
+ std::unique_ptr<CLHEP::RandPoissonQ> const & poissonDistribution (StreamID const & streamID);
75
+ std::unique_ptr<CLHEP::RandPoisson> const & poissonDistr_OOT (StreamID const & streamID);
76
+ CLHEP::HepRandomEngine* randomEngine (StreamID const & streamID);
77
+
76
78
unsigned int inputType_;
77
79
std::string type_;
78
80
double averageNumber_;
@@ -100,9 +102,9 @@ namespace edm {
100
102
boost::shared_ptr<LuminosityBlockPrincipal> lumiPrincipal_;
101
103
boost::shared_ptr<RunPrincipal> runPrincipal_;
102
104
std::unique_ptr<SecondaryEventProvider> provider_;
103
- std::unique_ptr<CLHEP::RandPoissonQ> poissonDistribution_ ;
104
- std::unique_ptr<CLHEP::RandPoisson> poissonDistr_OOT_ ;
105
-
105
+ std::vector<std:: unique_ptr<CLHEP::RandPoissonQ> > vPoissonDistribution_ ;
106
+ std::vector<std:: unique_ptr<CLHEP::RandPoisson> > vPoissonDistr_OOT_ ;
107
+ std::vector<CLHEP::HepRandomEngine*> randomEngines_;
106
108
107
109
TH1F *h1f;
108
110
TH1F *hprobFunction;
@@ -152,7 +154,8 @@ namespace edm {
152
154
*/
153
155
template <typename T>
154
156
void
155
- PileUp::readPileUp (edm::EventID const & signal, std::vector<edm::EventID> &ids, T eventOperator, const int pileEventCnt) {
157
+ PileUp::readPileUp (edm::EventID const & signal, std::vector<edm::EventID> &ids, T eventOperator,
158
+ const int pileEventCnt, StreamID const & streamID) {
156
159
157
160
// One reason PileUp is responsible for recording event IDs is
158
161
// that it is the one that knows how many events will be read.
@@ -164,7 +167,7 @@ namespace edm {
164
167
if (sequential_)
165
168
read = input_->loopSequentialWithID (*eventPrincipal_, lumi, pileEventCnt, recorder);
166
169
else
167
- read = input_->loopRandomWithID (*eventPrincipal_, lumi, pileEventCnt, recorder);
170
+ read = input_->loopRandomWithID (*eventPrincipal_, lumi, pileEventCnt, recorder, randomEngine (streamID) );
168
171
} else {
169
172
if (sequential_) {
170
173
// boost::bind creates a functor from recordEventForPlayback
@@ -178,7 +181,7 @@ namespace edm {
178
181
// );
179
182
180
183
} else {
181
- read = input_->loopRandom (*eventPrincipal_, pileEventCnt, recorder);
184
+ read = input_->loopRandom (*eventPrincipal_, pileEventCnt, recorder, randomEngine (streamID) );
182
185
// boost::bind(&PileUp::recordEventForPlayback<T>,
183
186
// boost::ref(*this), _1, boost::ref(ids),
184
187
// boost::ref(eventOperator))
0 commit comments