Create the transient representation of an object, given an opaque address. This and the following update method comprise the core functionality of calibration converters. Convenience routine used by most CAL calibration types, which have a <dimension> element describing how the remainder of the Data is laid out. Read from TDS; store information internally in protected members.
Given a pointer to a TDS object which can be cast to "our" type, fill in corresponding information in the corresponding root class
65 {
66
67 MsgStream log(
msgSvc(),
"RootTofCalibDataCnv");
68 log<<MSG::DEBUG<<"SetProperty"<<endreq;
69
70
72 if(!sc)
73 { log<<MSG::ERROR<<"unable to open files"<<endreq;
74 }
75
82
83 std::vector<CalibData::bTofCalibBase> tmpbTof;
84 std::vector<CalibData::eTofCalibBase> tmpeTof;
85 std::vector<CalibData::etfCalibBase> tmpetf;
86 std::vector<CalibData::etfBunchCalibBase> tmpetfBunch;
87 std::vector<CalibData::bTofCommonCalibBase> tmpbTofCommon;
88 std::vector<CalibData::tofCalibInfoBase> tofinfoCol;
89
90 int cnt;
91
92
108
109 TTree *btoftree = (TTree*)
m_inFile -> Get(
"BarTofPar");
110
111 char brname[10];
112 for(
unsigned int i=0; i<
nBarAtten; i++ ) {
113 sprintf( brname,
"Atten%i", i );
115 }
116 for(
unsigned int i=0; i<
nBarSpeed; i++ ) {
117 sprintf( brname,
"Speed%i", i );
119 }
120 for(
unsigned int i=0; i<
nBarPar; i++ ) {
123 }
124 for(
unsigned int i=0; i<
nBarPar; i++ ) {
127 }
129 sprintf( brname,
"Bunch0_Poff%i", i );
131 }
135 }
137 sprintf( brname,
"Bunch1_Poff%i", i );
139 }
143 }
145 sprintf( brname,
"Bunch2_Poff%i", i );
147 }
151 }
153 sprintf( brname,
"Bunch3_Poff%i", i );
155 }
159 }
160 for(
unsigned int i=0; i<
nBarSigma; i++ ) {
161 sprintf( brname,
"FLeft%i", i );
163 }
164 for(
unsigned int i=0; i<
nBarSigma; i++ ) {
165 sprintf( brname,
"FRight%i", i );
167 }
169 sprintf( brname,
"FCounter%i", i );
171 }
172
173 for(cnt=0; cnt<btoftree->GetEntries(); cnt++){
177 bTof.
setP1( cnvBarPar1 );
178 bTof.
setP2( cnvBarPar2 );
190 tmpbTof.push_back(bTof);
191 }
192
193
198
199 TTree *etoftree = (TTree*)
m_inFile -> Get(
"EndTofPar");
200
201 char ecname[10];
202 for(
unsigned int i=0; i<
nEndAtten; i++ ) {
203 sprintf( ecname,
"Atten%i", i );
205 }
206 for(
unsigned int i=0; i<
nEndSpeed; i++ ) {
207 sprintf( ecname,
"Speed%i", i );
209 }
210 for(
unsigned int i=0; i<
nEndPar; i++ ) {
213 }
214 for(
unsigned int i=0; i<
nEndSigma; i++ ) {
215 sprintf( ecname,
"FCounter%i", i );
217 }
218
219 for(cnt=0; cnt<etoftree->GetEntries(); cnt++){
223 eTof.
setP( cnvEndPar );
224 eTof.
setFP( cnvEndFPar );
225 tmpeTof.push_back(eTof);
226 }
227
228
233
234 if( NULL!=
m_inFile->Get(
"EtfTofPar") ) {
235 TTree *etftree = (TTree*)
m_inFile -> Get(
"EtfTofPar");
236
237 char etfname[10];
238 for(
unsigned int i=0; i<
nEtfSpeed; i++ ) {
239 sprintf( etfname,
"Speed%i", i );
241 }
242 for(
unsigned int i=0; i<
nEtfPar; i++ ) {
245 }
246 for(
unsigned int i=0; i<
nEtfPar; i++ ) {
249 }
250 for(
unsigned int i=0; i<
nEtfPar; i++ ) {
253 }
254
255 for(cnt=0; cnt<etftree->GetEntries(); cnt++){
258 etf.
setP( cnvEtfPar );
259 etf.
setP1( cnvEtfPar1 );
260 etf.
setP2( cnvEtfPar2 );
261 tmpetf.push_back(etf);
262 }
263 }
264
265
267
268 if( NULL!=
m_inFile->Get(
"EtfTofBunch") ) {
269 TTree *etfbunchtree = (TTree*)
m_inFile -> Get(
"EtfTofBunch");
270
271 char etfbunchname[10];
272 for(
unsigned int i=0; i<
nEtfBunch; i++ ) {
273 sprintf( etfbunchname,
"pbunch%i", i );
275 }
276
277 int entries= etfbunchtree->GetEntries();
278 for(cnt=0;cnt<entries;cnt++){
281 tmpetfBunch.push_back( etfBunch );
282 }
283 }
284
285
288 TTree *btofcommontree = (TTree*)
m_inFile -> Get(
"BarTofParCommon");
290 sprintf( brname,
"sigmaCorr%i", i );
292 }
294 sprintf( brname,
"t0offset%i", i );
296 }
297
298 int entries = btofcommontree->GetEntries();
299 for(cnt=0;cnt<entries;cnt++){
300 btofcommontree->GetEntry(cnt);
303 tmpbTofCommon.push_back(bTofCommon);
304 }
305
306 int m_run1, m_run2, m_version;
307 int m_qCorr, m_qElec, m_misLable;
308 int m_tofidEast[5], m_tofidWest[5], m_tofidEndcap[5];
309 int m_runFrom, m_runTo, m_eventFrom, m_eventTo;
310
311 TTree *CalibInfo = (TTree*)
m_inFile -> Get(
"CalibInfo");
312 CalibInfo->SetBranchAddress("Run1", &m_run1 );
313 CalibInfo->SetBranchAddress("Run2", &m_run2 );
314 CalibInfo->SetBranchAddress("Version", &m_version );
315 CalibInfo->SetBranchAddress("ebrId0", &m_tofidEast[0] );
316 CalibInfo->SetBranchAddress("ebrId1", &m_tofidEast[1] );
317 CalibInfo->SetBranchAddress("ebrId2", &m_tofidEast[2] );
318 CalibInfo->SetBranchAddress("ebrId3", &m_tofidEast[3] );
319 CalibInfo->SetBranchAddress("ebrId4", &m_tofidEast[4] );
320 CalibInfo->SetBranchAddress("ecId0", &m_tofidEndcap[0] );
321 CalibInfo->SetBranchAddress("ecId1", &m_tofidEndcap[1] );
322 CalibInfo->SetBranchAddress("ecId2", &m_tofidEndcap[2] );
323 CalibInfo->SetBranchAddress("ecId3", &m_tofidEndcap[3] );
324 CalibInfo->SetBranchAddress("ecId4", &m_tofidEndcap[4] );
325 CalibInfo->SetBranchAddress("wbrId0", &m_tofidWest[0] );
326 CalibInfo->SetBranchAddress("wbrId1", &m_tofidWest[1] );
327 CalibInfo->SetBranchAddress("wbrId2", &m_tofidWest[2] );
328 CalibInfo->SetBranchAddress("wbrId3", &m_tofidWest[3] );
329 CalibInfo->SetBranchAddress("wbrId4", &m_tofidWest[4] );
330 CalibInfo->SetBranchAddress("misLable",&m_misLable );
331 CalibInfo->SetBranchAddress("qCorr", &m_qCorr );
332 CalibInfo->SetBranchAddress("qElec", &m_qElec );
333 if( CalibInfo->GetBranchStatus("runFrom") ){
334 CalibInfo->SetBranchAddress("runFrom", &m_runFrom );
335 CalibInfo->SetBranchAddress("runTo", &m_runTo );
336 CalibInfo->SetBranchAddress("eventFrom", &m_eventFrom );
337 CalibInfo->SetBranchAddress("eventTo", &m_eventTo );
338 }
339 else {
340 m_runFrom = -1;
341 m_runTo = -1;
342 m_eventFrom = -1;
343 m_eventTo = -1;
344 }
345
346 entries= CalibInfo->GetEntries();
347 for(cnt=0;cnt<entries;cnt++){
348 CalibInfo->GetEntry(cnt);
362 tofinfoCol.push_back(tofinfo);
363 }
364
366
367 refpObject=tmpObject;
368
369 return StatusCode::SUCCESS;
370}
data SetBranchAddress("time",&time)
const unsigned int nBarOffset
const unsigned int nBarSigCor
void setP2(const double *TofP2)
void setPoff1_bunch3(const double *TofPoff1_bunch3)
void setFPleft(const double *FP1)
void setPoff2_bunch1(const double *TofPoff2_bunch1)
void setSpeed(const double *Speed)
void setAtten(const double *Atten)
void setPoff1_bunch0(const double *TofPoff1_bunch0)
void setPoff2_bunch2(const double *TofPoff2_bunch2)
void setPoff1_bunch1(const double *TofPoff1_bunch1)
void setFPcounter(const double *FP3)
void setPoff1_bunch2(const double *TofPoff1_bunch2)
void setPoff2_bunch3(const double *TofPoff2_bunch3)
void setFPright(const double *FP2)
void setPoff2_bunch0(const double *TofPoff2_bunch0)
void setP1(const double *TofP1)
void setSigmaCorr(const double *sigmaCorr)
void setOffset(const double *offset)
void setAtten(const double *Atten)
void setP(const double *TofP)
void setFP(const double *FP)
void setSpeed(const double *Speed)
void setPBunch(const double *etfBunchP)
void setSpeed(const double *Speed)
void setP(const double *etfP)
void setP1(const double *etfP1)
void setP2(const double *etfP2)
void setRunFrom(const int runFrom)
void setBrWest(const int *tofidWest)
void setRunEnd(const int run2)
void setVersion(const int version)
void setMisLable(const int misLable)
void setRunBegin(const int run1)
void setEventTo(const int eventTo)
void setRunTo(const int runTo)
void setBrEast(const int *tofidEast)
void setQElec(const int qElec)
void setEventFrom(const int eventFrom)
void setQCorr(const int qCorr)
void setEndcap(const int *tofidEndcap)
StatusCode openRead(const std::string &fname)