CMS 3D CMS Logo

Enumerations | Functions | Variables
RunInfoPI Namespace Reference

Enumerations

enum  parameters {
  m_run, m_start_time_ll, m_stop_time_ll, m_start_current,
  m_stop_current, m_avg_current, m_max_current, m_min_current,
  m_run_interval_seconds, m_fedIN, m_BField, END_OF_TYPES
}
 
enum  state { fake = 0, valid = 1, invalid = 2 }
 

Functions

std::string getStringFromTypeEnum (const parameters &parameter)
 
void reportSummaryMapPalette (TH2 *obj)
 
float runDuration (const std::shared_ptr< RunInfo > &payload)
 
std::string runEndTime (const std::shared_ptr< RunInfo > &payload)
 
std::string runStartTime (const std::shared_ptr< RunInfo > &payload)
 
float theBField (const float current)
 

Variables

constexpr std::array< int, 7 > nominalCurrents {{-1, 0, 9558, 14416, 16819, 18268, 19262}}
 
constexpr std::array< float, 7 > nominalFields {{3.8, 0., 2., 3., 3.5, 3.8, 4.}}
 

Enumeration Type Documentation

◆ parameters

Enumerator
m_run 
m_start_time_ll 
m_stop_time_ll 
m_start_current 
m_stop_current 
m_avg_current 
m_max_current 
m_min_current 
m_run_interval_seconds 
m_fedIN 
m_BField 
END_OF_TYPES 

Definition at line 23 of file RunInfoPayloadInspectoHelper.h.

23  {
24  m_run, // int
25  m_start_time_ll, // long long;
26  m_stop_time_ll, // long long
27  m_start_current, // float
28  m_stop_current, // float
29  m_avg_current, // float
30  m_max_current, // float
31  m_min_current, // float
32  m_run_interval_seconds, // float
33  m_fedIN, // unsigned int
34  m_BField, // float
36  };

◆ state

Enumerator
fake 
valid 
invalid 

Definition at line 16 of file RunInfoPayloadInspectoHelper.h.

16 { fake = 0, valid = 1, invalid = 2 };

Function Documentation

◆ getStringFromTypeEnum()

std::string RunInfoPI::getStringFromTypeEnum ( const parameters parameter)
inline

Definition at line 74 of file RunInfoPayloadInspectoHelper.h.

74  {
75  switch (parameter) {
76  case m_run:
77  return "run number";
78  case m_start_time_ll:
79  return "start time";
80  case m_stop_time_ll:
81  return "stop time";
82  case m_start_current:
83  return "start current [A]";
84  case m_stop_current:
85  return "stop current [A]";
86  case m_avg_current:
87  return "average current [A]";
88  case m_max_current:
89  return "max current [A]";
90  case m_min_current:
91  return "min current [A]";
93  return "run duration [s]";
94  case m_fedIN:
95  return "n. FEDs";
96  case m_BField:
97  return "B-field intensity [T]";
98  default:
99  return "should never be here";
100  }
101  }

References m_avg_current, m_BField, m_fedIN, m_max_current, m_min_current, m_run, m_run_interval_seconds, m_start_current, m_start_time_ll, m_stop_current, m_stop_time_ll, and pfMETsysShiftCorrections_cfi::parameter.

◆ reportSummaryMapPalette()

void RunInfoPI::reportSummaryMapPalette ( TH2 *  obj)
inline

Definition at line 104 of file RunInfoPayloadInspectoHelper.h.

104  {
105  static int pcol[20];
106 
107  float rgb[20][3];
108 
109  for (int i = 0; i < 20; i++) {
110  if (i < 17) {
111  rgb[i][0] = 0.80 + 0.01 * i;
112  rgb[i][1] = 0.00 + 0.03 * i;
113  rgb[i][2] = 0.00;
114  } else if (i < 19) {
115  rgb[i][0] = 0.80 + 0.01 * i;
116  rgb[i][1] = 0.00 + 0.03 * i + 0.15 + 0.10 * (i - 17);
117  rgb[i][2] = 0.00;
118  } else if (i == 19) {
119  rgb[i][0] = 0.00;
120  rgb[i][1] = 0.80;
121  rgb[i][2] = 0.00;
122  }
123  pcol[i] = TColor::GetColor(rgb[i][0], rgb[i][1], rgb[i][2]);
124  }
125 
126  gStyle->SetPalette(20, pcol);
127 
128  if (obj) {
129  obj->SetMinimum(-1.e-15);
130  obj->SetMaximum(+1.0);
131  obj->SetOption("colz");
132  }
133  }

References MillePedeFileConverter_cfg::e, mps_fire::i, getGTfromDQMFile::obj, and svgfig::rgb().

◆ runDuration()

float RunInfoPI::runDuration ( const std::shared_ptr< RunInfo > &  payload)
inline

Definition at line 52 of file RunInfoPayloadInspectoHelper.h.

52  {
53  // calculation of the run duration in seconds
54  time_t start_time = payload->m_start_time_ll;
55  ctime(&start_time);
56  time_t end_time = payload->m_stop_time_ll;
57  ctime(&end_time);
58  return difftime(end_time, start_time) / 1.0e+6;
59  }

References jets_cff::payload.

◆ runEndTime()

std::string RunInfoPI::runEndTime ( const std::shared_ptr< RunInfo > &  payload)
inline

Definition at line 68 of file RunInfoPayloadInspectoHelper.h.

68  {
69  const time_t end_time = payload->m_stop_time_ll / 1.0e+6;
70  return std::asctime(std::gmtime(&end_time));
71  }

References jets_cff::payload.

◆ runStartTime()

std::string RunInfoPI::runStartTime ( const std::shared_ptr< RunInfo > &  payload)
inline

Definition at line 62 of file RunInfoPayloadInspectoHelper.h.

62  {
63  const time_t start_time = payload->m_start_time_ll / 1.0e+6;
64  return std::asctime(std::gmtime(&start_time));
65  }

References jets_cff::payload.

◆ theBField()

float RunInfoPI::theBField ( const float  current)
inline

Definition at line 39 of file RunInfoPayloadInspectoHelper.h.

39  {
40  // logic is taken from https://github.com/cms-sw/cmssw/blob/master/MagneticField/GeomBuilder/plugins/VolumeBasedMagneticFieldESProducerFromDB.cc#L156
41 
42  int i = 0;
43  for (; i < (int)nominalFields.size() - 1; i++) {
44  if (2 * current < nominalCurrents[i] + nominalCurrents[i + 1]) {
45  return nominalFields[i];
46  }
47  }
48  return nominalFields[i];
49  }

References mps_fire::i, createfilelist::int, nominalCurrents, and nominalFields.

Variable Documentation

◆ nominalCurrents

constexpr std::array<int, 7> RunInfoPI::nominalCurrents {{-1, 0, 9558, 14416, 16819, 18268, 19262}}
constexpr

◆ nominalFields

constexpr std::array<float, 7> RunInfoPI::nominalFields {{3.8, 0., 2., 3., 3.5, 3.8, 4.}}
constexpr
RunInfoPI::m_min_current
Definition: RunInfoPayloadInspectoHelper.h:31
mps_fire.i
i
Definition: mps_fire.py:428
RunInfoPI::nominalCurrents
constexpr std::array< int, 7 > nominalCurrents
Definition: RunInfoPayloadInspectoHelper.h:19
pfMETsysShiftCorrections_cfi.parameter
parameter
Definition: pfMETsysShiftCorrections_cfi.py:118
RunInfoPI::nominalFields
constexpr std::array< float, 7 > nominalFields
Definition: RunInfoPayloadInspectoHelper.h:20
RunInfoPI::m_stop_current
Definition: RunInfoPayloadInspectoHelper.h:28
RunInfoPI::m_start_current
Definition: RunInfoPayloadInspectoHelper.h:27
RunInfoPI::m_run
Definition: RunInfoPayloadInspectoHelper.h:24
jets_cff.payload
payload
Definition: jets_cff.py:32
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
RunInfoPI::END_OF_TYPES
Definition: RunInfoPayloadInspectoHelper.h:35
RunInfoPI::m_BField
Definition: RunInfoPayloadInspectoHelper.h:34
align::invalid
Definition: StructureType.h:18
createfilelist.int
int
Definition: createfilelist.py:10
RunInfoPI::fake
Definition: RunInfoPayloadInspectoHelper.h:16
RunInfoPI::m_max_current
Definition: RunInfoPayloadInspectoHelper.h:30
RunInfoPI::m_avg_current
Definition: RunInfoPayloadInspectoHelper.h:29
RunInfoPI::m_fedIN
Definition: RunInfoPayloadInspectoHelper.h:33
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
RunInfoPI::m_start_time_ll
Definition: RunInfoPayloadInspectoHelper.h:25
svgfig.rgb
def rgb(r, g, b, maximum=1.)
Definition: svgfig.py:40
RunInfoPI::m_stop_time_ll
Definition: RunInfoPayloadInspectoHelper.h:26
RunInfoPI::m_run_interval_seconds
Definition: RunInfoPayloadInspectoHelper.h:32
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37