CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/RecoLuminosity/LumiProducer/src/DIPLumiDetail.cc

Go to the documentation of this file.
00001 #include "RecoLuminosity/LumiProducer/interface/DIPLumiDetail.h"
00002 
00003 #include <iomanip>
00004 #include <ostream>
00005 #include <iostream>
00006 
00007 DIPLumiDetail::DIPLumiDetail():m_runnum(0),m_ls(0),m_lumiValues(3564){
00008 }
00009 bool
00010 DIPLumiDetail::isNull()const{
00011   if(m_runnum==0&&m_ls==0){
00012     return true;
00013   }
00014   return false;
00015 }
00016 float 
00017 DIPLumiDetail::lumiValue(unsigned int bx) const {
00018   return m_lumiValues[bx];
00019 }
00020 DIPLumiDetail::ValueRange
00021 DIPLumiDetail::lumiValues() const {
00022   return ValueRange(m_lumiValues.begin(),m_lumiValues.end());
00023 }
00024 void
00025 DIPLumiDetail::filldata(std::vector<float>& lumivalues){
00026   lumivalues.swap(m_lumiValues);
00027 }
00028 void
00029 DIPLumiDetail::fillbxdata(unsigned int bxidx,float bxvalue){
00030   m_lumiValues[bxidx]=bxvalue;
00031 }
00032 unsigned int 
00033 DIPLumiDetail::fromRun()const{
00034   return m_runnum;
00035 }
00036 unsigned int 
00037 DIPLumiDetail::fromLS()const{
00038   return m_ls;
00039 }
00040 void
00041 DIPLumiDetail::setOrigin(unsigned int runnumber,unsigned int ls){
00042   m_runnum=runnumber;
00043   m_ls=ls;
00044 }
00045 std::ostream& operator<<(std::ostream& s, DIPLumiDetail const& diplumiDetail) {
00046   s << "\nDumping DIPLumiDetail\n";
00047   std::cout.setf(std::ios::fixed,std::ios::floatfield);
00048   std::cout.setf(std::ios::showpoint);
00049   std::vector<float>::const_iterator lumivalueIt= diplumiDetail.lumiValues().first;
00050   std::vector<float>::const_iterator lumivalueEnd = diplumiDetail.lumiValues().second;
00051   for(unsigned int i=0; lumivalueIt!=lumivalueEnd;++lumivalueIt,++i){
00052     s<<std::setw(10)<<" bunch = "<<i<<" bunchlumi = "<<*lumivalueIt << "\n";
00053   }
00054   s<<"\n";
00055   return s;
00056 }