CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/CondFormats/RunInfo/src/MixingModuleConfig.cc

Go to the documentation of this file.
00001 #include "CondFormats/RunInfo/interface/MixingModuleConfig.h"
00002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00003 
00004 #include <sstream>
00005 
00006 MixingModuleConfig::MixingModuleConfig(){
00007   configs_.resize(4);
00008 }
00009 MixingInputConfig::MixingInputConfig(){}
00010 
00011 std::ostream& operator<< ( std::ostream& os, const MixingModuleConfig & c) {
00012   std::stringstream ss;
00013   os <<c.bunchSpace()<<"\n"<<c.config();
00014   return os;
00015 }
00016 std::ostream& operator<< ( std::ostream& os, const MixingInputConfig & c) {
00017   std::stringstream ss;
00018   os <<c.type();
00019   return os;
00020 }
00021 
00022 void MixingModuleConfig::read(edm::ParameterSet & pset){
00023   
00024   bs_=pset.getParameter<int>("bunchspace");
00025   minb_=(pset.getParameter<int>("minBunch")*25)/pset.getParameter<int>("bunchspace");
00026   maxb_=(pset.getParameter<int>("maxBunch")*25)/pset.getParameter<int>("bunchspace");
00027 
00028   //FIXME. not covering all possible cases (not used anyways)
00029   edm::ParameterSet p0=pset.getParameter<edm::ParameterSet>("input");
00030   configs_[0].read(p0);
00031 }
00032 
00033 
00034 void MixingInputConfig::read(edm::ParameterSet & pset){
00035   t_=itype(pset.getParameter<std::string>("type"));
00036   an_=0;
00037   //  ia_=0;
00038   dpfv_.clear();
00039   dp_.clear();
00040   moot_=0;
00041   ioot_=0;
00042 
00043   switch(t_){
00044   case 1:
00045     an_=pset.getParameter<double>("averageNumber");
00046     break;
00047   case 2:
00048     an_=pset.getParameter<double>("averageNumber");
00049     break;
00050   case 3:
00051     //not supposed to be valid
00052   case 4:
00053     dpfv_=pset.getParameter<edm::ParameterSet>("nbPileupEvents").getParameter<std::vector<int> >("probFunctionVariable");
00054     dp_=pset.getParameter<edm::ParameterSet>("nbPileupEvents").getParameter<std::vector<double> >("probValue");
00055     break;
00056   }
00057 
00058   if (pset.getUntrackedParameter<bool>("manage_OOT"))
00059     {
00060       std::string OOT_type = pset.getUntrackedParameter<std::string>("OOT_type");
00061 
00062       if(OOT_type == "Poisson" || OOT_type == "poisson")
00063         moot_=2;
00064       else if (OOT_type == "Fixed" || OOT_type == "fixed") {
00065         moot_=1;
00066         ioot_=pset.getUntrackedParameter<int>("intFixed_OOT", -1);
00067       }
00068     }
00069 }