CMS 3D CMS Logo

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

Go to the source code of this file.

Functions

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

Function Documentation

◆ bitsetToVector()

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

Definition at line 9 of file LHCInfoPerFill.cc.

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

Referenced by LHCInfoPerFill::bunchConfigurationForBeam1(), and LHCInfoPerFill::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 ( LHCInfoPerFill::FillTypeId const &  fillType)
static

Definition at line 21 of file LHCInfoPerFill.cc.

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

Referenced by LHCInfoPerFill::print().

21  {
22  std::string s_fillType("UNKNOWN");
23  switch (fillType) {
25  s_fillType = std::string("UNKNOWN");
26  break;
28  s_fillType = std::string("PROTONS");
29  break;
31  s_fillType = std::string("IONS");
32  break;
34  s_fillType = std::string("COSMICS");
35  break;
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,
LHCInfoPerFill  beamInfo 
)

Definition at line 460 of file LHCInfoPerFill.cc.

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

460  {
461  std::stringstream ss;
462  beamInfo.print(ss);
463  os << ss.str();
464  return os;
465 }
void print(std::stringstream &ss) const

◆ particleTypeToString()

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

Definition at line 46 of file LHCInfoPerFill.cc.

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

Referenced by LHCInfoPerFill::print().

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