//*-- AUTHOR : Ilse Koenig //*-- Created : 16/11/2015 //*-- Modified : RafaƂ Lalik //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // // HFRpcContFact // // Factory for the parameter containers in libFRpc // ///////////////////////////////////////////////////////////// #include "hfrpccontfact.h" #include "hfrpccalpar.h" #include "hfrpcdigipar.h" #include "hfrpcgeompar.h" #include "hfrpchitfinderpar.h" #include "hfrpcstrippar.h" #include "hfrpctrb3calpar.h" #include "hfrpctrb3lookup.h" #include "hruntimedb.h" ClassImp(HFRpcContFact); static HFRpcContFact gHFRpcContFact; HFRpcContFact::HFRpcContFact() { // Constructor (called when the library is loaded) fName = "FRpcContFact"; fTitle = "Factory for parameter containers in libFRpc"; setAllContainers(); HRuntimeDb::instance()->addContFactory(this); } void HFRpcContFact::setAllContainers() { // Creates the Container objects with all accepted contexts and adds them to // the list of containers for the FRpc library. containers->Add( new HContainer("FRpcTrb3Lookup", "Lookup table for the TRB3 unpacker of the FRpc", "FRpcTrb3LookupProduction")); containers->Add( new HContainer("FRpcGeomPar", "Geometry simulation parameters of the RPC Forward Detector", "GeomProduction")); containers->Add(new HContainer("FRpcDigiPar", "FRpc digitization parameters", "FRpcDigiParProduction")); containers->Add(new HContainer("FRpcCalPar", "FRpc calibration parameters", "FRpcCalParProduction")); containers->Add(new HContainer("FRpcStripPar", "FRpc strip calibration parameters", "FRpcStripParProduction")); containers->Add(new HContainer("FRpcHitFinderPar", "FRpc hit finder parameters", "FRpcHitFinderParProduction")); containers->Add(new HContainer("FRpcTrb3Calpar", "TRB3 TDC calibration parameters of the FRpc-Rpc detector", "FRpcTrb3CalparProduction")); } HParSet *HFRpcContFact::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, "FRpcGeomPar") == 0) return new HFRpcGeomPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "FRpcTrb3Lookup") == 0) return new HFRpcTrb3Lookup(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "FRpcDigiPar") == 0) return new HFRpcDigiPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "FRpcCalPar") == 0) return new HFRpcCalPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "FRpcStripPar") == 0) return new HFRpcStripPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "FRpcHitFinderPar") == 0) return new HFRpcHitFinderPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); if (strcmp(name, "FRpcTrb3Calpar") == 0) return new HFRpcTrb3Calpar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); return 0; }