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