BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
EsTimeCalibData.cxx
Go to the documentation of this file.
1/** @class EsTimeCalibData
2 * Implementation of EsTimeCalibData calibration TCDS class
3 */
4
6#include "GaudiKernel/MsgStream.h"
7namespace CalibData {
8 EsTimeCalibData::EsTimeCalibData():m_TestCalibConst(0){
9 // if( m_TestCalibConst) { delete m_TestCalibConst; }
10 if( m_toffsetb.size()>0 ) { m_toffsetb.clear(); }
11 if( m_toffsete.size()>0 ) { m_toffsete.clear(); }
12 if( m_bunchtime.size()>0 ) { m_bunchtime.clear(); }
13 if( m_runFrom.size()>0 ) { m_runFrom.clear(); }
14 if( m_runTo.size()>0 ) { m_runTo.clear(); }
15 if( m_eventFrom.size()>0 ) { m_eventFrom.clear(); }
16 if( m_eventTo.size()>0 ) { m_eventTo.clear(); }
17 return;
18 }
19
20 StatusCode EsTimeCalibData::update(CalibBase1& other, MsgStream* log) {
21 EsTimeCalibData& other1 = dynamic_cast<EsTimeCalibData& >(other);
22 std::cout<<"========================================"<<"\n"
23 <<"here is the update in the EsTimeCalibData"<<"\n"
24 <<"=================================================="<<std::endl;
25 CalibBase1::update(other, log);
26 //set the Calibration Data
27 if( m_TestCalibConst) { delete m_TestCalibConst; }
28 if( m_toffsetb.size()>0 ) { m_toffsetb.clear(); }
29 if( m_toffsete.size()>0 ) { m_toffsete.clear(); }
30 if( m_bunchtime.size()>0 ) { m_bunchtime.clear(); }
31 if( m_runFrom.size()>0 ) { m_runFrom.clear(); }
32 if( m_runTo.size()>0 ) { m_runTo.clear(); }
33 if( m_eventFrom.size()>0 ) { m_eventFrom.clear(); }
34 if( m_eventTo.size()>0 ) { m_eventTo.clear(); }
35
36 m_TestCalibConst = new vector<double>(*other1.m_TestCalibConst);
37 m_toffsetb = other1.m_toffsetb;
38 m_toffsete = other1.m_toffsete;
39 m_bunchtime = other1.m_bunchtime;
40 m_runFrom = other1.m_runFrom;
41 m_runTo = other1.m_runTo;
42 m_eventFrom = other1.m_eventFrom;
43 m_eventTo = other1.m_eventTo;
44
45 return StatusCode::SUCCESS;
46 }
47
48 //set the Calibdata of EsTime
49 void EsTimeCalibData::setTestCalibConst(const vector<double>* TestCalibConst) {
50 if(m_TestCalibConst) delete m_TestCalibConst;
51 m_TestCalibConst = new vector<double>(*TestCalibConst);
52 }
53
54 //set time of offset
55 void EsTimeCalibData::setToffsetb(const double toffset) {
56 m_toffsetb.push_back( toffset );
57 return;
58 }
59
60 void EsTimeCalibData::setToffsete(const double toffset) {
61 m_toffsete.push_back( toffset );
62 return;
63 }
64
65 //set the time interval of each bunch
66 void EsTimeCalibData::setBunchTime(const int bunchtime) {
67 m_bunchtime.push_back( bunchtime );
68 return;
69 }
70
71 void EsTimeCalibData::setRunFrom(const int runFrom) {
72 m_runFrom.push_back( runFrom );
73 return;
74 }
75
76 void EsTimeCalibData::setRunTo(const int runTo) {
77 m_runTo.push_back( runTo );
78 return;
79 }
80
81 void EsTimeCalibData::setEventFrom(const int eventFrom) {
82 m_eventFrom.push_back( eventFrom );
83 return;
84 }
85
86 void EsTimeCalibData::setEventTo(const int eventTo) {
87 m_eventTo.push_back( eventTo );
88 return;
89 }
90
92 return getToffsetb(0);
93 }
94
95 double EsTimeCalibData::getToffsetb(unsigned int No) {
96 double toffsetb = 0.0;
97 if( m_toffsetb.size() != 0 ) {
98 vector<double>::iterator it = m_toffsetb.begin() + No;
99 toffsetb = (*it);
100 }
101 return toffsetb;
102 }
103
105 return getToffsete(0);
106 }
107
108 double EsTimeCalibData::getToffsete(unsigned int No) {
109 double toffsete = 0.0;
110 if( m_toffsete.size() != 0 ) {
111 vector<double>::iterator it = m_toffsete.begin() + No;
112 toffsete = (*it);
113 }
114 return toffsete;
115 }
116
118 return getBunchTime(0);
119 }
120
121 double EsTimeCalibData::getBunchTime(unsigned int No) {
122 double bunchtime = 0.0;
123 if( m_bunchtime.size() != 0 ) {
124 vector<int>::iterator it = m_bunchtime.begin() + No;
125 bunchtime = (*it);
126 }
127 return bunchtime;
128 }
129
131 return getRunFrom(0);
132 }
133
134 int EsTimeCalibData::getRunFrom(unsigned int No) {
135 int runFrom = 0.0;
136 if( m_runFrom.size() != 0 ) {
137 vector<int>::iterator it = m_runFrom.begin() + No;
138 runFrom = (*it);
139 }
140 return runFrom;
141 }
142
144 return getRunTo(0);
145 }
146
147 int EsTimeCalibData::getRunTo(unsigned int No) {
148 int runTo = 0.0;
149 if( m_runTo.size() != 0 ) {
150 vector<int>::iterator it = m_runTo.begin() + No;
151 runTo = (*it);
152 }
153 return runTo;
154 }
155
156 int EsTimeCalibData::getEventFrom(unsigned int No) {
157 int eventFrom = 0.0;
158 if( m_eventFrom.size() != 0 ) {
159 vector<int>::iterator it = m_eventFrom.begin() + No;
160 eventFrom = (*it);
161 }
162 return eventFrom;
163 }
164
166 return getEventTo(0);
167 }
168
169 int EsTimeCalibData::getEventTo(unsigned int No) {
170 int eventTo = 0.0;
171 if( m_eventTo.size() != 0 ) {
172 vector<int>::iterator it = m_eventTo.begin() + No;
173 eventTo = (*it);
174 }
175 return eventTo;
176 }
177
178}
virtual StatusCode update(CalibBase1 &obj, MsgStream *)
Definition: CalibBase1.cxx:33
void setRunFrom(const int runFrom)
void setEventTo(const int eventTo)
void setToffsetb(const double toffsetb)
void setEventFrom(const int eventFrom)
virtual StatusCode update(CalibBase1 &other, MsgStream *log)
void setBunchTime(const int bunchtime)
void setTestCalibConst(const vector< double > *TestCalibConst)
void setRunTo(const int runTo)
void setToffsete(const double toffsete)