PandaRoot
PndFairHitQATask.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
28 #ifndef PndFairHitQATask_H
29 #define PndFairHitQATask_H
30 
31 // Root includes
32 #include "TVector3.h"
33 #include "TString.h"
34 #include "TGeoManager.h"
35 #include "TH1.h"
36 
37 // framework includes
38 #include "PndPersistencyTask.h"
40 
41 #include "FairLogger.h"
42 #include "FairHit.h"
43 
44 #include <map>
45 
46 class TClonesArray;
47 
49  public:
51  PndFairHitQATask(std::string hitBranchName, std::string pointBranchName);
52 
54  virtual ~PndFairHitQATask();
55 
57  virtual void SetParContainers();
58  virtual InitStatus Init();
59 
61  virtual void Exec(Option_t *opt);
62  virtual void FinishTask();
63  void SetWorkdir(TString path) { fWorkdir = path; }
64 
65  void SetHitBranch(std::string hitBranch) { fHitBranchName = hitBranch; }
66  void SetPointBranch(std::string pointBranch) { fPointBranchName = pointBranch; }
67  void SetOutputPlotName(std::string val = "Output.gif") { fOutputPlotName = val; }
68 
69  protected:
70  // These methods should be overwritten for a realistic test
71 
75  virtual void InitHistos();
76 
80  virtual void SetAllBoundaries();
81 
85  virtual void CalculateResolutions(FairHit *hit);
86 
90  virtual void FillHistos();
91 
95  virtual void AssignMeasurements();
96 
97  // No need to touch these classes
98  bool Test();
99  void DrawHistos();
100  void SaveHistos();
101  void PrintDartMeasurement();
102 
103  std::string fHitBranchName;
104  std::string fPointBranchName;
105  std::string fOutputPlotName{"ResolutionHistos.png"};
106 
107  TClonesArray *fMcPoints = nullptr;
108  TClonesArray *fHits = nullptr;
109  Bool_t fProperDifference = false;
111  double fTimeDifference = -1.0;
112  TString fWorkdir;
113 
115 
116  std::map<std::string, TH1 *> fHistos;
117 
119 };
120 
121 #endif
virtual void CalculateResolutions(FairHit *hit)
Calculate the resolution of a FairHit based on the MC data from a FairMCPoint.
void SetWorkdir(TString path)
only needed to give cdash the path to the stored pictures
void PrintDartMeasurement()
virtual void SetAllBoundaries()
Set the name and the boundaries for a measurement to pass.
TClonesArray * fHits
virtual void FinishTask()
virtual ~PndFairHitQATask()
std::string fPointBranchName
virtual void Exec(Option_t *opt)
void SetPointBranch(std::string pointBranch)
virtual void AssignMeasurements()
Extract the measurement values from the histograms like mean or RMS values and assign them to the mea...
std::string fHitBranchName
void SetHitBranch(std::string hitBranch)
void SetOutputPlotName(std::string val="Output.gif")
Base class to tests reconstructed hits based on FairHits for the PANDA QA tasks This class calculate...
TClonesArray * fMcPoints
virtual void FillHistos()
Fill the output of CalculateResolutions into the corresponding histograms.
virtual InitStatus Init()
PndMeasurementBoundaries fBoundaries
TVector3 fSpatialDifference
std::string fOutputPlotName
PndFairHitQATask(std::string hitBranchName, std::string pointBranchName)
ClassDef(PndFairHitQATask, 2)
std::map< std::string, TH1 * > fHistos
virtual void SetParContainers()
Bool_t fProperDifference
if method CalculateResolutions worked
virtual void InitHistos()
Initialize the histograms containing the measurement data in the histogram map.