CMS 3D CMS Logo

Namespaces | Functions
LHCInfo.cc File Reference
#include "CondFormats/RunInfo/interface/LHCInfo.h"
#include "CondFormats/Common/interface/TimeConversions.h"
#include <algorithm>
#include <iterator>
#include <vector>
#include <stdexcept>

Go to the source code of this file.

Namespaces

 LHCInfoImpl
 

Functions

template<typename T >
TLHCInfoImpl::accessParams (std::vector< T > &params, size_t index)
 
static std::vector< unsigned short > bitsetToVector (std::bitset< LHCInfo::bunchSlots+1 > const &bs)
 
static std::string fillTypeToString (LHCInfo::FillTypeId const &fillType)
 
template<typename T >
const TLHCInfoImpl::getOneParam (const std::vector< std::vector< T > > &params, size_t index)
 
template<typename T >
const TLHCInfoImpl::getParams (const std::vector< T > &params, size_t index)
 
std::ostream & operator<< (std::ostream &os, LHCInfo beamInfo)
 
static std::string particleTypeToString (LHCInfo::ParticleTypeId const &particleType)
 
template<typename T >
void LHCInfoImpl::setOneParam (std::vector< std::vector< T > > &params, size_t index, const T &value)
 
template<typename T >
void LHCInfoImpl::setParams (std::vector< T > &params, size_t index, const T &value)
 

Function Documentation

◆ bitsetToVector()

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

Definition at line 9 of file LHCInfo.cc.

References cms::cuda::bs, and mps_fire::i.

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

9  {
10  std::vector<unsigned short> vec;
11  //reserve space only for the bits in the bitset that are set
12  vec.reserve(bs.count());
13  for (size_t i = 0; i < bs.size(); ++i) {
14  if (bs.test(i))
15  vec.push_back((unsigned short)i);
16  }
17  return vec;
18 }

◆ fillTypeToString()

static std::string fillTypeToString ( LHCInfo::FillTypeId const &  fillType)
static

Definition at line 21 of file LHCInfo.cc.

References LHCInfo::COSMICS, LHCInfo::GAP, LHCInfo::IONS, LHCInfo::PROTONS, AlCaHLTBitMon_QueryRunRegistry::string, and LHCInfo::UNKNOWN.

Referenced by LHCInfo::print().

21  {
22  std::string s_fillType("UNKNOWN");
23  switch (fillType) {
24  case LHCInfo::UNKNOWN:
25  s_fillType = std::string("UNKNOWN");
26  break;
27  case LHCInfo::PROTONS:
28  s_fillType = std::string("PROTONS");
29  break;
30  case LHCInfo::IONS:
31  s_fillType = std::string("IONS");
32  break;
33  case LHCInfo::COSMICS:
34  s_fillType = std::string("COSMICS");
35  break;
36  case LHCInfo::GAP:
37  s_fillType = std::string("GAP");
38  break;
39  default:
40  s_fillType = std::string("UNKNOWN");
41  }
42  return s_fillType;
43 }

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
LHCInfo  beamInfo 
)

Definition at line 513 of file LHCInfo.cc.

References LHCInfo::print(), and contentValuesCheck::ss.

513  {
514  std::stringstream ss;
515  beamInfo.print(ss);
516  os << ss.str();
517  return os;
518 }
void print(std::stringstream &ss) const
Definition: LHCInfo.cc:437

◆ particleTypeToString()

static std::string particleTypeToString ( LHCInfo::ParticleTypeId const &  particleType)
static

Definition at line 46 of file LHCInfo.cc.

References LHCInfo::AR18, LHCInfo::D, LHCInfo::NONE, PbPb_ZMuSkimMuonDPG_cff::particleType, LHCInfo::PB82, LHCInfo::PROTON, AlCaHLTBitMon_QueryRunRegistry::string, and LHCInfo::XE54.

Referenced by LHCInfo::print().

46  {
47  std::string s_particleType("NONE");
48  switch (particleType) {
49  case LHCInfo::NONE:
50  s_particleType = std::string("NONE");
51  break;
52  case LHCInfo::PROTON:
53  s_particleType = std::string("PROTON");
54  break;
55  case LHCInfo::PB82:
56  s_particleType = std::string("PB82");
57  break;
58  case LHCInfo::AR18:
59  s_particleType = std::string("AR18");
60  break;
61  case LHCInfo::D:
62  s_particleType = std::string("D");
63  break;
64  case LHCInfo::XE54:
65  s_particleType = std::string("XE54");
66  break;
67  default:
68  s_particleType = std::string("NONE");
69  }
70  return s_particleType;
71 }