///////////////////////////////////////////////////////////// // // CbmSttContFact // // Factory for the parameter containers in libStt1 // // authors: Pablo Genova - Pavia University // Lia Lavezzi - Pavia University ///////////////////////////////////////////////////////////// using namespace std; #include "CbmSttContFact.h" #include "CbmRuntimeDb.h" #include "CbmGeoSttPar.h" //#include "CbmParRootFileIo.h" //#include "CbmParAsciiFileIo.h" #include #include ClassImp(CbmSttContFact) static CbmSttContFact gCbmSttContFact; CbmSttContFact::CbmSttContFact() { // Constructor (called when the library is loaded) fName="CbmSttContFact"; fTitle="Factory for parameter containers in libStt"; setAllContainers(); CbmRuntimeDb::instance()->addContFactory(this); } void CbmSttContFact::setAllContainers() { /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the STT library.*/ CbmContainer* p= new CbmContainer("CbmGeoSttPar", "Stt Geometry Parameters", "TestDefaultContext"); p->addContext("TestNonDefaultContext"); containers->Add(p); } CbmParSet* CbmSttContFact::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,"CbmGeoSttPar")==0) { p=new CbmGeoSttPar(c->getConcatName().Data(),c->GetTitle(),c->getContext()); } return p; } // void CbmSttContFact::activateParIo(CbmParIo* io) { // // activates the input/output class for the parameters // // needed by the Stt // return; // }