ROOT logo
//*-- AUTHOR : Ilse Koenig
//*-- Modified last : 20/02/2002 by Ilse Koenig

//_HADES_CLASS_DESCRIPTION 
/////////////////////////////////////////////////////////////
//
//  HTofContFact
//
//  Factory for the parameter containers in libTof
//
/////////////////////////////////////////////////////////////

#include "htofcontfact.h"
#include "hruntimedb.h"
#include "htofcalpar.h"
#include "htofdigipar.h"
#include "htofgeompar.h"
#include "htoflookup.h"
#include "htoftrb2lookup.h"
#include "htoftrb3lookup.h"
#include "htofclusterfpar.h"
#include "htofwalkpar.h"

ClassImp(HTofContFact)

static HTofContFact gHTofContFact;

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

void HTofContFact::setAllContainers() {
  // Creates the Container objects with all accepted contexts and adds them to
  // the list of containers for the Tof library.
  containers->Add(
    new HContainer("TofCalPar",
                   "Calibration parameters for Tof",
                   "TofCalProduction"));
  containers->Add(
    new HContainer("TofDigiPar",
                   "TOF digitization parameters",
                   "TofDigiProduction"));
  containers->Add(
    new HContainer("TofGeomPar",
                   "Tof geometry parameters",
                   "GeomProduction"));
  containers->Add(
    new HContainer("TofLookup",
                   "Lookup table for Tof unpacker",
                   ""));
  containers->Add(
    new HContainer("TofTrb2Lookup",
                   "Lookup table for the TRB2 unpacker of the TOF detector",
                   "TofTrb2LookupProduction"));

  containers->Add(
    new HContainer("TofTrb3Lookup",
                   "Lookup table for the TRB3 unpacker of the TOF detector",
                   "TofTrb3LookupProduction"));

  containers->Add(
    new HContainer("TofClusterFPar",
                   "Parameter container for the cluster finder",
                   "TofCluNormalBias"));
  containers->Add(
    new HContainer("TofWalkPar",
                   "Walk Calibration parameters for Tof",
                   "TofWalkParProduction"));
}

HParSet* HTofContFact::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,"TofCalPar")==0)
    return new HTofCalPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"TofDigiPar")==0)
    return new HTofDigiPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"TofGeomPar")==0)
    return new HTofGeomPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"TofLookup")==0)
    return new HTofLookup(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"TofTrb2Lookup")==0)
    return new HTofTrb2Lookup(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"TofTrb3Lookup")==0)
    return new HTofTrb3Lookup(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"TofClusterFPar")==0)
    return new HTofClusterFPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  if (strcmp(name,"TofWalkPar")==0)
    return new HTofWalkPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
  return 0;
}
 htofcontfact.cc:1
 htofcontfact.cc:2
 htofcontfact.cc:3
 htofcontfact.cc:4
 htofcontfact.cc:5
 htofcontfact.cc:6
 htofcontfact.cc:7
 htofcontfact.cc:8
 htofcontfact.cc:9
 htofcontfact.cc:10
 htofcontfact.cc:11
 htofcontfact.cc:12
 htofcontfact.cc:13
 htofcontfact.cc:14
 htofcontfact.cc:15
 htofcontfact.cc:16
 htofcontfact.cc:17
 htofcontfact.cc:18
 htofcontfact.cc:19
 htofcontfact.cc:20
 htofcontfact.cc:21
 htofcontfact.cc:22
 htofcontfact.cc:23
 htofcontfact.cc:24
 htofcontfact.cc:25
 htofcontfact.cc:26
 htofcontfact.cc:27
 htofcontfact.cc:28
 htofcontfact.cc:29
 htofcontfact.cc:30
 htofcontfact.cc:31
 htofcontfact.cc:32
 htofcontfact.cc:33
 htofcontfact.cc:34
 htofcontfact.cc:35
 htofcontfact.cc:36
 htofcontfact.cc:37
 htofcontfact.cc:38
 htofcontfact.cc:39
 htofcontfact.cc:40
 htofcontfact.cc:41
 htofcontfact.cc:42
 htofcontfact.cc:43
 htofcontfact.cc:44
 htofcontfact.cc:45
 htofcontfact.cc:46
 htofcontfact.cc:47
 htofcontfact.cc:48
 htofcontfact.cc:49
 htofcontfact.cc:50
 htofcontfact.cc:51
 htofcontfact.cc:52
 htofcontfact.cc:53
 htofcontfact.cc:54
 htofcontfact.cc:55
 htofcontfact.cc:56
 htofcontfact.cc:57
 htofcontfact.cc:58
 htofcontfact.cc:59
 htofcontfact.cc:60
 htofcontfact.cc:61
 htofcontfact.cc:62
 htofcontfact.cc:63
 htofcontfact.cc:64
 htofcontfact.cc:65
 htofcontfact.cc:66
 htofcontfact.cc:67
 htofcontfact.cc:68
 htofcontfact.cc:69
 htofcontfact.cc:70
 htofcontfact.cc:71
 htofcontfact.cc:72
 htofcontfact.cc:73
 htofcontfact.cc:74
 htofcontfact.cc:75
 htofcontfact.cc:76
 htofcontfact.cc:77
 htofcontfact.cc:78
 htofcontfact.cc:79
 htofcontfact.cc:80
 htofcontfact.cc:81
 htofcontfact.cc:82
 htofcontfact.cc:83
 htofcontfact.cc:84
 htofcontfact.cc:85
 htofcontfact.cc:86
 htofcontfact.cc:87
 htofcontfact.cc:88
 htofcontfact.cc:89
 htofcontfact.cc:90
 htofcontfact.cc:91
 htofcontfact.cc:92
 htofcontfact.cc:93
 htofcontfact.cc:94
 htofcontfact.cc:95
 htofcontfact.cc:96
 htofcontfact.cc:97