KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVNDTManager.cpp
1//Created by KVClassFactory on Thu Feb 24 11:24:52 2011
2//Author: bonnet
3
4#include "KVNDTManager.h"
5#include "KVNuclDataTable.h"
6#include "KVNuclData.h"
7#include "KVString.h"
8#include "KVBase.h"
9#include "Riostream.h"
10#include "TObjArray.h"
11
13
14KVNDTManager* gNDTManager;
15
16
19
21{
22 // Default constructor
24 init();
25}
26
27
28
31
33{
34 // Destructor
35}
36
37
38
44
46{
47 // Initialize Nuclear Data Table Manager
48 // We automatically instantiate a data table of each class which is
49 // declared as a "KVNuclDataTable" plugin
50 // If a new class is added to the .kvrootrc, there is no need to alter the code.
51
52 Arange = 0;
53 Zrange = 0;
54
55 KVString plugins = KVBase::GetListOfPlugins("KVNuclDataTable");
56 plugins.Begin(" ");
57 while (!plugins.End()) {
58 Add((KVNuclDataTable*)TClass::GetClass(plugins.Next())->New());
59 }
60
61 Execute("Initialize", "");
62
63}
64
65
66
68
70{
71
73
74}
75
76
77
79
81{
82 KVNuclDataTable* tab = 0;
83 return ((tab = GetTable(name)) && tab->IsInTable(zz, aa));
84
85}
86
87
88
90
92{
93
94 KVNuclDataTable* tab = 0;
95 if ((tab = GetTable(name))) return tab->GetValue(zz, aa);
96 return -666;
97
98}
99
100
101
103
104void KVNDTManager::SetValue(Int_t zz, Int_t aa, const Char_t* name, Double_t val)
105{
106 KVNuclDataTable* tab = 0;
107 if ((tab = GetTable(name))) {
108 tab->SetValue(zz, aa, val);
109 }
110 else
111 Error("SetValue", "No table found with name %s", name);
112
113}
114
115
116
118
120{
121
122 KVNuclDataTable* tab = 0;
123 if ((tab = GetTable(name))) return tab->GetData(zz, aa);
124 return 0;
125
126}
127
128
129
131
133{
134
135 KVNuclDataTable* tab = 0;
136 if ((tab = GetTable(name))) return tab->IsMeasured(zz, aa);
137 return kFALSE;
138
139}
140
141
142
144
145const Char_t* KVNDTManager::GetUnit(Int_t zz, Int_t aa, const Char_t* name) const
146{
147
148 KVNuclDataTable* tab = 0;
149 if ((tab = GetTable(name))) return tab->GetUnit(zz, aa);
150 return "";
151
152
153}
154
155
156
157
158
160
162{
163 printf("--------\n");
164 Info("Print", "%d Available nuclear data tables", GetEntries());
165 for (Int_t ii = 0; ii < GetEntries(); ii += 1) {
166 printf("name=%s file=%s number of nuclei stored=%d\n",
167 ((KVNuclDataTable*)At(ii))->GetName(),
168 ((KVNuclDataTable*)At(ii))->GetTitle(),
169 ((KVNuclDataTable*)At(ii))->GetNumberOfNuclei()
170 );
171 }
172 printf("--------\n");
173
174}
175
176
int Int_t
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
char name[80]
static const Char_t * GetListOfPlugins(const Char_t *base)
Definition KVBase.cpp:1260
Nuclear Data Table manager.
Bool_t IsInTable(Int_t zz, Int_t aa, const Char_t *name) const
void PrintTables() const
Double_t GetValue(Int_t zz, Int_t aa, const Char_t *name) const
const Char_t * GetUnit(Int_t zz, Int_t aa, const Char_t *name) const
KVNuclData * GetData(Int_t zz, Int_t aa, const Char_t *name) const
Bool_t IsMeasured(Int_t zz, Int_t aa, const Char_t *name) const
KVNuclDataTable * GetTable(const Char_t *name) const
TObjArray * Arange
virtual ~KVNDTManager()
Destructor.
void SetValue(Int_t zz, Int_t aa, const Char_t *name, Double_t val)
KVNDTManager()
Default constructor.
TObjArray * Zrange
Abstract base class for nuclear data table.
void SetValue(Int_t zz, Int_t aa, Double_t val)
Bool_t IsInTable(Int_t zz, Int_t aa) const
Returns kTRUE if there is a couple (Z,A) in the table.
Double_t GetValue(Int_t zz, Int_t aa) const
const Char_t * GetUnit(Int_t zz, Int_t aa) const
KVNuclData * GetData(Int_t zz, Int_t aa) const
Bool_t IsMeasured(Int_t zz, Int_t aa) const
Simple abstract class to store value related to nuclear data.
Definition KVNuclData.h:18
virtual TObject * FindObject(const char *name) const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual void Execute(const char *method, const char *params, Int_t *error=0)
virtual TObject * At(Int_t idx) const
virtual void Add(TObject *obj)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition KVString.h:73
void Begin(TString delim) const
Definition KVString.cpp:565
Bool_t End() const
Definition KVString.cpp:634
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition KVString.cpp:695
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
const char * GetName() const override
virtual Int_t GetEntries() const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual const char * GetTitle() const
virtual void Info(const char *method, const char *msgfmt,...) const
ClassImp(TPyArg)