///////////////////////////////////////////////////////////// // // PndDchContFact // // Factory for the parameter containers in libDch // ///////////////////////////////////////////////////////////// using namespace std; #include "PndDchContFact.h" #include "CbmRuntimeDb.h" #include "PndDchGeoPar.h" //#include "CbmParRootFileIo.h" //#include "CbmParAsciiFileIo.h" #include #include ClassImp(PndDchContFact) static PndDchContFact gDchContFact; PndDchContFact::PndDchContFact() { // Constructor (called when the library is loaded) fName="PndDchContFact"; fTitle="Factory for parameter containers in libDch"; setAllContainers(); CbmRuntimeDb::instance()->addContFactory(this); } void PndDchContFact::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("PndDchGeoPar", "Dch Geometry Parameters", "TestDefaultContext"); p->addContext("TestNonDefaultContext"); containers->Add(p); } CbmParSet* PndDchContFact::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,"PndDchGeoPar")==0) { p=new PndDchGeoPar(c->getConcatName().Data(),c->GetTitle(),c->getContext()); } return p; } // void PndDchContFact::activateParIo(CbmParIo* io) { // // activates the input/output class for the parameters // // needed by the Dch // return; // }