CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/CondFormats/RunInfo/interface/MixingModuleConfig.h

Go to the documentation of this file.
00001 #ifndef MixingModuleConfig_H
00002 #define MixingModuleConfig_H
00003 
00004 #include <vector>
00005 #include <string>
00006 #include <iostream>
00007 
00008 namespace edm{
00009   class ParameterSet;
00010 }
00011 
00012 class MixingInputConfig {
00013  public:
00014   MixingInputConfig();
00015   virtual ~MixingInputConfig(){};
00016 
00017   const int itype() const {return t_;}
00018   std::string type() const { 
00019     switch(t_){
00020     case 0:      return "none";
00021     case 1:      return "fixed";
00022     case 2:      return "poisson";
00023     case 3:      return "histo";
00024     case 4:      return "prodFunction";
00025     }
00026     return "";
00027   }
00028   int itype(std::string s)const {
00029     if (s=="none")      return 0;
00030     if (s=="fixed")      return 1;
00031     if (s=="poisson")      return 2;
00032     if (s=="histo")      return 3;
00033     if (s=="probFunction")      return 4;
00034     return 0;
00035   }
00036 
00037   const double averageNumber() const { return an_;}
00038   //  const int intAverage() const { return ia_;}
00039   const std::vector<int> & probFunctionVariable() const { return dpfv_;}
00040   const std::vector<double> & probValue() const { return dp_;}
00041   const int outOfTime() const { return moot_;}
00042   const int fixedOutOfTime() const { return ioot_;}
00043 
00044   void read(edm::ParameterSet & pset);
00045 
00046  private:
00047   int t_;
00048   double an_;
00049   //  int ia_;
00050   std::vector<int> dpfv_;
00051   std::vector<double>dp_;
00052   int moot_;
00053   int ioot_;
00054   
00055 };
00056 
00057 class MixingModuleConfig {
00058  public:
00059   MixingModuleConfig();
00060   virtual ~MixingModuleConfig(){};
00061 
00062   const MixingInputConfig & config (unsigned int i=0) const { return configs_[i];}
00063   
00064   const int & bunchSpace() const { return bs_;}
00065   const int & minBunch() const { return minb_;}
00066   const int & maxBunch() const { return maxb_;}
00067 
00068   void read(edm::ParameterSet & pset);
00069   
00070  private:
00071   std::vector<MixingInputConfig> configs_;
00072   
00073   int minb_;
00074   int maxb_;
00075   int bs_;
00076 };
00077 
00078 
00079 
00080 std::ostream& operator<< ( std::ostream&, const MixingModuleConfig & beam );
00081 std::ostream& operator<< ( std::ostream&, const MixingInputConfig & beam );
00082 
00083 #endif