56 MsgStream log(
msgSvc(),
"TreeTofCalibDataCnv" );
57 log << MSG::DEBUG <<
"SetProperty" << endmsg;
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;
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"] )
76 buf5 =
new TBufferFile( TBuffer::kRead );
77 buf5->SetBuffer( ( *records )[
"EtfTofPar"], 2048000, kFALSE );
79 if ( ( *records )[
"EtfTofBunch"] )
81 buf6 =
new TBufferFile( TBuffer::kRead );
82 buf6->SetBuffer( ( *records )[
"EtfTofBunch"], 2048000, kFALSE );
85 std::cout <<
" SftVer is " << ( *records )[
"SftVer"];
86 std::cout <<
" CalVerSft is " << ( *records )[
"CalParVer"];
87 std::cout <<
" File name is " << ( *records )[
"FileName"] << std::endl;
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();
96 btoftree->Streamer( *buf1 );
97 etoftree->Streamer( *buf2 );
98 btofcommontree->Streamer( *buf3 );
99 CalibInfo->Streamer( *buf4 );
100 if ( buf5 ) { etftree->Streamer( *buf5 ); }
102 if ( buf6 ) { etfbunchtree->Streamer( *buf6 ); }
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;
138 for (
unsigned int i = 0; i <
nBarAtten; i++ )
140 sprintf( brname,
"Atten%i", i );
141 btoftree->SetBranchAddress( brname, &cnvBarAtten[i] );
143 for (
unsigned int i = 0; i <
nBarSpeed; i++ )
145 sprintf( brname,
"Speed%i", i );
146 btoftree->SetBranchAddress( brname, &cnvBarSpeed[i] );
148 for (
unsigned int i = 0; i <
nBarPar; i++ )
151 btoftree->SetBranchAddress( brname, &cnvBarPar1[i] );
153 for (
unsigned int i = 0; i <
nBarPar; i++ )
156 btoftree->SetBranchAddress( brname, &cnvBarPar2[i] );
158 for (
unsigned int i = 0; i <
nBarParOff; i++ )
160 sprintf( brname,
"Bunch0_Poff%i", i );
161 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch0[i] );
163 for (
unsigned int i = 0; i <
nBarParOff; i++ )
166 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch0[i] );
168 for (
unsigned int i = 0; i <
nBarParOff; i++ )
170 sprintf( brname,
"Bunch1_Poff%i", i );
171 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch1[i] );
173 for (
unsigned int i = 0; i <
nBarParOff; i++ )
176 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch1[i] );
178 for (
unsigned int i = 0; i <
nBarParOff; i++ )
180 sprintf( brname,
"Bunch2_Poff%i", i );
181 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch2[i] );
183 for (
unsigned int i = 0; i <
nBarParOff; i++ )
186 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch2[i] );
188 for (
unsigned int i = 0; i <
nBarParOff; i++ )
190 sprintf( brname,
"Bunch3_Poff%i", i );
191 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch3[i] );
193 for (
unsigned int i = 0; i <
nBarParOff; i++ )
196 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch3[i] );
198 for (
unsigned int i = 0; i <
nBarSigma; i++ )
200 sprintf( brname,
"FLeft%i", i );
201 btoftree->SetBranchAddress( brname, &cnvFLeft[i] );
203 for (
unsigned int i = 0; i <
nBarSigma; i++ )
205 sprintf( brname,
"FRight%i", i );
206 btoftree->SetBranchAddress( brname, &cnvFRight[i] );
208 for (
unsigned int i = 0; i <
nBarSigCnt; i++ )
210 sprintf( brname,
"FCounter%i", i );
211 btoftree->SetBranchAddress( brname, &cnvFCount[i] );
215 btoftree->GetEntries();
216 for ( cnt = 0; cnt < btofN; cnt++ )
218 btoftree->GetEntry( cnt );
221 bTof.
setP1( cnvBarPar1 );
222 bTof.
setP2( cnvBarPar2 );
234 tmpbTof.push_back( bTof );
244 for (
unsigned int i = 0; i <
nEndAtten; i++ )
246 sprintf( ecname,
"Atten%i", i );
247 etoftree->SetBranchAddress( ecname, &cnvEndAtten[i] );
249 for (
unsigned int i = 0; i <
nEndSpeed; i++ )
251 sprintf( ecname,
"Speed%i", i );
252 etoftree->SetBranchAddress( ecname, &cnvEndSpeed[i] );
254 for (
unsigned int i = 0; i <
nEndPar; i++ )
257 etoftree->SetBranchAddress( ecname, &cnvEndPar[i] );
259 for (
unsigned int i = 0; i <
nEndSigma; i++ )
261 sprintf( ecname,
"FCounter%i", i );
262 etoftree->SetBranchAddress( ecname, &cnvEndFPar[i] );
266 etoftree->GetEntries();
267 for ( cnt = 0; cnt < etofN; cnt++ )
269 etoftree->GetEntry( cnt );
272 eTof.
setP( cnvEndPar );
273 eTof.
setFP( cnvEndFPar );
274 tmpeTof.push_back( eTof );
278 if ( etftree->GetEntries() != 0 )
287 for (
unsigned int i = 0; i <
nEtfSpeed; i++ )
289 sprintf( etfname,
"Speed%i", i );
290 etftree->SetBranchAddress( etfname, &cnvEtfSpeed[i] );
292 for (
unsigned int i = 0; i <
nEtfPar; i++ )
295 etftree->SetBranchAddress( etfname, &cnvEtfPar[i] );
297 etftree->SetBranchAddress( etfname, &cnvEtfPar1[i] );
299 etftree->SetBranchAddress( etfname, &cnvEtfPar2[i] );
303 etftree->GetEntries();
304 for ( cnt = 0; cnt < etfN; cnt++ )
306 etftree->GetEntry( cnt );
308 etf.
setP( cnvEtfPar );
309 etf.
setP1( cnvEtfPar1 );
310 etf.
setP2( cnvEtfPar2 );
311 tmpetf.push_back( etf );
316 if ( etfbunchtree->GetEntries() != 0 )
319 char etfbunchname[10];
320 for (
unsigned int i = 0; i <
nEtfBunch; i++ )
322 sprintf( etfbunchname,
"pbunch%i", i );
323 etfbunchtree->SetBranchAddress( etfbunchname, &cnvEtfBunchP[i] );
325 int entries = etfbunchtree->GetEntries();
326 for ( cnt = 0; cnt < entries; cnt++ )
328 etfbunchtree->GetEntry( cnt );
330 tmpetfBunch.push_back( etfBunch );
337 for (
unsigned int i = 0; i <
nBarSigCor; i++ )
339 sprintf( brname,
"sigmaCorr%i", i );
340 btofcommontree->SetBranchAddress( brname, &cnvBarSigCor[i] );
342 for (
unsigned int i = 0; i <
nBarOffset; i++ )
344 sprintf( brname,
"t0offset%i", i );
345 btofcommontree->SetBranchAddress( brname, &cnvBarOffset[i] );
348 int entries = btofcommontree->GetEntries();
349 for ( cnt = 0; cnt < entries; cnt++ )
351 btofcommontree->GetEntry( cnt );
354 tmpbTofCommon.push_back( bTofCommon );
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];
362 if ( CalibInfo->GetBranchStatus(
"runFrom" ) )
364 CalibInfo->SetBranchAddress(
"runFrom", &m_runFrom );
365 CalibInfo->SetBranchAddress(
"runTo", &m_runTo );
366 CalibInfo->SetBranchAddress(
"eventFrom", &m_eventFrom );
367 CalibInfo->SetBranchAddress(
"eventTo", &m_eventTo );
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 );
398 entries = CalibInfo->GetEntries();
399 for ( cnt = 0; cnt < entries; cnt++ )
401 CalibInfo->GetEntry( cnt );
415 tofinfoCol.push_back( tofinfo );
419 tmpbTof, tmpbTofCommon, tmpeTof, tmpetf, tmpetfBunch, tofinfoCol );
421 refpObject = tmpObject;
426 delete btofcommontree;
429 return StatusCode::SUCCESS;