KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
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 ***/
165using Element_t = std::map<Int_t, IsotopeYield_t>; // Type alias with "using" keyword (similar to typdef)
166using YieldData_t = std::map<Int_t, Element_t>;
167using YieldGraph_t = std::map<Int_t, TGraphErrors*>;
168using YieldGauss_t = std::map<Int_t, TF1*>;
169
170struct 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 ***/
182using IsoGraph_t = std::map<Int_t, TGraphErrors*>; // isoscaling lnR21 graphs
183using IsoFit_t = std::map<Int_t, TF1*>; // isoscaling lnR21 fits
184using IsoGaussRatio = std::map<Int_t, TF1*>; // ratio of the gaussian fits
185
196
198class KVIsoscaling : public TObject {
199public:
200
202 {
204 ftol_ = 2.5;
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
253protected:
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.
KVNumberList GetANumberList(const std::string &system_name, Int_t zz)
std::unordered_map< std::string, System_t > fSystemList_
(hash) map by name
void DrawAlphavsNFits(const std::string &system_name1, const std::string &system_name2)
void PrintYieldsList()
— Printers —
void SetVerbose(Bool_t debug)
— inline methods —
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()
Bool_t fdebug_
verbose mode for debugging
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)
void SetRMSTolerance(Double_t tol)
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
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.
TGraphErrors * gr_alpha_delta
IsoGaussRatio gauss_ratios
TGraphErrors * gr_csymT
IsoGaussRatio gauss_ratiosln
TGraphErrors * gr_alpha
IsoGraph_t graphs
TGraphErrors * gr_delta
IsoFit_t fits
YieldGauss_t gauss
YieldGraph_t lngraphs
YieldData_t yields
YieldGraph_t graphs
std::string file_path