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 ***/
163 };
164 using Element_t = std::map<Int_t, IsotopeYield_t>; // Type alias with "using" keyword (similar to typdef)
165 using YieldData_t = std::map<Int_t, Element_t>;
166 using YieldGraph_t = std::map<Int_t, TGraphErrors*>;
167 using YieldGauss_t = std::map<Int_t, TF1*>;
168 
169 struct System_t {
170  YieldData_t yields; // all yields
171  YieldGraph_t graphs; // all yields in the form of a TGraphErrors
172  YieldGraph_t lngraphs; // all Ln(yields) in the form of a TGraphErrors
173  YieldGauss_t gauss; // all gaussian fits applied to the TGraphErrors
174  std::string file_path; // input file path
175 
177 };
178 
180 /*** Isoscaling struct and map ***/
181 using IsoGraph_t = std::map<Int_t, TGraphErrors*>; // isoscaling lnR21 graphs
182 using IsoFit_t = std::map<Int_t, TF1*>; // isoscaling lnR21 fits
183 using IsoGaussRatio = std::map<Int_t, TF1*>; // ratio of the gaussian fits
184 
185 struct Isoscaling_t {
186  IsoGraph_t graphs;
187  IsoFit_t fits;
188  IsoGaussRatio gauss_ratios;
189  IsoGaussRatio gauss_ratiosln;
194 };
195 
197 class KVIsoscaling : public TObject {
198 public:
199 
201  {
203  ftol_ = 2.5;
204  fdebug_ = kFALSE;
205  }
206 
207  void ReadYieldsFile(const std::string& system_name, const Char_t* file_path);
208 
209  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
210  void BuildLnR21vsNPlots(const std::string& system_name1, const std::string& system_name2);
211 
212  void FitLnR21vsNPlots(const std::string& system_name1, const std::string& system_name2, Option_t* option = "MNVR", Option_t* gooption = "goff");
213 
214  void DrawAlphavsNFits(const std::string& system_name1, const std::string& system_name2);
215  void DrawLnR21vsNFits(const std::string& system_name1, const std::string& system_name2);
216  void BuildIsoscalingPlots(const std::string& system_name1, const std::string& system_name2, Int_t mcolor, Int_t mstyle, Bool_t draw = kFALSE);
218  void SaveResultsROOT(const Char_t* file_name = "./isoscaling_output_file.root");
219  void SaveResultsASCII(const Char_t* file_name = "./isoscaling_output_file.txt");
220 
222  Bool_t GetAMean(const std::string& system_name, Int_t zz, Float_t& meanA, Float_t& meanA_err);
223  Bool_t GetAlpha(const std::string& system_name1, const std::string& system_name2, Int_t zz, Float_t& alpha, Float_t& alpha_err);
224  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);
225  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);
226  Int_t FindZFromAmean(const std::string& system_name, Int_t aa);
228  {
229  return ftol_;
230  }
231 
232  KVNumberList GetZNumberList(const std::string& system_name);
233  KVNumberList GetANumberList(const std::string& system_name, Int_t zz);
234  KVNumberList GetSharedZNumberList(const std::string& system_name1, const std::string& system_name2);
235  KVNumberList GetSharedANumberList(const std::string& system_name1, const std::string& system_name2, Int_t zz);
236 
238  void PrintYieldsList();
239  void PrintSystemsList();
240 
242  inline void SetVerbose(Bool_t debug)
243  {
244  fdebug_ = debug;
245  }
246 
247  inline void SetRMSTolerance(Double_t tol)
248  {
249  ftol_ = tol;
250  }
251 
252 protected:
253  std::unordered_map<std::string, System_t> fSystemList_;
254  std::unordered_map<std::string, Isoscaling_t> fIsoscalingList_;
255 
258 
259  void BuildGaussianPlots(const std::string& system_name);
260 
261  ClassDef(KVIsoscaling, 2) //KVClass
262 };
263 
264 #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:197
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:253
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:242
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:227
Bool_t fdebug_
verbose mode for debugging
Definition: KVIsoscaling.h:256
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:257
void SetRMSTolerance(Double_t tol)
Definition: KVIsoscaling.h:247
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:254
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:192
IsoGaussRatio gauss_ratios
Definition: KVIsoscaling.h:188
TGraphErrors * gr_csymT
Definition: KVIsoscaling.h:193
IsoGaussRatio gauss_ratiosln
Definition: KVIsoscaling.h:189
TGraphErrors * gr_alpha
Definition: KVIsoscaling.h:190
IsoGraph_t graphs
Definition: KVIsoscaling.h:186
TGraphErrors * gr_delta
Definition: KVIsoscaling.h:191
IsoFit_t fits
Definition: KVIsoscaling.h:187
Float_t yield_err
Definition: KVIsoscaling.h:162
YieldGauss_t gauss
Definition: KVIsoscaling.h:173
YieldGraph_t lngraphs
Definition: KVIsoscaling.h:172
YieldData_t yields
Definition: KVIsoscaling.h:170
YieldGraph_t graphs
Definition: KVIsoscaling.h:171
std::string file_path
Definition: KVIsoscaling.h:174