#include "PndTorinoDetector2ContFact.h" #include "PndTorinoDetector2GeoPar.h" #include "FairRuntimeDb.h" #include ClassImp(PndTorinoDetector2ContFact) static PndTorinoDetector2ContFact gPndTorinoDetector2ContFact; PndTorinoDetector2ContFact::PndTorinoDetector2ContFact() : FairContFact() { /** Constructor (called when the library is loaded) */ fName="PndTorinoDetector2ContFact"; fTitle="Factory for parameter containers in libPndTorinoDetector2"; setAllContainers(); FairRuntimeDb::instance()->addContFactory(this); } void PndTorinoDetector2ContFact::setAllContainers() { /** Creates the Container objects with all accepted contexts and adds them to the list of containers for the PndTorinoDetector2 library. */ FairContainer* p= new FairContainer("PndTorinoDetector2GeoPar", "PndTorinoDetector2 Geometry Parameters", "TestDefaultContext"); p->addContext("TestNonDefaultContext"); containers->Add(p); } FairParSet* PndTorinoDetector2ContFact::createContainer(FairContainer* 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(); FairParSet* p=NULL; if (strcmp(name,"PndTorinoDetector2GeoPar")==0) { p=new PndTorinoDetector2GeoPar(c->getConcatName().Data(), c->GetTitle(),c->getContext()); } return p; }