CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Mixing/Base/interface/PileUp.h

Go to the documentation of this file.
00001 #ifndef Base_PileUp_h
00002 #define Base_PileUp_h
00003 
00004 #include <string>
00005 #include <vector>
00006 #include "FWCore/Framework/interface/Frameworkfwd.h"
00007 #include "FWCore/Sources/interface/VectorInputSource.h"
00008 #include "DataFormats/Provenance/interface/EventID.h"
00009 
00010 
00011 class TFile;
00012 class TH1F;
00013 
00014 namespace CLHEP {
00015   class RandPoissonQ;
00016   class RandPoisson;
00017 }
00018 
00019 
00020 
00021 namespace edm {
00022   class PileUp {
00023   public:
00024     typedef VectorInputSource::EventPrincipalVector EventPrincipalVector;
00025     explicit PileUp(ParameterSet const& pset, int const minb, int const maxb, double averageNumber, TH1F* const histo, const bool playback);
00026     ~PileUp();
00027 
00028     void readPileUp(std::vector<EventPrincipalVector> & result,std::vector<std::vector<edm::EventID> > &ids, std::vector<float>& TrueBXCount);
00029 
00030     double averageNumber() const {return averageNumber_;}
00031     bool poisson() const {return poisson_;}
00032     bool doPileup() {return none_ ? false :  averageNumber_>0.;}
00033     void dropUnwantedBranches(std::vector<std::string> const& wantedBranches) {
00034       input_->dropUnwantedBranches(wantedBranches);
00035     }
00036     void endJob () {
00037       input_->doEndJob();
00038     }
00039 
00040   private:
00041     std::string const type_;
00042     int const minBunch_;
00043     int const maxBunch_;
00044     double const averageNumber_;
00045     int const intAverage_;
00046     TH1F* const histo_;
00047     bool const histoDistribution_;
00048     bool const probFunctionDistribution_;
00049     bool const poisson_;
00050     bool const fixed_;
00051     bool const none_;
00052     bool manage_OOT_;
00053     bool poisson_OOT_;
00054     bool fixed_OOT_;
00055     int  intFixed_OOT_;
00056 
00057     VectorInputSource * const input_;
00058     CLHEP::RandPoissonQ *poissonDistribution_;
00059     CLHEP::RandPoisson  *poissonDistr_OOT_;
00060 
00061 
00062     TH1F *h1f;
00063     TH1F *hprobFunction;
00064     TFile *probFileHisto;
00065     
00066     //playback info
00067     bool playback_;
00068 
00069     // sequential reading
00070     bool sequential_;
00071     
00072     // read the seed for the histo and probability function cases
00073     int seed_;
00074   };
00075 }
00076 
00077 #endif