//*-- AUTHOR : Ilse Koenig //*-- Created : 16/11/2015 //*-- Modified : RafaƂ Lalik //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // // HStsContFact // // Factory for the parameter containers in libSts // ///////////////////////////////////////////////////////////// #include "hstscontfact.h" #include "hruntimedb.h" #include "hstscalibraterpar.h" #include "hstscalpar.h" #include "hstsdigipar.h" #include "hstsgeompar.h" #include "hstsstatuspar.h" #include "hststrb3calpar.h" #include "hststrb3lookup.h" static HStsContFact gHStsContFact; ClassImp(HStsContFact) HStsContFact::HStsContFact() { // Constructor (called when the library is loaded) fName = "StsContFact"; fTitle = "Factory for parameter containers in libSts"; setAllContainers(); HRuntimeDb::instance()->addContFactory(this); } void HStsContFact::setAllContainers() { // Creates the Container objects with all accepted contexts and adds them to // the list of containers for the Sts library. containers->Add( new HContainer("StsGeomPar", "Geometry simulation parameters of the Straw Forward Detector", "GeomProduction")); containers->Add(new HContainer("StsDigiPar", "Sts digitization parameters", "StsDigiProduction")); containers->Add(new HContainer("StsCalPar", "Sts Cal parameters", "StsCalProduction")); containers->Add(new HContainer("StsCalibraterPar", "Sts Calibrater parameters", "StsCalibraterParProduction")); containers->Add(new HContainer("StsTrb3Lookup", "Lookup table for the TRB3 unpacker of the Sts-Straw", "StsTrb3LookupProduction")); containers->Add(new HContainer("StsTrb3Calpar", "TRB3 TDC calibration parameters of the Sts-Straw detector", "StsTrb3CalparProduction")); containers->Add(new HContainer("StsStatusPar", "Sts status parameters", "StsStatusParProduction")); } HParSet *HStsContFact::createContainer(HContainer *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_t *name = c->GetName(); if (strcmp(name, "StsGeomPar") == 0) return new HStsGeomPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "StsDigiPar") == 0) return new HStsDigiPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "StsCalPar") == 0) return new HStsCalPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "StsCalibraterPar") == 0) return new HStsCalibraterPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "StsTrb3Lookup") == 0) return new HStsTrb3Lookup(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "StsTrb3Calpar") == 0) return new HStsTrb3Calpar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "StsStatusPar") == 0) return new HStsStatusPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); return 0; }