KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVPartitionFunction.h
Go to the documentation of this file.
1 
4 #ifndef __KVPARTITIONFUNCTION_H
5 #define __KVPARTITIONFUNCTION_H
6 
7 #include "TNamed.h"
8 #include "TString.h"
9 #include "THashTable.h"
10 
54 class KVPartitionFunction : public TObject {
56 
61 
62  Double_t sneppen_Nclass(int A, int Z, int M, int B);
63  Double_t sneppen_Np(int A, int Z, int M);
64  Double_t calc_sneppen_Nclass(int A, int Z, int M, int B);
65  Double_t calc_sneppen_Np(int A, int Z, int M);
66 
67  const Char_t* name_value(Int_t A, Int_t Z, Int_t M, Int_t B = -1)
68  {
69  if (B > -1) return Form("A%dZ%dM%dB%d", A, Z, M, B);
70  return Form("A%dZ%dM%d", A, Z, M);
71  }
72 
73  void store_value(Double_t val, Int_t A, Int_t Z, Int_t M, Int_t B = -1)
74  {
75  TString name = name_value(A, Z, M, B);
76  TNamed* o = new TNamed(name.Data(), "");
77  o->SetTitle(Form("%f", val));
78  fTable.Add(o);
79  }
80 
82  {
83  TString name = name_value(A, Z, M, B);
84  TNamed* o = (TNamed*)fTable.FindObject(name.Data());
85  if (!o) return -1.;
86  Double_t val;
87  sscanf(o->GetTitle(), "%lf", &val);
88  return val;
89  }
90 
91 public:
93  virtual ~KVPartitionFunction();
94 
95  Double_t PartFunc(int A, int M);
96  Double_t PartSum(int A);
97  Double_t PartFunc(int A, int Z, int M);
98  Double_t PartSum(int A, int Z);
99 
101  {
102  return maxvalueNp;
103  };
105  {
106  return maxvalueNclass;
107  };
108 
109  Double_t MeanNA(int A0, int A);
110  Double_t MeanNA_M(int A0, int A, int M);
111  Double_t MeanNA(int A0, int Z0, int A);
112  Double_t MeanNZ(int A0, int Z0, int Z);
113  Double_t MeanNAZ(int A0, int Z0, int A, int Z);
114 
115  Double_t MeanM(int A0);
116  Double_t MeanA(int A0);
117 
118  ClassDef(KVPartitionFunction, 0) //Calculates number of partitions of A or (A,Z) into fragments
119 };
120 
121 #endif
int Int_t
KVIonRangeTableMaterial * M
char Char_t
double Double_t
#define ClassDef(name, id)
char * Form(const char *fmt,...)
Calculates number of partitions of (A,Z,M)
Double_t get_value(Int_t A, Int_t Z, Int_t M, Int_t B=-1)
Double_t sneppen_Np(int A, int Z, int M)
Double_t PartFunc(int A, int M)
Double_t MeanNAZ(int A0, int Z0, int A, int Z)
Double_t MeanNA(int A0, int A)
KVPartitionFunction()
Default constructor.
Double_t GetMaxValueNclass() const
Double_t calc_sneppen_Np(int A, int Z, int M)
calculates Eq. 4
Double_t GetMaxValueNp() const
Double_t calc_sneppen_Nclass(int A, int Z, int M, int B)
calculates Eqs. 5a-d
Double_t sneppen_Nclass(int A, int Z, int M, int B)
const Char_t * name_value(Int_t A, Int_t Z, Int_t M, Int_t B=-1)
Double_t MeanNZ(int A0, int Z0, int Z)
void store_value(Double_t val, Int_t A, Int_t Z, Int_t M, Int_t B=-1)
virtual ~KVPartitionFunction()
Destructor.
Double_t MeanNA_M(int A0, int A, int M)
void Add(TObject *obj)
TObject * FindObject(const char *name) const
virtual void SetTitle(const char *title="")
virtual const char * GetTitle() const
const char * Data() const