00001 #ifndef FastSimulation_PileUpProducer_PileUpProducer_H 00002 #define FastSimulation_PileUpProducer_PileUpProducer_H 00003 00004 #include "FWCore/Framework/interface/EDProducer.h" 00005 00006 #include <vector> 00007 #include <string> 00008 #include <fstream> 00009 #include "TH1F.h" 00010 00011 class ParameterSet; 00012 class Event; 00013 class EventSetup; 00014 00015 class TFile; 00016 class TTree; 00017 class TBranch; 00018 class PUEvent; 00019 00020 class PrimaryVertexGenerator; 00021 class RandomEngine; 00022 00023 class PileUpProducer : public edm::EDProducer 00024 { 00025 00026 public: 00027 00028 explicit PileUpProducer(edm::ParameterSet const & p); 00029 virtual ~PileUpProducer(); 00030 virtual void beginRun(edm::Run &, edm::EventSetup const&); 00031 virtual void endRun(); 00032 virtual void produce(edm::Event & e, const edm::EventSetup & c); 00033 00034 private: 00035 00037 void save(); 00038 00040 bool read(std::string inputFile); 00041 00042 private: 00043 00044 PrimaryVertexGenerator* theVertexGenerator; 00045 00046 double averageNumber_; 00047 const RandomEngine* random; 00048 std::vector<std::string> theFileNames; 00049 std::string inputFile; 00050 unsigned theNumberOfFiles; 00051 bool usePoisson_; 00052 00053 std::vector<TFile*> theFiles; 00054 std::vector<TTree*> theTrees; 00055 std::vector<TBranch*> theBranches; 00056 std::vector<PUEvent*> thePUEvents; 00057 std::vector<unsigned> theCurrentEntry; 00058 std::vector<unsigned> theCurrentMinBiasEvt; 00059 std::vector<unsigned> theNumberOfEntries; 00060 std::vector<unsigned> theNumberOfMinBiasEvts; 00061 00062 std::ofstream myOutputFile; 00063 unsigned myOutputBuffer; 00064 00065 TH1F * hprob; 00066 std::vector<int> dataProbFunctionVar; 00067 std::vector<double> dataProb; 00068 int varSize; 00069 int probSize; 00070 }; 00071 00072 #endif