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

Detailed Description

Definition at line 58 of file TSourceCalibration.h.

Public Member Functions

 TSourceTab (const TSourceTab &rhs)
 
 TSourceTab (TSourceCalibration *sourceCal, TChannelTab *channel, TGCompositeFrame *frame, GH1D *projection, const char *sourceName, std::vector< std::tuple< double, double, double, double > > sourceEnergy)
 
 TSourceTab (TSourceTab &&) noexcept=default
 
 ~TSourceTab ()
 
void Add (std::map< double, std::tuple< double, double, double, double > > map)
 
void Add (std::map< TGauss *, std::tuple< double, double, double, double > > map)
 
TGraphErrors * Data () const
 
void Disconnect ()
 
void Draw ()
 
void FindCalibratedPeaks (const TF1 *calibration)
 
TGraphErrors * Fwhm () const
 
void InitialCalibration (const bool &force)
 
void MakeConnections ()
 
TSourceTaboperator= (const TSourceTab &)=default
 
TSourceTaboperator= (TSourceTab &&) noexcept=default
 
void Print () const
 
void PrintCanvases () const
 
void PrintLayout () const
 
TRootEmbeddedCanvas * ProjectionCanvas () const
 
void ProjectionStatus (Event_t *event)
 
void ProjectionStatus (Int_t event, Int_t px, Int_t py, TObject *selected)
 
void RemovePoint (Int_t oldPoint)
 
void ReplacePeak (const size_t &index, const double &channel)
 
void SourceEnergy (std::vector< std::tuple< double, double, double, double > > val)
 
const char * SourceName () const
 
void Status (const char *status, int position)
 

Private Member Functions

void BuildInterface ()
 
bool Good (TGauss *peak)
 
bool Good (TGauss *peak, double lowRange, double highRange)
 
void SetLineColors ()
 
void UpdateFits ()
 
void UpdateRegions ()
 

Private Attributes

std::vector< TPeakFitter * > fBadFits
 
TChannelTabfChannelTab {nullptr}
 
TGraphErrors * fData {nullptr}
 
std::vector< TPeakFitter * > fFits
 
TGraphErrors * fFwhm {nullptr}
 
std::vector< TGauss * > fPeaks
 
GH1DfProjection {nullptr}
 
TRootEmbeddedCanvas * fProjectionCanvas {nullptr}
 
std::vector< std::pair< double, double > > fRegions
 
TSourceCalibrationfSourceCalibration {nullptr}
 
std::vector< std::tuple< double, double, double, double > > fSourceEnergy
 
TGCompositeFrame * fSourceFrame {nullptr}
 
const char * fSourceName
 
TGStatusBar * fSourceStatusBar {nullptr}
 
+ Collaboration diagram for TSourceTab:

Constructor & Destructor Documentation

◆ TSourceTab() [1/3]

TSourceTab::TSourceTab ( TSourceCalibration * sourceCal,
TChannelTab * channel,
TGCompositeFrame * frame,
GH1D * projection,
const char * sourceName,
std::vector< std::tuple< double, double, double, double > > sourceEnergy )

◆ TSourceTab() [2/3]

◆ TSourceTab() [3/3]

TSourceTab::TSourceTab ( TSourceTab && )
defaultnoexcept

◆ ~TSourceTab()

TSourceTab::~TSourceTab ( )

Member Function Documentation

◆ Add() [1/2]

void TSourceTab::Add ( std::map< double, std::tuple< double, double, double, double > > map)

◆ Add() [2/2]

void TSourceTab::Add ( std::map< TGauss *, std::tuple< double, double, double, double > > map)

◆ BuildInterface()

◆ Data()

TGraphErrors * TSourceTab::Data ( ) const
inline

Definition at line 83 of file TSourceCalibration.h.

References fData.

◆ Disconnect()

void TSourceTab::Disconnect ( )

Definition at line 551 of file TSourceCalibration.cxx.

References fProjectionCanvas.

◆ Draw()

void TSourceTab::Draw ( )

◆ FindCalibratedPeaks()

void TSourceTab::FindCalibratedPeaks ( const TF1 * calibration)

◆ Fwhm()

TGraphErrors * TSourceTab::Fwhm ( ) const
inline

Definition at line 84 of file TSourceCalibration.h.

References fFwhm.

◆ Good() [1/2]

◆ Good() [2/2]

bool TSourceTab::Good ( TGauss * peak,
double lowRange,
double highRange )
inlineprivate

Definition at line 101 of file TSourceCalibration.h.

References TGauss::Centroid(), and Good().

Referenced by Good().

◆ InitialCalibration()

void TSourceTab::InitialCalibration ( const bool & force)

This functions finds the peaks in the histogram, fits them, and adds the fits to the list of peaks. This list is then used to find all peaks that lie on a straight line.

Definition at line 784 of file TSourceCalibration.cxx.

References Add(), GH1D::Clear(), DCYAN, fBadFits, fData, fFits, fPeaks, fProjection, fRegions, fSourceCalibration, fSourceEnergy, kBasicFlow, kLoops, kSubroutines, RoughCal(), TSourceCalibration::Sigma(), Status(), TSourceCalibration::Threshold(), UpdateRegions(), and TSourceCalibration::VerboseLevel().

◆ MakeConnections()

void TSourceTab::MakeConnections ( )

◆ operator=() [1/2]

TSourceTab & TSourceTab::operator= ( const TSourceTab & )
default

◆ operator=() [2/2]

TSourceTab & TSourceTab::operator= ( TSourceTab && )
defaultnoexcept

◆ Print()

void TSourceTab::Print ( ) const

Definition at line 1281 of file TSourceCalibration.cxx.

References fBadFits, fData, fFits, fFwhm, fPeaks, and fProjection.

Referenced by RemovePoint().

◆ PrintCanvases()

void TSourceTab::PrintCanvases ( ) const

Definition at line 1326 of file TSourceCalibration.cxx.

References fProjectionCanvas, and fSourceName.

◆ PrintLayout()

void TSourceTab::PrintLayout ( ) const

Definition at line 1335 of file TSourceCalibration.cxx.

References fProjectionCanvas, fSourceFrame, and fSourceStatusBar.

◆ ProjectionCanvas()

TRootEmbeddedCanvas * TSourceTab::ProjectionCanvas ( ) const
inline

Definition at line 85 of file TSourceCalibration.h.

References fProjectionCanvas.

◆ ProjectionStatus() [1/2]

void TSourceTab::ProjectionStatus ( Event_t * event)

◆ ProjectionStatus() [2/2]

◆ RemovePoint()

void TSourceTab::RemovePoint ( Int_t oldPoint)

◆ ReplacePeak()

void TSourceTab::ReplacePeak ( const size_t & index,
const double & channel )

Replace the peak at the index with one centered at channel (calculated from an initial calibration and the source energy of this peak). This replaces the TGauss* in fPeaks, and updates the values of this index in fData and fFwhm.

Definition at line 1146 of file TSourceCalibration.cxx.

References DCYAN, fData, fFits, fFwhm, TSourceCalibration::FitRange(), fPeaks, fProjection, fSourceCalibration, Good(), kBasicFlow, kSubroutines, TSourceCalibration::LogFile(), TSourceCalibration::Sigma(), UpdateFits(), and TSourceCalibration::VerboseLevel().

◆ SetLineColors()

void TSourceTab::SetLineColors ( )
private

This function sets the line colors of good and bad fits to alternating colors. Red and blue for the good fits, and grey and dark grey for the bad fits.

Definition at line 1243 of file TSourceCalibration.cxx.

References fBadFits, fFits, fPeaks, kSubroutines, and TSourceCalibration::VerboseLevel().

Referenced by FindCalibratedPeaks(), and RemovePoint().

◆ SourceEnergy()

void TSourceTab::SourceEnergy ( std::vector< std::tuple< double, double, double, double > > val)
inline

Definition at line 79 of file TSourceCalibration.h.

References fSourceEnergy.

◆ SourceName()

const char * TSourceTab::SourceName ( ) const
inline

Definition at line 86 of file TSourceCalibration.h.

References fSourceName.

◆ Status()

void TSourceTab::Status ( const char * status,
int position )

◆ UpdateFits()

void TSourceTab::UpdateFits ( )
private

This functions removes all fits named "gauss_total" from the histogram and adds instead the fit functions from all good and bad peaks to it.

Definition at line 727 of file TSourceCalibration.cxx.

References fBadFits, fFits, fProjection, fProjectionCanvas, fSourceEnergy, kSubroutines, and TSourceCalibration::VerboseLevel().

Referenced by FindCalibratedPeaks(), RemovePoint(), and ReplacePeak().

◆ UpdateRegions()

void TSourceTab::UpdateRegions ( )
private

Member Data Documentation

◆ fBadFits

std::vector<TPeakFitter*> TSourceTab::fBadFits
private

all bad fits (centroid err > 10%, area err > 100%, or either of them not a number at all)

Definition at line 120 of file TSourceCalibration.h.

Referenced by TSourceTab(), ~TSourceTab(), FindCalibratedPeaks(), InitialCalibration(), Print(), RemovePoint(), SetLineColors(), and UpdateFits().

◆ fChannelTab

TChannelTab* TSourceTab::fChannelTab {nullptr}
private

Definition at line 107 of file TSourceCalibration.h.

Referenced by TSourceTab(), and ProjectionStatus().

◆ fData

TGraphErrors* TSourceTab::fData {nullptr}
private

◆ fFits

std::vector<TPeakFitter*> TSourceTab::fFits
private

◆ fFwhm

TGraphErrors* TSourceTab::fFwhm {nullptr}
private

Definition at line 118 of file TSourceCalibration.h.

Referenced by TSourceTab(), Add(), Fwhm(), Print(), and ReplacePeak().

◆ fPeaks

std::vector<TGauss*> TSourceTab::fPeaks
private

all peaks that have been fitted and are good

Definition at line 121 of file TSourceCalibration.h.

Referenced by TSourceTab(), ~TSourceTab(), FindCalibratedPeaks(), InitialCalibration(), Print(), ProjectionStatus(), RemovePoint(), ReplacePeak(), and SetLineColors().

◆ fProjection

GH1D* TSourceTab::fProjection {nullptr}
private

◆ fProjectionCanvas

TRootEmbeddedCanvas* TSourceTab::fProjectionCanvas {nullptr}
private

◆ fRegions

std::vector<std::pair<double, double> > TSourceTab::fRegions
private

Definition at line 123 of file TSourceCalibration.h.

Referenced by InitialCalibration(), and UpdateRegions().

◆ fSourceCalibration

TSourceCalibration* TSourceTab::fSourceCalibration {nullptr}
private

◆ fSourceEnergy

std::vector<std::tuple<double, double, double, double> > TSourceTab::fSourceEnergy
private

gamma rays from the source, with their energies, uncertainties in the energies, intensities, and uncertainties in the intesities

Definition at line 122 of file TSourceCalibration.h.

Referenced by TSourceTab(), FindCalibratedPeaks(), InitialCalibration(), ProjectionStatus(), SourceEnergy(), and UpdateFits().

◆ fSourceFrame

TGCompositeFrame* TSourceTab::fSourceFrame {nullptr}
private

Definition at line 110 of file TSourceCalibration.h.

Referenced by TSourceTab(), ~TSourceTab(), BuildInterface(), PrintLayout(), and Status().

◆ fSourceName

const char* TSourceTab::fSourceName
private

Definition at line 116 of file TSourceCalibration.h.

Referenced by PrintCanvases(), and SourceName().

◆ fSourceStatusBar

TGStatusBar* TSourceTab::fSourceStatusBar {nullptr}
private

Definition at line 112 of file TSourceCalibration.h.

Referenced by TSourceTab(), ~TSourceTab(), BuildInterface(), PrintLayout(), and Status().