GRSISort
Created by P.C. Bender
Developement Team: P.C. Bender, R. Dunlop, V. Bildstein
An extension of the ROOT analysis Framework
TCalibrationGraphSet Class Reference

Definition at line 44 of file TCalibrationGraph.h.

Public Member Functions

 TCalibrationGraphSet (TGraphErrors *graph=nullptr, const std::string &label="")
 
 ~TCalibrationGraphSet ()
 
void Add (TGraphErrors *, const std::string &label)
 
void DrawCalibration (Option_t *opt="", TLegend *legend=nullptr)
 
void DrawResidual (Option_t *opt="", TLegend *legend=nullptr)
 
void Fit (TF1 *function, Option_t *opt="")
 
TF1 * FitFunction ()
 
double * GetEX ()
 
double * GetEY ()
 
double GetMaximumX ()
 
double GetMaximumY ()
 
double GetMinimumX ()
 
double GetMinimumY ()
 
int GetN ()
 
double * GetX ()
 
double * GetY ()
 
TCalibrationGraphGraph (size_t i)
 
size_t NumberOfGraphs ()
 
TCalibrationGraphSetoperator= (const TCalibrationGraphSet &rhs)
 
void Print ()
 
Int_t RemovePoint ()
 
Int_t RemoveResidualPoint ()
 
void ResetTotalGraph ()
 
TCalibrationGraphResidual (size_t i)
 
void Scale ()
 
void SetLineColor (int index, int color)
 
void SetMarkerColor (int index, int color)
 
bool SetResidual (const bool &force=false)
 
TGraphErrors * TotalGraph ()
 
void VerboseLevel (int val)
 

Private Attributes

std::vector< size_t > fGraphIndex
 
std::vector< TCalibrationGraphfGraphs
 
std::vector< std::string > fLabel
 
double fMaximumX {0.}
 
double fMaximumY {0.}
 
double fMinimumX {0.}
 
double fMinimumY {0.}
 
std::vector< size_t > fPointIndex
 
std::vector< TCalibrationGraphfResidualGraphs
 
bool fResidualSet {false}
 
TGraphErrors * fTotalGraph {nullptr}
 
TGraphErrors * fTotalResidualGraph {nullptr}
 
int fVerboseLevel {0}
 

#include <TCalibrationGraph.h>

+ Inheritance diagram for TCalibrationGraphSet:
+ Collaboration diagram for TCalibrationGraphSet:

Constructor & Destructor Documentation

◆ TCalibrationGraphSet()

TCalibrationGraphSet::TCalibrationGraphSet ( TGraphErrors *  graph = nullptr,
const std::string &  label = "" 
)

Definition at line 44 of file TCalibrationGraph.cxx.

References Add(), fTotalGraph, fTotalResidualGraph, fVerboseLevel, and Print().

◆ ~TCalibrationGraphSet()

TCalibrationGraphSet::~TCalibrationGraphSet ( )

Definition at line 54 of file TCalibrationGraph.cxx.

Member Function Documentation

◆ Add()

void TCalibrationGraphSet::Add ( TGraphErrors *  graph,
const std::string &  label 
)

◆ DrawCalibration()

void TCalibrationGraphSet::DrawCalibration ( Option_t *  opt = "",
TLegend *  legend = nullptr 
)

Definition at line 163 of file TCalibrationGraph.cxx.

References fGraphs, fLabel, fTotalGraph, and fVerboseLevel.

◆ DrawResidual()

void TCalibrationGraphSet::DrawResidual ( Option_t *  opt = "",
TLegend *  legend = nullptr 
)

Definition at line 178 of file TCalibrationGraph.cxx.

References fLabel, fResidualGraphs, fTotalResidualGraph, and fVerboseLevel.

◆ Fit()

void TCalibrationGraphSet::Fit ( TF1 *  function,
Option_t *  opt = "" 
)
inline

Fits the provided function to the total graph.

Definition at line 66 of file TCalibrationGraph.h.

References fTotalGraph.

◆ FitFunction()

TF1* TCalibrationGraphSet::FitFunction ( )
inline

Gets the calibration from the total graph (might be nullptr!).

Definition at line 67 of file TCalibrationGraph.h.

References fTotalGraph.

Referenced by SetResidual().

◆ GetEX()

double* TCalibrationGraphSet::GetEX ( )
inline

Returns an array of x-errors of the total graph.

Definition at line 58 of file TCalibrationGraph.h.

References fTotalGraph.

◆ GetEY()

double* TCalibrationGraphSet::GetEY ( )
inline

Returns an array of y-errors of the total graph.

Definition at line 59 of file TCalibrationGraph.h.

References fTotalGraph.

◆ GetMaximumX()

double TCalibrationGraphSet::GetMaximumX ( )
inline

Return maximum x-value.

Definition at line 62 of file TCalibrationGraph.h.

References fMaximumX.

◆ GetMaximumY()

double TCalibrationGraphSet::GetMaximumY ( )
inline

Return maximum y-value.

Definition at line 64 of file TCalibrationGraph.h.

References fMaximumY.

◆ GetMinimumX()

double TCalibrationGraphSet::GetMinimumX ( )
inline

Return minimum x-value.

Definition at line 61 of file TCalibrationGraph.h.

References fMinimumX.

◆ GetMinimumY()

double TCalibrationGraphSet::GetMinimumY ( )
inline

Return minimum y-value.

Definition at line 63 of file TCalibrationGraph.h.

References fMinimumY.

◆ GetN()

int TCalibrationGraphSet::GetN ( )
inline

Returns GetN(), i.e. number of points of the total graph.

Definition at line 55 of file TCalibrationGraph.h.

References fTotalGraph.

Referenced by Scale(), and SetResidual().

◆ GetX()

double* TCalibrationGraphSet::GetX ( )
inline

Returns an array of x-values of the total graph.

Definition at line 56 of file TCalibrationGraph.h.

References fTotalGraph.

◆ GetY()

double* TCalibrationGraphSet::GetY ( )
inline

Returns an array of y-values of the total graph.

Definition at line 57 of file TCalibrationGraph.h.

References fTotalGraph.

◆ Graph()

TCalibrationGraph* TCalibrationGraphSet::Graph ( size_t  i)
inline

Definition at line 70 of file TCalibrationGraph.h.

References fGraphs.

◆ NumberOfGraphs()

size_t TCalibrationGraphSet::NumberOfGraphs ( )
inline

Definition at line 69 of file TCalibrationGraph.h.

References fGraphs.

◆ operator=()

TCalibrationGraphSet& TCalibrationGraphSet::operator= ( const TCalibrationGraphSet rhs)
inline

Assignment operator that takes care of properly cloning all the pointers to objects.

Definition at line 86 of file TCalibrationGraph.h.

References fGraphIndex, fGraphs, fLabel, fPointIndex, fResidualGraphs, fResidualSet, fTotalGraph, and fTotalResidualGraph.

◆ Print()

void TCalibrationGraphSet::Print ( )

◆ RemovePoint()

Int_t TCalibrationGraphSet::RemovePoint ( )

This function is primarily a copy of TGraph::RemovePoint with some added bits to remove a point that has been selected in the calibration graph from it and the corresponding point from the residual graph and the total graphs

Definition at line 193 of file TCalibrationGraph.cxx.

References fGraphIndex, fGraphs, fPointIndex, fResidualGraphs, fResidualSet, fTotalGraph, fTotalResidualGraph, fVerboseLevel, and Print().

Referenced by ClassImp().

◆ RemoveResidualPoint()

Int_t TCalibrationGraphSet::RemoveResidualPoint ( )

This function is primarily a copy of TGraph::RemovePoint with some added bits to remove a point that has been selected in the residual graph from it and the corresponding point from the calibration graph and the total graphs

Definition at line 251 of file TCalibrationGraph.cxx.

References fGraphIndex, fGraphs, fPointIndex, fResidualGraphs, fTotalResidualGraph, fVerboseLevel, and Print().

Referenced by ClassImp().

◆ ResetTotalGraph()

void TCalibrationGraphSet::ResetTotalGraph ( )

reset the total graph and add the individual ones again (used e.g. after scaling of individual graphs is done)

Definition at line 346 of file TCalibrationGraph.cxx.

References fGraphIndex, fGraphs, fMaximumX, fMaximumY, fMinimumX, fMinimumY, fPointIndex, fResidualSet, fTotalGraph, fTotalResidualGraph, and fVerboseLevel.

Referenced by Scale().

◆ Residual()

TCalibrationGraph* TCalibrationGraphSet::Residual ( size_t  i)
inline

Definition at line 71 of file TCalibrationGraph.h.

References fResidualGraphs.

◆ Scale()

void TCalibrationGraphSet::Scale ( )

scale all graphs to fit each other (based on the first graph)

Definition at line 308 of file TCalibrationGraph.cxx.

References fGraphs, fVerboseLevel, GetN(), Print(), and ResetTotalGraph().

◆ SetLineColor()

void TCalibrationGraphSet::SetLineColor ( int  index,
int  color 
)
inline

Set the line color of the graph and residuals at index.

Definition at line 52 of file TCalibrationGraph.h.

References fGraphs, and fResidualGraphs.

◆ SetMarkerColor()

void TCalibrationGraphSet::SetMarkerColor ( int  index,
int  color 
)
inline

Set the marker color of the graph and residuals at index.

Definition at line 53 of file TCalibrationGraph.h.

References fGraphs, and fResidualGraphs.

◆ SetResidual()

bool TCalibrationGraphSet::SetResidual ( const bool &  force = false)

◆ TotalGraph()

TGraphErrors* TCalibrationGraphSet::TotalGraph ( )
inline

Definition at line 68 of file TCalibrationGraph.h.

References fTotalGraph.

◆ VerboseLevel()

void TCalibrationGraphSet::VerboseLevel ( int  val)
inline

Definition at line 106 of file TCalibrationGraph.h.

References fGraphs, fResidualGraphs, and fVerboseLevel.

Member Data Documentation

◆ fGraphIndex

std::vector<size_t> TCalibrationGraphSet::fGraphIndex
private

Index of the graph this point belongs to.

Definition at line 114 of file TCalibrationGraph.h.

Referenced by Add(), operator=(), Print(), RemovePoint(), RemoveResidualPoint(), and ResetTotalGraph().

◆ fGraphs

std::vector<TCalibrationGraph> TCalibrationGraphSet::fGraphs
private

These are the graphs used for plotting the calibration points per source.

Definition at line 109 of file TCalibrationGraph.h.

Referenced by Add(), DrawCalibration(), Graph(), NumberOfGraphs(), operator=(), Print(), RemovePoint(), RemoveResidualPoint(), ResetTotalGraph(), Scale(), SetLineColor(), SetMarkerColor(), SetResidual(), and VerboseLevel().

◆ fLabel

std::vector<std::string> TCalibrationGraphSet::fLabel
private

The labels for the different graphs.

Definition at line 111 of file TCalibrationGraph.h.

Referenced by Add(), DrawCalibration(), DrawResidual(), operator=(), and Print().

◆ fMaximumX

double TCalibrationGraphSet::fMaximumX {0.}
private

Maximum x-value.

Definition at line 118 of file TCalibrationGraph.h.

Referenced by Add(), GetMaximumX(), and ResetTotalGraph().

◆ fMaximumY

double TCalibrationGraphSet::fMaximumY {0.}
private

Maximum y-value.

Definition at line 120 of file TCalibrationGraph.h.

Referenced by Add(), GetMaximumY(), and ResetTotalGraph().

◆ fMinimumX

double TCalibrationGraphSet::fMinimumX {0.}
private

Minimum x-value.

Definition at line 117 of file TCalibrationGraph.h.

Referenced by Add(), GetMinimumX(), and ResetTotalGraph().

◆ fMinimumY

double TCalibrationGraphSet::fMinimumY {0.}
private

Minimum y-value.

Definition at line 119 of file TCalibrationGraph.h.

Referenced by Add(), GetMinimumY(), and ResetTotalGraph().

◆ fPointIndex

std::vector<size_t> TCalibrationGraphSet::fPointIndex
private

Index of the point within the graph this point corresponds to.

Definition at line 115 of file TCalibrationGraph.h.

Referenced by Add(), operator=(), Print(), RemovePoint(), RemoveResidualPoint(), and ResetTotalGraph().

◆ fResidualGraphs

std::vector<TCalibrationGraph> TCalibrationGraphSet::fResidualGraphs
private

These are the graphs used for plotting the residuals per source.

Definition at line 110 of file TCalibrationGraph.h.

Referenced by Add(), DrawResidual(), operator=(), Print(), RemovePoint(), RemoveResidualPoint(), Residual(), SetLineColor(), SetMarkerColor(), SetResidual(), and VerboseLevel().

◆ fResidualSet

bool TCalibrationGraphSet::fResidualSet {false}
private

Flag to indicate if the residual has been set correctly.

Definition at line 116 of file TCalibrationGraph.h.

Referenced by Add(), operator=(), RemovePoint(), ResetTotalGraph(), and SetResidual().

◆ fTotalGraph

TGraphErrors* TCalibrationGraphSet::fTotalGraph {nullptr}
private

The sum of the other graphs, used for fitting.

Definition at line 112 of file TCalibrationGraph.h.

Referenced by Add(), DrawCalibration(), Fit(), FitFunction(), GetEX(), GetEY(), GetN(), GetX(), GetY(), operator=(), Print(), RemovePoint(), ResetTotalGraph(), SetResidual(), TCalibrationGraphSet(), and TotalGraph().

◆ fTotalResidualGraph

TGraphErrors* TCalibrationGraphSet::fTotalResidualGraph {nullptr}
private

The sum of the residuals. Not really used apart from plotting (but overlayed with the individual graphs).

Definition at line 113 of file TCalibrationGraph.h.

Referenced by Add(), DrawResidual(), operator=(), Print(), RemovePoint(), RemoveResidualPoint(), ResetTotalGraph(), SetResidual(), and TCalibrationGraphSet().

◆ fVerboseLevel

int TCalibrationGraphSet::fVerboseLevel {0}
private

Changes verbosity from 0 (quiet) to 4 (very verbose)

Definition at line 122 of file TCalibrationGraph.h.

Referenced by Add(), DrawCalibration(), DrawResidual(), RemovePoint(), RemoveResidualPoint(), ResetTotalGraph(), Scale(), SetResidual(), TCalibrationGraphSet(), and VerboseLevel().