47 DataObject*& refpObject ) {
49 MsgStream log(
msgSvc(),
"RootEstTofCalibDataCnv" );
50 log << MSG::DEBUG <<
"SetProperty" << endmsg;
54 if ( !sc ) { log << MSG::ERROR <<
"unable to open files" << endmsg; }
62 std::vector<CalibData::bTofCalibBase> tmpbTof;
63 std::vector<CalibData::eTofCalibBase> tmpeTof;
64 std::vector<CalibData::etfCalibBase> tmpetf;
65 std::vector<CalibData::bTofCommonCalibBase> tmpbTofCommon;
66 std::vector<CalibData::tofCalibInfoBase> tofinfoCol;
82 TTree* btoftree = (TTree*)
m_inFile->Get(
"BarTofPar" );
85 for (
unsigned int i = 0; i <
nBarPar; i++ )
88 btoftree->SetBranchAddress( brname, &cnvBarPar1[i] );
90 for (
unsigned int i = 0; i <
nBarPar; i++ )
93 btoftree->SetBranchAddress( brname, &cnvBarPar2[i] );
95 for (
unsigned int i = 0; i <
nBarParOff; i++ )
97 sprintf( brname,
"Bunch0_Poff%i", i );
98 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch0[i] );
100 for (
unsigned int i = 0; i <
nBarParOff; i++ )
103 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch0[i] );
105 for (
unsigned int i = 0; i <
nBarParOff; i++ )
107 sprintf( brname,
"Bunch1_Poff%i", i );
108 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch1[i] );
110 for (
unsigned int i = 0; i <
nBarParOff; i++ )
113 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch1[i] );
115 for (
unsigned int i = 0; i <
nBarParOff; i++ )
117 sprintf( brname,
"Bunch2_Poff%i", i );
118 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch2[i] );
120 for (
unsigned int i = 0; i <
nBarParOff; i++ )
123 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch2[i] );
125 for (
unsigned int i = 0; i <
nBarParOff; i++ )
127 sprintf( brname,
"Bunch3_Poff%i", i );
128 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch3[i] );
130 for (
unsigned int i = 0; i <
nBarParOff; i++ )
133 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch3[i] );
136 for ( cnt = 0; cnt < btoftree->GetEntries(); cnt++ )
138 btoftree->GetEntry( cnt );
139 bTof.
setP1( cnvBarPar1 );
140 bTof.
setP2( cnvBarPar2 );
149 tmpbTof.push_back( bTof );
155 TTree* etoftree = (TTree*)
m_inFile->Get(
"EndTofPar" );
158 for (
unsigned int i = 0; i <
nEndPar; i++ )
161 etoftree->SetBranchAddress( ecname, &cnvEndPar[i] );
164 for ( cnt = 0; cnt < etoftree->GetEntries(); cnt++ )
166 etoftree->GetEntry( cnt );
167 eTof.
setP( cnvEndPar );
168 tmpeTof.push_back( eTof );
176 if ( NULL !=
m_inFile->Get(
"EtfTofPar" ) )
178 TTree* etftree = (TTree*)
m_inFile->Get(
"EtfTofPar" );
181 for (
unsigned int i = 0; i <
nEtfPar; i++ )
184 etftree->SetBranchAddress( etfname, &cnvEtfPar[i] );
186 for (
unsigned int i = 0; i <
nEtfPar; i++ )
189 etftree->SetBranchAddress( etfname, &cnvEtfPar1[i] );
191 for (
unsigned int i = 0; i <
nEtfPar; i++ )
194 etftree->SetBranchAddress( etfname, &cnvEtfPar2[i] );
197 for ( cnt = 0; cnt < etftree->GetEntries(); cnt++ )
199 etftree->GetEntry( cnt );
200 etf.
setP( cnvEtfPar );
201 etf.
setP1( cnvEtfPar1 );
202 etf.
setP2( cnvEtfPar2 );
203 tmpetf.push_back( etf );
209 TTree* btofcommontree = (TTree*)
m_inFile->Get(
"BarTofParCommon" );
210 for (
unsigned int i = 0; i <
nBarOffset; i++ )
212 sprintf( brname,
"t0offset%i", i );
213 btofcommontree->SetBranchAddress( brname, &cnvBarOffset[i] );
216 int entries = btofcommontree->GetEntries();
217 for ( cnt = 0; cnt < entries; cnt++ )
219 btofcommontree->GetEntry( cnt );
221 tmpbTofCommon.push_back( bTofCommon );
224 int m_runFrom, m_runTo, m_eventFrom, m_eventTo;
226 TTree* CalibInfo = (TTree*)
m_inFile->Get(
"CalibInfo" );
228 if ( CalibInfo->GetBranchStatus(
"runFrom" ) )
230 CalibInfo->SetBranchAddress(
"runFrom", &m_runFrom );
231 CalibInfo->SetBranchAddress(
"runTo", &m_runTo );
232 CalibInfo->SetBranchAddress(
"eventFrom", &m_eventFrom );
233 CalibInfo->SetBranchAddress(
"eventTo", &m_eventTo );
243 entries = CalibInfo->GetEntries();
244 for ( cnt = 0; cnt < entries; cnt++ )
246 CalibInfo->GetEntry( cnt );
251 tofinfoCol.push_back( tofinfo );
257 refpObject = tmpObject;
259 return StatusCode::SUCCESS;
264 MsgStream log(
msgSvc(),
"RootEstTofCalibDataCnv" );
268 if ( !sc ) { log << MSG::ERROR <<
"unable to open files" << endmsg; }
276 char brname[8], ibrname[8];
277 TTree* btoftree =
new TTree(
"BarTofPar",
"BarTofPar" );
278 for (
unsigned int i = 0; i <
nBarPar; i++ )
281 sprintf( ibrname,
"P%i/D", i );
282 btoftree->Branch( brname, &cnvBarPar1[i], ibrname );
285 for (
int i = 0; i < 176; i++ )
287 for (
int j = 0; j < static_cast<int>(
nBarPar ); j++ )
298 char ecname[8], iecname[8];
299 TTree* etoftree =
new TTree(
"EndTofPar",
"EndTofPar" );
300 for (
unsigned int i = 0; i <
nEndPar; i++ )
303 sprintf( iecname,
"P%i/D", i );
304 etoftree->Branch( ecname, &cnvEndPar[i], iecname );
307 for (
int i = 0; i < 96; i++ )
309 for (
int j = 0; j < static_cast<int>(
nEndPar ); j++ )
310 { cnvEndPar[j] = btof->
getETofP( i, j ); }
319 char etfname[8], ietfname[8];
320 TTree* etftree =
new TTree(
"EtfTofPar",
"EtfTofPar" );
321 for (
unsigned int i = 0; i <
nEtfPar; i++ )
324 sprintf( ietfname,
"P%i/D", i );
325 etftree->Branch( etfname, &cnvEtfPar[i], ietfname );
327 for (
unsigned int i = 0; i <
nEtfPar; i++ )
331 etftree->Branch( etfname, &cnvEtfPar1[i], ietfname );
333 for (
unsigned int i = 0; i <
nEtfPar; i++ )
337 etftree->Branch( etfname, &cnvEtfPar2[i], ietfname );
340 for (
int i = 0; i < 72; i++ )
342 for (
int k = 0; k < 12; k++ )
344 for (
int j = 0; j < static_cast<int>(
nEtfPar ); j++ )
362 log << MSG::INFO <<
"successfully create RootFile" << endmsg;