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