CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PileUpProducer.h
Go to the documentation of this file.
1 #ifndef FastSimulation_PileUpProducer_PileUpProducer_H
2 #define FastSimulation_PileUpProducer_PileUpProducer_H
3 
7 
8 #include <vector>
9 #include <string>
10 #include <fstream>
11 #include "TH1F.h"
12 
13 namespace edm {
14  class Event;
15  class EventSetup;
16  class LuminosityBlock;
17  class ParameterSet;
18  class Run;
19 }
20 
21 class TFile;
22 class TTree;
23 class TBranch;
24 class PUEvent;
25 
27 
29 {
30 
31  public:
32 
33  explicit PileUpProducer(edm::ParameterSet const & p);
34  virtual ~PileUpProducer();
35  virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
36  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
37  virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
38  virtual void produce(edm::Event & e, const edm::EventSetup & c) override;
39 
40  private:
41 
43  void save();
44 
47 
48  private:
49 
51 
53  std::vector<std::string> theFileNames;
55  unsigned theNumberOfFiles;
57 
58  std::vector<TFile*> theFiles;
59  std::vector<TTree*> theTrees;
60  std::vector<TBranch*> theBranches;
61  std::vector<PUEvent*> thePUEvents;
62  std::vector<unsigned> theCurrentEntry;
63  std::vector<unsigned> theCurrentMinBiasEvt;
64  std::vector<unsigned> theNumberOfEntries;
65  std::vector<unsigned> theNumberOfMinBiasEvts;
66 
67  std::ofstream myOutputFile;
68  unsigned myOutputBuffer;
69 
70  TH1F * hprob;
71  std::vector<int> dataProbFunctionVar;
72  std::vector<double> dataProb;
73  int varSize;
74  int probSize;
75 
77 };
78 
79 #endif
PileUpProducer(edm::ParameterSet const &p)
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< unsigned > theNumberOfMinBiasEvts
std::vector< std::string > theFileNames
bool read(std::string inputFile)
Read former minbias configuration (from previous run)
std::vector< int > dataProbFunctionVar
std::vector< unsigned > theNumberOfEntries
PrimaryVertexGenerator * theVertexGenerator
std::ofstream myOutputFile
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
bool currentValuesWereSet
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
std::vector< unsigned > theCurrentMinBiasEvt
std::vector< PUEvent * > thePUEvents
std::string inputFile
std::vector< double > dataProb
std::vector< unsigned > theCurrentEntry
double averageNumber_
std::vector< TTree * > theTrees
virtual ~PileUpProducer()
Definition: PUEvent.h:6
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
unsigned theNumberOfFiles
unsigned myOutputBuffer
Definition: Run.h:41
std::vector< TFile * > theFiles
void save()
Save current minbias configuration (for later use)
std::vector< TBranch * > theBranches