CMS 3D CMS Logo

Functions
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

◆ bitsetToVector()

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

Definition at line 8 of file FillInfo.cc.

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

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

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

◆ fillTypeToString()

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, AlCaHLTBitMon_QueryRunRegistry::string, and FillInfo::UNKNOWN.

Referenced by FillInfo::print().

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

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
FillInfo  fillInfo 
)

Definition at line 321 of file FillInfo.cc.

References l1tGTMenu_BTagSeeds_cff::os, FillInfo::print(), and contentValuesCheck::ss.

321  {
322  std::stringstream ss;
323  fillInfo.print(ss);
324  os << ss.str();
325  return os;
326 }
void print(std::stringstream &ss) const
Definition: FillInfo.cc:276

◆ particleTypeToString()

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

Definition at line 45 of file FillInfo.cc.

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

Referenced by FillInfo::print().

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