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

Definition at line 15 of file TGainMatch.h.

Public Member Functions

 TGainMatch ()
 
 TGainMatch (const char *name, const char *title)
 
 TGainMatch (const TGainMatch &copy)
 
 ~TGainMatch () override=default
 
Bool_t Align (TH1 *test, TH1 *hist, Int_t low_range=100, Int_t high_range=600)
 
void CalculateGain (Double_t cent1, Double_t cent2, Double_t eng1, Double_t eng2)
 
void Clear (Option_t *opt="") override
 
Bool_t CoarseMatch (TH1 *hist, Int_t chanNum=9999, Double_t energy1=1173.228, Double_t energy2=1332.492)
 
void Copy (TObject &obj) const override
 
Bool_t FineMatch (TH1 *energyHist, TH1 *testhist, TH1 *chargeHist, Double_t energy1, Double_t energy2, Int_t low_range=100, Int_t high_range=600, Int_t channelNum=9999)
 
Bool_t FineMatchFast (TH1 *hist1, TPeak *peak1, TH1 *hist2, TPeak *peak2, Int_t channelNum=9999)
 
Bool_t FineMatchFast (TH1 *hist, TPeak *peak1, TPeak *peak2, Int_t channelNum=9999)
 
Bool_t FineMatchFast (TH1 *hist, Double_t energy1, Double_t energy2, Int_t channelNum=9999)
 
Bool_t FineMatchFast (TH1 *hist1, Double_t energy1, TH1 *hist2, Double_t energy2, Int_t channelNum=9999)
 
TChannelGetChannel () const
 
Double_t GetCoarseRange () const
 
virtual TF1 * GetFitFunction () const
 
TH1 * GetHist () const
 
TNucleusGetNucleus () const override
 
virtual Double_t GetParameter (size_t parameter) const
 
virtual std::vector< Double_t > GetParameters () const
 
Bool_t IsGroupable () const override
 
void Print (Option_t *opt="") const override
 
Bool_t SetChannel (const TChannel *chan)
 
Bool_t SetChannel (UInt_t chanNum)
 
void SetCoarseRange (Double_t coarseRange)
 
virtual void SetFitFunction (const TF1 *func)
 
void SetHist (TH1 *) override
 
void SetNucleus (TNucleus *, Option_t *="") override
 
virtual void WriteToAllChannels (const std::string &mnemonic="")
 
void WriteToChannel () const override
 

Static Public Member Functions

static Bool_t AlignAll (TCalManager *cm, TH1 *hist, TH2 *mat, Int_t low_range=100, Int_t high_range=600)
 
static Bool_t CoarseMatchAll (TCalManager *cm, TH2 *mat, Double_t energy1=1173.228, Double_t energy2=1332.492)
 
static Bool_t FineMatchAll (TCalManager *cm, TH2 *charge_mat, TH2 *eng_mat, Int_t testchan, Double_t energy1, Double_t energy2, Int_t low_range=100, Int_t high_range=600)
 
static Bool_t FineMatchFastAll (TCalManager *cm, TH2 *mat, Double_t energy1, Double_t energy2)
 
static Bool_t FineMatchFastAll (TCalManager *cm, TH2 *mat1, Double_t energy1, TH2 *mat2, Double_t energy2)
 
static Bool_t FineMatchFastAll (TCalManager *cm, TH2 *mat1, TPeak *peak1, TH2 *mat2, TPeak *peak2)
 
static Bool_t FineMatchFastAll (TCalManager *cm, TH2 *mat, TPeak *peak1, TPeak *peak2)
 
static Double_t GetDefaultCoarseRange ()
 
static void SetDefaultCoarseRange (Double_t coarseRange)
 

Protected Member Functions

void InitTCal ()
 

Private Member Functions

Double_t HistCompare (Double_t *x, Double_t *par)
 

Private Attributes

Double_t fAlignCoeffs [2] {0.}
 
Bool_t fAligned {false}
 
Bool_t fCoarseMatch {false}
 
Double_t fCoarseRange
 
Double_t fGainCoeffs [2] {0.}
 
TH1 * fHist {nullptr}
 

Static Private Attributes

static Double_t gDefaultCoarseRange = 40.
 

#include <TGainMatch.h>

+ Inheritance diagram for TGainMatch:
+ Collaboration diagram for TGainMatch:

Constructor & Destructor Documentation

◆ TGainMatch() [1/3]

TGainMatch::TGainMatch ( )
inline

Definition at line 17 of file TGainMatch.h.

Referenced by AlignAll(), CoarseMatchAll(), FineMatchAll(), and FineMatchFastAll().

◆ TGainMatch() [2/3]

TGainMatch::TGainMatch ( const char *  name,
const char *  title 
)
inline

Definition at line 18 of file TGainMatch.h.

References Clear().

◆ ~TGainMatch()

TGainMatch::~TGainMatch ( )
overridedefault

◆ TGainMatch() [3/3]

TGainMatch::TGainMatch ( const TGainMatch copy)

Definition at line 18 of file TGainMatch.cxx.

References Copy(), fCoarseRange, and fHist.

Member Function Documentation

◆ Align()

Bool_t TGainMatch::Align ( TH1 *  test,
TH1 *  hist,
Int_t  low_range = 100,
Int_t  high_range = 600 
)

Definition at line 511 of file TGainMatch.cxx.

References fAlignCoeffs, fAligned, fHist, hist, and HistCompare().

Referenced by FineMatch().

◆ AlignAll()

Bool_t TGainMatch::AlignAll ( TCalManager cm,
TH1 *  hist,
TH2 *  mat,
Int_t  low_range = 100,
Int_t  high_range = 600 
)
static

Definition at line 576 of file TGainMatch.cxx.

References TCalManager::AddToManager(), hist, mat, and TGainMatch().

◆ CalculateGain()

void TGainMatch::CalculateGain ( Double_t  cent1,
Double_t  cent2,
Double_t  eng1,
Double_t  eng2 
)

Definition at line 32 of file TGainMatch.cxx.

References fGainCoeffs, and TCal::SetFitFunction().

◆ Clear()

void TGainMatch::Clear ( Option_t *  opt = "")
override

Definition at line 500 of file TGainMatch.cxx.

References TCal::Clear(), fAlignCoeffs, fAligned, fCoarseMatch, and fGainCoeffs.

Referenced by TGainMatch().

◆ CoarseMatch()

Bool_t TGainMatch::CoarseMatch ( TH1 *  hist,
Int_t  chanNum = 9999,
Double_t  energy1 = 1173.228,
Double_t  energy2 = 1332.492 
)

◆ CoarseMatchAll()

Bool_t TGainMatch::CoarseMatchAll ( TCalManager cm,
TH2 *  mat,
Double_t  energy1 = 1173.228,
Double_t  energy2 = 1332.492 
)
static

Definition at line 362 of file TGainMatch.cxx.

References TCalManager::AddToManager(), mat, and TGainMatch().

◆ Copy()

void TGainMatch::Copy ( TObject &  obj) const
override

Definition at line 25 of file TGainMatch.cxx.

References TCal::Copy(), fCoarseMatch, and fCoarseRange.

Referenced by TGainMatch().

◆ FineMatch()

Bool_t TGainMatch::FineMatch ( TH1 *  energyHist,
TH1 *  testhist,
TH1 *  chargeHist,
Double_t  energy1,
Double_t  energy2,
Int_t  low_range = 100,
Int_t  high_range = 600,
Int_t  channelNum = 9999 
)

◆ FineMatchAll()

Bool_t TGainMatch::FineMatchAll ( TCalManager cm,
TH2 *  charge_mat,
TH2 *  eng_mat,
Int_t  testchan,
Double_t  energy1,
Double_t  energy2,
Int_t  low_range = 100,
Int_t  high_range = 600 
)
static

Definition at line 625 of file TGainMatch.cxx.

References TCalManager::AddToManager(), and TGainMatch().

◆ FineMatchFast() [1/4]

Bool_t TGainMatch::FineMatchFast ( TH1 *  hist1,
TPeak peak1,
TH1 *  hist2,
TPeak peak2,
Int_t  channelNum = 9999 
)

◆ FineMatchFast() [2/4]

Bool_t TGainMatch::FineMatchFast ( TH1 *  hist,
TPeak peak1,
TPeak peak2,
Int_t  channelNum = 9999 
)

Definition at line 293 of file TGainMatch.cxx.

References FineMatchFast(), and hist.

◆ FineMatchFast() [3/4]

Bool_t TGainMatch::FineMatchFast ( TH1 *  hist,
Double_t  energy1,
Double_t  energy2,
Int_t  channelNum = 9999 
)

Definition at line 301 of file TGainMatch.cxx.

References FineMatchFast(), and hist.

◆ FineMatchFast() [4/4]

Bool_t TGainMatch::FineMatchFast ( TH1 *  hist1,
Double_t  energy1,
TH1 *  hist2,
Double_t  energy2,
Int_t  channelNum = 9999 
)

Definition at line 308 of file TGainMatch.cxx.

References FineMatchFast().

◆ FineMatchFastAll() [1/4]

Bool_t TGainMatch::FineMatchFastAll ( TCalManager cm,
TH2 *  mat,
Double_t  energy1,
Double_t  energy2 
)
static

Definition at line 424 of file TGainMatch.cxx.

References mat.

Referenced by FineMatchFastAll().

◆ FineMatchFastAll() [2/4]

Bool_t TGainMatch::FineMatchFastAll ( TCalManager cm,
TH2 *  mat1,
Double_t  energy1,
TH2 *  mat2,
Double_t  energy2 
)
static

Definition at line 409 of file TGainMatch.cxx.

References FineMatchFastAll().

◆ FineMatchFastAll() [3/4]

Bool_t TGainMatch::FineMatchFastAll ( TCalManager cm,
TH2 *  mat1,
TPeak peak1,
TH2 *  mat2,
TPeak peak2 
)
static

Definition at line 429 of file TGainMatch.cxx.

References TCalManager::AddToManager(), and TGainMatch().

◆ FineMatchFastAll() [4/4]

Bool_t TGainMatch::FineMatchFastAll ( TCalManager cm,
TH2 *  mat,
TPeak peak1,
TPeak peak2 
)
static

Definition at line 495 of file TGainMatch.cxx.

References FineMatchFastAll(), and mat.

◆ GetChannel()

TChannel * TCal::GetChannel ( ) const
inherited

◆ GetCoarseRange()

Double_t TGainMatch::GetCoarseRange ( ) const
inline

Definition at line 71 of file TGainMatch.h.

References fCoarseRange.

◆ GetDefaultCoarseRange()

static Double_t TGainMatch::GetDefaultCoarseRange ( )
inlinestatic

Definition at line 77 of file TGainMatch.h.

References gDefaultCoarseRange.

◆ GetFitFunction()

virtual TF1* TCal::GetFitFunction ( ) const
inlinevirtualinherited

Definition at line 58 of file TCal.h.

References TCal::fFitFunc.

Referenced by FineMatch(), FineMatchFast(), TCal::GetParameter(), TCal::GetParameters(), and main().

◆ GetHist()

TH1* TGainMatch::GetHist ( ) const
inline

Definition at line 64 of file TGainMatch.h.

◆ GetNucleus()

TNucleus* TGainMatch::GetNucleus ( ) const
inlineoverridevirtual

Reimplemented from TCal.

Definition at line 57 of file TGainMatch.h.

◆ GetParameter()

Double_t TCal::GetParameter ( size_t  parameter) const
virtualinherited

Returns the parameter at the index parameter

Reimplemented in TEnergyCal, TCFDCal, and TTimeCal.

Definition at line 108 of file TCal.cxx.

References TCal::GetFitFunction().

Referenced by FineMatch(), FineMatchFast(), TCal::GetParameters(), and WriteToChannel().

◆ GetParameters()

std::vector< Double_t > TCal::GetParameters ( ) const
virtualinherited

Returns all of the parameters in the current TCal.

Reimplemented in TEnergyCal, TCFDCal, and TTimeCal.

Definition at line 90 of file TCal.cxx.

References TCal::GetFitFunction(), and TCal::GetParameter().

◆ HistCompare()

Double_t TGainMatch::HistCompare ( Double_t *  x,
Double_t *  par 
)
private

Definition at line 851 of file TGainMatch.cxx.

References fHist.

Referenced by Align().

◆ InitTCal()

void TCal::InitTCal ( )
protectedinherited

Initiallizes the TCal.

Definition at line 179 of file TCal.cxx.

References TCal::Clear(), TCal::fChan, TCal::fFitFunc, TCal::fHist, and TCal::fNuc.

Referenced by TCal::TCal().

◆ IsGroupable()

Bool_t TGainMatch::IsGroupable ( ) const
inlineoverridevirtual

Implements TCal.

Definition at line 53 of file TGainMatch.h.

◆ Print()

void TGainMatch::Print ( Option_t *  opt = "") const
override

Definition at line 340 of file TGainMatch.cxx.

References fAlignCoeffs, fAligned, fCoarseMatch, fGainCoeffs, and TCal::Print().

◆ SetChannel() [1/2]

Bool_t TCal::SetChannel ( const TChannel chan)
inherited

Sets the channel being calibrated

Definition at line 60 of file TCal.cxx.

References TCal::fChan.

Referenced by TCalManager::AddToManager(), CoarseMatch(), FineMatch(), FineMatchFast(), main(), TCal::SetChannel(), and TCal::WriteToAllChannels().

◆ SetChannel() [2/2]

Bool_t TCal::SetChannel ( UInt_t  chanNum)
inherited

Sets the channel for the calibration to the channel number channum. Returns 0 if the channel does not exist

Definition at line 118 of file TCal.cxx.

References TChannel::GetChannelByNumber(), and TCal::SetChannel().

◆ SetCoarseRange()

void TGainMatch::SetCoarseRange ( Double_t  coarseRange)
inline

Definition at line 70 of file TGainMatch.h.

References fCoarseRange.

◆ SetDefaultCoarseRange()

static void TGainMatch::SetDefaultCoarseRange ( Double_t  coarseRange)
inlinestatic

Definition at line 72 of file TGainMatch.h.

References gDefaultCoarseRange.

◆ SetFitFunction()

virtual void TCal::SetFitFunction ( const TF1 *  func)
inlinevirtualinherited

Definition at line 59 of file TCal.h.

References TCal::fFitFunc.

Referenced by CalculateGain(), CoarseMatch(), FineMatch(), FineMatchFast(), and main().

◆ SetHist()

void TGainMatch::SetHist ( TH1 *  )
inlineoverridevirtual

Reimplemented from TCal.

Definition at line 63 of file TGainMatch.h.

◆ SetNucleus()

void TGainMatch::SetNucleus ( TNucleus ,
Option_t *  = "" 
)
inlineoverridevirtual

Reimplemented from TCal.

Definition at line 56 of file TGainMatch.h.

◆ WriteToAllChannels()

void TCal::WriteToAllChannels ( const std::string &  mnemonic = "")
virtualinherited

Writes this calibration to all channels in the current TChannel Map

Definition at line 72 of file TCal.cxx.

References TCal::GetChannel(), TChannel::GetChannelMap(), TCal::SetChannel(), and TCal::WriteToChannel().

◆ WriteToChannel()

void TGainMatch::WriteToChannel ( ) const
overridevirtual

Member Data Documentation

◆ fAlignCoeffs

Double_t TGainMatch::fAlignCoeffs[2] {0.}
private

Definition at line 83 of file TGainMatch.h.

Referenced by Align(), Clear(), FineMatch(), and Print().

◆ fAligned

Bool_t TGainMatch::fAligned {false}
private

Definition at line 81 of file TGainMatch.h.

Referenced by Align(), Clear(), and Print().

◆ fCoarseMatch

Bool_t TGainMatch::fCoarseMatch {false}
private

Definition at line 80 of file TGainMatch.h.

Referenced by Clear(), CoarseMatch(), Copy(), FineMatch(), FineMatchFast(), and Print().

◆ fCoarseRange

Double_t TGainMatch::fCoarseRange
private

Definition at line 85 of file TGainMatch.h.

Referenced by CoarseMatch(), Copy(), GetCoarseRange(), SetCoarseRange(), and TGainMatch().

◆ fGainCoeffs

Double_t TGainMatch::fGainCoeffs[2] {0.}
private

Definition at line 84 of file TGainMatch.h.

Referenced by CalculateGain(), Clear(), CoarseMatch(), FineMatch(), FineMatchFast(), and Print().

◆ fHist

TH1* TGainMatch::fHist {nullptr}
private

Definition at line 82 of file TGainMatch.h.

Referenced by Align(), CoarseMatch(), HistCompare(), and TGainMatch().

◆ gDefaultCoarseRange

Double_t TGainMatch::gDefaultCoarseRange = 40.
staticprivate

Definition at line 88 of file TGainMatch.h.

Referenced by GetDefaultCoarseRange(), and SetDefaultCoarseRange().