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
59 {
60
61 MsgStream log(
msgSvc(),
"RootTofCalibDataCnv" );
62 log << MSG::DEBUG << "SetProperty" << endmsg;
63
64
66 if ( !sc ) { log << MSG::ERROR << "unable to open files" << endmsg; }
67
68 CalibData::bTofCalibBase bTof;
69 CalibData::eTofCalibBase eTof;
70 CalibData::etfCalibBase etf;
71 CalibData::etfBunchCalibBase etfBunch;
72 CalibData::bTofCommonCalibBase bTofCommon;
73 CalibData::tofCalibInfoBase tofinfo;
74
75 std::vector<CalibData::bTofCalibBase> tmpbTof;
76 std::vector<CalibData::eTofCalibBase> tmpeTof;
77 std::vector<CalibData::etfCalibBase> tmpetf;
78 std::vector<CalibData::etfBunchCalibBase> tmpetfBunch;
79 std::vector<CalibData::bTofCommonCalibBase> tmpbTofCommon;
80 std::vector<CalibData::tofCalibInfoBase> tofinfoCol;
81
82 int cnt;
83
84
100
101 TTree* btoftree = (TTree*)
m_inFile->Get(
"BarTofPar" );
102
103 char brname[10];
104 for (
unsigned int i = 0; i <
nBarAtten; i++ )
105 {
106 sprintf( brname,
"Atten%i", i );
107 btoftree->SetBranchAddress( brname, &cnvBarAtten[i] );
108 }
109 for (
unsigned int i = 0; i <
nBarSpeed; i++ )
110 {
111 sprintf( brname,
"Speed%i", i );
112 btoftree->SetBranchAddress( brname, &cnvBarSpeed[i] );
113 }
114 for (
unsigned int i = 0; i <
nBarPar; i++ )
115 {
117 btoftree->SetBranchAddress( brname, &cnvBarPar1[i] );
118 }
119 for (
unsigned int i = 0; i <
nBarPar; i++ )
120 {
122 btoftree->SetBranchAddress( brname, &cnvBarPar2[i] );
123 }
124 for (
unsigned int i = 0; i <
nBarParOff; i++ )
125 {
126 sprintf( brname,
"Bunch0_Poff%i", i );
127 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch0[i] );
128 }
129 for (
unsigned int i = 0; i <
nBarParOff; i++ )
130 {
132 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch0[i] );
133 }
134 for (
unsigned int i = 0; i <
nBarParOff; i++ )
135 {
136 sprintf( brname,
"Bunch1_Poff%i", i );
137 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch1[i] );
138 }
139 for (
unsigned int i = 0; i <
nBarParOff; i++ )
140 {
142 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch1[i] );
143 }
144 for (
unsigned int i = 0; i <
nBarParOff; i++ )
145 {
146 sprintf( brname,
"Bunch2_Poff%i", i );
147 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch2[i] );
148 }
149 for (
unsigned int i = 0; i <
nBarParOff; i++ )
150 {
152 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch2[i] );
153 }
154 for (
unsigned int i = 0; i <
nBarParOff; i++ )
155 {
156 sprintf( brname,
"Bunch3_Poff%i", i );
157 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch3[i] );
158 }
159 for (
unsigned int i = 0; i <
nBarParOff; i++ )
160 {
162 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch3[i] );
163 }
164 for (
unsigned int i = 0; i <
nBarSigma; i++ )
165 {
166 sprintf( brname,
"FLeft%i", i );
167 btoftree->SetBranchAddress( brname, &cnvFLeft[i] );
168 }
169 for (
unsigned int i = 0; i <
nBarSigma; i++ )
170 {
171 sprintf( brname,
"FRight%i", i );
172 btoftree->SetBranchAddress( brname, &cnvFRight[i] );
173 }
174 for (
unsigned int i = 0; i <
nBarSigCnt; i++ )
175 {
176 sprintf( brname,
"FCounter%i", i );
177 btoftree->SetBranchAddress( brname, &cnvFCount[i] );
178 }
179
180 for ( cnt = 0; cnt < btoftree->GetEntries(); cnt++ )
181 {
182 btoftree->GetEntry( cnt );
185 bTof.
setP1( cnvBarPar1 );
186 bTof.
setP2( cnvBarPar2 );
198 tmpbTof.push_back( bTof );
199 }
200
201
206
207 TTree* etoftree = (TTree*)
m_inFile->Get(
"EndTofPar" );
208
209 char ecname[10];
210 for (
unsigned int i = 0; i <
nEndAtten; i++ )
211 {
212 sprintf( ecname,
"Atten%i", i );
213 etoftree->SetBranchAddress( ecname, &cnvEndAtten[i] );
214 }
215 for (
unsigned int i = 0; i <
nEndSpeed; i++ )
216 {
217 sprintf( ecname,
"Speed%i", i );
218 etoftree->SetBranchAddress( ecname, &cnvEndSpeed[i] );
219 }
220 for (
unsigned int i = 0; i <
nEndPar; i++ )
221 {
223 etoftree->SetBranchAddress( ecname, &cnvEndPar[i] );
224 }
225 for (
unsigned int i = 0; i <
nEndSigma; i++ )
226 {
227 sprintf( ecname,
"FCounter%i", i );
228 etoftree->SetBranchAddress( ecname, &cnvEndFPar[i] );
229 }
230
231 for ( cnt = 0; cnt < etoftree->GetEntries(); cnt++ )
232 {
233 etoftree->GetEntry( cnt );
236 eTof.
setP( cnvEndPar );
237 eTof.
setFP( cnvEndFPar );
238 tmpeTof.push_back( eTof );
239 }
240
241
246
247 if ( NULL !=
m_inFile->Get(
"EtfTofPar" ) )
248 {
249 TTree* etftree = (TTree*)
m_inFile->Get(
"EtfTofPar" );
250
251 char etfname[10];
252 for (
unsigned int i = 0; i <
nEtfSpeed; i++ )
253 {
254 sprintf( etfname,
"Speed%i", i );
255 etftree->SetBranchAddress( etfname, &cnvEtfSpeed[i] );
256 }
257 for (
unsigned int i = 0; i <
nEtfPar; i++ )
258 {
260 etftree->SetBranchAddress( etfname, &cnvEtfPar[i] );
261 }
262 for (
unsigned int i = 0; i <
nEtfPar; i++ )
263 {
265 etftree->SetBranchAddress( etfname, &cnvEtfPar1[i] );
266 }
267 for (
unsigned int i = 0; i <
nEtfPar; i++ )
268 {
270 etftree->SetBranchAddress( etfname, &cnvEtfPar2[i] );
271 }
272
273 for ( cnt = 0; cnt < etftree->GetEntries(); cnt++ )
274 {
275 etftree->GetEntry( cnt );
277 etf.
setP( cnvEtfPar );
278 etf.
setP1( cnvEtfPar1 );
279 etf.
setP2( cnvEtfPar2 );
280 tmpetf.push_back( etf );
281 }
282 }
283
284
286
287 if ( NULL !=
m_inFile->Get(
"EtfTofBunch" ) )
288 {
289 TTree* etfbunchtree = (TTree*)
m_inFile->Get(
"EtfTofBunch" );
290
291 char etfbunchname[10];
292 for (
unsigned int i = 0; i <
nEtfBunch; i++ )
293 {
294 sprintf( etfbunchname,
"pbunch%i", i );
295 etfbunchtree->SetBranchAddress( etfbunchname, &cnvEtfBunchP[i] );
296 }
297
298 int entries = etfbunchtree->GetEntries();
299 for ( cnt = 0; cnt < entries; cnt++ )
300 {
301 etfbunchtree->GetEntry( cnt );
303 tmpetfBunch.push_back( etfBunch );
304 }
305 }
306
307
310 TTree* btofcommontree = (TTree*)
m_inFile->Get(
"BarTofParCommon" );
311 for (
unsigned int i = 0; i <
nBarSigCor; i++ )
312 {
313 sprintf( brname,
"sigmaCorr%i", i );
314 btofcommontree->SetBranchAddress( brname, &cnvBarSigCor[i] );
315 }
316 for (
unsigned int i = 0; i <
nBarOffset; i++ )
317 {
318 sprintf( brname,
"t0offset%i", i );
319 btofcommontree->SetBranchAddress( brname, &cnvBarOffset[i] );
320 }
321
322 int entries = btofcommontree->GetEntries();
323 for ( cnt = 0; cnt < entries; cnt++ )
324 {
325 btofcommontree->GetEntry( cnt );
328 tmpbTofCommon.push_back( bTofCommon );
329 }
330
331 int m_run1, m_run2, m_version;
332 int m_qCorr, m_qElec, m_misLable;
333 int m_tofidEast[5], m_tofidWest[5], m_tofidEndcap[5];
334 int m_runFrom, m_runTo, m_eventFrom, m_eventTo;
335
336 TTree* CalibInfo = (TTree*)
m_inFile->Get(
"CalibInfo" );
337 CalibInfo->SetBranchAddress( "Run1", &m_run1 );
338 CalibInfo->SetBranchAddress( "Run2", &m_run2 );
339 CalibInfo->SetBranchAddress( "Version", &m_version );
340 CalibInfo->SetBranchAddress( "ebrId0", &m_tofidEast[0] );
341 CalibInfo->SetBranchAddress( "ebrId1", &m_tofidEast[1] );
342 CalibInfo->SetBranchAddress( "ebrId2", &m_tofidEast[2] );
343 CalibInfo->SetBranchAddress( "ebrId3", &m_tofidEast[3] );
344 CalibInfo->SetBranchAddress( "ebrId4", &m_tofidEast[4] );
345 CalibInfo->SetBranchAddress( "ecId0", &m_tofidEndcap[0] );
346 CalibInfo->SetBranchAddress( "ecId1", &m_tofidEndcap[1] );
347 CalibInfo->SetBranchAddress( "ecId2", &m_tofidEndcap[2] );
348 CalibInfo->SetBranchAddress( "ecId3", &m_tofidEndcap[3] );
349 CalibInfo->SetBranchAddress( "ecId4", &m_tofidEndcap[4] );
350 CalibInfo->SetBranchAddress( "wbrId0", &m_tofidWest[0] );
351 CalibInfo->SetBranchAddress( "wbrId1", &m_tofidWest[1] );
352 CalibInfo->SetBranchAddress( "wbrId2", &m_tofidWest[2] );
353 CalibInfo->SetBranchAddress( "wbrId3", &m_tofidWest[3] );
354 CalibInfo->SetBranchAddress( "wbrId4", &m_tofidWest[4] );
355 CalibInfo->SetBranchAddress( "misLable", &m_misLable );
356 CalibInfo->SetBranchAddress( "qCorr", &m_qCorr );
357 CalibInfo->SetBranchAddress( "qElec", &m_qElec );
358 if ( CalibInfo->GetBranchStatus( "runFrom" ) )
359 {
360 CalibInfo->SetBranchAddress( "runFrom", &m_runFrom );
361 CalibInfo->SetBranchAddress( "runTo", &m_runTo );
362 CalibInfo->SetBranchAddress( "eventFrom", &m_eventFrom );
363 CalibInfo->SetBranchAddress( "eventTo", &m_eventTo );
364 }
365 else
366 {
367 m_runFrom = -1;
368 m_runTo = -1;
369 m_eventFrom = -1;
370 m_eventTo = -1;
371 }
372
373 entries = CalibInfo->GetEntries();
374 for ( cnt = 0; cnt < entries; cnt++ )
375 {
376 CalibInfo->GetEntry( cnt );
390 tofinfoCol.push_back( tofinfo );
391 }
392
393 CalibData::TofCalibData* tmpObject = new CalibData::TofCalibData(
394 tmpbTof, tmpbTofCommon, tmpeTof, tmpetf, tmpetfBunch, tofinfoCol );
395
396 refpObject = tmpObject;
397
398 return StatusCode::SUCCESS;
399}
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)