CMS 3D CMS Logo

Typedefs | Enumerations | Functions | Variables
RunInfoPI Namespace Reference

Typedefs

using FEDMAP_T = std::map< RunInfoPI::DET, std::pair< int, int > >
 

Enumerations

enum  DET {
  SIPIXEL, SISTRIP, PRESHOWER, TOTEMRP_H,
  CTPPSDIAMOND, TOTEMRP_V, TOTEMRP_T, ECAL,
  CASTOR, HCAL, CSC, RPC,
  HCALPHASE1, SIPIXELPHASE1, GEM
}
 
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 { k_fake = 0, k_valid = 1, k_invalid = 2 }
 

Functions

FEDMAP_T buildFEDBounds ()
 
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.}}
 

Typedef Documentation

◆ FEDMAP_T

using RunInfoPI::FEDMAP_T = typedef std::map<RunInfoPI::DET, std::pair<int, int> >

Definition at line 159 of file RunInfoPayloadInspectoHelper.h.

Enumeration Type Documentation

◆ DET

◆ 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 28 of file RunInfoPayloadInspectoHelper.h.

◆ state

Function Documentation

◆ buildFEDBounds()

FEDMAP_T RunInfoPI::buildFEDBounds ( )
inline

Definition at line 161 of file RunInfoPayloadInspectoHelper.h.

References CASTOR, CSC, CTPPSDIAMOND, ECAL, GEM, HCALPHASE1, FEDNumbering::MAXCASTORFEDID, FEDNumbering::MAXCSCFEDID, FEDNumbering::MAXCTPPSDiamondFEDID, FEDNumbering::MAXECALFEDID, FEDNumbering::MAXGEMFEDID, FEDNumbering::MAXHCALFEDID, FEDNumbering::MAXHCALuTCAFEDID, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MAXRPCFEDID, FEDNumbering::MAXSiPixelFEDID, FEDNumbering::MAXSiPixeluTCAFEDID, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MAXTotemRPHorizontalFEDID, FEDNumbering::MAXTotemRPTimingVerticalFEDID, FEDNumbering::MAXTotemRPVerticalFEDID, FEDNumbering::MINCASTORFEDID, FEDNumbering::MINCSCFEDID, FEDNumbering::MINCTPPSDiamondFEDID, FEDNumbering::MINECALFEDID, FEDNumbering::MINGEMFEDID, FEDNumbering::MINHCALFEDID, FEDNumbering::MINHCALuTCAFEDID, FEDNumbering::MINPreShowerFEDID, FEDNumbering::MINRPCFEDID, FEDNumbering::MINSiPixelFEDID, FEDNumbering::MINSiPixeluTCAFEDID, FEDNumbering::MINSiStripFEDID, FEDNumbering::MINTotemRPHorizontalFEDID, FEDNumbering::MINTotemRPTimingVerticalFEDID, FEDNumbering::MINTotemRPVerticalFEDID, MK_P, PRESHOWER, RPC, SIPIXEL, SIPIXELPHASE1, SISTRIP, TOTEMRP_H, TOTEMRP_T, and TOTEMRP_V.

161  {
162  static RunInfoPI::FEDMAP_T fb;
169  fb.insert(MK_P(TOTEMRP_T,
179  return fb;
180  }
std::map< RunInfoPI::DET, std::pair< int, int > > FEDMAP_T
Definition: HCAL.py:1
#define MK_P(a, b)

◆ getStringFromTypeEnum()

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

Definition at line 79 of file RunInfoPayloadInspectoHelper.h.

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.

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

◆ reportSummaryMapPalette()

void RunInfoPI::reportSummaryMapPalette ( TH2 *  obj)
inline

Definition at line 109 of file RunInfoPayloadInspectoHelper.h.

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

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

◆ runDuration()

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

Definition at line 57 of file RunInfoPayloadInspectoHelper.h.

References jetsAK4_Puppi_cff::payload.

57  {
58  // calculation of the run duration in seconds
59  time_t start_time = payload->m_start_time_ll;
60  ctime(&start_time);
61  time_t end_time = payload->m_stop_time_ll;
62  ctime(&end_time);
63  return difftime(end_time, start_time) / 1.0e+6;
64  }

◆ runEndTime()

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

Definition at line 73 of file RunInfoPayloadInspectoHelper.h.

References jetsAK4_Puppi_cff::payload.

73  {
74  const time_t end_time = payload->m_stop_time_ll / 1.0e+6;
75  return std::asctime(std::gmtime(&end_time));
76  }

◆ runStartTime()

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

Definition at line 67 of file RunInfoPayloadInspectoHelper.h.

References jetsAK4_Puppi_cff::payload.

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

◆ theBField()

float RunInfoPI::theBField ( const float  current)
inline

Definition at line 44 of file RunInfoPayloadInspectoHelper.h.

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

Referenced by L1MuonRecoTreeProducer::analyze().

44  {
45  // logic is taken from https://github.com/cms-sw/cmssw/blob/master/MagneticField/GeomBuilder/plugins/VolumeBasedMagneticFieldESProducerFromDB.cc#L156
46 
47  int i = 0;
48  for (; i < (int)nominalFields.size() - 1; i++) {
49  if (2 * current < nominalCurrents[i] + nominalCurrents[i + 1]) {
50  return nominalFields[i];
51  }
52  }
53  return nominalFields[i];
54  }
constexpr std::array< float, 7 > nominalFields
constexpr std::array< int, 7 > nominalCurrents

Variable Documentation

◆ nominalCurrents

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

◆ nominalFields

constexpr std::array<float, 7> RunInfoPI::nominalFields {{3.8, 0., 2., 3., 3.5, 3.8, 4.}}

Definition at line 25 of file RunInfoPayloadInspectoHelper.h.

Referenced by theBField().