ROOT logo
//////////////////////////////////////////////////////////////////////////////
//
// @(#)hydraTrans/richNew:$Id: $
//
//*-- Author  : Ilse Koenig <i.koenig@gsi.de>
//*-- Revised : Martin Jurkovic <martin.jurkovic@ph.tum.de> 2010
//
//_HADES_CLASS_DESCRIPTION
//////////////////////////////////////////////////////////////////////////////
//
//  HRichContFact
//
//  Factory for the parameter containers in libRich
//
//////////////////////////////////////////////////////////////////////////////


#include "hrichanalysispar.h"
#include "hrichcalpar.h"
#include "hrichcontfact.h"
#include "hrichdigitisationpar.h"
#include "hrichgeometrypar.h"
#include "hrichmappingpar.h"
#include "hrichthresholdpar.h"
#include "hrich700digipar.h"
#include "hrich700ringfinderpar.h"

#include "hrich700trb3lookup.h"
#include "hrich700thresholdpar.h"
#include "hrich700geompar.h"

#include "hruntimedb.h"

#include <string.h>

using namespace std;

ClassImp(HRichContFact)

static HRichContFact gHRichContFact;  // instantiated when libRich is loaded

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

void
HRichContFact::setAllContainers()
{
   // Creates the Container objects with all accepted contexts and adds them to
   // the list of containers for the Rich library.

   containers->Add(new HContainer("RichAnalysisParameters",
                                  "Rich Analysis Parameters",
                                  "RichAnaNormalBias"));

   containers->Add(new HContainer("RichCalPar",
                                  "Rich Calibration Parameters",
                                  "RichPrimaryCalibration"));

   containers->Add(new HContainer("RichDigitisationParameters",
                                  "Rich Digitisation Parameters",
                                  "RichDigiProduction"));

   containers->Add(new HContainer("RichGeometryParameters",
                                  "Rich Geometry Parameters",
                                  "RichGeometryParProduction"));

   containers->Add(new HContainer("RichMappingParameters",
                                  "Rich Mapping Parameters",
                                  "RichMappingParProduction"));

   containers->Add(new HContainer("RichThresholdParameters",
                                  "Rich Threshold Parameters",
                                  ""));

   containers->Add(new HContainer("Rich700DigiPar",
                                  "Rich Digitizer Parameters",
                                  "Rich700DigiParProduction"));

   containers->Add(new HContainer("Rich700RingFinderPar",
                                  "Rich RingFinder Parameters",
                                  "Rich700RingFinderParProduction"));


   containers->Add(new HContainer("Rich700Trb3Lookup",
				  "Rich700 Trb3 Lookup Parameters",
				  "Rich700Trb3LookupProduction"));

   containers->Add(new HContainer("Rich700ThresholdPar",
				  "Rich700 Trb3 Threshold Parameters",
				  "Rich700ThresholdProduction"));
   containers->Add(new HContainer("Rich700GeomPar",
                     "Geometry parameters of the new RICH 700",
                     "GeomProduction"));

}

HParSet*
HRichContFact::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 (0 == strncmp(name, "RichAnalysisParameters", strlen("RichAnalysisParameters")))
      return new HRichAnalysisPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (0 == strncmp(name, "RichCalPar", strlen("RichCalPar")))
      return new HRichCalPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (0 == strncmp(name, "RichDigitisationParameters", strlen("RichDigitisationParameters")))
      return new HRichDigitisationPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (0 == strncmp(name, "RichGeometryParameters", strlen("RichGeometryParameters")))
      return new HRichGeometryPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (0 == strncmp(name, "RichMappingParameters", strlen("RichMappingParameters")))
      return new HRichMappingPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (0 == strncmp(name, "RichThresholdParameters", strlen("RichThresholdParameters")))
      return new HRichThresholdPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (0 == strncmp(name, "Rich700DigiPar", strlen("Rich700DigiPar")))
      return new HRich700DigiPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (0 == strncmp(name, "Rich700RingFinderPar", strlen("Rich700RingFinderPar")))
      return new HRich700RingFinderPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());

   if (0 == strncmp(name, "Rich700Trb3Lookup", strlen("Rich700Trb3Lookup")))
        return new HRich700Trb3Lookup(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (0 == strncmp(name, "Rich700ThresholdPar", strlen("Rich700ThresholdPar")))
          return new HRich700ThresholdPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
   if (strcmp(name,"Rich700GeomPar")==0)
       return new HRich700GeomPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());

   return 0;
}
 hrichcontfact.cc:1
 hrichcontfact.cc:2
 hrichcontfact.cc:3
 hrichcontfact.cc:4
 hrichcontfact.cc:5
 hrichcontfact.cc:6
 hrichcontfact.cc:7
 hrichcontfact.cc:8
 hrichcontfact.cc:9
 hrichcontfact.cc:10
 hrichcontfact.cc:11
 hrichcontfact.cc:12
 hrichcontfact.cc:13
 hrichcontfact.cc:14
 hrichcontfact.cc:15
 hrichcontfact.cc:16
 hrichcontfact.cc:17
 hrichcontfact.cc:18
 hrichcontfact.cc:19
 hrichcontfact.cc:20
 hrichcontfact.cc:21
 hrichcontfact.cc:22
 hrichcontfact.cc:23
 hrichcontfact.cc:24
 hrichcontfact.cc:25
 hrichcontfact.cc:26
 hrichcontfact.cc:27
 hrichcontfact.cc:28
 hrichcontfact.cc:29
 hrichcontfact.cc:30
 hrichcontfact.cc:31
 hrichcontfact.cc:32
 hrichcontfact.cc:33
 hrichcontfact.cc:34
 hrichcontfact.cc:35
 hrichcontfact.cc:36
 hrichcontfact.cc:37
 hrichcontfact.cc:38
 hrichcontfact.cc:39
 hrichcontfact.cc:40
 hrichcontfact.cc:41
 hrichcontfact.cc:42
 hrichcontfact.cc:43
 hrichcontfact.cc:44
 hrichcontfact.cc:45
 hrichcontfact.cc:46
 hrichcontfact.cc:47
 hrichcontfact.cc:48
 hrichcontfact.cc:49
 hrichcontfact.cc:50
 hrichcontfact.cc:51
 hrichcontfact.cc:52
 hrichcontfact.cc:53
 hrichcontfact.cc:54
 hrichcontfact.cc:55
 hrichcontfact.cc:56
 hrichcontfact.cc:57
 hrichcontfact.cc:58
 hrichcontfact.cc:59
 hrichcontfact.cc:60
 hrichcontfact.cc:61
 hrichcontfact.cc:62
 hrichcontfact.cc:63
 hrichcontfact.cc:64
 hrichcontfact.cc:65
 hrichcontfact.cc:66
 hrichcontfact.cc:67
 hrichcontfact.cc:68
 hrichcontfact.cc:69
 hrichcontfact.cc:70
 hrichcontfact.cc:71
 hrichcontfact.cc:72
 hrichcontfact.cc:73
 hrichcontfact.cc:74
 hrichcontfact.cc:75
 hrichcontfact.cc:76
 hrichcontfact.cc:77
 hrichcontfact.cc:78
 hrichcontfact.cc:79
 hrichcontfact.cc:80
 hrichcontfact.cc:81
 hrichcontfact.cc:82
 hrichcontfact.cc:83
 hrichcontfact.cc:84
 hrichcontfact.cc:85
 hrichcontfact.cc:86
 hrichcontfact.cc:87
 hrichcontfact.cc:88
 hrichcontfact.cc:89
 hrichcontfact.cc:90
 hrichcontfact.cc:91
 hrichcontfact.cc:92
 hrichcontfact.cc:93
 hrichcontfact.cc:94
 hrichcontfact.cc:95
 hrichcontfact.cc:96
 hrichcontfact.cc:97
 hrichcontfact.cc:98
 hrichcontfact.cc:99
 hrichcontfact.cc:100
 hrichcontfact.cc:101
 hrichcontfact.cc:102
 hrichcontfact.cc:103
 hrichcontfact.cc:104
 hrichcontfact.cc:105
 hrichcontfact.cc:106
 hrichcontfact.cc:107
 hrichcontfact.cc:108
 hrichcontfact.cc:109
 hrichcontfact.cc:110
 hrichcontfact.cc:111
 hrichcontfact.cc:112
 hrichcontfact.cc:113
 hrichcontfact.cc:114
 hrichcontfact.cc:115
 hrichcontfact.cc:116
 hrichcontfact.cc:117
 hrichcontfact.cc:118
 hrichcontfact.cc:119
 hrichcontfact.cc:120
 hrichcontfact.cc:121
 hrichcontfact.cc:122
 hrichcontfact.cc:123
 hrichcontfact.cc:124
 hrichcontfact.cc:125
 hrichcontfact.cc:126
 hrichcontfact.cc:127
 hrichcontfact.cc:128
 hrichcontfact.cc:129
 hrichcontfact.cc:130
 hrichcontfact.cc:131
 hrichcontfact.cc:132
 hrichcontfact.cc:133
 hrichcontfact.cc:134
 hrichcontfact.cc:135