CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/CondFormats/RunInfo/src/FillInfo.cc File Reference

#include "CondFormats/RunInfo/interface/FillInfo.h"
#include "CondFormats/Common/interface/TimeConversions.h"
#include <algorithm>
#include <iterator>
#include <stdexcept>

Go to the source code of this file.

Functions

static std::vector< unsigned
short > 
bitsetToVector (std::bitset< FillInfo::bunchSlots+1 > const &bs)
static std::string fillTypeToString (FillInfo::FillTypeId const &fillType)
std::ostream & operator<< (std::ostream &os, FillInfo fillInfo)
static std::string particleTypeToString (FillInfo::ParticleTypeId const &particleType)

Function Documentation

static std::vector<unsigned short> bitsetToVector ( std::bitset< FillInfo::bunchSlots+1 > const &  bs) [static]

Definition at line 8 of file FillInfo.cc.

References i.

Referenced by FillInfo::bunchConfigurationForBeam1(), and FillInfo::bunchConfigurationForBeam2().

                                                                                              {
  std::vector<unsigned short> vec;
  //reserve space only for the bits in the bitset that are set
  vec.reserve( bs.count() );
  for( size_t i = 0; i < bs.size(); ++i ) {
    if( bs.test( i ) )
      vec.push_back( (unsigned short)i );
  }
  return vec;
}
static std::string fillTypeToString ( FillInfo::FillTypeId const &  fillType) [static]

Definition at line 20 of file FillInfo.cc.

References FillInfo::COSMICS, FillInfo::GAP, FillInfo::IONS, FillInfo::PROTONS, and FillInfo::UNKNOWN.

Referenced by FillInfo::print().

                                                                         {
  std::string s_fillType( "UNKNOWN" );
  switch( fillType ) {
  case FillInfo::UNKNOWN :
    s_fillType = std::string( "UNKNOWN" );
    break;
  case FillInfo::PROTONS :
    s_fillType = std::string( "PROTONS" );
    break;
  case FillInfo::IONS :
    s_fillType = std::string( "IONS" );
    break;
  case FillInfo::COSMICS :
    s_fillType = std::string( "COSMICS" );
    break;
  case FillInfo::GAP :
    s_fillType = std::string( "GAP" );
    break;
  default :
    s_fillType = std::string( "UNKNOWN" );
  }
  return s_fillType;
}
std::ostream& operator<< ( std::ostream &  os,
FillInfo  fillInfo 
)

Definition at line 383 of file FillInfo.cc.

References FillInfo::print().

                                                              {
  std::stringstream ss;
  fillInfo.print( ss );
  os << ss.str();
  return os;
}
static std::string particleTypeToString ( FillInfo::ParticleTypeId const &  particleType) [static]

Definition at line 45 of file FillInfo.cc.

References FillInfo::AR18, FillInfo::D, FillInfo::NONE, FillInfo::PB82, FillInfo::PROTON, and FillInfo::XE54.

Referenced by FillInfo::print().

                                                                                     {
  std::string s_particleType( "NONE" );
  switch( particleType ) {
  case FillInfo::NONE :
    s_particleType = std::string( "NONE" );
    break;
  case FillInfo::PROTON :
    s_particleType = std::string( "PROTON" );
    break;
  case FillInfo::PB82 :
    s_particleType = std::string( "PB82" );
    break;
  case FillInfo::AR18 :
    s_particleType = std::string( "AR18" );
    break;
  case FillInfo::D :
    s_particleType = std::string( "D" );
    break;
  case FillInfo::XE54 :
    s_particleType = std::string( "XE54" );
    break;
  default :
    s_particleType = std::string( "NONE" );
  }
  return s_particleType;
}