/** CbmMuchContFact class * * @author A.Kiseleva * @version 0.0 * @since 13.04.06 * * Factory for the parameter containers for MUon CHambers detector * */ using namespace std; #include "CbmMuchContFact.h" #include "CbmRuntimeDb.h" #include "CbmGeoMuchPar.h" #include #include ClassImp(CbmMuchContFact) static CbmMuchContFact gCbmMuchContFact; CbmMuchContFact::CbmMuchContFact() { // Constructor (called when the library is loaded) fName="CbmMuchContFact"; fTitle="Factory for parameter containers in libMuch"; setAllContainers(); CbmRuntimeDb::instance()->addContFactory(this); } void CbmMuchContFact::setAllContainers() { /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the STS library.*/ CbmContainer* p= new CbmContainer("CbmGeoMuchPar", "Much Geometry Parameters", "TestDefaultContext"); p->addContext("TestNonDefaultContext"); containers->Add(p); } CbmParSet* CbmMuchContFact::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(); cout << " -I conatiner name " << name << endl; CbmParSet* p=0; if (strcmp(name,"CbmGeoMuchPar")==0) { p=new CbmGeoMuchPar(c->getConcatName().Data(),c->GetTitle(),c->getContext()); } return p; }