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.

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 }

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

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

◆ fillTypeToString()

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

Definition at line 21 of file LHCInfo.cc.

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 }

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

Referenced by LHCInfo::print().

◆ operator<<()

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

Definition at line 513 of file LHCInfo.cc.

513  {
514  std::stringstream ss;
515  beamInfo.print(ss);
516  os << ss.str();
517  return os;
518 }

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

◆ particleTypeToString()

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

Definition at line 46 of file LHCInfo.cc.

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 }

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().

mps_fire.i
i
Definition: mps_fire.py:428
LHCInfo::UNKNOWN
Definition: LHCInfo.h:14
LHCInfo::GAP
Definition: LHCInfo.h:14
LHCInfo::D
Definition: LHCInfo.h:15
LHCInfo::PROTON
Definition: LHCInfo.h:15
LHCInfo::COSMICS
Definition: LHCInfo.h:14
LHCInfo::IONS
Definition: LHCInfo.h:14
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
cms::cuda::bs
bs
Definition: HistoContainer.h:127
LHCInfo::XE54
Definition: LHCInfo.h:15
LHCInfo::print
void print(std::stringstream &ss) const
Definition: LHCInfo.cc:437
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LHCInfo::AR18
Definition: LHCInfo.h:15
LHCInfo::PB82
Definition: LHCInfo.h:15
LHCInfo::NONE
Definition: LHCInfo.h:15
PbPb_ZMuSkimMuonDPG_cff.particleType
particleType
Definition: PbPb_ZMuSkimMuonDPG_cff.py:27
LHCInfo::PROTONS
Definition: LHCInfo.h:14