Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JRootToolkit.hh File Reference
#include <string>
#include <istream>
#include <ostream>
#include <limits>
#include <cctype>
#include <vector>
#include "TString.h"
#include "TObjString.h"
#include "TRegexp.h"
#include "TPRegexp.h"
#include "TFormula.h"
#include "TFile.h"
#include "TStreamerInfo.h"
#include "TIterator.h"
#include "TF1.h"
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "TGraph.h"
#include "TGraphErrors.h"
#include "TGraphAsymmErrors.h"
#include "TGraph2D.h"
#include "TGraph2DErrors.h"
#include "TMultiGraph.h"
#include "TNtuple.h"
#include "JLang/JType.hh"
#include "JLang/JLangToolkit.hh"
#include "Jeep/JPrint.hh"
#include "JROOT/JRootFile.hh"

Go to the source code of this file.

Classes

struct  JROOT::JFitParameter_t
 Auxiliary data structure for a parameter index and its value. More...
 

Namespaces

namespace  JROOT
 Auxiliary classes and methods for ROOT I/O.
 
namespace  JPP
 This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 

Macros

#define RESET_OBJECT(T, P, O)
 
#define RESET_OBJECT(T, P, O)
 

Functions

template<class T >
const char * JROOT::getName ()
 Get ROOT name of given data type.
 
template<class T >
const char * JROOT::getName (const JType< T > &type)
 Get ROOT name of given data type.
 
void JROOT::resetObject (TH3 *h3, const bool reset=false)
 Reset TH3 object.
 
void JROOT::resetObject (TH2 *h2, const bool reset=false)
 Reset TH2 object.
 
void JROOT::resetObject (TH1 *h1, const bool reset=false)
 Reset TH1 object.
 
void JROOT::resetObject (TGraph *g1, const bool reset=false)
 Reset TGraph object.
 
void JROOT::resetObject (TGraphErrors *g1, const bool reset=false)
 Reset TGraphErrors object.
 
void JROOT::resetObject (TGraphAsymmErrors *g1, const bool reset=false)
 Reset TGraphAsymmErrors object.
 
void JROOT::resetObject (TGraph2D *g2, const bool reset=false)
 Reset TGraph2D object.
 
void JROOT::resetObject (TGraph2DErrors *g2, const bool reset=false)
 Reset TGraph2DErrors object.
 
void JROOT::resetObject (TMultiGraph *gs, const bool reset=false)
 Reset TMultiGraph object.
 
void JROOT::AddPoint (TGraph *g1, const Double_t x, const Double_t y)
 Add point to TGraph.
 
void JROOT::AddPoint (TGraphErrors *g1, const Double_t x, const Double_t y, const Double_t ex, const Double_t ey)
 Add point to TGraphErrors.
 
void JROOT::AddPoint (TGraphAsymmErrors *g1, const Double_t x, const Double_t y, const Double_t exl, const Double_t exh, const Double_t eyl, const Double_t eyh)
 Add point to TGraphAsymmErrors.
 
void JROOT::AddPoint (TGraph2D *g1, const Double_t x, const Double_t y, const Double_t z)
 Add point to TGraph2D.
 
void JROOT::AddPoint (TGraph2DErrors *g1, const Double_t x, const Double_t y, const Double_t z, const Double_t ex, const Double_t ey, const Double_t ez)
 Add point to TGraph2DErrors.
 
TFile & JROOT::operator<< (TFile &file, const TObject &object)
 Write object to ROOT file.
 
const TStreamerInfo * JROOT::getStreamerInfo (TFile *file, const char *const name)
 Get ROOT streamer information of class with given name.
 
const TStreamerInfo * JROOT::getStreamerInfo (const char *const file_name, const char *const name)
 Get ROOT streamer information of class with given name.
 
int JROOT::getStreamerVersion (TFile *file, const char *const name)
 Get ROOT streamer version of class with given name.
 
int JROOT::getStreamerVersion (const char *const file_name, const char *const name)
 Get ROOT streamer version of class with given name.
 
TString JROOT::parse (const TPRegexp &regexp, const TString &string, const int index=1)
 Match a regular expression with given string and return the specified matched parts.
 
bool JROOT::setParameter (TF1 &f1, const JFitParameter_t &parameter)
 Set fit parameter.
 
bool JROOT::fixParameter (TF1 &f1, const JFitParameter_t &parameter)
 Fix fit parameter.
 
bool JROOT::releaseParameter (TF1 &f1, const Int_t index)
 Release fit parameter.
 
bool JROOT::setParLimits (TF1 &f1, const Int_t index, Double_t xmin, Double_t xmax)
 Set fit parameter limits.
 
bool JROOT::isParameterFixed (const TF1 &f1, const Int_t index)
 Check if fit parameter is fixed.
 
TGraph * JROOT::histogramToGraph (const TH1 &h1)
 Helper method to convert a 1D histogram to a graph.
 
TH1 * JROOT::projectHistogram (const TH2 &h2, const Double_t xmin, const Double_t xmax, const char projection)
 Helper method for ROOT histogram projections.
 
std::istream & operator>> (std::istream &in, TRegexp &object)
 Read regular expression from input stream.
 
std::ostream & operator<< (std::ostream &out, const TRegexp &object)
 Write regular expression to output stream.
 
std::istream & operator>> (std::istream &in, TFormula &object)
 Read formula from input stream.
 
std::ostream & operator<< (std::ostream &out, const TFormula &object)
 Write formula to output stream.
 

Macro Definition Documentation

◆ RESET_OBJECT [1/2]

#define RESET_OBJECT ( T,
P,
O )
Value:
if (dynamic_cast<T*>(P) != NULL) { resetObject(dynamic_cast<T*>(P), O); return; }

◆ RESET_OBJECT [2/2]

#define RESET_OBJECT ( T,
P,
O )
Value:
if (dynamic_cast<T*>(P) != NULL) { resetObject(dynamic_cast<T*>(P), O); continue; }

Function Documentation

◆ operator>>() [1/2]

std::istream & operator>> ( std::istream & in,
TRegexp & object )
inline

Read regular expression from input stream.

Parameters
ininput stream
objectregular expression
Returns
output stream

Definition at line 736 of file JRootToolkit.hh.

737{
738 std::string buffer;
739
740 if (in >> buffer) {
741 object = TRegexp(buffer.c_str());
742 }
743
744 return in;
745}

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream & out,
const TRegexp & object )
inline

Write regular expression to output stream.

Parameters
outoutput stream
objectregular expression
Returns
output stream

Definition at line 755 of file JRootToolkit.hh.

756{
757 return out;
758}

◆ operator>>() [2/2]

std::istream & operator>> ( std::istream & in,
TFormula & object )
inline

Read formula from input stream.

Parameters
ininput stream
objectformula
Returns
input stream

Definition at line 768 of file JRootToolkit.hh.

769{
770 std::string buffer;
771
772 if (getline(in,buffer)) {
773 object = TFormula("", buffer.c_str());
774 }
775
776 return in;
777}
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition JString.hh:478

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & out,
const TFormula & object )
inline

Write formula to output stream.

Parameters
outoutput stream
objectformula
Returns
output stream

Definition at line 787 of file JRootToolkit.hh.

788{
789 return out << object.GetExpFormula();
790}