29 const Text_t* name=pPar->GetName();
31 if (0 == strncmp(name,
"EmcTrb3Lookup", strlen(
"EmcTrb3Lookup"))) {
32 return HDetParAsciiFileIo::readFile<HEmcTrb3Lookup>((
HEmcTrb3Lookup*)pPar);
34 if (0 == strncmp(name,
"EmcCalPar", strlen(
"EmcCalPar"))) {
37 if (0 == strncmp(name,
"EmcGeomPar", strlen(
"EmcGeomPar"))) {
40 Error(
"init(HParSet*,Int_t*)",
"Initialization of %s not possible from ASCII file",name);
43 Error(
"init(HParSet*,Int_t*)",
"No input file open");
50 const Text_t* name=pPar->GetName();
51 if (0 == strncmp(name,
"EmcTrb3Lookup", strlen(
"EmcTrb3Lookup"))) {
52 return HDetParAsciiFileIo::writeFile<HEmcTrb3Lookup>((
HEmcTrb3Lookup*)pPar);
54 if (0 == strncmp(name,
"EmcCalPar", strlen(
"EmcCalPar"))) {
55 return HDetParAsciiFileIo::writeFile<HEmcCalPar>((
HEmcCalPar*)pPar);
57 if (0 == strncmp(name,
"EmcGeomPar", strlen(
"EmcGeomPar"))) {
60 Error(
"write(HParSet*)",
"%s could not be written to ASCII file",name);
63 Error(
"write(HParSet*)",
"No output file open");
71 const Text_t* name = pPar->GetName();
76 const Int_t maxbuf = 155;
78 while (!
pFile->eof()) {
79 pFile->getline(buf, maxbuf);
80 if (buf[0] ==
'#')
break;
81 if (buf[0] !=
'/' && buf[0] !=
'\0') pPar->readline(buf, set);
83 Bool_t allFound = kTRUE;
84 for (Int_t i = 0; i < nSize; i++) {
86 if (set[i] == 999) set[i] = 1;
87 else allFound = kFALSE;
93 Info(
"readFile",
"%s initialized from Ascii file", pPar->GetName());
Int_t getMaxModules(void)
Bool_t read(HDetGeomPar *, Int_t *)
ClassImp(HEmcParAsciiFileIo) HEmcParAsciiFileIo
fstream * pFile
comment line
Bool_t init(HParSet *, Int_t *)
HSpectrometer * getSetup(void)
HDetector * getDetector(const Char_t *name)
Bool_t read(T *, Int_t *)
Bool_t findContainer(const Text_t *name)
Int_t writeFile(HDetGeomPar *)