//_HADES_CLASS_DESCRIPTION //*-- AUTHOR : Ilse Koenig //*-- Created : 16/11/2015 ///////////////////////////////////////////////////////////////////////////////// // HFRpcParRootFileIo // // Class for parameter input/output from/into ROOT file for the Forward detector // // It is derived from the base class HDetParRootFileIo and // inherits from it basic functions e.g. write(...) // ///////////////////////////////////////////////////////////////////////////////// #include "hfrpcparrootfileio.h" #include "hades.h" #include "hfrpcdetector.h" #include "hfrpcgeompar.h" #include "hspectrometer.h" ClassImp(HFRpcParRootFileIo); HFRpcParRootFileIo::HFRpcParRootFileIo(HParRootFile *f) : HDetParRootFileIo(f) { // constructor sets the name of the detector I/O "HFRpcParIo" fName = "HFRpcParIo"; HDetector *det = gHades->getSetup()->getDetector("FRpc"); Int_t n = det->getMaxSectors(); initModules = new TArrayI(n); } HFRpcParRootFileIo::~HFRpcParRootFileIo() { // destructor if (initModules) { delete initModules; initModules = 0; } } Bool_t HFRpcParRootFileIo::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 if (!isActiv) readModules("FRpc"); const Text_t *name = pPar->GetName(); if (pFile) { if (0 == strncmp(name, "FRpcGeomPar", strlen("FRpcGeomPar"))) return HDetParRootFileIo::read((HFRpcGeomPar *)pPar, set); if (0 == strncmp(name, "FRpcTrb3Lookup", strlen("FRpcTrb3Lookup"))) return read(pPar); if (0 == strncmp(name, "FRpcTrb3Calpar", strlen("FRpcTrb3Calpar"))) return read(pPar); if (0 == strncmp(name, "FRpcCalPar", strlen("FRpcCalpar"))) return read(pPar); if (0 == strncmp(name, "FRpcStripPar", strlen("FRpcStripPar"))) return read(pPar); } Error("init(HParSet*,Int_t*)", "Initialization of %s not possible from ROOT file", name); return kFALSE; }