////////////////////////////////////////////////////////////////////////////// // // $Id: $ // //*-- Author : Witold Przygoda (przygoda@psja1.if.uj.edu.pl) //*-- Revised : Martin Jurkovic 2010 // //_HADES_CLASS_DESCRIPTION ////////////////////////////////////////////////////////////////////////////// // // HRichParHadAsciiFileIo // // This class will become obsolete soon... // I/O in had-ascii. // ////////////////////////////////////////////////////////////////////////////// #include "hades.h" #include "hrichcalpar.h" #include "hrichdetector.h" #include "hrichparhadasciifileio.h" #include "hspectrometer.h" #include #include using namespace std; ClassImp(HRichParHadAsciiFileIo) //---------------------------------------------------------------------------- HRichParHadAsciiFileIo::HRichParHadAsciiFileIo(HParHadAsciiFileIo* f) : HDetParHadAsciiFileIo(f) { fName = "HRichParIo"; } //============================================================================ //---------------------------------------------------------------------------- Bool_t HRichParHadAsciiFileIo::init(HParSet* pPar, Int_t* set) { // initializes a container called by name, but only the modules // defined in the array 'set' // calls the special read function for this container // If it is called the first time it reads the setup found in the file using namespace HadAsciiAuxiliaryFunctions; const Text_t* name = ((TNamed*)pPar)->GetName(); // printf("rich par file io init - %s\n", name); if (pFile) { if (strcmp(name, "RichCalPar") == 0) return read((HRichCalPar*)pPar, set); } ErrorMsg(2, "HRichParHadAsciiFileIo::init", 3, "Initialisation of \'", name, "\' container from ASCII file not possible. \ Container of this name is not known."); return kFALSE; } //============================================================================ //---------------------------------------------------------------------------- Int_t HRichParHadAsciiFileIo::write(HParSet* pPar) { using namespace HadAsciiAuxiliaryFunctions; const Text_t* name = ((TNamed*)pPar)->GetName(); if (pFile) { if (strcmp(name, "RichCalPar") == 0) return writeFile((HRichCalPar*)pPar); } ErrorMsg(2, "HRichParHadAsciiFileIo::write", 3, "Writing of \'", name, "\' container to ASCII file not possible. \ Container of this name is not known."); return kFALSE; } //============================================================================ //---------------------------------------------------------------------------- Bool_t HRichParHadAsciiFileIo::write(HDetector* p) { return kTRUE; // not implemented! } //============================================================================ //---------------------------------------------------------------------------- Bool_t HRichParHadAsciiFileIo::read(HRichCalPar* pPar, Int_t* set) { Bool_t status = pPar->initAscii(pFile); pPar->setChanged(); return status; } //============================================================================ //---------------------------------------------------------------------------- Bool_t HRichParHadAsciiFileIo::writeFile(HRichCalPar* pPar) { return pPar->writeAscii(pFile); } //============================================================================