CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PileUp.h
Go to the documentation of this file.
1 #ifndef Base_PileUp_h
2 #define Base_PileUp_h
3 
4 #include <string>
5 #include <vector>
9 
10 
11 class TFile;
12 class TH1F;
13 
14 namespace CLHEP {
15  class RandPoissonQ;
16  class RandPoisson;
17 }
18 
19 
20 
21 namespace edm {
22  class PileUp {
23  public:
25  explicit PileUp(ParameterSet const& pset, int const minb, int const maxb, double averageNumber, TH1F* const histo, const bool playback);
26  ~PileUp();
27 
28  void readPileUp(std::vector<EventPrincipalVector> & result,std::vector<std::vector<edm::EventID> > &ids);
29 
30  double averageNumber() const {return averageNumber_;}
31  bool poisson() const {return poisson_;}
32  bool doPileup() {return none_ ? false : averageNumber_>0.;}
33  void dropUnwantedBranches(std::vector<std::string> const& wantedBranches) {
34  input_->dropUnwantedBranches(wantedBranches);
35  }
36  void endJob () {
37  input_->doEndJob();
38  }
39 
40  private:
41  std::string const type_;
42  int const minBunch_;
43  int const maxBunch_;
44  double const averageNumber_;
45  int const intAverage_;
46  TH1F* const histo_;
47  bool const histoDistribution_;
49  bool const poisson_;
50  bool const fixed_;
51  bool const none_;
54  bool fixed_OOT_;
56 
58  CLHEP::RandPoissonQ *poissonDistribution_;
59  CLHEP::RandPoisson *poissonDistr_OOT_;
60 
61 
62  TH1F *h1f;
64  TFile *probFileHisto;
65 
66  //playback info
67  bool playback_;
68 
69  // sequential reading
71 
72  // read the seed for the histo and probability function cases
73  int seed_;
74  };
75 }
76 
77 #endif
bool manage_OOT_
Definition: PileUp.h:52
int const maxBunch_
Definition: PileUp.h:43
bool const histoDistribution_
Definition: PileUp.h:47
bool poisson() const
Definition: PileUp.h:31
TH1F * h1f
Definition: PileUp.h:62
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
void dropUnwantedBranches(std::vector< std::string > const &wantedBranches)
Definition: PileUp.h:33
void endJob()
Definition: PileUp.h:36
bool const none_
Definition: PileUp.h:51
tuple histo
Definition: trackerHits.py:12
VectorInputSource *const input_
Definition: PileUp.h:57
bool const probFunctionDistribution_
Definition: PileUp.h:48
bool doPileup()
Definition: PileUp.h:32
int const intAverage_
Definition: PileUp.h:45
double averageNumber() const
Definition: PileUp.h:30
bool playback_
Definition: PileUp.h:67
bool poisson_OOT_
Definition: PileUp.h:53
VectorInputSource::EventPrincipalVector EventPrincipalVector
Definition: PileUp.h:24
tuple result
Definition: query.py:137
std::vector< EventPrincipalVectorElement > EventPrincipalVector
bool const poisson_
Definition: PileUp.h:49
tuple pset
Definition: CrabTask.py:85
bool fixed_OOT_
Definition: PileUp.h:54
CLHEP::RandPoisson * poissonDistr_OOT_
Definition: PileUp.h:59
void doEndJob()
Called by framework at end of job.
Definition: InputSource.cc:237
bool const fixed_
Definition: PileUp.h:50
void readPileUp(std::vector< EventPrincipalVector > &result, std::vector< std::vector< edm::EventID > > &ids)
Definition: PileUp.cc:103
double const averageNumber_
Definition: PileUp.h:44
TFile * probFileHisto
Definition: PileUp.h:64
TH1F *const histo_
Definition: PileUp.h:46
bool sequential_
Definition: PileUp.h:70
PileUp(ParameterSet const &pset, int const minb, int const maxb, double averageNumber, TH1F *const histo, const bool playback)
Definition: PileUp.cc:22
std::string const type_
Definition: PileUp.h:41
int seed_
Definition: PileUp.h:73
TH1F * hprobFunction
Definition: PileUp.h:63
tuple playback
Definition: Playback_cff.py:20
int intFixed_OOT_
Definition: PileUp.h:55
CLHEP::RandPoissonQ * poissonDistribution_
Definition: PileUp.h:58
int const minBunch_
Definition: PileUp.h:42