CbmRoot
CbmLitTrackingQaStudyReport Class Reference

Creates study report for tracking QA. More...

#include <CbmLitTrackingQaStudyReport.h>

Inheritance diagram for CbmLitTrackingQaStudyReport:
[legend]
Collaboration diagram for CbmLitTrackingQaStudyReport:
[legend]

Public Member Functions

 CbmLitTrackingQaStudyReport ()
 Constructor. More...
 
virtual ~CbmLitTrackingQaStudyReport ()
 Destructor. More...
 
void Create (const std::vector< CbmHistManager * > &histManagers, const std::vector< std::string > &studyNames, const std::string &outputDir)
 Main function which creates report data. More...
 
void Create (const std::vector< std::string > &fileNames, const std::vector< std::string > &studyNames, const std::string &outputDir)
 Main function which creates report data. More...
 
const std::vector< CbmHistManager * > & HM () const
 
CbmHistManagerHM (Int_t index) const
 
const std::vector< std::string > & GetStudyNames () const
 
const std::string & GetStudyName (Int_t index) const
 
const CbmReportElementR () const
 Accessor to CbmReportElement object. User has to write the report using available tags from CbmReportElement class. More...
 
std::ostream & Out () const
 All text output goes to this stream. More...
 
void SetReportName (const std::string &name)
 
void SetReportTitle (const std::string &title)
 
void SetOutputDir (const std::string &outputDir)
 
const std::string & GetReportName () const
 
const std::string & GetReportTitle () const
 
const std::string & GetOutputDir () const
 

Protected Member Functions

void Create ()
 Inherited from CbmLitStudyReport. More...
 
void Draw ()
 Inherited from CbmLitStudyReport. More...
 
string PrintTable (const string &tableName, const string &pattern, string(*rowNameFormatter)(const string &), string(*cellFormatter)(const TH1 *, Int_t)) const
 Return formated string with table of numbers. More...
 
string PrintEfficiencyTable (const string &tableName, const string &pattern) const
 Return formated string with table of efficiency numbers. More...
 
void DivideHistos (TH1 *histo1, TH1 *histo2, TH1 *histo3, Double_t scale)
 Divide two histograms. More...
 
void CalculateEfficiencyHistos ()
 Calculate efficiency histograms. More...
 
void DrawEfficiencyHistos ()
 Main function for drawing efficiency histograms. More...
 
void DrawEfficiency (const string &canvasName, const string &histName)
 Draw efficiency histogram. More...
 
void DrawMeanEfficiencyLines (const std::vector< TH1 * > &histos, const std::vector< Double_t > &efficiencies)
 Draw mean efficiency lines on histogram. More...
 
void DrawAccAndRec (const string &canvasName, const string &histName)
 Draw accepted and reconstructed tracks histograms. More...
 
Double_t CalcEfficiency (const TH1 *histRec, const TH1 *histAcc, Double_t scale=1.) const
 Calculate efficiency for two histograms. More...
 
void Draw (Option_t *)
 Inherited from TObject. This method is implemented in order to avoid warnings. More...
 
void CreateReports ()
 Create all available report types. More...
 
TCanvas * CreateCanvas (const char *name, const char *title, Int_t ww, Int_t wh)
 Create canvas and put it to vector of TCanvases. Canvases created with this function will be automatically saved to image and printed in the report. More...
 
void SaveCanvasesAsImages () const
 Save all canvases to images. More...
 
void WriteCanvases () const
 Write canvases to file. More...
 
void PrintCanvases () const
 Print images created from canvases in the report. More...
 

Private Member Functions

void CreateReportElement (ReportType reportType)
 Create concrete CbmReportElement instance based on report type. More...
 
void DeleteReportElement ()
 Delete report element. Normally should be called at the end of Create function. More...
 

Private Attributes

std::vector< CbmHistManager * > fHM
 
std::vector< std::string > fStudyNames
 
std::string fReportName
 
std::string fReportTitle
 
std::string fOutputDir
 
ReportType fReportType
 
CbmReportElementfR
 
std::ostream * fOut
 
std::vector< TCanvas * > fCanvases
 

Detailed Description

Creates study report for tracking QA.

Generates tracking QA report from a number of results of different simulations and reconstructions. Creates comparison tables. Very useful for studies since all numbers are automatically put in the comparison tables.

Author
Andrey Lebedev andre.nosp@m.y.le.nosp@m.bedev.nosp@m.@gsi.nosp@m..de
Date
2011

Definition at line 28 of file CbmLitTrackingQaStudyReport.h.

Constructor & Destructor Documentation

◆ CbmLitTrackingQaStudyReport()

CbmLitTrackingQaStudyReport::CbmLitTrackingQaStudyReport ( )

Constructor.

Definition at line 58 of file CbmLitTrackingQaStudyReport.cxx.

References CbmReport::SetReportName(), and CbmReport::SetReportTitle().

◆ ~CbmLitTrackingQaStudyReport()

CbmLitTrackingQaStudyReport::~CbmLitTrackingQaStudyReport ( )
virtual

Destructor.

Definition at line 63 of file CbmLitTrackingQaStudyReport.cxx.

Member Function Documentation

◆ CalcEfficiency()

Double_t CbmLitTrackingQaStudyReport::CalcEfficiency ( const TH1 *  histRec,
const TH1 *  histAcc,
Double_t  scale = 1. 
) const
protected

Calculate efficiency for two histograms.

Parameters
[in]histRecoReconstruction histogram.
[in]histAccAcceptance histogram.
[in]scaleScaling factor for efficiency.

Definition at line 259 of file CbmLitTrackingQaStudyReport.cxx.

Referenced by DrawEfficiency().

◆ CalculateEfficiencyHistos()

void CbmLitTrackingQaStudyReport::CalculateEfficiencyHistos ( )
protected

Calculate efficiency histograms.

Definition at line 270 of file CbmLitTrackingQaStudyReport.cxx.

References DivideHistos(), Cbm::FindAndReplace(), and CbmStudyReport::HM().

Referenced by Draw().

◆ Create() [1/3]

◆ Create() [2/3]

void CbmStudyReport::Create ( const std::vector< CbmHistManager * > &  histManagers,
const std::vector< std::string > &  studyNames,
const std::string &  outputDir 
)
inherited

Main function which creates report data.

Non virtual interface pattern is used here. User always creates simulation report using this public non virtual method. In order to configure concrete report generation class user has to implement protected Create() method and getters for the file names.

Parameters
[in]histManagersArray of histogram managers for which report is created.
[in]studyNamesNames of studies.
[in]outputDirname of the output directory.

Referenced by CbmAnaDielectronReports::CreateStudyReport().

◆ Create() [3/3]

void CbmStudyReport::Create ( const std::vector< std::string > &  fileNames,
const std::vector< std::string > &  studyNames,
const std::string &  outputDir 
)
inherited

Main function which creates report data.

Same pattern is used here.

Parameters
[in]fileNamesArray of file names for which report is created.
[in]studyNamesNames of studies.
[in]outputDirname of the output directory.

◆ CreateCanvas()

TCanvas * CbmReport::CreateCanvas ( const char *  name,
const char *  title,
Int_t  ww,
Int_t  wh 
)
protectedinherited

Create canvas and put it to vector of TCanvases. Canvases created with this function will be automatically saved to image and printed in the report.

Definition at line 82 of file CbmReport.cxx.

References CbmReport::fCanvases.

Referenced by CbmAnaJpsiReport::Draw(), CbmAnaJpsiSuperEventReport::Draw(), CbmAnaJpsiReport::Draw2DCut(), CbmStsDigitizeQaReport::Draw2dHistograms(), CbmLitTrackingQaReport::DrawAccAndRec(), DrawAccAndRec(), CbmAnaJpsiReport::DrawAnalysisStepsH1(), CbmAnaJpsiReport::DrawAnalysisStepsH2(), CbmLitFieldApproximationQaReport::DrawApr(), CbmAnaDielectronStudyReportAll::DrawBgMinv(), CbmAnaJpsiReport::DrawBgSource2D(), CbmAnaJpsiSuperEventReport::DrawComparison(), CbmAnaJpsiReport::DrawCutH1(), CbmLitRadLengthQaReport::DrawDetector(), CbmLitTrackingQaReport::DrawEfficiency(), DrawEfficiency(), CbmLitTrackingQaReport::DrawEfficiencyHistos(), CbmSimulationReport::DrawH2ByPattern(), CbmStsDigitizeQaReport::DrawHistograms(), CbmLitTrackingQaReport::DrawHitsHistos(), CbmStsDigitizeQaReport::DrawLogHistograms(), CbmAnaJpsiSuperEventReport::DrawMinvDiffPtBins(), CbmAnaJpsiReport::DrawMinvMismatchesAll(), CbmAnaJpsiSuperEventReport::DrawMinvMismatchPt(), CbmAnaJpsiReport::DrawMinvSAndBgAllSteps(), CbmAnaJpsiSuperEventReport::DrawMinvSignalBg(), CbmAnaJpsiReport::DrawMomEffAllSteps(), CbmAnaJpsiReport::DrawMomMcVsRec(), CbmStsDigitizeQaReport::DrawNofObjectsHistograms(), CbmLitClusteringQaReport::DrawNofObjectsHistograms(), CbmAnaJpsiSuperEventReport::DrawPairSource(), CbmAnaJpsiReport::DrawPairSource(), CbmLitTrackingQaReport::DrawPionSuppression(), CbmAnaJpsiReport::DrawPtYEfficiencyAll(), CbmLitFitQaReport::DrawResidualAndPullHistograms(), CbmLitClusteringQaReport::DrawResidualsAndPulls(), CbmAnaDielectronStudyReportAll::DrawSBgMinv(), CbmAnaJpsiReport::DrawSignalMinv(), CbmLitFieldApproximationQaReport::DrawSlices(), CbmLitFitQaReport::DrawTrackMomentumAtVertex(), CbmLitFitQaReport::DrawTrackParams(), CbmLitFitQaStudyReport::DrawTrackParamsAtVertex(), CbmLitFitQaReport::DrawTrackParamsAtVertex(), CbmLitTrackingQaReport::DrawYPt(), CbmLitTofQaReport::FitHistograms(), CbmAnaJpsiSuperEventReport::SignalOverBgAllSteps(), and CbmAnaJpsiReport::SignalOverBgAllSteps().

◆ CreateReportElement()

void CbmReport::CreateReportElement ( ReportType  reportType)
privateinherited

Create concrete CbmReportElement instance based on report type.

Parameters
[in]reportTypeType of the report to be produced.

Definition at line 36 of file CbmReport.cxx.

References CbmReport::fOut, CbmReport::fR, CbmReport::fReportName, CbmReport::fReportType, CbmReport::GetOutputDir(), kCoutReport, kHtmlReport, kLatexReport, and kTextReport.

Referenced by CbmReport::CreateReports().

◆ CreateReports()

void CbmReport::CreateReports ( )
protectedinherited

◆ DeleteReportElement()

void CbmReport::DeleteReportElement ( )
privateinherited

Delete report element. Normally should be called at the end of Create function.

Definition at line 55 of file CbmReport.cxx.

Referenced by CbmReport::CreateReports().

◆ DivideHistos()

void CbmLitTrackingQaStudyReport::DivideHistos ( TH1 *  histo1,
TH1 *  histo2,
TH1 *  histo3,
Double_t  scale 
)
protected

Divide two histograms.

Parameters
[in]histo1Numerator.
[in]histo2Denominator.
[out]histo3Output histogram.
[in]scaleScaling factor.

Definition at line 231 of file CbmLitTrackingQaStudyReport.cxx.

Referenced by CalculateEfficiencyHistos().

◆ Draw() [1/2]

void CbmLitTrackingQaStudyReport::Draw ( )
protectedvirtual

Inherited from CbmLitStudyReport.

Implements CbmReport.

Definition at line 153 of file CbmLitTrackingQaStudyReport.cxx.

References CalculateEfficiencyHistos(), DrawEfficiencyHistos(), and SetDefaultDrawStyle().

◆ Draw() [2/2]

void CbmReport::Draw ( Option_t *  )
inlineprotectedinherited

Inherited from TObject. This method is implemented in order to avoid warnings.

Definition at line 87 of file CbmReport.h.

◆ DrawAccAndRec()

void CbmLitTrackingQaStudyReport::DrawAccAndRec ( const string &  canvasName,
const string &  histName 
)
protected

Draw accepted and reconstructed tracks histograms.

Parameters
[in]canvasNameName of canvas.
[in]histNameHistogram name.

Definition at line 208 of file CbmLitTrackingQaStudyReport.cxx.

References CbmReport::CreateCanvas(), DrawH1(), CbmStudyReport::GetStudyName(), CbmHistManager::H1(), CbmStudyReport::HM(), and kLinear.

Referenced by DrawEfficiencyHistos().

◆ DrawEfficiency()

void CbmLitTrackingQaStudyReport::DrawEfficiency ( const string &  canvasName,
const string &  histName 
)
protected

Draw efficiency histogram.

Parameters
[in]canvasNameName of canvas.
[in]histNameHistogram name.

Definition at line 182 of file CbmLitTrackingQaStudyReport.cxx.

References CalcEfficiency(), CbmReport::CreateCanvas(), DrawH1(), DrawMeanEfficiencyLines(), Cbm::FindAndReplace(), CbmStudyReport::GetStudyName(), CbmHistManager::H1(), CbmStudyReport::HM(), and kLinear.

Referenced by DrawEfficiencyHistos().

◆ DrawEfficiencyHistos()

void CbmLitTrackingQaStudyReport::DrawEfficiencyHistos ( )
protected

Main function for drawing efficiency histograms.

Definition at line 159 of file CbmLitTrackingQaStudyReport.cxx.

References DrawAccAndRec(), DrawEfficiency(), CbmStudyReport::HM(), and i.

Referenced by Draw().

◆ DrawMeanEfficiencyLines()

void CbmLitTrackingQaStudyReport::DrawMeanEfficiencyLines ( const std::vector< TH1 * > &  histos,
const std::vector< Double_t > &  efficiencies 
)
protected

Draw mean efficiency lines on histogram.

Parameters
[in]histosVector of histograms.
[in]efficienciesVector of efficiency numbers.

Definition at line 242 of file CbmLitTrackingQaStudyReport.cxx.

Referenced by DrawEfficiency().

◆ GetOutputDir()

const std::string& CbmReport::GetOutputDir ( ) const
inlineinherited

◆ GetReportName()

◆ GetReportTitle()

const std::string& CbmReport::GetReportTitle ( ) const
inlineinherited

Definition at line 65 of file CbmReport.h.

References CbmReport::fReportTitle.

◆ GetStudyName()

const std::string& CbmStudyReport::GetStudyName ( Int_t  index) const
inlineinherited

Definition at line 77 of file CbmStudyReport.h.

References CbmStudyReport::fStudyNames.

Referenced by DrawAccAndRec(), and DrawEfficiency().

◆ GetStudyNames()

◆ HM() [1/2]

◆ HM() [2/2]

CbmHistManager* CbmStudyReport::HM ( Int_t  index) const
inlineinherited

Definition at line 75 of file CbmStudyReport.h.

References CbmStudyReport::fHM.

◆ Out()

◆ PrintCanvases()

◆ PrintEfficiencyTable()

string CbmLitTrackingQaStudyReport::PrintEfficiencyTable ( const string &  tableName,
const string &  pattern 
) const
protected

Return formated string with table of efficiency numbers.

Parameters
[in]tableNameTable name.
[in]patternPattern of histogram name.
Returns
Formated string with table of efficiency numbers.

Definition at line 120 of file CbmLitTrackingQaStudyReport.cxx.

References Cbm::FindAndReplace(), CbmStudyReport::GetStudyNames(), CbmStudyReport::HM(), i, CbmReport::R(), Cbm::Split(), split(), CbmReportElement::TableBegin(), CbmReportElement::TableEnd(), and CbmReportElement::TableRow().

Referenced by Create().

◆ PrintTable()

string CbmLitTrackingQaStudyReport::PrintTable ( const string &  tableName,
const string &  pattern,
string(*)(const string &)  rowNameFormatter,
string(*)(const TH1 *, Int_t)  cellFormatter 
) const
protected

Return formated string with table of numbers.

Parameters
[in]tableNameTable name.
[in]patternPattern of histogram name.
[in]rowNameFormatterFunction which formats row name.
[in]cellFormatterFunction formats cell string.
Returns
Formated string with table of numbers.

Definition at line 94 of file CbmLitTrackingQaStudyReport.cxx.

References CbmStudyReport::GetStudyNames(), CbmStudyReport::HM(), i, CbmReport::R(), CbmReportElement::TableBegin(), CbmReportElement::TableEnd(), and CbmReportElement::TableRow().

Referenced by Create().

◆ R()

◆ SaveCanvasesAsImages()

void CbmReport::SaveCanvasesAsImages ( ) const
protectedinherited

Save all canvases to images.

Definition at line 91 of file CbmReport.cxx.

References CbmReport::fCanvases, CbmReport::GetOutputDir(), i, and Cbm::SaveCanvasAsImage().

Referenced by CbmReport::CreateReports().

◆ SetOutputDir()

void CbmReport::SetOutputDir ( const std::string &  outputDir)
inlineinherited

Definition at line 61 of file CbmReport.h.

References CbmReport::fOutputDir.

◆ SetReportName()

◆ SetReportTitle()

void CbmReport::SetReportTitle ( const std::string &  title)
inlineinherited

◆ WriteCanvases()

void CbmReport::WriteCanvases ( ) const
protectedinherited

Write canvases to file.

Definition at line 101 of file CbmReport.cxx.

References CbmReport::fCanvases, CbmReport::GetOutputDir(), and i.

Member Data Documentation

◆ fCanvases

std::vector<TCanvas*> CbmReport::fCanvases
privateinherited

◆ fHM

std::vector<CbmHistManager*> CbmStudyReport::fHM
privateinherited

Definition at line 82 of file CbmStudyReport.h.

Referenced by CbmStudyReport::HM().

◆ fOut

std::ostream* CbmReport::fOut
mutableprivateinherited

Definition at line 135 of file CbmReport.h.

Referenced by CbmReport::CreateReportElement(), and CbmReport::Out().

◆ fOutputDir

std::string CbmReport::fOutputDir
privateinherited

Definition at line 132 of file CbmReport.h.

Referenced by CbmReport::GetOutputDir(), and CbmReport::SetOutputDir().

◆ fR

CbmReportElement* CbmReport::fR
privateinherited

Definition at line 134 of file CbmReport.h.

Referenced by CbmReport::CreateReportElement(), and CbmReport::R().

◆ fReportName

std::string CbmReport::fReportName
privateinherited

◆ fReportTitle

std::string CbmReport::fReportTitle
privateinherited

Definition at line 131 of file CbmReport.h.

Referenced by CbmReport::GetReportTitle(), and CbmReport::SetReportTitle().

◆ fReportType

ReportType CbmReport::fReportType
privateinherited

Definition at line 133 of file CbmReport.h.

Referenced by CbmReport::CreateReportElement().

◆ fStudyNames

std::vector<std::string> CbmStudyReport::fStudyNames
privateinherited

Definition at line 83 of file CbmStudyReport.h.

Referenced by CbmStudyReport::GetStudyName(), and CbmStudyReport::GetStudyNames().


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