CbmRoot
CbmAnaLmvmDrawStudy.h
Go to the documentation of this file.
1 
7 #ifndef CBM_ANA_LMVM_DRAW_STUDY
8 #define CBM_ANA_LMVM_DRAW_STUDY
9 
10 #include <string>
11 #include <vector>
12 
13 #include "CbmLmvmHist.h"
14 
15 #include "TObject.h"
16 
17 class TH1;
18 class TH2D;
19 class TH1D;
20 class TFile;
21 class TCanvas;
22 class CbmHistManager;
23 class CbmAnaPTree;
24 
25 class CbmAnaLmvmDrawStudy : public TObject {
26 
27 public:
32  : TObject()
33  , fCanvas()
34  , fNofStudies(0)
35  , fStudyNames()
36  , fHM()
37  , fMeanFiles()
38  , fOutputDir("") {
39  ;
40  }
41 
45  virtual ~CbmAnaLmvmDrawStudy() { ; }
46 
55  void DrawFromFile(const std::vector<std::string>& fileNames,
56  const std::vector<std::string>& fileNamesMean,
57  const std::vector<std::string>& studyNames,
58  const std::string& outputDir = "");
59 
60 private:
61  std::vector<TCanvas*>
62  fCanvas; // store all pointers to TCanvas -> save to images
63  Int_t fNofStudies;
64  std::vector<std::string> fStudyNames;
65 
66  std::vector<CbmHistManager*>
67  fHM; // store pointers to histogram manager for different simulations
68 
69  std::vector<std::string> fMeanFiles; // Files mean
70 
71  std::string fOutputDir; // output directory for figures and .json file
72 
73  TCanvas* CreateCanvas(const std::string& name,
74  const std::string& title,
75  int width,
76  int height);
77 
78  void DrawTextOnHist(const std::string& text,
79  Double_t x1,
80  Double_t y1,
81  Double_t x2,
82  Double_t y2);
83 
84  TH1D* H1(int studyNum, const std::string& name);
85 
86  TH2D* H2(int studyNum, const std::string& name);
87 
88  void SaveCanvasToImage();
89 
90  void SetAnalysisStepLabels(TH1* h);
91 
92  void DrawMinv();
93  void DrawNofBgTracks();
94  void DrawBgSourceTracks();
95  void DrawBgSourcePairsStep(int step);
96  void DrawBgSourcePairs();
97  void DrawBgSourceMinv();
98  void DrawDistributions(const std::string& canvasName,
99  const std::string& histName,
100  int step,
101  int sourceType);
102 
104 };
105 
106 #endif
CbmAnaLmvmDrawStudy::H1
TH1D * H1(int studyNum, const std::string &name)
Definition: CbmAnaLmvmDrawStudy.cxx:101
CbmAnaLmvmDrawStudy::DrawBgSourcePairs
void DrawBgSourcePairs()
Definition: CbmAnaLmvmDrawStudy.cxx:218
CbmAnaLmvmDrawStudy::DrawBgSourcePairsStep
void DrawBgSourcePairsStep(int step)
Definition: CbmAnaLmvmDrawStudy.cxx:251
CbmAnaLmvmDrawStudy::DrawBgSourceMinv
void DrawBgSourceMinv()
Definition: CbmAnaLmvmDrawStudy.cxx:297
CbmAnaLmvmDrawStudy::ClassDef
ClassDef(CbmAnaLmvmDrawStudy, 1)
CbmAnaLmvmDrawStudy::fHM
std::vector< CbmHistManager * > fHM
Definition: CbmAnaLmvmDrawStudy.h:67
CbmAnaLmvmDrawStudy::fCanvas
std::vector< TCanvas * > fCanvas
Definition: CbmAnaLmvmDrawStudy.h:62
CbmAnaLmvmDrawStudy::CreateCanvas
TCanvas * CreateCanvas(const std::string &name, const std::string &title, int width, int height)
Definition: CbmAnaLmvmDrawStudy.cxx:79
CbmAnaLmvmDrawStudy::DrawNofBgTracks
void DrawNofBgTracks()
Definition: CbmAnaLmvmDrawStudy.cxx:165
CbmAnaLmvmDrawStudy::H2
TH2D * H2(int studyNum, const std::string &name)
Definition: CbmAnaLmvmDrawStudy.cxx:105
CbmAnaLmvmDrawStudy
Definition: CbmAnaLmvmDrawStudy.h:25
CbmAnaLmvmDrawStudy::DrawFromFile
void DrawFromFile(const std::vector< std::string > &fileNames, const std::vector< std::string > &fileNamesMean, const std::vector< std::string > &studyNames, const std::string &outputDir="")
Implement functionality of drawing histograms in the macro from the specified files,...
Definition: CbmAnaLmvmDrawStudy.cxx:39
CbmAnaLmvmDrawStudy::fNofStudies
Int_t fNofStudies
Definition: CbmAnaLmvmDrawStudy.h:63
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
h
Data class with information on a STS local track.
CbmLmvmHist.h
CbmAnaLmvmDrawStudy::DrawTextOnHist
void DrawTextOnHist(const std::string &text, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: CbmAnaLmvmDrawStudy.cxx:88
CbmAnaLmvmDrawStudy::DrawDistributions
void DrawDistributions(const std::string &canvasName, const std::string &histName, int step, int sourceType)
Definition: CbmAnaLmvmDrawStudy.cxx:277
CbmAnaLmvmDrawStudy::fOutputDir
std::string fOutputDir
Definition: CbmAnaLmvmDrawStudy.h:71
CbmAnaLmvmDrawStudy::CbmAnaLmvmDrawStudy
CbmAnaLmvmDrawStudy()
Default constructor.
Definition: CbmAnaLmvmDrawStudy.h:31
CbmAnaLmvmDrawStudy::DrawBgSourceTracks
void DrawBgSourceTracks()
Definition: CbmAnaLmvmDrawStudy.cxx:184
CbmAnaLmvmDrawStudy::SetAnalysisStepLabels
void SetAnalysisStepLabels(TH1 *h)
Definition: CbmAnaLmvmDrawStudy.cxx:115
CbmAnaLmvmDrawStudy::SaveCanvasToImage
void SaveCanvasToImage()
Definition: CbmAnaLmvmDrawStudy.cxx:109
CbmAnaLmvmDrawStudy::DrawMinv
void DrawMinv()
Definition: CbmAnaLmvmDrawStudy.cxx:123
CbmAnaLmvmDrawStudy::fMeanFiles
std::vector< std::string > fMeanFiles
Definition: CbmAnaLmvmDrawStudy.h:69
CbmAnaLmvmDrawStudy::~CbmAnaLmvmDrawStudy
virtual ~CbmAnaLmvmDrawStudy()
Destructor.
Definition: CbmAnaLmvmDrawStudy.h:45
CbmAnaLmvmDrawStudy::fStudyNames
std::vector< std::string > fStudyNames
Definition: CbmAnaLmvmDrawStudy.h:64