FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairBaseParSet.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // -------------------------------------------------------------------------
9 // ----- FairBaseParSet source file -----
10 // ----- Created 06/01/04 by M. Al/Turany -----
11 // -------------------------------------------------------------------------
12 
13 #include "FairBaseParSet.h"
14 
15 #include "FairParamList.h" // for FairParamList
16 #include "FairPrimaryGenerator.h" // for FairPrimaryGenerator
17 
18 #include <TObjArray.h>
19 
21 
22 FairBaseParSet::FairBaseParSet(const char* name, const char* title, const char* context)
23  : FairParGenericSet(name, title, context)
24  , fDetList(0)
25  , fPriGen(0)
26  , fBeamMom(15)
27  , fContNameList(new TObjArray())
28  , fRandomSeed(99999999)
29 {}
30 
32 {
33  if (fContNameList) {
34  fContNameList->Delete();
35  delete fContNameList;
36  }
37 }
38 
39 void FairBaseParSet::clear(void) { fContNameList->Delete(); }
40 
42 {
43  if (!l) {
44  return;
45  }
46  l->addObject("Detector List", fDetList);
47  l->addObject("Event Generator", fPriGen);
48  l->add("Beam Momentum Gev/c", fBeamMom);
49  l->addObject("Parameter containers list", fContNameList);
50  l->add("Random Seed", fRandomSeed);
51 }
52 
54 {
55  if (!l) {
56  return kFALSE;
57  }
58  if (!l->fillObject("Detector List", fDetList)) {
59  return kFALSE;
60  }
61  if (!l->fillObject("Event Generator", fPriGen)) {
62  return kFALSE;
63  }
64  if (!l->fill("Beam Momentum Gev/c", &fBeamMom)) {
65  return kFALSE;
66  }
67  if (!l->fillObject("Parameter containers list", fContNameList)) {
68  return kFALSE;
69  }
70  if (!l->fill("Random Seed", &fRandomSeed)) {
71  return kFALSE;
72  }
73  return kTRUE;
74 }
void addObject(const Text_t *, TObject *)
ClassImp(FairEventBuilder)
void putParams(FairParamList *)
Bool_t fillObject(const Text_t *, TObject *)
TObjArray * fDetList
Detectors used in the simulation.
FairBaseParSet(const char *name="FairBaseParSet", const char *title="Class for base parameter io", const char *context="BaseDefaultContext")
TObjArray * fContNameList
List of parameter container names in the RUN.
Bool_t fill(const Text_t *, Text_t *, const Int_t)
UInt_t fRandomSeed
Random Seed from gRandom.
FairPrimaryGenerator * fPriGen
Generator used for simulation.
Double_t fBeamMom
Beam momentum (GeV/c)
void clear(void)
Bool_t getParams(FairParamList *)
void add(FairParamObj &)