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 "probFunction"; 00025 // FIX ME: add default 00026 } 00027 return ""; 00028 } 00029 int itype(std::string s)const { 00030 if (s=="none") return 0; 00031 if (s=="fixed") return 1; 00032 if (s=="poisson") return 2; 00033 if (s=="histo") return 3; 00034 if (s=="probFunction") return 4; 00035 return 0; 00036 } 00037 00038 const double averageNumber() const { return an_;} 00039 // const int intAverage() const { return ia_;} 00040 const std::vector<int> & probFunctionVariable() const { return dpfv_;} 00041 const std::vector<double> & probValue() const { return dp_;} 00042 const int outOfTime() const { return moot_;} 00043 const int fixedOutOfTime() const { return ioot_;} 00044 00045 void read(edm::ParameterSet & pset); 00046 00047 private: 00048 int t_; 00049 double an_; 00050 // int ia_; 00051 std::vector<int> dpfv_; 00052 std::vector<double>dp_; 00053 int moot_; 00054 int ioot_; 00055 00056 }; 00057 00058 class MixingModuleConfig { 00059 public: 00060 MixingModuleConfig(); 00061 virtual ~MixingModuleConfig(){}; 00062 00063 const MixingInputConfig & config (unsigned int i=0) const { return configs_[i];} 00064 00065 const int & bunchSpace() const { return bs_;} 00066 const int & minBunch() const { return minb_;} 00067 const int & maxBunch() const { return maxb_;} 00068 00069 void read(edm::ParameterSet & pset); 00070 00071 private: 00072 std::vector<MixingInputConfig> configs_; 00073 00074 int minb_; 00075 int maxb_; 00076 int bs_; 00077 }; 00078 00079 00080 00081 std::ostream& operator<< ( std::ostream&, const MixingModuleConfig & beam ); 00082 std::ostream& operator<< ( std::ostream&, const MixingInputConfig & beam ); 00083 00084 #endif