//*-- AUTHOR : Denis Bertini //*-- Modified : 06/10/2005 by Denis Bertini ///////////////////////////////////////////////////////////// // MvdParRootFileIo // // Class for Start parameter input/output from/into ROOT file // // It is derived from the base class HDetParRootFileIo and // inherits from it basic functions e.g. write(...) // ///////////////////////////////////////////////////////////// using namespace std; #include "MvdParRootFileIo.h" #include "CbmParRootFileIo.h" #include "CbmRuntimeDb.h" #include "MvdDigiPar.h" #include #include ClassImp(MvdParRootFileIo) MvdParRootFileIo::MvdParRootFileIo(CbmParRootFile* f) : CbmDetParRootFileIo(f) { // constructor sets the name of the detector I/O "MvdParIo" fName="MvdParIo"; } MvdParRootFileIo::~MvdParRootFileIo() { // destructor /* if (modulesFound) { delete modulesFound; modulesFound=0; } if (initModules) { delete initModules; initModules=0; } */ } Bool_t MvdParRootFileIo::init(CbmParSet* 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. const Text_t* name=pPar->GetName(); if (pFile) { if (!strcmp(name,"MvdDigiPar")) return read((MvdDigiPar*)pPar,set); } cerr<<"initialization of "<GetName(); Int_t version=findInputVersion(name); if (version<=0) { pPar->setInputVersion(-1,inputNumber); return kFALSE; // not in ROOT file } if (pPar->getInputVersion(inputNumber)==version && pPar->getInputVersion(inputNumber)!=-1) return kTRUE; // needs reinitialization MvdCalPar* rStart=(MvdCalPar*)findContainer(name,version); Bool_t allFound=kTRUE; initModules->Reset(); for(Int_t m=0;mgetSize();m++) { if (set[m]) { MvdCalParMod& r=(*rStart)[m]; MvdCalParMod& p=(*pPar)[m]; Int_t pModSize=p.getSize(); if (pModSize && r.getSize()==pModSize) { for(Int_t c=0;cAddAt(m+1,m); } else allFound=kFALSE; } } pPar->setInputVersion(version,inputNumber); pPar->setChanged(); printInfo("StartCalPar: module(s) initialized from Root file "); delete rStart; return allFound; */ return kTRUE; }