1 #ifndef __JROOTTOOLKIT__
2 #define __JROOTTOOLKIT__
7 #include "TStreamerInfo.h"
21 namespace JPP {
using namespace JROOT; }
35 file.WriteTObject(&
object);
51 if (file != NULL && file->IsOpen()) {
53 const TString buffer(name);
55 TIter iter(file->GetStreamerInfoList());
57 for (
const TStreamerInfo* pStreamerInfo; (pStreamerInfo = (TStreamerInfo*) iter.Next()) != NULL; ) {
58 if (buffer == TString(pStreamerInfo->GetName())) {
76 inline const TStreamerInfo*
getStreamerInfo(
const char* file_name,
const char* name)
96 if (pStreamerInfo != NULL)
97 return pStreamerInfo->GetClassVersion();
139 const Double_t
value) :
151 inline operator Int_t()
const
170 if (parameter.
index >= 0 && parameter.
index < f1.GetNpar()) {
172 f1.SetParameter(parameter.
index, parameter.
value);
191 if (parameter.
index >= 0 && parameter.
index < f1.GetNpar()) {
193 f1.FixParameter(parameter.
index, parameter.
value);
212 if (index >= 0 && index < f1.GetNpar()) {
214 f1.ReleaseParameter(index);
233 inline bool setParLimits(TF1& f1,
const Int_t index, Double_t xmin, Double_t xmax)
237 if (index >= 0 && index < f1.GetNpar()) {
239 if (xmin == 0.0) { xmin = -numeric_limits<Double_t>::min(); }
240 if (xmax == 0.0) { xmax = +numeric_limits<Double_t>::min(); }
242 f1.SetParLimits(index, xmin, xmax);
261 if (index >= 0 && index < f1.GetNpar()) {
266 f1.GetParLimits(index, xmin, xmax);
268 return (xmin != 0.0 && xmax != 0.0 && xmin >= xmax);
JFitParameter_t(const Int_t index, const Double_t value)
Constructor.
int getStreamerVersion(TFile *file, const char *name)
Get ROOT streamer version of class with given name.
const TStreamerInfo * getStreamerInfo(TFile *file, const char *name)
Get ROOT streamer information of class with given name.
bool releaseParameter(TF1 &f1, const Int_t index)
Release fit parameter.
JFitParameter_t()
Default constructor.
bool isParameterFixed(TF1 &f1, const Int_t index)
Check if fit parameter is fixed.
Auxiliary data structure for a parameter index and its value.
TFile * getFile() const
Get file.
bool setParameter(TF1 &f1, const JFitParameter_t ¶meter)
Set fit parameter.
bool setParLimits(TF1 &f1, const Int_t index, Double_t xmin, Double_t xmax)
Set fit parameter limits.
bool fixParameter(TF1 &f1, const JFitParameter_t ¶meter)
Fix fit parameter.