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 
6 
7 #include <vector>
8 #include <string>
9 #include <fstream>
10 #include "TH1F.h"
11 
12 namespace edm {
13  class Event;
14  class EventSetup;
15  class LuminosityBlock;
16  class ParameterSet;
17  class Run;
18 }
19 
20 class TFile;
21 class TTree;
22 class TBranch;
23 class PUEvent;
24 
26 
28 {
29 
30  public:
31 
32  explicit PileUpProducer(edm::ParameterSet const & p);
33  virtual ~PileUpProducer();
34  virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
35  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
36  virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
37  virtual void produce(edm::Event & e, const edm::EventSetup & c) override;
38 
39  private:
40 
42  void save();
43 
46 
47  private:
48 
50 
52  std::vector<std::string> theFileNames;
54  unsigned theNumberOfFiles;
56 
57  std::vector<TFile*> theFiles;
58  std::vector<TTree*> theTrees;
59  std::vector<TBranch*> theBranches;
60  std::vector<PUEvent*> thePUEvents;
61  std::vector<unsigned> theCurrentEntry;
62  std::vector<unsigned> theCurrentMinBiasEvt;
63  std::vector<unsigned> theNumberOfEntries;
64  std::vector<unsigned> theNumberOfMinBiasEvts;
65 
66  std::ofstream myOutputFile;
67  unsigned myOutputBuffer;
68 
69  TH1F * hprob;
70  std::vector<int> dataProbFunctionVar;
71  std::vector<double> dataProb;
72  int varSize;
73  int probSize;
74 
76 };
77 
78 #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