CMS 3D CMS Logo

BeamSpotOnlineObjects.h
Go to the documentation of this file.
1 #ifndef BEAMSPOTONLINEOBJECTS_H
2 #define BEAMSPOTONLINEOBJECTS_H
3 
18 
19 #include <cmath>
20 #include <sstream>
21 #include <cstring>
22 #include <vector>
23 #include <string>
24 
26 public:
30  lastAnalyzedRun_ = 0;
32  intParams_.resize(ISIZE, std::vector<int>(1, 0));
33  floatParams_.resize(FSIZE, std::vector<float>(1, 0.0));
34  stringParams_.resize(SSIZE, std::vector<std::string>(1, ""));
35  timeParams_.resize(TSIZE, std::vector<unsigned long long>(1, 0ULL));
36  }
37 
38  ~BeamSpotOnlineObjects() override {}
39 
41  enum IntParamIndex { NUM_TRACKS = 0, NUM_PVS = 1, USED_EVENTS = 2, MAX_PVS = 3, ISIZE = 4 };
42  enum FloatParamIndex { MEAN_PV = 0, ERR_MEAN_PV = 1, RMS_PV = 2, ERR_RMS_PV = 3, FSIZE = 4 };
43  enum StringParamIndex { START_TIME = 0, END_TIME = 1, LUMI_RANGE = 2, SSIZE = 3 };
45 
47  // set lastAnalyzedLumi_, last analyzed lumisection
49 
50  // set lastAnalyzedRun_, run of the last analyzed lumisection
52 
53  // set lastAnalyzedFill_, fill of the last analyzed lumisection
55 
56  // set number of tracks used in the BeamSpot fit
57  void setNumTracks(int val);
58 
59  // set number of Primary Vertices used in the BeamSpot fit
60  void setNumPVs(int val);
61 
62  // set number of Events used in the BeamSpot fit (for DIP)
63  void setUsedEvents(int val);
64 
65  // set max number of Primary Vertices used in the BeamSpot fit (for DIP)
66  void setMaxPVs(int val);
67 
68  // set mean number of PVs (for DIP)
69  void setMeanPV(float val);
70 
71  // set error on mean number of PVs (for DIP)
72  void setMeanErrorPV(float val);
73 
74  // set rms of number of PVs (for DIP)
75  void setRmsPV(float val);
76 
77  // set error on rm of number of PVs (for DIP)
78  void setRmsErrorPV(float val);
79 
80  // set start time of the firs LS as string (for DIP)
82 
83  // set end time of the last LS as string (for DIP)
85 
86  // set lumi range as string (for DIP)
88 
89  // set creation time of the payload
91 
92  // set timestamp of the first LS (for DIP)
94 
95  // set timestamp of the last LS (for DIP)
97 
99  // get lastAnalyzedLumi_, last analyzed lumisection
100  int lastAnalyzedLumi() const { return lastAnalyzedLumi_; }
101 
102  // get lastAnalyzedRun_, run of the last analyzed lumisection
103  int lastAnalyzedRun() const { return lastAnalyzedRun_; }
104 
105  // get lastAnalyzedFill_, fill of the last analyzed lumisection
106  int lastAnalyzedFill() const { return lastAnalyzedFill_; }
107 
108  // get number of tracks used in the BeamSpot fit
109  int numTracks() const;
110 
111  // get number of Primary Vertices used in the BeamSpot fit
112  int numPVs() const;
113 
114  // get number of Events used in the BeamSpot fit (for DIP)
115  int usedEvents() const;
116 
117  // get max number of Primary Vertices used in the BeamSpot fit (for DIP)
118  int maxPVs() const;
119 
120  // get mean number of PVs (for DIP)
121  float meanPV() const;
122 
123  // get error on mean number of PVs (for DIP)
124  float meanErrorPV() const;
125 
126  // get rms of number of PVs (for DIP)
127  float rmsPV() const;
128 
129  // get error on rm of number of PVs (for DIP)
130  float rmsErrorPV() const;
131 
132  // get start time of the firs LS as string (for DIP)
133  std::string startTime() const;
134 
135  // get end time of the last LS as string (for DIP)
136  std::string endTime() const;
137 
138  // get lumi range as string (for DIP)
139  std::string lumiRange() const;
140 
141  // get creation time of the payload
142  cond::Time_t creationTime() const;
143 
144  // get timestamp of the first LS (for DIP)
146 
147  // get timestamp of the last LS (for DIP)
148  cond::Time_t endTimeStamp() const;
149 
151  void print(std::stringstream& ss) const;
152 
153 private:
157  std::vector<std::vector<int> > intParams_;
158  std::vector<std::vector<float> > floatParams_;
159  std::vector<std::vector<std::string> > stringParams_;
160  std::vector<std::vector<unsigned long long> > timeParams_; // unsigned long long is equal to cond::Time_t
161 
163 };
164 
165 std::ostream& operator<<(std::ostream&, BeamSpotOnlineObjects beam);
166 
167 #endif
int lastAnalyzedLumi() const
Getters Methods.
cond::Time_t creationTime() const
void setStartTimeStamp(cond::Time_t val)
void setLastAnalyzedLumi(int val)
Setters Methods.
void print(std::stringstream &ss) const
Print BeamSpotOnline parameters.
std::string endTime() const
void setEndTimeStamp(cond::Time_t val)
std::string lumiRange() const
std::string startTime() const
std::vector< std::vector< int > > intParams_
void setEndTime(std::string val)
std::ostream & operator<<(std::ostream &, BeamSpotOnlineObjects beam)
unsigned long long Time_t
Definition: Time.h:14
cond::Time_t endTimeStamp() const
BeamSpotOnlineObjects()
default constructor
std::vector< std::vector< std::string > > stringParams_
std::vector< std::vector< unsigned long long > > timeParams_
cond::Time_t startTimeStamp() const
void setLumiRange(std::string val)
#define COND_SERIALIZABLE
Definition: Serializable.h:39
std::vector< std::vector< float > > floatParams_
void setStartTime(std::string val)
void setCreationTime(cond::Time_t val)