KaliVeda
Toolkit for HIC analysis
KVIsoscaling.h
1 #ifndef __KVISOSCALING_H
2 #define __KVISOSCALING_H
3 
5 #include <vector>
6 #include <utility>
7 #include <unordered_map>
8 #include <map>
9 #include <string>
10 
12 #include "KVNumberList.h"
13 #include "KVList.h"
14 #include "KVHashList.h"
15 
17 #include "TMultiGraph.h"
18 #include "TGraphErrors.h"
19 
159 /*** Yields struct and map ***/
161 {
164 };
165 using Element_t = std::map<Int_t, IsotopeYield_t>; // Type alias with "using" keyword (similar to typdef)
166 using YieldData_t = std::map<Int_t, Element_t>;
167 using YieldGraph_t = std::map<Int_t, TGraphErrors*>;
168 using YieldGauss_t = std::map<Int_t, TF1*>;
169 
170 struct System_t {
171  YieldData_t yields; // all yields
172  YieldGraph_t graphs; // all yields in the form of a TGraphErrors
173  YieldGraph_t lngraphs; // all Ln(yields) in the form of a TGraphErrors
174  YieldGauss_t gauss; // all gaussian fits applied to the TGraphErrors
175  std::string file_path; // input file path
176 
178 };
179 
181 /*** Isoscaling struct and map ***/
182 using IsoGraph_t = std::map<Int_t, TGraphErrors*>; // isoscaling lnR21 graphs
183 using IsoFit_t = std::map<Int_t, TF1*>; // isoscaling lnR21 fits
184 using IsoGaussRatio = std::map<Int_t, TF1*>; // ratio of the gaussian fits
185 
186 struct Isoscaling_t {
187  IsoGraph_t graphs;
188  IsoFit_t fits;
189  IsoGaussRatio gauss_ratios;
190  IsoGaussRatio gauss_ratiosln;
195 };
196 
198 class KVIsoscaling : public TObject {
199 public:
200 
202  {
204  ftol_ = 2.5;
205  fdebug_= kFALSE;
206  }
207 
208  void ReadYieldsFile(const std::string& system_name, const Char_t* file_path);
209 
210  void TestGaussianApprox(const std::string& system_name1, const std::string& system_name2, Int_t zz, Double_t tol); //use to test the rms tolerance for the given system combination and charge, return reduced chisquare
211  void BuildLnR21vsNPlots(const std::string& system_name1, const std::string& system_name2);
212 
213  void FitLnR21vsNPlots(const std::string& system_name1, const std::string& system_name2, Option_t* option = "MNVR", Option_t* gooption = "goff");
214 
215  void DrawAlphavsNFits(const std::string& system_name1, const std::string& system_name2);
216  void DrawLnR21vsNFits(const std::string& system_name1, const std::string& system_name2);
217  void BuildIsoscalingPlots(const std::string& system_name1, const std::string& system_name2, Int_t mcolor, Int_t mstyle, Bool_t draw = kFALSE);
219  void SaveResultsROOT(const Char_t* file_name = "./isoscaling_output_file.root");
220  void SaveResultsASCII(const Char_t* file_name = "./isoscaling_output_file.txt");
221 
223  Bool_t GetAMean(const std::string& system_name, Int_t zz, Float_t& meanA, Float_t& meanA_err);
224  Bool_t GetAlpha(const std::string& system_name1, const std::string& system_name2, Int_t zz, Float_t& alpha, Float_t& alpha_err);
225  Bool_t GetDeltaZA2(const std::string& system_name1, const std::string& system_name2, Int_t zz, Float_t& denum, Float_t& denum_err, Bool_t debug);
226  Bool_t GetCsymOverT(const std::string& system_name1, const std::string& system_name2, Int_t zz, Float_t& csymT, Float_t& csymT_err, Bool_t debug);
227  Int_t FindZFromAmean(const std::string& system_name, Int_t aa);
229  {
230  return ftol_;
231  }
232 
233  KVNumberList GetZNumberList(const std::string& system_name);
234  KVNumberList GetANumberList(const std::string& system_name, Int_t zz);
235  KVNumberList GetSharedZNumberList(const std::string& system_name1, const std::string& system_name2);
236  KVNumberList GetSharedANumberList(const std::string& system_name1, const std::string& system_name2, Int_t zz);
237 
239  void PrintYieldsList();
240  void PrintSystemsList();
241 
243  inline void SetVerbose(Bool_t debug)
244  {
245  fdebug_ = debug;
246  }
247 
248  inline void SetRMSTolerance(Double_t tol)
249  {
250  ftol_ = tol;
251  }
252 
253 protected:
254  std::unordered_map<std::string, System_t> fSystemList_;
255  std::unordered_map<std::string, Isoscaling_t> fIsoscalingList_;
256 
259 
260  void BuildGaussianPlots(const std::string& system_name);
261 
262  ClassDef(KVIsoscaling, 2) //KVClass
263 };
264 
265 #endif
int Int_t
bool Bool_t
char Char_t
float Float_t
constexpr Bool_t kFALSE
double Double_t
const char Option_t
#define ClassDef(name, id)
Isoscaling class.
Definition: KVIsoscaling.h:198
KVNumberList GetANumberList(const std::string &system_name, Int_t zz)
std::unordered_map< std::string, System_t > fSystemList_
(hash) map by name
Definition: KVIsoscaling.h:254
void DrawAlphavsNFits(const std::string &system_name1, const std::string &system_name2)
void PrintYieldsList()
— Printers —
void SetVerbose(Bool_t debug)
— inline methods —
Definition: KVIsoscaling.h:243
Bool_t GetAMean(const std::string &system_name, Int_t zz, Float_t &meanA, Float_t &meanA_err)
— Getters —
void BuildIsoscalingPlots(const std::string &system_name1, const std::string &system_name2, Int_t mcolor, Int_t mstyle, Bool_t draw=kFALSE)
Double_t GetRMSTolerance()
Definition: KVIsoscaling.h:228
Bool_t fdebug_
verbose mode for debugging
Definition: KVIsoscaling.h:257
void FitLnR21vsNPlots(const std::string &system_name1, const std::string &system_name2, Option_t *option="MNVR", Option_t *gooption="goff")
Double_t ftol_
tolerance for the gaussian approximation (in sigma)
Definition: KVIsoscaling.h:258
void SetRMSTolerance(Double_t tol)
Definition: KVIsoscaling.h:248
KVNumberList GetSharedZNumberList(const std::string &system_name1, const std::string &system_name2)
void PrintSystemsList()
void BuildLnR21vsNPlots(const std::string &system_name1, const std::string &system_name2)
void DrawLnR21vsNFits(const std::string &system_name1, const std::string &system_name2)
Bool_t GetCsymOverT(const std::string &system_name1, const std::string &system_name2, Int_t zz, Float_t &csymT, Float_t &csymT_err, Bool_t debug)
void ReadYieldsFile(const std::string &system_name, const Char_t *file_path)
Bool_t GetAlpha(const std::string &system_name1, const std::string &system_name2, Int_t zz, Float_t &alpha, Float_t &alpha_err)
void TestGaussianApprox(const std::string &system_name1, const std::string &system_name2, Int_t zz, Double_t tol)
std::unordered_map< std::string, Isoscaling_t > fIsoscalingList_
(hash) map by name
Definition: KVIsoscaling.h:255
void BuildGaussianPlots(const std::string &system_name)
void SaveResultsROOT(const Char_t *file_name="./isoscaling_output_file.root")
KVNumberList GetSharedANumberList(const std::string &system_name1, const std::string &system_name2, Int_t zz)
void CreateCsymOverTMultiGraph(TMultiGraph *mgr)
KVNumberList GetZNumberList(const std::string &system_name)
void SaveResultsASCII(const Char_t *file_name="./isoscaling_output_file.txt")
Bool_t GetDeltaZA2(const std::string &system_name1, const std::string &system_name2, Int_t zz, Float_t &denum, Float_t &denum_err, Bool_t debug)
Int_t FindZFromAmean(const std::string &system_name, Int_t aa)
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
TGraphErrors * gr_alpha_delta
Definition: KVIsoscaling.h:193
IsoGaussRatio gauss_ratios
Definition: KVIsoscaling.h:189
TGraphErrors * gr_csymT
Definition: KVIsoscaling.h:194
IsoGaussRatio gauss_ratiosln
Definition: KVIsoscaling.h:190
TGraphErrors * gr_alpha
Definition: KVIsoscaling.h:191
IsoGraph_t graphs
Definition: KVIsoscaling.h:187
TGraphErrors * gr_delta
Definition: KVIsoscaling.h:192
IsoFit_t fits
Definition: KVIsoscaling.h:188
Float_t yield_err
Definition: KVIsoscaling.h:163
YieldGauss_t gauss
Definition: KVIsoscaling.h:174
YieldGraph_t lngraphs
Definition: KVIsoscaling.h:173
YieldData_t yields
Definition: KVIsoscaling.h:171
YieldGraph_t graphs
Definition: KVIsoscaling.h:172
std::string file_path
Definition: KVIsoscaling.h:175