PandaRoot
PndFairHitQATask Class Reference

Base class to tests reconstructed hits based on FairHits for the PANDA QA tasks This class calculates the difference in time and each spatial coordinate between a FairHit and its corresponding FairMCPoint. The result is stored in a dedicated histogram. At the end of the run the mean and RMS value are taken from the histogram and assigned to a measurement with boundaries. If the value is inside the boundaries this value passes the test otherwise it fails. The result is printed in a CDASH compatible format and the histograms are stored as a PNG and a root file. More...

#include <PndFairHitQATask.h>

Inheritance diagram for PndFairHitQATask:
PndPersistencyTask PndFtofRecoQATask PndGemRecoQATask PndMvdPixelQATask PndMvdStripQATask PndSciTRecoQATask

Public Member Functions

 PndFairHitQATask (std::string hitBranchName, std::string pointBranchName)
 
virtual ~PndFairHitQATask ()
 
virtual void SetParContainers ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *opt)
 
virtual void FinishTask ()
 
void SetWorkdir (TString path)
 only needed to give cdash the path to the stored pictures More...
 
void SetHitBranch (std::string hitBranch)
 
void SetPointBranch (std::string pointBranch)
 
void SetOutputPlotName (std::string val)
 
- Public Member Functions inherited from PndPersistencyTask
 PndPersistencyTask ()
 
 PndPersistencyTask (const char *name, Int_t iVerbose=1)
 
virtual ~PndPersistencyTask ()
 
void SetPersistency (Bool_t val=kTRUE)
 
Bool_t GetPersistency ()
 

Protected Member Functions

virtual void InitHistos ()
 Initialize the histograms containing the measurement data in the histogram map. More...
 
virtual void SetAllBoundaries ()
 Set the name and the boundaries for a measurement to pass. More...
 
virtual void CalculateResolutions (FairHit *hit)
 Calculate the resolution of a FairHit based on the MC data from a FairMCPoint. More...
 
virtual void FillHistos ()
 Fill the output of CalculateResolutions into the corresponding histograms. More...
 
virtual void AssignMeasurements ()
 Extract the measurement values from the histograms like mean or RMS values and assign them to the measurement defined in SetAllBoundaries. More...
 
bool Test ()
 
void DrawHistos ()
 
void SaveHistos ()
 
void PrintDartMeasurement ()
 
 ClassDef (PndFairHitQATask, 2)
 

Protected Attributes

std::string fHitBranchName
 
std::string fPointBranchName
 
std::string fOutputPlotName {"ResolutionHistos.png"}
 
TClonesArray * fMcPoints = nullptr
 
TClonesArray * fHits = nullptr
 
Bool_t fProperDifference = false
 if method CalculateResolutions worked More...
 
TVector3 fSpatialDifference
 
double fTimeDifference = -1.0
 
TString fWorkdir
 
PndMeasurementBoundaries fBoundaries
 
std::map< std::string, TH1 * > fHistos
 

Detailed Description

Base class to tests reconstructed hits based on FairHits for the PANDA QA tasks This class calculates the difference in time and each spatial coordinate between a FairHit and its corresponding FairMCPoint. The result is stored in a dedicated histogram. At the end of the run the mean and RMS value are taken from the histogram and assigned to a measurement with boundaries. If the value is inside the boundaries this value passes the test otherwise it fails. The result is printed in a CDASH compatible format and the histograms are stored as a PNG and a root file.

This class is meant to be a base class and real tests have to be derived from this class. Especially the boundaries of the measurements have to be adopted to the actual use case.

Author
Tobias Stockmanns t.sto.nosp@m.ckma.nosp@m.nns@f.nosp@m.z-ju.nosp@m.elich.nosp@m..de
Date
23.11.2022

Definition at line 36 of file PndFairHitQATask.h.

Constructor & Destructor Documentation

◆ PndFairHitQATask()

PndFairHitQATask::PndFairHitQATask ( std::string  hitBranchName,
std::string  pointBranchName 
)

Default constructor

◆ ~PndFairHitQATask()

virtual PndFairHitQATask::~PndFairHitQATask ( )
virtual

Destructor

Member Function Documentation

◆ AssignMeasurements()

virtual void PndFairHitQATask::AssignMeasurements ( )
protectedvirtual

Extract the measurement values from the histograms like mean or RMS values and assign them to the measurement defined in SetAllBoundaries.

Reimplemented in PndFtofRecoQATask, PndGemRecoQATask, PndMvdPixelQATask, PndMvdStripQATask, and PndSciTRecoQATask.

Referenced by SetOutputPlotName().

◆ CalculateResolutions()

virtual void PndFairHitQATask::CalculateResolutions ( FairHit *  hit)
protectedvirtual

Calculate the resolution of a FairHit based on the MC data from a FairMCPoint.

Reimplemented in PndFtofRecoQATask, PndGemRecoQATask, PndMvdPixelQATask, PndMvdStripQATask, and PndSciTRecoQATask.

Referenced by SetOutputPlotName().

◆ ClassDef()

PndFairHitQATask::ClassDef ( PndFairHitQATask  ,
 
)
protected

◆ DrawHistos()

void PndFairHitQATask::DrawHistos ( )
protected

Referenced by SetOutputPlotName().

◆ Exec()

virtual void PndFairHitQATask::Exec ( Option_t *  opt)
virtual

Virtual method Exec

◆ FillHistos()

virtual void PndFairHitQATask::FillHistos ( )
protectedvirtual

Fill the output of CalculateResolutions into the corresponding histograms.

Reimplemented in PndFtofRecoQATask, PndGemRecoQATask, PndMvdPixelQATask, PndMvdStripQATask, and PndSciTRecoQATask.

Referenced by SetOutputPlotName().

◆ FinishTask()

virtual void PndFairHitQATask::FinishTask ( )
virtual

◆ Init()

virtual InitStatus PndFairHitQATask::Init ( )
virtual

◆ InitHistos()

virtual void PndFairHitQATask::InitHistos ( )
protectedvirtual

Initialize the histograms containing the measurement data in the histogram map.

Reimplemented in PndFtofRecoQATask, PndGemRecoQATask, PndMvdPixelQATask, PndMvdStripQATask, and PndSciTRecoQATask.

Referenced by SetOutputPlotName().

◆ PrintDartMeasurement()

void PndFairHitQATask::PrintDartMeasurement ( )
protected

Referenced by SetOutputPlotName().

◆ SaveHistos()

void PndFairHitQATask::SaveHistos ( )
protected

Referenced by SetOutputPlotName().

◆ SetAllBoundaries()

virtual void PndFairHitQATask::SetAllBoundaries ( )
protectedvirtual

Set the name and the boundaries for a measurement to pass.

Reimplemented in PndFtofRecoQATask, PndGemRecoQATask, PndMvdPixelQATask, PndMvdStripQATask, and PndSciTRecoQATask.

Referenced by SetOutputPlotName().

◆ SetHitBranch()

void PndFairHitQATask::SetHitBranch ( std::string  hitBranch)
inline

Definition at line 53 of file PndFairHitQATask.h.

References fHitBranchName.

53 { fHitBranchName = hitBranch; }
std::string fHitBranchName

◆ SetOutputPlotName()

void PndFairHitQATask::SetOutputPlotName ( std::string  val)
inline

◆ SetParContainers()

virtual void PndFairHitQATask::SetParContainers ( )
virtual

Virtual method Init

Reimplemented in PndMvdPixelQATask, PndMvdStripQATask, and PndSciTRecoQATask.

◆ SetPointBranch()

void PndFairHitQATask::SetPointBranch ( std::string  pointBranch)
inline

Definition at line 54 of file PndFairHitQATask.h.

References fPointBranchName.

54 { fPointBranchName = pointBranch; }
std::string fPointBranchName

◆ SetWorkdir()

void PndFairHitQATask::SetWorkdir ( TString  path)
inline

only needed to give cdash the path to the stored pictures

Definition at line 51 of file PndFairHitQATask.h.

References fWorkdir.

◆ Test()

bool PndFairHitQATask::Test ( )
protected

Referenced by SetOutputPlotName().

Member Data Documentation

◆ fBoundaries

PndMeasurementBoundaries PndFairHitQATask::fBoundaries
protected

Definition at line 102 of file PndFairHitQATask.h.

◆ fHistos

std::map<std::string, TH1 *> PndFairHitQATask::fHistos
protected

Definition at line 104 of file PndFairHitQATask.h.

◆ fHitBranchName

std::string PndFairHitQATask::fHitBranchName
protected

Definition at line 91 of file PndFairHitQATask.h.

Referenced by SetHitBranch().

◆ fHits

TClonesArray* PndFairHitQATask::fHits = nullptr
protected

Definition at line 96 of file PndFairHitQATask.h.

◆ fMcPoints

TClonesArray* PndFairHitQATask::fMcPoints = nullptr
protected

Definition at line 95 of file PndFairHitQATask.h.

◆ fOutputPlotName

std::string PndFairHitQATask::fOutputPlotName {"ResolutionHistos.png"}
protected

Definition at line 93 of file PndFairHitQATask.h.

Referenced by SetOutputPlotName().

◆ fPointBranchName

std::string PndFairHitQATask::fPointBranchName
protected

Definition at line 92 of file PndFairHitQATask.h.

Referenced by SetPointBranch().

◆ fProperDifference

Bool_t PndFairHitQATask::fProperDifference = false
protected

if method CalculateResolutions worked

Definition at line 97 of file PndFairHitQATask.h.

◆ fSpatialDifference

TVector3 PndFairHitQATask::fSpatialDifference
protected

Definition at line 98 of file PndFairHitQATask.h.

◆ fTimeDifference

double PndFairHitQATask::fTimeDifference = -1.0
protected

Definition at line 99 of file PndFairHitQATask.h.

◆ fWorkdir

TString PndFairHitQATask::fWorkdir
protected

Definition at line 100 of file PndFairHitQATask.h.

Referenced by SetWorkdir().


The documentation for this class was generated from the following file: