ROOT logo
//_HADES_CLASS_DESCRIPTION
/////////////////////////////////////////////////////////////
//
//  HEmcContFact
//
//  Factory for the parameter containers in libEmc
//
/////////////////////////////////////////////////////////////

#include "hemccontfact.h"
#include "hruntimedb.h"
#include "hemctrb3lookup.h"
#include "hemccalpar.h"
#include "hemcgeompar.h"
#include "hemccellgeompar.h"
#include "hemccellstatuspar.h"
#include "hemccalibraterpar.h"
#include "hemcdigipar.h"

ClassImp(HEmcContFact)

  static HEmcContFact gHEmcContFact;

HEmcContFact::HEmcContFact(void) {
  // Constructor (called when the library is loaded)
  fName="EmcContFact";
  fTitle="Factory for parameter containers in libEmc";
  setAllContainers();
  HRuntimeDb::instance()->addContFactory(this);
}

void HEmcContFact::setAllContainers(void) {
  // Creates the Container objects with all accepted contexts and adds them to
  // the list of containers for the Emc library.
  containers->Add(
    new HContainer("EmcTrb3Lookup",
                   "Lookup table for Emc TRB3 unpacker",
                   "EmcTrb3LookupProduction"));
  containers->Add(
    new HContainer("EmcCalPar",
                   "Calibration parameters of the Emc Detector",
                   "EmcCalParProduction"));
  containers->Add(
    new HContainer("EmcGeomPar",
                   "Geometry parameters of the Emc Detector",
                   "GeomProduction"));
  containers->Add(
    new HContainer("EmcCellGeomPar",
                   "Emc cell geometry parameters",
                   "GeomProduction"));
  containers->Add(
    new HContainer("EmcCellStatusPar",
                   "Emc cell geometry parameters",
                   "EmcCellStatusParProduction"));
  containers->Add(
    new HContainer("EmcCalibraterPar",
                   "Emc calibrater parameters",
                   "EmcCalibraterParProduction"));
  containers->Add(
    new HContainer("EmcDigiPar",
                   "Emc digitization parameters",
                   "EmcDigiProduction"));
}

HParSet* HEmcContFact::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, "EmcTrb3Lookup") == 0)
    return new HEmcTrb3Lookup(c->getConcatName().Data(), c->GetTitle(), c->getContext());
  if (strcmp(name, "EmcCalPar") == 0)
    return new HEmcCalPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
  if (strcmp(name,"EmcGeomPar")==0)
    return new HEmcGeomPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"EmcCellGeomPar")==0)
    return new HEmcCellGeomPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"EmcCellStatusPar")==0)
    return new HEmcCellStatusPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"EmcCalibraterPar")==0)
    return new HEmcCalibraterPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"EmcDigiPar")==0)
    return new HEmcDigiPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  return 0;
}
 hemccontfact.cc:1
 hemccontfact.cc:2
 hemccontfact.cc:3
 hemccontfact.cc:4
 hemccontfact.cc:5
 hemccontfact.cc:6
 hemccontfact.cc:7
 hemccontfact.cc:8
 hemccontfact.cc:9
 hemccontfact.cc:10
 hemccontfact.cc:11
 hemccontfact.cc:12
 hemccontfact.cc:13
 hemccontfact.cc:14
 hemccontfact.cc:15
 hemccontfact.cc:16
 hemccontfact.cc:17
 hemccontfact.cc:18
 hemccontfact.cc:19
 hemccontfact.cc:20
 hemccontfact.cc:21
 hemccontfact.cc:22
 hemccontfact.cc:23
 hemccontfact.cc:24
 hemccontfact.cc:25
 hemccontfact.cc:26
 hemccontfact.cc:27
 hemccontfact.cc:28
 hemccontfact.cc:29
 hemccontfact.cc:30
 hemccontfact.cc:31
 hemccontfact.cc:32
 hemccontfact.cc:33
 hemccontfact.cc:34
 hemccontfact.cc:35
 hemccontfact.cc:36
 hemccontfact.cc:37
 hemccontfact.cc:38
 hemccontfact.cc:39
 hemccontfact.cc:40
 hemccontfact.cc:41
 hemccontfact.cc:42
 hemccontfact.cc:43
 hemccontfact.cc:44
 hemccontfact.cc:45
 hemccontfact.cc:46
 hemccontfact.cc:47
 hemccontfact.cc:48
 hemccontfact.cc:49
 hemccontfact.cc:50
 hemccontfact.cc:51
 hemccontfact.cc:52
 hemccontfact.cc:53
 hemccontfact.cc:54
 hemccontfact.cc:55
 hemccontfact.cc:56
 hemccontfact.cc:57
 hemccontfact.cc:58
 hemccontfact.cc:59
 hemccontfact.cc:60
 hemccontfact.cc:61
 hemccontfact.cc:62
 hemccontfact.cc:63
 hemccontfact.cc:64
 hemccontfact.cc:65
 hemccontfact.cc:66
 hemccontfact.cc:67
 hemccontfact.cc:68
 hemccontfact.cc:69
 hemccontfact.cc:70
 hemccontfact.cc:71
 hemccontfact.cc:72
 hemccontfact.cc:73
 hemccontfact.cc:74
 hemccontfact.cc:75
 hemccontfact.cc:76
 hemccontfact.cc:77
 hemccontfact.cc:78
 hemccontfact.cc:79
 hemccontfact.cc:80
 hemccontfact.cc:81
 hemccontfact.cc:82
 hemccontfact.cc:83
 hemccontfact.cc:84
 hemccontfact.cc:85