///////////////////////////////////////////////////////////// // // DchContFact // // Factory for the parameter containers in libDch // ///////////////////////////////////////////////////////////// using namespace std; #include "DchContFact.h" #include "CbmRuntimeDb.h" #include "DchGeoPar.h" //#include "CbmParRootFileIo.h" //#include "CbmParAsciiFileIo.h" #include #include ClassImp(DchContFact) static DchContFact gDchContFact; DchContFact::DchContFact() { // Constructor (called when the library is loaded) fName="DchContFact"; fTitle="Factory for parameter containers in libDch"; setAllContainers(); CbmRuntimeDb::instance()->addContFactory(this); } void DchContFact::setAllContainers() { /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the DCH library.*/ CbmContainer* p= new CbmContainer("DchGeoPar", "Dch Geometry Parameters", "TestDefaultContext"); p->addContext("TestNonDefaultContext"); containers->Add(p); } CbmParSet* DchContFact::createContainer(CbmContainer* 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* name=c->GetName(); CbmParSet* p=NULL; if (strcmp(name,"DchGeoPar")==0) { p=new DchGeoPar(c->getConcatName().Data(),c->GetTitle(),c->getContext()); } return p; } // void DchContFact::activateParIo(CbmParIo* io) { // // activates the input/output class for the parameters // // needed by the Dch // return; // }