CMS 3D CMS Logo

Classes | Enumerations | Functions
beamSpotPI Namespace Reference

Classes

class  BeamSpot_history
 
class  BeamSpot_runhistory
 
class  BeamSpot_timehistory
 
class  BSParamsHelper
 
class  DisplayParameters
 
class  DisplayParametersDiff
 
class  xyCorrelation
 

Enumerations

enum  parameters {
  X = 0, Y = 1, Z = 2, sigmaX = 3,
  sigmaY = 4, sigmaZ = 5, dxdz = 6, dydz = 7,
  lastLumi = 8, lastRun = 9, lastFill = 10, nTracks = 11,
  nPVs = 12, nUsedEvents = 13, maxPVs = 14, meanPV = 15,
  meanErrorPV = 16, rmsPV = 17, rmsErrorPV = 18, creationTime = 19,
  startTimeStamp = 20, endTimeStamp = 21, startTime = 22, endTime = 23,
  lumiRange = 24, END_OF_TYPES = 25
}
 

Functions

std::string convertTimeToDateString (cond::Time_t timeValue, bool hasMicros=false, bool toUTC=true)
 
std::string getStringFromParamEnum (const parameters &parameter, const bool addUnits=false)
 
std::pair< unsigned int, unsigned int > unpack (cond::Time_t since)
 

Enumeration Type Documentation

◆ parameters

Enumerator
sigmaX 
sigmaY 
sigmaZ 
dxdz 
dydz 
lastLumi 
lastRun 
lastFill 
nTracks 
nPVs 
nUsedEvents 
maxPVs 
meanPV 
meanErrorPV 
rmsPV 
rmsErrorPV 
creationTime 
startTimeStamp 
endTimeStamp 
startTime 
endTime 
lumiRange 
END_OF_TYPES 

Definition at line 35 of file BeamSpotPayloadInspectorHelper.h.

35  {
36  X = 0, // 0 regular BS methods
37  Y = 1, // 1
38  Z = 2, // 2
39  sigmaX = 3, // 3
40  sigmaY = 4, // 4
41  sigmaZ = 5, // 5
42  dxdz = 6, // 6
43  dydz = 7, // 7
44  lastLumi = 8, // 8 additional int's
45  lastRun = 9, // 9
46  lastFill = 10, // 10
47  nTracks = 11, // 11
48  nPVs = 12, // 12
49  nUsedEvents = 13, // 13
50  maxPVs = 14, // 14
51  meanPV = 15, // 15 additional float's
52  meanErrorPV = 16, // 16
53  rmsPV = 17, // 17
54  rmsErrorPV = 18, // 18
55  creationTime = 19, // 19 additional cond::Time_t
56  startTimeStamp = 20, // 20
57  endTimeStamp = 21, // 21
58  startTime = 22, // 22 additional std::string
59  endTime = 23, // 23
60  lumiRange = 24, // 24
61  END_OF_TYPES = 25,
62  };
float dydz
float dxdz
#define X(str)
Definition: MuonsGrabber.cc:38
float rmsPV
time_t startTimeStamp
time_t endTimeStamp
float meanPV

Function Documentation

◆ convertTimeToDateString()

std::string beamSpotPI::convertTimeToDateString ( cond::Time_t  timeValue,
bool  hasMicros = false,
bool  toUTC = true 
)
inline

Definition at line 66 of file BeamSpotPayloadInspectorHelper.h.

References edmScanValgrind::buffer, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by beamSpotPI::DisplayParameters< PayloadType >::fill().

66  {
67  // Convert microseconds to seconds
68  std::time_t unixTime = static_cast<std::time_t>(hasMicros ? timeValue / 1000000 : timeValue);
69 
70  // Convert std::time_t to struct tm (to UTC, or not)
71  std::tm* timeInfo = toUTC ? std::gmtime(&unixTime) : std::localtime(&unixTime);
72 
73  // Convert struct tm to human-readable string format
74  char buffer[80];
75  std::strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", timeInfo);
76 
77  // Append microseconds to the string
78  std::string dateString(buffer);
79  //dateString += "." + std::to_string(timeValue % 1000000);
80 
81  return dateString;
82  }

◆ getStringFromParamEnum()

std::string beamSpotPI::getStringFromParamEnum ( const parameters parameter,
const bool  addUnits = false 
)
inline

Definition at line 85 of file BeamSpotPayloadInspectorHelper.h.

References dxdz, dydz, sigmaX, sigmaY, sigmaZ, X, Y, and Z.

Referenced by beamSpotPI::DisplayParametersDiff< PayloadType, nIOVs, ntags >::fill(), and beamSpotPI::BSParamsHelper< PayloadType >::printDebug().

86  {
87  switch (parameter) {
88  case X:
89  return (addUnits ? "X [cm]" : "X");
90  case Y:
91  return (addUnits ? "Y [cm]" : "Y");
92  case Z:
93  return (addUnits ? "Z [cm]" : "Z");
94  case sigmaX:
95  return (addUnits ? "#sigma_{X} [cm]" : "sigmaX");
96  case sigmaY:
97  return (addUnits ? "#sigma_{Y} [cm]" : "sigmaY");
98  case sigmaZ:
99  return (addUnits ? "#sigma_{Z} [cm]" : "sigmaZ");
100  case dxdz:
101  return (addUnits ? "#frac{dX}{dZ} [rad]" : "dx/dz");
102  case dydz:
103  return (addUnits ? "#frac{dY}{dZ} [rad]" : "dy/dz");
104  default:
105  return "should never be here";
106  }
107  }
float dydz
float dxdz
#define X(str)
Definition: MuonsGrabber.cc:38

◆ unpack()

std::pair<unsigned int, unsigned int> beamSpotPI::unpack ( cond::Time_t  since)
inline