BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
VData.h
Go to the documentation of this file.
1/**
2 * @file VData.h
3 * @author zhangzeheng ([email protected])
4 * @brief class defination for our cached hv info.
5 * @version 0.1
6 * @date 2022-01-19
7 *
8 */
9#ifndef _VDATA_H_
10#define _VDATA_H_
11
12#include <string>
13#include <vector>
14
15
16// like std::array<double,43>
17class VData;
18struct VDataItem;
19struct VDataItem {
20 const static size_t MDC_layers=43;
22 double & operator[](int i) { return data[i]; }
23 static size_t size(){
24 return MDC_layers;
25 }
26 static VDataItem fromArray(const double* item);
27};
28
29typedef std::vector<VDataItem> VDataItemVector;
30//typedef unsigned long Time_t;
31typedef long Time_t;
32class VData {
33public:
34 const static size_t MDC_layers=VDataItem::MDC_layers;
35private:
36
37 std::vector<Time_t> timeVector;
38 VDataItemVector VdataVector;
39 Time_t Boundary_time_High,Boundary_time_Low; // HV SLOWCTRL time
40 VDataItem voltagesStd;
41 int time_offset;
42
43public:
44 VData();
45 void setVoltagesStd(VDataItem voltagesStd){this->voltagesStd=voltagesStd;}
46 VDataItem getVoltageStd(){return this->voltagesStd;}
47 void push_back_sorted(Time_t time_HV_SLOWCTRL, const VDataItem &data);
49 if (timeVector.size() >= 1) {
50 Boundary_time_High = timeVector[timeVector.size() - 1];
51 Boundary_time_Low = timeVector[0];
52 }
53 }
54 size_t size(){return timeVector.size();}
55 Time_t getUpperBoundaryEventTime(){return this->Boundary_time_High-time_offset;}
56 Time_t getLowerBoundaryEventTime(){return this->Boundary_time_Low-time_offset;}
58 std::vector<Time_t>& getTimeVector(){return timeVector;}
59 VDataItemVector & getVDataItemVector(){return VdataVector;}
60 double getVoltage(Time_t time, int layer){return getVoltage(time)[layer-1];}
62 double getAvgDrop(Time_t time);
64 double getOffsetEvt2Db(){return time_offset;}
65 void setOffsetEvt2Db(int time_offset){time_offset=time_offset;}
66 void clear();
67 bool isValid(Time_t time)const;
68
69
70};
71
72#endif
TTree * data
Double_t time
long Time_t
Definition VData.h:31
std::vector< VDataItem > VDataItemVector
Definition VData.h:29
Definition VData.h:32
VDataItem getVoltageStd()
Definition VData.h:46
bool isValid(Time_t time) const
Definition VData.cxx:17
double getAvgDrop(Time_t time)
Definition VData.cxx:89
Time_t getUpperBoundaryEventTime()
Definition VData.h:55
std::vector< Time_t > & getTimeVector()
Definition VData.h:58
void push_back_sorted(Time_t time_HV_SLOWCTRL, const VDataItem &data)
add a entry to our cache. the entry has to be pushed back in ascending order, with no gap....
Definition VData.cxx:110
double getVoltage(Time_t time, int layer)
Definition VData.h:60
double getAvgDropButVeryDrop(Time_t time)
Definition VData.cxx:95
VDataItem getVoltage(Time_t time)
Definition VData.cxx:31
VDataItemVector & getVDataItemVector()
Definition VData.h:59
Time_t getLowerBoundaryEventTime()
Definition VData.h:56
void clear()
throw all cached data. next time you might have to prepare cache again..
Definition VData.cxx:73
void updateBoundary()
Definition VData.h:48
double getOffsetEvt2Db()
Definition VData.h:64
static const size_t MDC_layers
Definition VData.h:34
void setOffsetEvt2Db(int time_offset)
Definition VData.h:65
VDataItem getDrop(Time_t time)
Definition VData.cxx:81
size_t size()
Definition VData.h:54
VData()
Definition VData.cxx:55
void setVoltagesStd(VDataItem voltagesStd)
Definition VData.h:45
double data[MDC_layers]
Definition VData.h:21
static const size_t MDC_layers
Definition VData.h:20
double & operator[](int i)
Definition VData.h:22
static VDataItem fromArray(const double *item)
Definition VData.cxx:121
static size_t size()
Definition VData.h:23