28 fLight = fType = fZorA = 0;
29 fPar = zd = ad = xd = yd = 0;
46 if (fPar)
delete [] fPar;
47 if (istate)
delete [] istate;
70 Error(
"Fit(KVIDGraph*)",
71 "Can only fit graphs inheriting from KVIDZAGrid");
78 if (fPar)
delete [] fPar;
81 if (istate)
delete [] istate;
82 istate =
new Int_t[npar];
88 Bool_t with_xlimits = (fXmax > fXmin);
100 for (
int i = 0; i <
id->GetN(); i++) {
101 id->GetPoint(i,
x,
y);
102 if (
x >= fXmin &&
x <= fXmax) ++npts;
106 cout <<
"Points to fit = " << npts << endl;
108 Error(
"Fit(KVIDGraph*)",
109 "Too few points for fit");
115 if (zd)
delete [] zd;
116 if (ad)
delete [] ad;
117 if (xd)
delete [] xd;
118 if (yd)
delete [] yd;
127 for (
int i = 0; i <
id->GetN(); i++) {
128 id->GetPoint(i,
x,
y);
129 if ((!with_xlimits) || (
x >= fXmin &&
x <= fXmax)) {
132 zd[npts] =
id->GetZ();
133 ad[npts] =
id->GetA();
140 irc = globede_c(npts, zd, ad, xd, yd, fType, fLight, fPar, istate);
181 "addressing problem between Fortran and C",
182 "too few data points",
183 "no identification line with at least 2 points",
184 "convergence reached",
185 "convergence reached, but not well marked minimum",
186 "too many iterations, convergence not reached"
188 return message[irc + 3].
Data();
223 if (irc < 0 || irc > 1)
return;
227 fGrid->GetMassFormula());
228 fTGID->SetLTGParameters(fPar);
229 fTGID->SetIDmin(((
KVIDentifier*)fGrid->GetIdentifiers()->First())->GetZ());
230 fTGID->SetIDmax(((
KVIDentifier*)fGrid->GetIdentifiers()->Last())->GetZ());
231 fTGID->SetValidRuns(fGrid->GetRuns());
232 fTGID->SetVarX(fGrid->GetVarX());
233 fTGID->SetVarY(fGrid->GetVarY());
234 fTGID->SetIDTelescopes(fGrid->GetIDTelescopes());
262 Error(
"FitPanel",
"Set grid to fit with SetGrid(KVIDGraph*)");
265 SetFunctionalType(functional_type);
266 SetLight((
Int_t)with_csi_light_energy);
270 if (irc > 1 || irc < 0) {
271 Warning(
"FitPanel",
"Fit failed. Status of fit = %d", irc);
275 Error(
"FitPanel",
"Fit failed : %s", GetFitStatusString());
279 if (first_Z != -1) fTGID->SetIDmin(first_Z);
280 if (last_Z != -1) fTGID->SetIDmax(last_Z);
282 if (fGrid->GetXmin() == fGrid->GetXmax()) fGrid->FindAxisLimits();
KVIDGridManager * gIDGridManager
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
Base class for particle identification in a 2D map.
void Draw(Option_t *opt="")
Int_t GetMassFormula() const
virtual Bool_t HasMassIDCapability() const
void SetMassFormula(Int_t)
virtual void Initialize()=0
virtual void SetOnlyZId(Bool_t yes=kTRUE)
const KVList * GetIdentifiers() const
Identification grid with lines corresponding to different nuclear isotopes (KVIDZALine)
Base class for graphical cuts used in particle identification.
Int_t GetFitStatus() const
virtual void Fit(KVIDGraph *)
virtual ~KVTGIDFitter()
Destructor.
Int_t * GetStatusOfParameters() const
void FitPanel(Int_t functional_type=1, Bool_t with_csi_light_energy=kTRUE, Int_t first_Z=-1, Int_t last_Z=-1, Double_t xmin=0.0, Double_t xmax=0.0)
void MakeTGID()
Make a KVTGID out of fit result, if fit converged (irc<2)
const Char_t * GetFitStatusString() const
String with meaning of fit status codes (see GetFitStatus)
Grid representing result of fit.
virtual void Generate(Double_t xmax, Double_t xmin, Int_t ID_min=0, Int_t ID_max=0, Int_t npoints=50, Bool_t logscale=kTRUE)
static KVTGID * MakeTGID(const Char_t *name, Int_t type, Int_t light, Int_t ZorA, Int_t mass)
static Int_t GetNumberOfLTGParameters(Int_t type, Int_t light)
virtual Bool_t InheritsFrom(const char *classname) const
const char * Data() const
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)