KaliVeda
Toolkit for HIC analysis
KVNuclDataTable.h
1 
4 #ifndef __KVNUCLDATATABLE_H
5 #define __KVNUCLDATATABLE_H
6 
7 #include "TNamed.h"
8 #include "TMap.h"
9 #include "TObject.h"
10 #include "TClass.h"
11 #include "TObjArray.h"
12 
13 #include "KVString.h"
14 #include "KVNuclData.h"
15 
21 namespace NDT {
22  class key : public TNamed {
23  public:
24  key(int z, int a)
25  {
26  SetName(Form("%d:%d", z, a));
27  };
28  virtual ~key() {};
29  ClassDef(key, 0)
30  };
31  class value : public TObject {
32  int idx;
33  public:
34  value(int i) : idx(i) {};
35  virtual ~value() {};
36  int Index() const
37  {
38  return idx;
39  };
40  ClassDef(value, 0)
41  };
42 };
43 
80 class KVNuclDataTable : public TNamed {
81 
82 protected:
83 
84  TClass* cl;
85  TMap* nucMap;
86  Int_t current_idx;
87  Int_t NbNuc;
88 
89  KVString kcomments;
90  KVString kclassname;
91 
93 
94  TObjArray* tobj;
96 
97  KVNuclData* GetCurrent() const
98  {
99  return (KVNuclData*)tobj->At(current_idx);
100  }
101  void CreateTable(Int_t ntot); //Creation of the table
102  void CreateElement(Int_t idx);//a new KVNuclData pointeur is created and added
103  void InfoOnMeasured() const;
104 
105  virtual NDT::value* getNDTvalue(Int_t zz, Int_t aa) const;
106 
107 public:
108  KVNuclDataTable();
109  KVNuclDataTable(KVString classname);
110  virtual ~KVNuclDataTable();
111  void init();
112  virtual void Initialize() = 0;
113 
114  virtual void GiveIndexToNucleus(Int_t zz, Int_t aa, Int_t ntot);
115  Bool_t IsInTable(Int_t zz, Int_t aa) const;
116 
117  KVNuclData* GetData(Int_t zz, Int_t aa) const;
118  Double_t GetValue(Int_t zz, Int_t aa) const;
119  void SetValue(Int_t zz, Int_t aa, Double_t val);
120  const Char_t* GetUnit(Int_t zz, Int_t aa) const;
121  Bool_t IsMeasured(Int_t zz, Int_t aa) const;
122 
123  Int_t GetNumberOfNuclei() const;
124  const Char_t* GetReadFileName() const;
126 
127  ClassDef(KVNuclDataTable, 1) //Store information on nuclei
128 
129 };
130 
131 #endif
int Int_t
bool Bool_t
char Char_t
double Double_t
#define ClassDef(name, id)
char * Form(const char *fmt,...)
Abstract base class for nuclear data table.
virtual void Initialize()=0
void SetValue(Int_t zz, Int_t aa, Double_t val)
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.
KVNuclDataTable()
Default constructor.
const Char_t * GetUnit(Int_t zz, Int_t aa) const
KVNuclData * GetData(Int_t zz, Int_t aa) const
const Char_t * GetReadFileName() const
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
Simple abstract class to store value related to nuclear data.
Definition: KVNuclData.h:18
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
virtual ~key()
key(int z, int a)
virtual ~value()
int Index() const
virtual void SetName(const char *name)
TObject * At(Int_t idx) const override
Define key-value pair for nuclear data tables.
TArc a