KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVNuclDataTable.cpp
1//Created by KVClassFactory on Wed Feb 9 11:06:42 2011
2//Author: bonnet
3
4#include "KVNuclDataTable.h"
5
6using namespace NDT;
7
10
12
13
14
15
17
19{
20 // Default constructor
21 init();
22
23}
24
25
26
29
30KVNuclDataTable::KVNuclDataTable(KVString classname): kclassname(classname)
31{
32 // Constructor with class name of the store objects
33 init();
34
35
36}
37
38
39
42
44{
45 // Destructor
46 if (nucMap) {
48 delete nucMap;
49 }
50 if (tobj) delete tobj;
51
52}
53
54
55
57
59{
60 nucMap = 0;
61 tobj = 0;
62
63 current_idx = 0;
64 NbNuc = 0;
65 kcomments = "";
66 SetName("NuclDataTable");
67
68}
69
70
71
74
76{
77
78 //Add a new entry in the table
79 nucMap->Add(new NDT::key(zz, aa), new NDT::value(ntot));
80 NbNuc += 1;
81
82}
83
84
85
88
90{
91 // Return NDT::value object pointer stored at map position (Z,A).
92 return (NDT::value*)nucMap->GetValue(Form("%d:%d", zz, aa));
93}
94
95
96
99
101{
102 // Returns kTRUE if there is a couple (Z,A) in the table.
103
104 return (getNDTvalue(zz, aa) != 0);
105}
106
107
108
113
115{
116 // Returns the registered KVNuclData object associated to the couple (Z,A).
117 // Don't need to test its presence
118 //returns 0 if no such object is present
119
120 NDT::value* val = getNDTvalue(zz, aa);
121 if (val) return (KVNuclData*)tobj->At(val->Index());
122 return 0;
123
124}
125
126
127
132
134{
135
136 // Returns the value of the registered KVNuclData object associated to the couple (Z,A).
137 // Don't need to test the presence of the object
138 // returns -555 if no such object is present
139
140 KVNuclData* nd = 0;
141 if ((nd = GetData(zz, aa)))
142 return nd->GetValue();
143 else
144 return -555;
145
146}
147
148
149
151
153{
154 KVNuclData* nd = 0;
155 if ((nd = GetData(zz, aa))) {
156 nd->SetValue(val);
157 }
158 else
159 Error("SetValue", "No existing entry for this nucleus: Z=%d, A=%d", zz, aa);
160
161}
162
163
164
169
171{
172
173 // Returns the unit of the registered KVNuclData object associated to the couple (Z,A).
174 // Don't need to test the presence of the object
175 // returns "NONE" if no such object is present
176
177 KVNuclData* nd = 0;
178 if ((nd = GetData(zz, aa)))
179 return nd->GetUnit();
180 else
181 return "NONE";
182
183}
184
185
186
192
194{
195
196 // Returns bit of the registered KVNuclData object associated to the couple (Z,A).
197 // indicating if the value are measured (kTRUE) or not is from systematic (kFALSE)
198 // Don't need to test the presence of the object
199 // returns "NONE" if no such object is present
200
201 KVNuclData* nd = 0;
202 if ((nd = GetData(zz, aa)))
203 return nd->IsMeasured();
204 else
205 return kFALSE;
206
207}
208
209
210
212
214{
215
216 return NbNuc;
217
218}
219
220
221
223
225{
226
227 return GetTitle();
228
229}
230
231
232
234
236{
237
238 return kcomments;
239
240}
241
242
243
245
247{
248
249 cl = TClass::GetClass(kclassname.Data());
250 tobj = new TObjArray(ntot);
251
252}
253
254
255
257
259{
260
261 current_idx = idx;
262 tobj->Add((KVNuclData*)cl->New());
263
264}
265
266
267
269
271{
272 TString line = "";
273 line += "Information concerning value status (measured or deduced)";
274 line += " IS NOT available, Methodes KVNuclDataTable::IsMeasured and";
275 line += " KVNuclData::IsMeasured will always return kFALSE";
276
277 Warning("InfoOnMeasured", "%s", line.Data());
278
279
280}
281
282
int Int_t
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
char * Form(const char *fmt,...)
Abstract base class for nuclear data table.
KVString kcomments
Commentaire provenant de la lecture fichier.
TMap * nucMap
mapping (Z,A) -> nucleus index
void SetValue(Int_t zz, Int_t aa, Double_t val)
Int_t current_idx
current index
void InfoOnMeasured() const
KVString GetCommentsFromFile() const
Bool_t IsInTable(Int_t zz, Int_t aa) const
Returns kTRUE if there is a couple (Z,A) in the table.
Int_t GetNumberOfNuclei() const
Double_t GetValue(Int_t zz, Int_t aa) const
virtual ~KVNuclDataTable()
Destructor.
TObjArray * tobj
KVNumberList plageZ;.
KVNuclDataTable()
Default constructor.
TClass * cl
pointeur pour gerer les heritages de classes de KVNuclData
const Char_t * GetUnit(Int_t zz, Int_t aa) const
Int_t NbNuc
nbre de noyaux presents dans la table
KVNuclData * GetData(Int_t zz, Int_t aa) const
const Char_t * GetReadFileName() const
virtual NDT::value * getNDTvalue(Int_t zz, Int_t aa) const
Return NDT::value object pointer stored at map position (Z,A).
void CreateTable(Int_t ntot)
virtual void GiveIndexToNucleus(Int_t zz, Int_t aa, Int_t ntot)
Add a new entry in the table.
Bool_t IsMeasured(Int_t zz, Int_t aa) const
void CreateElement(Int_t idx)
Simple abstract class to store value related to nuclear data.
Definition KVNuclData.h:18
void SetValue(Double_t val)
Bool_t IsMeasured() const
Definition KVNuclData.h:60
Double_t GetValue() const
const Char_t * GetUnit() const
Definition KVNuclData.h:51
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition KVString.h:73
int Index() const
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
void DeleteAll()
void Add(TObject *key, TObject *value)
TObject * GetValue(const char *keyname) const
const char * GetTitle() const override
virtual void SetName(const char *name)
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
const char * Data() const
TLine * line
Define key-value pair for nuclear data tables.
void init()
ClassImp(TPyArg)