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
47 {
48
49 MsgStream log(
msgSvc(),
"RootEstTofCalibDataCnv" );
50 log << MSG::DEBUG << "SetProperty" << endmsg;
51
52
54 if ( !sc ) { log << MSG::ERROR << "unable to open files" << endmsg; }
55
56 CalibData::bTofCalibBase bTof;
57 CalibData::eTofCalibBase eTof;
58 CalibData::etfCalibBase etf;
59 CalibData::bTofCommonCalibBase bTofCommon;
60 CalibData::tofCalibInfoBase tofinfo;
61
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;
67
68
69 int cnt;
70
81
82 TTree* btoftree = (TTree*)
m_inFile->Get(
"BarTofPar" );
83
84 char brname[10];
85 for (
unsigned int i = 0; i <
nBarPar; i++ )
86 {
88 btoftree->SetBranchAddress( brname, &cnvBarPar1[i] );
89 }
90 for (
unsigned int i = 0; i <
nBarPar; i++ )
91 {
93 btoftree->SetBranchAddress( brname, &cnvBarPar2[i] );
94 }
95 for (
unsigned int i = 0; i <
nBarParOff; i++ )
96 {
97 sprintf( brname,
"Bunch0_Poff%i", i );
98 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch0[i] );
99 }
100 for (
unsigned int i = 0; i <
nBarParOff; i++ )
101 {
103 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch0[i] );
104 }
105 for (
unsigned int i = 0; i <
nBarParOff; i++ )
106 {
107 sprintf( brname,
"Bunch1_Poff%i", i );
108 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch1[i] );
109 }
110 for (
unsigned int i = 0; i <
nBarParOff; i++ )
111 {
113 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch1[i] );
114 }
115 for (
unsigned int i = 0; i <
nBarParOff; i++ )
116 {
117 sprintf( brname,
"Bunch2_Poff%i", i );
118 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch2[i] );
119 }
120 for (
unsigned int i = 0; i <
nBarParOff; i++ )
121 {
123 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch2[i] );
124 }
125 for (
unsigned int i = 0; i <
nBarParOff; i++ )
126 {
127 sprintf( brname,
"Bunch3_Poff%i", i );
128 btoftree->SetBranchAddress( brname, &cnvBarParOff1_bunch3[i] );
129 }
130 for (
unsigned int i = 0; i <
nBarParOff; i++ )
131 {
133 btoftree->SetBranchAddress( brname, &cnvBarParOff2_bunch3[i] );
134 }
135
136 for ( cnt = 0; cnt < btoftree->GetEntries(); cnt++ )
137 {
138 btoftree->GetEntry( cnt );
139 bTof.
setP1( cnvBarPar1 );
140 bTof.
setP2( cnvBarPar2 );
149 tmpbTof.push_back( bTof );
150 }
151
152
154
155 TTree* etoftree = (TTree*)
m_inFile->Get(
"EndTofPar" );
156
157 char ecname[10];
158 for (
unsigned int i = 0; i <
nEndPar; i++ )
159 {
161 etoftree->SetBranchAddress( ecname, &cnvEndPar[i] );
162 }
163
164 for ( cnt = 0; cnt < etoftree->GetEntries(); cnt++ )
165 {
166 etoftree->GetEntry( cnt );
167 eTof.
setP( cnvEndPar );
168 tmpeTof.push_back( eTof );
169 }
170
171
175
176 if ( NULL !=
m_inFile->Get(
"EtfTofPar" ) )
177 {
178 TTree* etftree = (TTree*)
m_inFile->Get(
"EtfTofPar" );
179
180 char etfname[10];
181 for (
unsigned int i = 0; i <
nEtfPar; i++ )
182 {
184 etftree->SetBranchAddress( etfname, &cnvEtfPar[i] );
185 }
186 for (
unsigned int i = 0; i <
nEtfPar; i++ )
187 {
189 etftree->SetBranchAddress( etfname, &cnvEtfPar1[i] );
190 }
191 for (
unsigned int i = 0; i <
nEtfPar; i++ )
192 {
194 etftree->SetBranchAddress( etfname, &cnvEtfPar2[i] );
195 }
196
197 for ( cnt = 0; cnt < etftree->GetEntries(); cnt++ )
198 {
199 etftree->GetEntry( cnt );
200 etf.
setP( cnvEtfPar );
201 etf.
setP1( cnvEtfPar1 );
202 etf.
setP2( cnvEtfPar2 );
203 tmpetf.push_back( etf );
204 }
205 }
206
207
209 TTree* btofcommontree = (TTree*)
m_inFile->Get(
"BarTofParCommon" );
210 for (
unsigned int i = 0; i <
nBarOffset; i++ )
211 {
212 sprintf( brname,
"t0offset%i", i );
213 btofcommontree->SetBranchAddress( brname, &cnvBarOffset[i] );
214 }
215
216 int entries = btofcommontree->GetEntries();
217 for ( cnt = 0; cnt < entries; cnt++ )
218 {
219 btofcommontree->GetEntry( cnt );
221 tmpbTofCommon.push_back( bTofCommon );
222 }
223
224 int m_runFrom, m_runTo, m_eventFrom, m_eventTo;
225
226 TTree* CalibInfo = (TTree*)
m_inFile->Get(
"CalibInfo" );
227
228 if ( CalibInfo->GetBranchStatus( "runFrom" ) )
229 {
230 CalibInfo->SetBranchAddress( "runFrom", &m_runFrom );
231 CalibInfo->SetBranchAddress( "runTo", &m_runTo );
232 CalibInfo->SetBranchAddress( "eventFrom", &m_eventFrom );
233 CalibInfo->SetBranchAddress( "eventTo", &m_eventTo );
234 }
235 else
236 {
237 m_runFrom = -1;
238 m_runTo = -1;
239 m_eventFrom = -1;
240 m_eventTo = -1;
241 }
242
243 entries = CalibInfo->GetEntries();
244 for ( cnt = 0; cnt < entries; cnt++ )
245 {
246 CalibInfo->GetEntry( cnt );
251 tofinfoCol.push_back( tofinfo );
252 }
253
254 CalibData::TofCalibData* tmpObject =
255 new CalibData::TofCalibData( tmpbTof, tmpbTofCommon, tmpeTof, tmpetf, tofinfoCol );
256
257 refpObject = tmpObject;
258
259 return StatusCode::SUCCESS;
260}
const unsigned int nBarOffset
const unsigned int nBarParOff
void setP2(const double *TofP2)
void setPoff1_bunch3(const double *TofPoff1_bunch3)
void setPoff2_bunch1(const double *TofPoff2_bunch1)
void setPoff1_bunch0(const double *TofPoff1_bunch0)
void setPoff2_bunch2(const double *TofPoff2_bunch2)
void setPoff1_bunch1(const double *TofPoff1_bunch1)
void setPoff1_bunch2(const double *TofPoff1_bunch2)
void setPoff2_bunch3(const double *TofPoff2_bunch3)
void setPoff2_bunch0(const double *TofPoff2_bunch0)
void setP1(const double *TofP1)
void setOffset(const double *offset)
void setP(const double *TofP)
void setP(const double *etfP)
void setP1(const double *etfP1)
void setP2(const double *etfP2)
void setRunFrom(const int runFrom)
void setEventTo(const int eventTo)
void setRunTo(const int runTo)
void setEventFrom(const int eventFrom)
StatusCode openRead(const std::string &fname)