6 #include "GaudiKernel/MsgStream.h"
13 ISvcLocator * pSvcLocator) :
26 ATH_MSG_INFO (
"=== LArReadHadDMCoeffFile::initialize() ===" );
33 return StatusCode::SUCCESS;
39 return StatusCode::SUCCESS;
44 return StatusCode::SUCCESS;
56 FILE *
fin = fopen(
file.c_str(),
"r");
59 return StatusCode::FAILURE;
65 int nFrac, nEner,
nEta, nPars;
67 if(
line[0] ==
'#' ||
line[0] ==
'\n' )
continue;
69 if(sscanf(
line,
"%80d %80d %127s\n",&izone, &is_on,
title)!=3 || indx_zone != izone) {
72 return StatusCode::FAILURE;
81 nFrac<0 || nFrac>1000)
85 return StatusCode::FAILURE;
89 nEner < 0 || nEner > 1000)
93 return StatusCode::FAILURE;
97 nEta < 0 || nEta > 1000)
101 return StatusCode::FAILURE;
104 if(sscanf(
line,
"%80d \n", &nPars)!=1 || nPars < 0 || nPars> 1000) {
107 return StatusCode::FAILURE;
111 for(
int i_frac=0; i_frac<nFrac; i_frac++){
112 int iparset = 0, ifrac = 0, iener = 0, ieta = 0;
113 float frac = 0, ener = 0,
eta = 0;
114 for(
int i_ener=0; i_ener<nEner; i_ener++){
115 for(
int i_eta=0; i_eta<
nEta; i_eta++){
118 sLine = std::string(
line);
119 std::istringstream es( sLine.c_str() );
121 if ( es >> iparset >> ifrac >> iener >> ieta >>
frac >> ener >>
eta) {
124 for(
int i=0;
i<nPars;
i++) {
125 if(!(es >>
pars[
i]) ) {
128 return StatusCode::FAILURE;
131 if(ifrac != i_frac || iener != i_ener || ieta != i_eta || (
int)
pars.size() != nPars){
134 return StatusCode::FAILURE;
137 if(i_frac==0 && i_ener==0) dmArea.
m_EtaBins.push_back(
eta);
144 if(i_frac == 0) dmArea.
m_EnerBins.push_back(ener);
156 return StatusCode::SUCCESS;