86 {
87
88 MsgStream log(
msgSvc(), name() );
89
90
91
92 std::string fullPath = "/Calib/TofCal";
93 log << MSG::INFO << "execute() fullPath = " << fullPath << endmsg;
94
95 SmartDataPtr<CalibData::TofCalibData> btof( m_pCalibDataSvc, fullPath );
96
97 TFile*
f1 =
new TFile(
"TofCalConst.root",
"read" );
98
99 TTree* btoftree = (TTree*)
f1->Get(
"BarTofPar" );
100 double fCount[10];
101 double fLeft[5];
102 double fRight[5];
103 btoftree->SetBranchAddress( "FCounter0", &fCount[0] );
104 btoftree->SetBranchAddress( "FCounter1", &fCount[1] );
105 btoftree->SetBranchAddress( "FCounter2", &fCount[2] );
106 btoftree->SetBranchAddress( "FCounter3", &fCount[3] );
107 btoftree->SetBranchAddress( "FCounter4", &fCount[4] );
108 btoftree->SetBranchAddress( "FCounter5", &fCount[5] );
109 btoftree->SetBranchAddress( "FCounter6", &fCount[6] );
110 btoftree->SetBranchAddress( "FCounter7", &fCount[7] );
111 btoftree->SetBranchAddress( "FCounter8", &fCount[8] );
112 btoftree->SetBranchAddress( "FCounter9", &fCount[9] );
113 btoftree->SetBranchAddress( "FLeft0", &fLeft[0] );
114 btoftree->SetBranchAddress( "FLeft1", &fLeft[1] );
115 btoftree->SetBranchAddress( "FLeft2", &fLeft[2] );
116 btoftree->SetBranchAddress( "FLeft3", &fLeft[3] );
117 btoftree->SetBranchAddress( "FLeft4", &fLeft[4] );
118 btoftree->SetBranchAddress( "FRight0", &fRight[0] );
119 btoftree->SetBranchAddress( "FRight1", &fRight[1] );
120 btoftree->SetBranchAddress( "FRight2", &fRight[2] );
121 btoftree->SetBranchAddress( "FRight3", &fRight[3] );
122 btoftree->SetBranchAddress( "FRight4", &fRight[4] );
123
124 for ( int i = 0; i < 176; i++ )
125 {
126 btoftree->GetEntry( i );
127
128 double bAtten0 = btof->getBTofAtten( i, 0 );
129 double bAtten1 = btof->getBTofAtten( i, 1 );
130 double bP0 = btof->getBTofPleft( i, 0 );
131 double bP1 = btof->getBTofPleft( i, 1 );
132 double bP2 = btof->getBTofPleft( i, 2 );
133 double bP3 = btof->getBTofPleft( i, 3 );
134 double bP4 = btof->getBTofPleft( i, 4 );
135 double bP5 = btof->getBTofPleft( i, 5 );
136 double bP10 = btof->getBTofPright( i, 0 );
137
138
139 double bSpeed0 = btof->getBTofSpeed( i, 0 );
140 double bSpeed1 = btof->getBTofSpeed( i, 1 );
141
142
143
144
145
146
147 double fCount1[10], fLeft1[5], fRight1[5];
148 for ( int j = 0; j < 10; j++ )
149 {
150 fCount1[j] = btof->getBTofFcounter( i, j );
151 if ( fCount1[j] != fCount[j] ) std::cout << "error error error error" << std::endl;
152
153
154 }
155
156 for ( int j = 0; j < 5; j++ )
157 {
158 fLeft1[j] = btof->getBTofFleft( i, j );
159 if ( fLeft1[j] != fLeft[j] ) std::cout << "error error error error" << std::endl;
160
161 }
162
163
164 for ( int j = 0; j < 5; j++ )
165 {
166 fRight1[j] = btof->getBTofFright( i, j );
167 if ( fRight1[j] != fRight[j] ) std::cout << "error error error error" << std::endl;
168
169 }
170
171
172
173
174
175
176
177
178
179
180
181 }
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260 double sigma[8];
261
262 for ( int i = 0; i < 8; i++ )
263 {
264 sigma[i] = btof->getBTofSigmaCorr( 0, i );
265 std::cout << " sigma[" << i << "]=" << sigma[i];
266 }
267 std::cout << "\n";
268
269 std::cout << " btof->getRunBegin()" << btof->getRunBegin( 0 );
270 std::cout << "btof->getRunEnd()" << btof->getRunEnd( 0 );
271 std::cout << "btof->getVersion()" << btof->getVersion( 0 );
272 std::cout << "btof->getQCorr()" << btof->getQCorr( 0 );
273 std::cout << "btof->getMisLable()" << btof->getMisLable( 0 );
274 std::cout << "btof->getQElec()" << btof->getQElec( 0 );
275 for ( int i = 0; i < 5; i++ )
276 {
277 std::cout << "i===" << i << std::endl;
278 std::cout << " btof->getBrEast(int index)" << btof->getBrEast( 0, i );
279 std::cout << " btof->getBrWest(int index)" << btof->getBrWest( 0, i );
280 std::cout << " btof->getEndcap(int index)" << btof->getEndcap( 0, i );
281 }
282
283
284
285 return StatusCode::SUCCESS;
286}