54 {
55
56 MsgStream log(
msgSvc(),
"TreeTofCalibDataCnv" );
57 log << MSG::DEBUG << "SetProperty" << endmsg;
58
59 TreeAddress* add = dynamic_cast<TreeAddress*>( addr );
60
61 DatabaseRecord* records = add->
pp();
62
63 TBufferFile* buf1 = new TBufferFile( TBuffer::kRead );
64 TBufferFile* buf2 = new TBufferFile( TBuffer::kRead );
65 TBufferFile* buf3 = new TBufferFile( TBuffer::kRead );
66 TBufferFile* buf4 = new TBufferFile( TBuffer::kRead );
67 TBufferFile* buf5 = 0;
68 TBufferFile* buf6 = 0;
69
70 buf1->SetBuffer( ( *records )["BarTofPar"], 2048000, kFALSE );
71 buf2->SetBuffer( ( *records )["EndTofPar"], 2048000, kFALSE );
72 buf3->SetBuffer( ( *records )["TofConPar"], 2048000, kFALSE );
73 buf4->SetBuffer( ( *records )["BarTof"], 2048000, kFALSE );
74 if ( ( *records )["EtfTofPar"] )
75 {
76 buf5 = new TBufferFile( TBuffer::kRead );
77 buf5->SetBuffer( ( *records )["EtfTofPar"], 2048000, kFALSE );
78 }
79 if ( ( *records )["EtfTofBunch"] )
80 {
81 buf6 = new TBufferFile( TBuffer::kRead );
82 buf6->SetBuffer( ( *records )["EtfTofBunch"], 2048000, kFALSE );
83 }
84
85 std::cout << " SftVer is " << ( *records )["SftVer"];
86 std::cout << " CalVerSft is " << ( *records )["CalParVer"];
87 std::cout << " File name is " << ( *records )["FileName"] << std::endl;
88
89 TTree* btoftree = new TTree();
90 TTree* etoftree = new TTree();
91 TTree* etftree = new TTree();
92 TTree* etfbunchtree = new TTree();
93 TTree* btofcommontree = new TTree();
94 TTree* CalibInfo = new TTree();
95
96 btoftree->Streamer( *buf1 );
97 etoftree->Streamer( *buf2 );
98 btofcommontree->Streamer( *buf3 );
99 CalibInfo->Streamer( *buf4 );
100 if ( buf5 ) { etftree->Streamer( *buf5 ); }
101
102 if ( buf6 ) { etfbunchtree->Streamer( *buf6 ); }
103
104 CalibData::bTofCalibBase bTof;
105 CalibData::eTofCalibBase eTof;
106 CalibData::etfCalibBase etf;
107 CalibData::etfBunchCalibBase etfBunch;
108 CalibData::bTofCommonCalibBase bTofCommon;
109 CalibData::tofCalibInfoBase tofinfo;
110
111 std::vector<CalibData::bTofCalibBase> tmpbTof;
112 std::vector<CalibData::eTofCalibBase> tmpeTof;
113 std::vector<CalibData::etfCalibBase> tmpetf;
114 std::vector<CalibData::etfBunchCalibBase> tmpetfBunch;
115 std::vector<CalibData::bTofCommonCalibBase> tmpbTofCommon;
116 std::vector<CalibData::tofCalibInfoBase> tofinfoCol;
117
118
119 int cnt;
120
136
137 char brname[10];
138 for (
unsigned int i = 0; i <
nBarAtten; i++ )
139 {
140 sprintf( brname,
"Atten%i", i );
141 btoftree->SetBranchAddress( brname, &cnvBarAtten[i] );
142 }
143 for (
unsigned int i = 0; i <
nBarSpeed; i++ )
144 {
145 sprintf( brname,
"Speed%i", i );
146 btoftree->SetBranchAddress( brname, &cnvBarSpeed[i] );
147 }
148 for (
unsigned int i = 0; i <
nBarPar; i++ )
149 {
151 btoftree->SetBranchAddress( brname, &cnvBarPar1[i] );
152 }
153 for (
unsigned int i = 0; i <
nBarPar; i++ )
154 {
156 btoftree->SetBranchAddress( brname, &cnvBarPar2[i] );
157 }
158 for (
unsigned int i = 0; i <
nBarParOff; i++ )
159 {
160 sprintf( brname,
"Bunch0_Poff%i", i );
161 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch0[i] );
162 }
163 for (
unsigned int i = 0; i <
nBarParOff; i++ )
164 {
166 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch0[i] );
167 }
168 for (
unsigned int i = 0; i <
nBarParOff; i++ )
169 {
170 sprintf( brname,
"Bunch1_Poff%i", i );
171 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch1[i] );
172 }
173 for (
unsigned int i = 0; i <
nBarParOff; i++ )
174 {
176 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch1[i] );
177 }
178 for (
unsigned int i = 0; i <
nBarParOff; i++ )
179 {
180 sprintf( brname,
"Bunch2_Poff%i", i );
181 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch2[i] );
182 }
183 for (
unsigned int i = 0; i <
nBarParOff; i++ )
184 {
186 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch2[i] );
187 }
188 for (
unsigned int i = 0; i <
nBarParOff; i++ )
189 {
190 sprintf( brname,
"Bunch3_Poff%i", i );
191 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch3[i] );
192 }
193 for (
unsigned int i = 0; i <
nBarParOff; i++ )
194 {
196 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch3[i] );
197 }
198 for (
unsigned int i = 0; i <
nBarSigma; i++ )
199 {
200 sprintf( brname,
"FLeft%i", i );
201 btoftree->SetBranchAddress( brname, &cnvFLeft[i] );
202 }
203 for (
unsigned int i = 0; i <
nBarSigma; i++ )
204 {
205 sprintf( brname,
"FRight%i", i );
206 btoftree->SetBranchAddress( brname, &cnvFRight[i] );
207 }
208 for (
unsigned int i = 0; i <
nBarSigCnt; i++ )
209 {
210 sprintf( brname,
"FCounter%i", i );
211 btoftree->SetBranchAddress( brname, &cnvFCount[i] );
212 }
213
214 unsigned int btofN =
215 btoftree->GetEntries();
216 for ( cnt = 0; cnt < btofN; cnt++ )
217 {
218 btoftree->GetEntry( cnt );
221 bTof.
setP1( cnvBarPar1 );
222 bTof.
setP2( cnvBarPar2 );
234 tmpbTof.push_back( bTof );
235 }
236
237
242
243 char ecname[10];
244 for (
unsigned int i = 0; i <
nEndAtten; i++ )
245 {
246 sprintf( ecname,
"Atten%i", i );
247 etoftree->SetBranchAddress( ecname, &cnvEndAtten[i] );
248 }
249 for (
unsigned int i = 0; i <
nEndSpeed; i++ )
250 {
251 sprintf( ecname,
"Speed%i", i );
252 etoftree->SetBranchAddress( ecname, &cnvEndSpeed[i] );
253 }
254 for (
unsigned int i = 0; i <
nEndPar; i++ )
255 {
257 etoftree->SetBranchAddress( ecname, &cnvEndPar[i] );
258 }
259 for (
unsigned int i = 0; i <
nEndSigma; i++ )
260 {
261 sprintf( ecname,
"FCounter%i", i );
262 etoftree->SetBranchAddress( ecname, &cnvEndFPar[i] );
263 }
264
265 unsigned int etofN =
266 etoftree->GetEntries();
267 for ( cnt = 0; cnt < etofN; cnt++ )
268 {
269 etoftree->GetEntry( cnt );
272 eTof.
setP( cnvEndPar );
273 eTof.
setFP( cnvEndFPar );
274 tmpeTof.push_back( eTof );
275 }
276
277
278 if ( etftree->GetEntries() != 0 )
279 {
280
285
286 char etfname[10];
287 for (
unsigned int i = 0; i <
nEtfSpeed; i++ )
288 {
289 sprintf( etfname,
"Speed%i", i );
290 etftree->SetBranchAddress( etfname, &cnvEtfSpeed[i] );
291 }
292 for (
unsigned int i = 0; i <
nEtfPar; i++ )
293 {
295 etftree->SetBranchAddress( etfname, &cnvEtfPar[i] );
297 etftree->SetBranchAddress( etfname, &cnvEtfPar1[i] );
299 etftree->SetBranchAddress( etfname, &cnvEtfPar2[i] );
300 }
301
302 unsigned int etfN =
303 etftree->GetEntries();
304 for ( cnt = 0; cnt < etfN; cnt++ )
305 {
306 etftree->GetEntry( cnt );
308 etf.
setP( cnvEtfPar );
309 etf.
setP1( cnvEtfPar1 );
310 etf.
setP2( cnvEtfPar2 );
311 tmpetf.push_back( etf );
312 }
313 }
314
315
316 if ( etfbunchtree->GetEntries() != 0 )
317 {
319 char etfbunchname[10];
320 for (
unsigned int i = 0; i <
nEtfBunch; i++ )
321 {
322 sprintf( etfbunchname,
"pbunch%i", i );
323 etfbunchtree->SetBranchAddress( etfbunchname, &cnvEtfBunchP[i] );
324 }
325 int entries = etfbunchtree->GetEntries();
326 for ( cnt = 0; cnt < entries; cnt++ )
327 {
328 etfbunchtree->GetEntry( cnt );
330 tmpetfBunch.push_back( etfBunch );
331 }
332 }
333
334
337 for (
unsigned int i = 0; i <
nBarSigCor; i++ )
338 {
339 sprintf( brname,
"sigmaCorr%i", i );
340 btofcommontree->SetBranchAddress( brname, &cnvBarSigCor[i] );
341 }
342 for (
unsigned int i = 0; i <
nBarOffset; i++ )
343 {
344 sprintf( brname,
"t0offset%i", i );
345 btofcommontree->SetBranchAddress( brname, &cnvBarOffset[i] );
346 }
347
348 int entries = btofcommontree->GetEntries();
349 for ( cnt = 0; cnt < entries; cnt++ )
350 {
351 btofcommontree->GetEntry( cnt );
354 tmpbTofCommon.push_back( bTofCommon );
355 }
356
357 int m_runFrom, m_runTo, m_eventFrom, m_eventTo;
358 int m_run1, m_run2, m_version;
359 int m_qCorr, m_qElec, m_misLable;
360 int m_tofidEast[5], m_tofidWest[5], m_tofidEndcap[5];
361
362 if ( CalibInfo->GetBranchStatus( "runFrom" ) )
363 {
364 CalibInfo->SetBranchAddress( "runFrom", &m_runFrom );
365 CalibInfo->SetBranchAddress( "runTo", &m_runTo );
366 CalibInfo->SetBranchAddress( "eventFrom", &m_eventFrom );
367 CalibInfo->SetBranchAddress( "eventTo", &m_eventTo );
368 }
369 else
370 {
371 m_runFrom = -1;
372 m_runTo = -1;
373 m_eventFrom = -1;
374 m_eventTo = -1;
375 }
376 CalibInfo->SetBranchAddress( "Run1", &m_run1 );
377 CalibInfo->SetBranchAddress( "Run2", &m_run2 );
378 CalibInfo->SetBranchAddress( "Version", &m_version );
379 CalibInfo->SetBranchAddress( "ebrId0", &m_tofidEast[0] );
380 CalibInfo->SetBranchAddress( "ebrId1", &m_tofidEast[1] );
381 CalibInfo->SetBranchAddress( "ebrId2", &m_tofidEast[2] );
382 CalibInfo->SetBranchAddress( "ebrId3", &m_tofidEast[3] );
383 CalibInfo->SetBranchAddress( "ebrId4", &m_tofidEast[4] );
384 CalibInfo->SetBranchAddress( "ecId0", &m_tofidEndcap[0] );
385 CalibInfo->SetBranchAddress( "ecId1", &m_tofidEndcap[1] );
386 CalibInfo->SetBranchAddress( "ecId2", &m_tofidEndcap[2] );
387 CalibInfo->SetBranchAddress( "ecId3", &m_tofidEndcap[3] );
388 CalibInfo->SetBranchAddress( "ecId4", &m_tofidEndcap[4] );
389 CalibInfo->SetBranchAddress( "wbrId0", &m_tofidWest[0] );
390 CalibInfo->SetBranchAddress( "wbrId1", &m_tofidWest[1] );
391 CalibInfo->SetBranchAddress( "wbrId2", &m_tofidWest[2] );
392 CalibInfo->SetBranchAddress( "wbrId3", &m_tofidWest[3] );
393 CalibInfo->SetBranchAddress( "wbrId4", &m_tofidWest[4] );
394 CalibInfo->SetBranchAddress( "misLable", &m_misLable );
395 CalibInfo->SetBranchAddress( "qCorr", &m_qCorr );
396 CalibInfo->SetBranchAddress( "qElec", &m_qElec );
397
398 entries = CalibInfo->GetEntries();
399 for ( cnt = 0; cnt < entries; cnt++ )
400 {
401 CalibInfo->GetEntry( cnt );
415 tofinfoCol.push_back( tofinfo );
416 }
417
418 CalibData::TofCalibData* tmpObject = new CalibData::TofCalibData(
419 tmpbTof, tmpbTofCommon, tmpeTof, tmpetf, tmpetfBunch, tofinfoCol );
420
421 refpObject = tmpObject;
422 delete btoftree;
423 delete etoftree;
424 delete etftree;
425 delete etfbunchtree;
426 delete btofcommontree;
427 delete CalibInfo;
428
429 return StatusCode::SUCCESS;
430}
sprintf(cut, "kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_" "pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
const unsigned int nBarOffset
const unsigned int nBarParOff
const unsigned int nEndPar
const unsigned int nEtfPar
const unsigned int nBarPar
const unsigned int nBarSigma
const unsigned int nEndSigma
const unsigned int nBarSigCor
const unsigned int nEndSpeed
const unsigned int nEtfSpeed
const unsigned int nEtfBunch
const unsigned int nBarSpeed
const unsigned int nEndAtten
const unsigned int nBarAtten
const unsigned int nBarSigCnt
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)
virtual DatabaseRecord * pp()