//_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // // HiTofContFact // // Factory for the parameter containers in libiTof // ///////////////////////////////////////////////////////////// #include "hitofcontfact.h" #include "hruntimedb.h" #include "hitofcalpar.h" #include "hitoftrb3lookup.h" ClassImp(HiTofContFact) static HiTofContFact gHiTofContFact; HiTofContFact::HiTofContFact() { // Constructor (called when the library is loaded) fName="iTofContFact"; fTitle="Factory for parameter containers in libiTof"; setAllContainers(); HRuntimeDb::instance()->addContFactory(this); } void HiTofContFact::setAllContainers() { // Creates the Container objects with all accepted contexts and adds them to // the list of containers for the iTof library. containers->Add( new HContainer("iTofCalPar", "Calibration parameters for iTof", "iTofCalParProduction")); containers->Add( new HContainer("iTofTrb3Lookup", "Trb3 Lookup table for iTof unpacker", "iTofTrb3LookupProduction")); } HParSet* HiTofContFact::createContainer(HContainer* c) { // Calls the constructor of the corresponding parameter container. // For an actual context, which is not an empty string and not the default context // of this container, the name is concatinated with the context. const Char_t* name=c->GetName(); if (strcmp(name,"iTofCalPar")==0) return new HiTofCalPar(c->getConcatName().Data(),c->GetTitle(),c->getContext()); if (strcmp(name,"iTofTrb3Lookup")==0) return new HiTofTrb3Lookup(c->getConcatName().Data(),c->GetTitle(),c->getContext()); return 0; }