///////////////////////////////////////////////////////////// // // PndMvdContFact // // Factory for the parameter containers in libPndMvd // ///////////////////////////////////////////////////////////// using namespace std; #include "PndTriggerContFact.h" #include "FairRuntimeDb.h" #include "PndTriggerGeoPar.h" #include "FairParRootFileIo.h" #include "FairParAsciiFileIo.h" #include "TList.h" #include "TObjString.h" #include #include ClassImp(PndTriggerContFact); static PndTriggerContFact gPndTriggerContFact; PndTriggerContFact::PndTriggerContFact() { // Constructor (called when the library is loaded) fName="PndTriggerContFact"; fTitle="Factory for parameter containers in libPndTrigger"; fDigiParNames = new TList(); setAllContainers(); FairRuntimeDb::instance()->addContFactory(this); } PndTriggerContFact::~PndTriggerContFact() { if(0!=fDigiParNames) { fDigiParNames->Delete(); delete fDigiParNames; } } void PndTriggerContFact::setAllContainers() { /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the MVD library.*/ FairContainer* p= new FairContainer("PndTriggerGeoPar","PndTrigger Geometry Parameters","TestDefaultContext"); p->addContext("TestNonDefaultContext"); fDigiParNames->Add(new TObjString(p->GetName())); containers->Add(p); } FairParSet* PndTriggerContFact::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,"PndTriggerGeoPar")==0) { p=new PndTriggerGeoPar(c->getConcatName().Data(),c->GetTitle(),c->getContext()); } return p; }