///////////////////////////////////////////////////////////// // // TpcContFact // // Factory for the parameter containers in libTst // ///////////////////////////////////////////////////////////// using namespace std; #include "TpcContFact.h" #include "CbmRuntimeDb.h" #include "TpcGeoPar.h" #include "CbmParRootFileIo.h" #include "CbmParAsciiFileIo.h" //#include "CbmParIo.h" //#include "TpcParRootFileIo.h" //#include "TpcParAsciiFileIo.h" #include #include ClassImp(TpcContFact) static TpcContFact gTpcContFact; TpcContFact::TpcContFact() { // Constructor (called when the library is loaded) fName="TpcContFact"; fTitle="Factory for parameter containers in libTpc"; setAllContainers(); CbmRuntimeDb::instance()->addContFactory(this); } void TpcContFact::setAllContainers() { /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the TST library.*/ CbmContainer* p= new CbmContainer("TpcGeoPar", "Tpc Geometry Parameters", "TpcDefaultContext"); p->addContext("TpcNonDefaultContext"); containers->Add(p); } CbmParSet* TpcContFact::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,"TpcGeoPar")==0) { p=new TpcGeoPar(c->getConcatName().Data(),c->GetTitle(),c->getContext()); } return p; } /*void TpcContFact::activateParIo(CbmParIo* io) { // activates the input/output class for the parameters // needed by the Tst if (strcmp(io->IsA()->GetName(),"CbmParRootFileIo")==0) { TpcParRootFileIo* p=new TpcParRootFileIo(((CbmParRootFileIo*)io)->getParRootFile()); io->setDetParIo(p); } if (strcmp(io->IsA()->GetName(),"CbmParAsciiFileIo")==0) { TpcParAsciiFileIo* p=new TpcParAsciiFileIo(((CbmParAsciiFileIo*)io)->getFile()); io->setDetParIo(p); } }*/