1 #ifndef __JROOT__JROOTTOOLKIT__
2 #define __JROOT__JROOTTOOLKIT__
15 #include "TStreamerInfo.h"
17 #include "TIterator.h"
32 namespace JPP {
using namespace JROOT; }
60 return T::Class_Name();
73 file.WriteTObject(&
object);
89 if (file != NULL && file->IsOpen()) {
91 const TString buffer(name);
93 TIter iter(file->GetStreamerInfoList());
95 for (
const TStreamerInfo* pStreamerInfo; (pStreamerInfo = (TStreamerInfo*) iter.Next()) != NULL; ) {
96 if (buffer == TString(pStreamerInfo->GetName())) {
134 if (pStreamerInfo != NULL)
135 return pStreamerInfo->GetClassVersion();
167 inline TString
parse(TPRegexp& regexp,
const TString&
string,
int i=1)
169 TObjArray* a = regexp.MatchS(
string);
171 if (a->GetLast() > i-1){
172 s = ((TObjString*)a->At(i))->GetName();
199 const Double_t
value) :
211 inline operator Int_t()
const
230 if (parameter.
index >= 0 && parameter.
index < f1.GetNpar()) {
232 f1.SetParameter(parameter.
index, parameter.
value);
251 if (parameter.
index >= 0 && parameter.
index < f1.GetNpar()) {
253 f1.FixParameter(parameter.
index, parameter.
value);
272 if (index >= 0 && index < f1.GetNpar()) {
274 f1.ReleaseParameter(index);
293 inline bool setParLimits(TF1& f1,
const Int_t index, Double_t xmin, Double_t xmax)
297 if (index >= 0 && index < f1.GetNpar()) {
299 if (xmin == 0.0) { xmin = -numeric_limits<Double_t>::min(); }
300 if (xmax == 0.0) { xmax = +numeric_limits<Double_t>::min(); }
302 f1.SetParLimits(index, xmin, xmax);
321 if (index >= 0 && index < f1.GetNpar()) {
326 f1.GetParLimits(index, xmin, xmax);
328 return (xmin != 0.0 && xmax != 0.0 && xmin >= xmax);
359 string buffer = (
const char*)
text;
361 for (string::size_type pos = 0; pos != buffer.size(); ) {
363 if (isalpha(buffer[pos]) || buffer[pos] ==
'_') {
365 string::size_type len = 1;
367 while (pos + len != buffer.size() && (isalnum(buffer[pos+len]) || buffer[pos+len] ==
'_' || buffer[pos+len] ==
'.')) {
377 buffer.replace(pos, len, os.str());
379 pos += os.str().size();
387 return TFormula(
"/tmp", buffer.c_str()).Eval(0.0);
404 object = TRegexp(buffer.c_str());
418 std::ostream&
operator<<(std::ostream& out,
const TRegexp&
object)