4 #include "KVIDGridManager.h"
5 #include "KVIDZAFromZGrid.h"
49 using mass_dist_stat_t = std::unordered_map<std::string,std::vector<std::string>>;
50 std::map<int,mass_dist_stat_t> all_mass_ranges;
52 std::unordered_map<std::string,int> theRunLists;
53 std::optional<KVNumberList> currentRunList;
54 bool has_multi_runlists()
const {
return theRunLists.size()>1; }
55 void correct_masses_for_grid(
const TString& grid_name,
int Z,
int deltaA,
68 if(
gr && (!has_multi_runlists() || (currentRunList && (!
gr->HasRunList() || currentRunList->SubsetOf(
gr->GetRuns())))))
70 if(
gr && has_multi_runlists() && currentRunList &&
gr->GetRuns().SubsetOf(*currentRunList))
73 "Check current runlist (%s): grid %s may be included several times (this version is for runs %s)",
74 currentRunList->AsString(),
gr->
GetName(),
gr->GetRunList());
79 void Analyse(
const TString& gridname,
double min_yield)
81 auto gr = GetGrid(gridname);
82 Analyse(
gr,min_yield);
94 return currentRunList.value_or(
"");
102 if(has_multi_runlists() && !currentRunList)
104 KVError::Error(
this,
"Analyse",
"Grids have multiple runlists. You must choose the current runlist first:");
105 for(
auto& rl : theRunLists)
109 " - %d grids are valid for runlist %s", rl.second, rl.first.c_str());
113 for(
auto obj : *theGrids.
GetGrids())
115 Analyse(GetGrid(obj),min_yield);
123 return GetGrid(theGrids.
GetGrid(gridname));
126 void ShowFits(
int Z,
const std::string& alist);
127 void CorrectMasses(
int Z,
const std::string& alist,
int deltaA,
134 all_mass_ranges.clear();
#define ClassDefOverride(name, id)
Base class for KaliVeda framework.
Handles a stock of identification grids to be used by one or more identification telescopes.
KVIDGraph * GetGrid(const Char_t *name) const
Return pointer to grid with name "name".
const KVSeqCollection * GetGrids() const
Check & correct if necessary that isotopic masses used in different multi-gauss fits are consistent.
KVIDZAFromZGrid * GetGrid(const TString &gridname)
void Analyse(double min_yield)
void CorrectMassesForTelescope(int Z, const TString &idtel, int deltaA, const KVNameValueList &mass_fit_parameters)
void SaveGrids(const TString &filename)
Save all grids: overwrites original file if no filename given (filename=""), otherwise writes a new f...
KVIDZAFromZGridMassHomogenizer(const TString &gridfile, const TString &datafile)
void CorrectMasses(int Z, const std::string &alist, int deltaA, const KVNameValueList &mass_fit_parameters)
void ShowFits(int Z, const std::string &alist)
void SetCurrentRunList(const TString &runs)
KVNumberList GetCurrentRunList() const
Hybrid charge & mass identification grid.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Strings used to represent a set of ranges of values.
const char * GetName() const override
void Error(UserClass p, const char *location, const char *va_(fmt),...)
void Warning(UserClass p, const char *location, const char *va_(fmt),...)
void Info(UserClass p, const char *location, const char *va_(fmt),...)