24 m_par_rtcontainerkey(
"/TRT/Calib/RT"),
25 m_par_errcontainerkey(
"/TRT/Calib/errors2d"),
26 m_par_slopecontainerkey(
"/TRT/Calib/slopes"),
27 m_par_t0containerkey(
"/TRT/Calib/T0"),
28 m_par_caltextfile(
""),
30 m_streamer(
"AthenaOutputStreamTool/CondStream1"),
31 m_detstore(
"DetectorStore",
name)
51 if (StatusCode::SUCCESS!=
m_detstore.retrieve()) {
53 return StatusCode::FAILURE;
60 if (
sc.isFailure() ) {
73 return StatusCode::FAILURE ;
77 ATH_MSG_FATAL(
" No input text file supplied. Nothing can be done. ");
78 return StatusCode::FAILURE;
84 return StatusCode::FAILURE ;
88 return StatusCode::SUCCESS;
110 sc=StatusCode::FAILURE;
116 std::string linestring(
line) ;
117 size_t pos = linestring.find(
"Fileformat") ;
118 if(
pos != std::string::npos) {
121 ATH_MSG_WARNING(
"Input file has no Fileformat identifier. Assuming format=0.");
144 std::string linestring(
line) ;
145 size_t pos = linestring.find(
"Fileformat") ;
146 if(
pos != std::string::npos) {
149 ATH_MSG_WARNING(
"Input file has no Fileformat identifier. Assuming format=1");
173 enum ReadMode { ReadingRtRelation, ReadingStrawT0, ReadingGarbage } ;
174 ReadMode readmode =ReadingGarbage ;
182 int nrtrelations(0), nstrawt0(0) ;
186 std::string linestring(
line) ;
187 if(linestring.find(
"RtRelation") != std::string::npos) {
188 readmode = ReadingRtRelation ;
191 }
else if (linestring.find(
"StrawT0") != std::string::npos) {
192 readmode = ReadingStrawT0 ;
195 }
else readmode = ReadingGarbage ;
196 }
else if( readmode != ReadingGarbage) {
197 std::istringstream is(
line) ;
206 if( readmode == ReadingRtRelation ) {
210 rtContainer->
set(
id,rt);
213 }
else if( readmode == ReadingStrawT0 ) {
215 float t0(0), t0err(0) ;
221 t0Container->
setT0(
id,
t0, t0err );
232 size_t t0footprint = t0Container->
footprint() ;
233 size_t rtfootprint = rtContainer->
footprint() ;
236 ATH_MSG_INFO(
"read " << nstrawt0 <<
" t0 and " << nrtrelations <<
" rt from file. "
237 <<
" t0/rt footprints " << t0footprint <<
" / " << rtfootprint ) ;
246 return StatusCode::FAILURE;
249 ATH_MSG_FATAL(
"Could not retrieve data handle for StrawT0Container " );
250 return StatusCode::FAILURE ;
260 return StatusCode::FAILURE;
263 ATH_MSG_FATAL(
"Could not retrieve data handle for RtRelationContainer " );
264 return StatusCode::FAILURE ;
271 return StatusCode::SUCCESS ;
278 enum ReadMode { ReadingRtRelation, ReadingErrors, ReadingStrawT0, ReadingGarbage } ;
279 ReadMode readmode =ReadingGarbage ;
281 int nrtrelations(0), nerrors(0), nstrawt0(0) ;
292 std::string linestring(
line) ;
293 if( linestring.find(
"RtRelation") != std::string::npos) {
294 readmode = ReadingRtRelation ;
296 rtContainer->
clear() ;
297 }
else if(linestring.find(
"StrawT0") != std::string::npos) {
298 readmode = ReadingStrawT0 ;
300 t0Container->
clear() ;
301 }
else if(linestring.find(
"RtErrors") != std::string::npos) {
302 readmode = ReadingErrors ;
304 errContainer->
clear() ;
305 }
else { readmode = ReadingGarbage ; }
306 }
else if( readmode != ReadingGarbage) {
307 std::istringstream is(
line) ;
315 if( readmode == ReadingRtRelation ) {
318 rtContainer->
set(
id,rt);
322 }
else if( readmode == ReadingErrors ) {
325 errContainer->
set(
id,
err);
329 }
else if( readmode == ReadingStrawT0 ) {
331 float t0(0), t0err(0) ;
333 t0Container->
setT0(
id,
t0, t0err );
340 size_t t0footprint = t0Container->
footprint() ;
341 size_t rtfootprint = rtContainer->
footprint() ;
342 size_t errfootprint = errContainer->
footprint() ;
344 ATH_MSG_INFO(
"read " << nstrawt0 <<
" t0 and " << nerrors <<
" errors and " << nrtrelations <<
" rt relations "
345 <<
" t0/rt/err footprints " << t0footprint <<
" / " << rtfootprint <<
" / " << errfootprint ) ;
352 return StatusCode::FAILURE;
355 ATH_MSG_FATAL(
"Could not retrieve data handle for StrawT0Container " );
356 return StatusCode::FAILURE ;
366 return StatusCode::FAILURE;
369 ATH_MSG_FATAL(
"Could not retrieve data handle for RtRelationContainer " );
370 return StatusCode::FAILURE ;
379 return StatusCode::FAILURE;
382 ATH_MSG_FATAL(
"Could not retrieve data handle for RtRelationContainer " );
383 return StatusCode::FAILURE ;
389 return StatusCode::SUCCESS ;
403 enum ReadMode { ReadingRtRelation, ReadingErrors, ReadingSlopes, ReadingStrawT0, ReadingGarbage } ;
404 ReadMode readmode =ReadingGarbage ;
406 int nrtrelations(0), nerrors(0), nslopes(0), nstrawt0(0) ;
411 std::string linestring(
line) ;
412 if( linestring.find(
"RtRelation") != std::string::npos) {
413 readmode = ReadingRtRelation ;
414 rtContainer->
clear() ;
416 }
else if(linestring.find(
"RtErrors") != std::string::npos) {
417 readmode = ReadingErrors ;
418 errContainer->
clear() ;
420 }
else if(linestring.find(
"RtSlopes") != std::string::npos) {
421 readmode = ReadingSlopes ;
422 slopeContainer->
clear() ;
424 }
else if(linestring.find(
"StrawT0") != std::string::npos) {
425 readmode = ReadingStrawT0 ;
426 t0Container->
clear() ;
428 }
else { readmode = ReadingGarbage ; }
429 }
else if( readmode != ReadingGarbage) {
430 std::istringstream is(
line) ;
438 if( readmode == ReadingRtRelation ) {
441 rtContainer->
set(
id,rt);
445 }
else if( readmode == ReadingErrors ) {
448 errContainer->
set(
id,
err);
452 }
else if( readmode == ReadingSlopes ) {
455 slopeContainer->
set(
id,slope);
459 }
else if( readmode == ReadingStrawT0 ) {
461 float t0(0), t0err(0) ;
463 t0Container->
setT0(
id,
t0, t0err );
469 size_t t0footprint = t0Container->
footprint() ;
470 size_t rtfootprint = rtContainer->
footprint() ;
471 size_t errfootprint = errContainer->
footprint() ;
472 size_t slopefootprint = slopeContainer->
footprint() ;
474 ATH_MSG_INFO(
"read " << nstrawt0 <<
" t0 and " << nerrors <<
" errors and " << nrtrelations <<
" rt relations and " << nslopes <<
" error slopes "
475 <<
" t0/rt/err/slope footprints " << t0footprint <<
" / " << rtfootprint <<
" / " << errfootprint <<
" / " << slopefootprint) ;
483 return StatusCode::FAILURE;
486 ATH_MSG_FATAL(
"Could not retrieve data handle for StrawT0Container " );
487 return StatusCode::FAILURE ;
497 return StatusCode::FAILURE;
500 ATH_MSG_FATAL(
"Could not retrieve data handle for RtRelationContainer " );
501 return StatusCode::FAILURE ;
510 return StatusCode::FAILURE;
513 ATH_MSG_FATAL(
"Could not retrieve data handle for RtRelationContainer " );
514 return StatusCode::FAILURE ;
523 return StatusCode::FAILURE;
526 ATH_MSG_FATAL(
"Could not retrieve data handle for RtRelationContainer " );
527 return StatusCode::FAILURE ;
534 return StatusCode::SUCCESS ;