GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TCalibrationGraphSet Class Reference

Detailed Description

Definition at line 49 of file TCalibrationGraph.h.

Public Member Functions

 TCalibrationGraphSet (const TCalibrationGraphSet &)=delete
 
 TCalibrationGraphSet (std::string xAxisLabel, std::string yAxisLabel)
 
 TCalibrationGraphSet (TCalibrationGraphSet &&) noexcept=delete
 
 TCalibrationGraphSet (TGraphErrors *graph=nullptr, const std::string &label="")
 
 ~TCalibrationGraphSet ()
 
int Add (TGraphErrors *, const std::string &label)
 
void Clear (Option_t *option="") override
 
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 () const
 
double GetMaximumY () const
 
double GetMinimumX () const
 
double GetMinimumY () const
 
int GetN ()
 
double * GetX ()
 
double * GetY ()
 
TCalibrationGraphGraph (size_t index)
 
size_t NumberOfGraphs ()
 
TCalibrationGraphSetoperator= (const TCalibrationGraphSet &rhs)
 
TCalibrationGraphSetoperator= (TCalibrationGraphSet &&) noexcept=delete
 
void Print (Option_t *opt="") const override
 
void RemoveGraph (int64_t index)
 
Int_t RemovePoint (const Int_t &px, const Int_t &py)
 
Int_t RemoveResidualPoint (const Int_t &px, const Int_t &py)
 
void ResetTotalGraph ()
 
TCalibrationGraphResidual (size_t index)
 
void Scale (bool useAllPrevious=true)
 
void SetAxisTitle (const char *title)
 
void SetColor (int index, Color_t color)
 
void SetColorStyle (int index, int val)
 
void SetLineColor (int index, Color_t color)
 
void SetMarkerColor (int index, Color_t color)
 
void SetMarkerStyle (int index, Style_t style)
 
bool SetResidual (const bool &force=false)
 
TGraphErrors * TotalGraph ()
 
std::string XAxisLabel ()
 
void XAxisLabel (const std::string &xAxisLabel)
 
std::string YAxisLabel ()
 
void YAxisLabel (const std::string &yAxisLabel)
 

Static Public Member Functions

static EVerbosity VerboseLevel ()
 
static void VerboseLevel (EVerbosity 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}
 
std::string fXAxisLabel
 
std::string fYAxisLabel
 

Static Private Attributes

static EVerbosity fVerboseLevel = EVerbosity::kQuiet
 
+ Inheritance diagram for TCalibrationGraphSet:
+ Collaboration diagram for TCalibrationGraphSet:

Constructor & Destructor Documentation

◆ TCalibrationGraphSet() [1/4]

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

Definition at line 37 of file TCalibrationGraph.cxx.

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

◆ TCalibrationGraphSet() [2/4]

TCalibrationGraphSet::TCalibrationGraphSet ( std::string xAxisLabel,
std::string yAxisLabel )

Definition at line 47 of file TCalibrationGraph.cxx.

References fTotalGraph, fVerboseLevel, and kBasicFlow.

◆ ~TCalibrationGraphSet()

TCalibrationGraphSet::~TCalibrationGraphSet ( )

Definition at line 53 of file TCalibrationGraph.cxx.

References fTotalGraph, and fTotalResidualGraph.

◆ TCalibrationGraphSet() [3/4]

TCalibrationGraphSet::TCalibrationGraphSet ( const TCalibrationGraphSet & )
delete

◆ TCalibrationGraphSet() [4/4]

TCalibrationGraphSet::TCalibrationGraphSet ( TCalibrationGraphSet && )
deletenoexcept

Member Function Documentation

◆ Add()

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

Add new graph to set, using the label when creating legends during plotting.

Definition at line 59 of file TCalibrationGraph.cxx.

References fGraphIndex, fGraphs, fLabel, fMaximumX, fMaximumY, fMinimumX, fMinimumY, fPointIndex, fResidualGraphs, fResidualSet, fTotalGraph, fTotalResidualGraph, fVerboseLevel, kBasicFlow, kSubroutines, and Print().

Referenced by TCalibrationGraphSet(), TChannelTab::UpdateData(), and TChannelTab::UpdateFwhm().

◆ Clear()

void TCalibrationGraphSet::Clear ( Option_t * option = "")
override

◆ DrawCalibration()

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

◆ DrawResidual()

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

◆ Fit()

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

Fits the provided function to the total graph.

Definition at line 127 of file TCalibrationGraph.h.

References fTotalGraph.

Referenced by TChannelTab::Calibrate().

◆ FitFunction()

TF1 * TCalibrationGraphSet::FitFunction ( )
inline

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

Definition at line 128 of file TCalibrationGraph.h.

References fTotalGraph.

Referenced by SetResidual(), and TChannelTab::UpdateChannel().

◆ GetEX()

double * TCalibrationGraphSet::GetEX ( )
inline

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

Definition at line 119 of file TCalibrationGraph.h.

References fTotalGraph.

◆ GetEY()

double * TCalibrationGraphSet::GetEY ( )
inline

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

Definition at line 120 of file TCalibrationGraph.h.

References fTotalGraph.

◆ GetMaximumX()

double TCalibrationGraphSet::GetMaximumX ( ) const
inline

Return maximum x-value.

Definition at line 123 of file TCalibrationGraph.h.

References fMaximumX.

Referenced by TChannelTab::Calibrate().

◆ GetMaximumY()

double TCalibrationGraphSet::GetMaximumY ( ) const
inline

Return maximum y-value.

Definition at line 125 of file TCalibrationGraph.h.

References fMaximumY.

Referenced by TChannelTab::Calibrate().

◆ GetMinimumX()

double TCalibrationGraphSet::GetMinimumX ( ) const
inline

Return minimum x-value.

Definition at line 122 of file TCalibrationGraph.h.

References fMinimumX.

Referenced by TChannelTab::Calibrate().

◆ GetMinimumY()

double TCalibrationGraphSet::GetMinimumY ( ) const
inline

Return minimum y-value.

Definition at line 124 of file TCalibrationGraph.h.

References fMinimumY.

Referenced by TChannelTab::Calibrate().

◆ GetN()

int TCalibrationGraphSet::GetN ( )
inline

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

Definition at line 116 of file TCalibrationGraph.h.

References fTotalGraph.

Referenced by TChannelTab::Calibrate(), SetResidual(), TChannelTab::UpdateChannel(), TChannelTab::UpdateData(), and TChannelTab::UpdateFwhm().

◆ GetX()

double * TCalibrationGraphSet::GetX ( )
inline

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

Definition at line 117 of file TCalibrationGraph.h.

References fTotalGraph.

Referenced by TChannelTab::UpdateChannel().

◆ GetY()

double * TCalibrationGraphSet::GetY ( )
inline

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

Definition at line 118 of file TCalibrationGraph.h.

References fTotalGraph.

Referenced by TChannelTab::UpdateChannel().

◆ Graph()

TCalibrationGraph * TCalibrationGraphSet::Graph ( size_t index)
inline

Definition at line 131 of file TCalibrationGraph.h.

References fGraphs.

◆ NumberOfGraphs()

size_t TCalibrationGraphSet::NumberOfGraphs ( )
inline

Definition at line 130 of file TCalibrationGraph.h.

References fGraphs.

◆ operator=() [1/2]

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

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

Definition at line 56 of file TCalibrationGraph.h.

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

◆ operator=() [2/2]

TCalibrationGraphSet & TCalibrationGraphSet::operator= ( TCalibrationGraphSet && )
deletenoexcept

◆ Print()

◆ RemoveGraph()

void TCalibrationGraphSet::RemoveGraph ( int64_t index)
inline

Definition at line 137 of file TCalibrationGraph.h.

References fGraphs, and ResetTotalGraph().

◆ RemovePoint()

Int_t TCalibrationGraphSet::RemovePoint ( const Int_t & px,
const Int_t & py )

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 241 of file TCalibrationGraph.cxx.

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

Referenced by TCalibrationGraph::RemovePoint(), RemovePoint(), and RemoveResidualPoint().

◆ RemoveResidualPoint()

Int_t TCalibrationGraphSet::RemoveResidualPoint ( const Int_t & px,
const Int_t & py )

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 322 of file TCalibrationGraph.cxx.

References fGraphIndex, fGraphs, fPointIndex, fResidualGraphs, fTotalGraph, fTotalResidualGraph, fVerboseLevel, kBasicFlow, kSubroutines, Print(), and RemovePoint().

Referenced by TCalibrationGraph::RemovePoint().

◆ 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 440 of file TCalibrationGraph.cxx.

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

Referenced by RemoveGraph(), and Scale().

◆ Residual()

TCalibrationGraph * TCalibrationGraphSet::Residual ( size_t index)
inline

Definition at line 132 of file TCalibrationGraph.h.

References fResidualGraphs.

◆ Scale()

void TCalibrationGraphSet::Scale ( bool useAllPrevious = true)

Scale all graphs to fit each other (based on the first "previous" graph found or just the first graph). If no overlap is being found between the graph that is being scaled and the first graph (or all graphs before this one), the current graph isn't being scaled and we continue with the next graph.

Definition at line 387 of file TCalibrationGraph.cxx.

References fGraphs, fVerboseLevel, kBasicFlow, kLoops, kQuiet, kSubroutines, Print(), and ResetTotalGraph().

◆ SetAxisTitle()

void TCalibrationGraphSet::SetAxisTitle ( const char * title)

Set axis title for the graph (form "x-axis title;y-axis title")

Definition at line 181 of file TCalibrationGraph.cxx.

References fTotalGraph.

◆ SetColor()

void TCalibrationGraphSet::SetColor ( int index,
Color_t color )
inline

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

Definition at line 100 of file TCalibrationGraph.h.

References SetLineColor(), and SetMarkerColor().

◆ SetColorStyle()

void TCalibrationGraphSet::SetColorStyle ( int index,
int val )
inline

Set the line and marker color and marker style of the graph and residuals at index

Definition at line 106 of file TCalibrationGraph.h.

References SetLineColor(), SetMarkerColor(), and SetMarkerStyle().

◆ SetLineColor()

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

Set the line color of the graph and residuals at index

Definition at line 81 of file TCalibrationGraph.h.

References fGraphs, and fResidualGraphs.

Referenced by SetColor(), SetColorStyle(), TChannelTab::UpdateData(), and TChannelTab::UpdateFwhm().

◆ SetMarkerColor()

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

Set the marker color of the graph and residuals at index

Definition at line 87 of file TCalibrationGraph.h.

References fGraphs, fResidualGraphs, fVerboseLevel, and kSubroutines.

Referenced by SetColor(), SetColorStyle(), TChannelTab::UpdateData(), and TChannelTab::UpdateFwhm().

◆ SetMarkerStyle()

void TCalibrationGraphSet::SetMarkerStyle ( int index,
Style_t style )
inline

Set the marker style of the graph and residuals at index

Definition at line 94 of file TCalibrationGraph.h.

References fGraphs, and fResidualGraphs.

Referenced by SetColorStyle().

◆ SetResidual()

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

◆ TotalGraph()

TGraphErrors * TCalibrationGraphSet::TotalGraph ( )
inline

Definition at line 129 of file TCalibrationGraph.h.

References fTotalGraph.

Referenced by TChannelTab::UpdateChannel().

◆ VerboseLevel() [1/2]

static EVerbosity TCalibrationGraphSet::VerboseLevel ( )
inlinestatic

Definition at line 158 of file TCalibrationGraph.h.

References fVerboseLevel.

Referenced by TCalibrationGraph::RemovePoint().

◆ VerboseLevel() [2/2]

static void TCalibrationGraphSet::VerboseLevel ( EVerbosity val)
inlinestatic

Definition at line 157 of file TCalibrationGraph.h.

References fVerboseLevel.

◆ XAxisLabel() [1/2]

std::string TCalibrationGraphSet::XAxisLabel ( )
inline

Definition at line 148 of file TCalibrationGraph.h.

References fXAxisLabel.

◆ XAxisLabel() [2/2]

void TCalibrationGraphSet::XAxisLabel ( const std::string & xAxisLabel)
inline

Definition at line 145 of file TCalibrationGraph.h.

References fXAxisLabel.

◆ YAxisLabel() [1/2]

std::string TCalibrationGraphSet::YAxisLabel ( )
inline

Definition at line 149 of file TCalibrationGraph.h.

References fYAxisLabel.

◆ YAxisLabel() [2/2]

void TCalibrationGraphSet::YAxisLabel ( const std::string & yAxisLabel)
inline

Definition at line 146 of file TCalibrationGraph.h.

References fYAxisLabel.

Member Data Documentation

◆ fGraphIndex

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

Index of the graph this point belongs to.

Definition at line 168 of file TCalibrationGraph.h.

Referenced by Add(), Clear(), 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 163 of file TCalibrationGraph.h.

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

◆ fLabel

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

The labels for the different graphs.

Definition at line 165 of file TCalibrationGraph.h.

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

◆ fMaximumX

double TCalibrationGraphSet::fMaximumX {0.}
private

Maximum x-value.

Definition at line 172 of file TCalibrationGraph.h.

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

◆ fMaximumY

double TCalibrationGraphSet::fMaximumY {0.}
private

Maximum y-value.

Definition at line 174 of file TCalibrationGraph.h.

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

◆ fMinimumX

double TCalibrationGraphSet::fMinimumX {0.}
private

Minimum x-value.

Definition at line 171 of file TCalibrationGraph.h.

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

◆ fMinimumY

double TCalibrationGraphSet::fMinimumY {0.}
private

Minimum y-value.

Definition at line 173 of file TCalibrationGraph.h.

Referenced by Add(), Clear(), 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 169 of file TCalibrationGraph.h.

Referenced by Add(), Clear(), 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 164 of file TCalibrationGraph.h.

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

◆ fResidualSet

bool TCalibrationGraphSet::fResidualSet {false}
private

Flag to indicate if the residual has been set correctly.

Definition at line 170 of file TCalibrationGraph.h.

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

◆ fTotalGraph

TGraphErrors* TCalibrationGraphSet::fTotalGraph {nullptr}
private

◆ 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 167 of file TCalibrationGraph.h.

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

◆ fVerboseLevel

◆ fXAxisLabel

std::string TCalibrationGraphSet::fXAxisLabel
private

The label of the x-axis.

Definition at line 175 of file TCalibrationGraph.h.

Referenced by DrawCalibration(), XAxisLabel(), and XAxisLabel().

◆ fYAxisLabel

std::string TCalibrationGraphSet::fYAxisLabel
private

The label of the y-axis.

Definition at line 176 of file TCalibrationGraph.h.

Referenced by DrawCalibration(), YAxisLabel(), and YAxisLabel().