HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hrichcontfact.cc
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // @(#)hydraTrans/richNew:$Id: $
4 //
5 //*-- Author : Ilse Koenig <i.koenig@gsi.de>
6 //*-- Revised : Martin Jurkovic <martin.jurkovic@ph.tum.de> 2010
7 //
8 //_HADES_CLASS_DESCRIPTION
9 //////////////////////////////////////////////////////////////////////////////
10 //
11 // HRichContFact
12 //
13 // Factory for the parameter containers in libRich
14 //
15 //////////////////////////////////////////////////////////////////////////////
16 
17 
18 #include "hrichanalysispar.h"
19 #include "hrichcalpar.h"
20 #include "hrichcontfact.h"
21 #include "hrichdigitisationpar.h"
22 #include "hrichgeometrypar.h"
23 #include "hrichmappingpar.h"
24 #include "hrichthresholdpar.h"
25 #include "hrich700digipar.h"
26 #include "hrich700ringfinderpar.h"
27 
28 #include "hrich700trb3lookup.h"
29 #include "hrich700thresholdpar.h"
30 #include "hrich700geompar.h"
31 
32 #include "hruntimedb.h"
33 
34 #include <string.h>
35 
36 using namespace std;
37 
39 
40 static HRichContFact gHRichContFact; // instantiated when libRich is loaded
41 
43 {
44  // Constructor (called when the library is loaded)
45  fName = "RichContFact";
46  fTitle = "Factory for parameter containers in libRich";
47  setAllContainers();
49 }
50 
51 void
53 {
54  // Creates the Container objects with all accepted contexts and adds them to
55  // the list of containers for the Rich library.
56 
57  containers->Add(new HContainer("RichAnalysisParameters",
58  "Rich Analysis Parameters",
59  "RichAnaNormalBias"));
60 
61  containers->Add(new HContainer("RichCalPar",
62  "Rich Calibration Parameters",
63  "RichPrimaryCalibration"));
64 
65  containers->Add(new HContainer("RichDigitisationParameters",
66  "Rich Digitisation Parameters",
67  "RichDigiProduction"));
68 
69  containers->Add(new HContainer("RichGeometryParameters",
70  "Rich Geometry Parameters",
71  "RichGeometryParProduction"));
72 
73  containers->Add(new HContainer("RichMappingParameters",
74  "Rich Mapping Parameters",
75  "RichMappingParProduction"));
76 
77  containers->Add(new HContainer("RichThresholdParameters",
78  "Rich Threshold Parameters",
79  ""));
80 
81  containers->Add(new HContainer("Rich700DigiPar",
82  "Rich Digitizer Parameters",
83  "Rich700DigiParProduction"));
84 
85  containers->Add(new HContainer("Rich700RingFinderPar",
86  "Rich RingFinder Parameters",
87  "Rich700RingFinderParProduction"));
88 
89 
90  containers->Add(new HContainer("Rich700Trb3Lookup",
91  "Rich700 Trb3 Lookup Parameters",
92  "Rich700Trb3LookupProduction"));
93 
94  containers->Add(new HContainer("Rich700ThresholdPar",
95  "Rich700 Trb3 Threshold Parameters",
96  "Rich700ThresholdProduction"));
97  containers->Add(new HContainer("Rich700GeomPar",
98  "Geometry parameters of the new RICH 700",
99  "GeomProduction"));
100 
101 }
102 
103 HParSet*
105 {
106  // Calls the constructor of the corresponding parameter container.
107  // For an actual context, which is not an empty string and not the default context
108  // of this container, the name is concatinated with the context.
109  const Char_t* name = c->GetName();
110  if (0 == strncmp(name, "RichAnalysisParameters", strlen("RichAnalysisParameters")))
111  return new HRichAnalysisPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
112  if (0 == strncmp(name, "RichCalPar", strlen("RichCalPar")))
113  return new HRichCalPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
114  if (0 == strncmp(name, "RichDigitisationParameters", strlen("RichDigitisationParameters")))
115  return new HRichDigitisationPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
116  if (0 == strncmp(name, "RichGeometryParameters", strlen("RichGeometryParameters")))
117  return new HRichGeometryPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
118  if (0 == strncmp(name, "RichMappingParameters", strlen("RichMappingParameters")))
119  return new HRichMappingPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
120  if (0 == strncmp(name, "RichThresholdParameters", strlen("RichThresholdParameters")))
121  return new HRichThresholdPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
122  if (0 == strncmp(name, "Rich700DigiPar", strlen("Rich700DigiPar")))
123  return new HRich700DigiPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
124  if (0 == strncmp(name, "Rich700RingFinderPar", strlen("Rich700RingFinderPar")))
125  return new HRich700RingFinderPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
126 
127  if (0 == strncmp(name, "Rich700Trb3Lookup", strlen("Rich700Trb3Lookup")))
128  return new HRich700Trb3Lookup(c->getConcatName().Data(), c->GetTitle(), c->getContext());
129  if (0 == strncmp(name, "Rich700ThresholdPar", strlen("Rich700ThresholdPar")))
130  return new HRich700ThresholdPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
131  if (strcmp(name,"Rich700GeomPar")==0)
132  return new HRich700GeomPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
133 
134  return 0;
135 }
const Char_t * getContext()
Definition: hcontfact.cc:107
TString getConcatName()
Definition: hcontfact.cc:92
void addContFactory(HContFact *)
Definition: hruntimedb.cc:73
ClassImp(HRichContFact) static HRichContFact gHRichContFact
Definition: hparset.h:9
void setAllContainers()
static HRuntimeDb * instance(void)
generator for a parameter file
HParSet * createContainer(HContainer *)