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