ROOT logo
//*-- AUTHOR : Ilse Koenig
//*-- Modified last : 06/12/2009 by Ilse Koenig

//_HADES_CLASS_DESCRIPTION 
/////////////////////////////////////////////////////////////
//
//  HBaseContFact
//
//  Factory for the parameter containers in libHydra 
//
/////////////////////////////////////////////////////////////
using namespace std;
#include "hbasecontfact.h"
#include "hruntimedb.h"
#include "hspecgeompar.h"
#include "hmagnetpar.h"
#include "htrblookup.h"
#include "htrbnetaddressmapping.h"
#include "hslowpar.h"
#include "hemcsimulpar.h"
#include <iostream>
#include <iomanip>

ClassImp(HBaseContFact)

static HBaseContFact gHBaseContFact;

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

void HBaseContFact::setAllContainers() {
  // Creates the Container objects with all accepted contexts and adds them to
  // the list of containers in libHydra.
  containers->Add(new HContainer(
                    "SpecGeomPar",
                    "Geometry of cave, sectors and target",
                    "GeomProduction"));
  HContainer* cm=new HContainer(
                    "MagnetPar",
                    "Magnet current",
                    "MagnetCurrentSetValues");
  cm->addContext("MagnetCurrentReadbackValues");
  containers->Add(cm);  
  containers->Add(new HContainer(
                    "TrbLookup",
                    "Lookup table for TRB unpacker",
                    "TrbLookupProduction"));
  containers->Add(new HContainer(
                    "TrbnetAddressMapping",
                    "Mapping of subevent ids to TRB boards",
                    "Trb2Production"));

  containers->Add(new HContainer(
                    "SlowPar",
                    "slow control parameters",
                    "SlowParProduction"));
  containers->Add(new HContainer(
                    "EmcSimulPar",
                    "Emc simulation parameters",
                    "EmcSimulProduction"));
}

HParSet* HBaseContFact::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,"SpecGeomPar")==0) {
    return new HSpecGeomPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  }
  if (strcmp(name,"MagnetPar")==0) {
    return new HMagnetPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  }
  if (strcmp(name,"TrbLookup")==0) {
    return new HTrbLookup(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  }
  if (strcmp(name,"TrbnetAddressMapping")==0) {
    return new HTrbnetAddressMapping(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  }
  if (strcmp(name,"SlowPar")==0) {
    return new HSlowPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  }
  if (strcmp(name,"EmcSimulPar")==0) {
    return new HEmcSimulPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  }
  return 0;
} 
 hbasecontfact.cc:1
 hbasecontfact.cc:2
 hbasecontfact.cc:3
 hbasecontfact.cc:4
 hbasecontfact.cc:5
 hbasecontfact.cc:6
 hbasecontfact.cc:7
 hbasecontfact.cc:8
 hbasecontfact.cc:9
 hbasecontfact.cc:10
 hbasecontfact.cc:11
 hbasecontfact.cc:12
 hbasecontfact.cc:13
 hbasecontfact.cc:14
 hbasecontfact.cc:15
 hbasecontfact.cc:16
 hbasecontfact.cc:17
 hbasecontfact.cc:18
 hbasecontfact.cc:19
 hbasecontfact.cc:20
 hbasecontfact.cc:21
 hbasecontfact.cc:22
 hbasecontfact.cc:23
 hbasecontfact.cc:24
 hbasecontfact.cc:25
 hbasecontfact.cc:26
 hbasecontfact.cc:27
 hbasecontfact.cc:28
 hbasecontfact.cc:29
 hbasecontfact.cc:30
 hbasecontfact.cc:31
 hbasecontfact.cc:32
 hbasecontfact.cc:33
 hbasecontfact.cc:34
 hbasecontfact.cc:35
 hbasecontfact.cc:36
 hbasecontfact.cc:37
 hbasecontfact.cc:38
 hbasecontfact.cc:39
 hbasecontfact.cc:40
 hbasecontfact.cc:41
 hbasecontfact.cc:42
 hbasecontfact.cc:43
 hbasecontfact.cc:44
 hbasecontfact.cc:45
 hbasecontfact.cc:46
 hbasecontfact.cc:47
 hbasecontfact.cc:48
 hbasecontfact.cc:49
 hbasecontfact.cc:50
 hbasecontfact.cc:51
 hbasecontfact.cc:52
 hbasecontfact.cc:53
 hbasecontfact.cc:54
 hbasecontfact.cc:55
 hbasecontfact.cc:56
 hbasecontfact.cc:57
 hbasecontfact.cc:58
 hbasecontfact.cc:59
 hbasecontfact.cc:60
 hbasecontfact.cc:61
 hbasecontfact.cc:62
 hbasecontfact.cc:63
 hbasecontfact.cc:64
 hbasecontfact.cc:65
 hbasecontfact.cc:66
 hbasecontfact.cc:67
 hbasecontfact.cc:68
 hbasecontfact.cc:69
 hbasecontfact.cc:70
 hbasecontfact.cc:71
 hbasecontfact.cc:72
 hbasecontfact.cc:73
 hbasecontfact.cc:74
 hbasecontfact.cc:75
 hbasecontfact.cc:76
 hbasecontfact.cc:77
 hbasecontfact.cc:78
 hbasecontfact.cc:79
 hbasecontfact.cc:80
 hbasecontfact.cc:81
 hbasecontfact.cc:82
 hbasecontfact.cc:83
 hbasecontfact.cc:84
 hbasecontfact.cc:85
 hbasecontfact.cc:86
 hbasecontfact.cc:87
 hbasecontfact.cc:88
 hbasecontfact.cc:89
 hbasecontfact.cc:90
 hbasecontfact.cc:91
 hbasecontfact.cc:92