CbmAnaDielectronTaskDraw.h 7.07 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
/** CbmAnaDielectronTaskDraw.h
 * @author Elena Lebedeva <e.lebedeva@gsi.de>
 * @since 2011
 * @version 1.0
 **/

#ifndef CBM_ANA_DIELECTRON_TASK_DRAW_H
#define CBM_ANA_DIELECTRON_TASK_DRAW_H

#include "CbmLmvmCuts.h"
Administrator's avatar
Administrator committed
11
#include "CbmLmvmHist.h"
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#include "TObject.h"

#include <string>
#include <vector>

class TH1;
class TH2D;
class TH1D;
class TFile;
class TCanvas;
class CbmHistManager;


Administrator's avatar
Administrator committed
26
class CbmAnaDielectronTaskDraw : public TObject {
27
28

public:
Administrator's avatar
Administrator committed
29
  CbmAnaDielectronTaskDraw();
30

Administrator's avatar
Administrator committed
31
  virtual ~CbmAnaDielectronTaskDraw() { ; }
32

Administrator's avatar
Administrator committed
33
  /**
34
35
36
37
38
39
40
     * \brief Implement functionality of drawing histograms in the macro
     * from the specified file, this function should be called from macro.
     * \param[in] fileName Name of the input file with histograms.
     * \param[in] outputDir Path to the output directory (if it does not exist, it will be created automatically).
     * \param[in] useMvd draw histograms related to the MVD detector?
     * \param[in] drawSig Do you want to draw significance histograms?
     **/
Administrator's avatar
Administrator committed
41
42
43
44
  void DrawHistFromFile(const std::string& fileName,
                        const std::string& outputDir = "",
                        Bool_t useMvd                = true,
                        Bool_t drawSig               = true);
45
46

private:
Administrator's avatar
Administrator committed
47
48
49
50
51
  Int_t fNofEvents;
  Bool_t
    fUseMvd;  // do you want to draw histograms related to the MVD detector?
  Bool_t
    fDrawSignificance;  // do you want to draw significance histograms of 1D cuts?
52

Administrator's avatar
Administrator committed
53
  CbmLmvmCuts fCuts;  // electron identification and analysis cuts
54

Administrator's avatar
Administrator committed
55
56
  CbmHistManager* fHM;     //histogram manager
  std::string fOutputDir;  // output directory for results
57

Administrator's avatar
Administrator committed
58
  /**
59
60
61
     * \brief Rebin minv histograms for better drawing. Should be called after
     * calculation of S/BG ratios.
     */
Administrator's avatar
Administrator committed
62
  void RebinMinvHist();
63

Administrator's avatar
Administrator committed
64
  /**
65
66
67
     * \brief Return TH1D* pointer to the specified histogram.
     * \param[in] name Histogram name.
     */
Administrator's avatar
Administrator committed
68
  TH1D* H1(const std::string& name);
69

Administrator's avatar
Administrator committed
70
  /**
71
72
73
     * \brief Return TH2D* pointer to the specified histogram.
     * \param[in] name Histogram name.
     */
Administrator's avatar
Administrator committed
74
  TH2D* H2(const std::string& name);
75

Administrator's avatar
Administrator committed
76
  /**
77
78
     * \brief Save all created canvases to images.
     */
Administrator's avatar
Administrator committed
79
  void SaveCanvasToImage();
80

Administrator's avatar
Administrator committed
81
  /**
82
83
84
85
86
87
88
     * \brief Draw an integrated efficiency on a histogram (100.*h1->GetEntries()/h2->GetEntries()).
     * Histogram must be drawn in advance.
     * \param[in] h1 Pointer to the first histogram.
     * \param[in] h2 Pointer to the second histogram.
     * \param[in] xPos X position of the text in absolute coordinates.
     * \param[in] yPos Y position of the text in absolute coordinates.
     */
Administrator's avatar
Administrator committed
89
  void DrawEfficiencyOnHist(TH1* h1, TH1* h2, Double_t xPos, Double_t yPos);
90

Administrator's avatar
Administrator committed
91
  /**
92
93
94
95
96
97
     * Produce 1D significance histogram Significance=S/sqrt(S+BG).
     * \param[in] s Histogram with signal.
     * \param[in] bg Histogram eith background.
     * \param[in] name Name of new significance histogram.
     * \param[in] option Could be "right" or "left".
     */
Administrator's avatar
Administrator committed
98
99
100
101
  TH1D* CreateSignificanceH1D(TH1D* s,
                              TH1D* bg,
                              const std::string& name,
                              const std::string& option);
102

Administrator's avatar
Administrator committed
103
  /**
104
105
     * Produce 2D significance histogram Significance=S/sqrt(S+BG).
     */
Administrator's avatar
Administrator committed
106
107
108
109
  TH2D* CreateSignificanceH2D(TH2D* signal,
                              TH2D* bg,
                              const std::string& name,
                              const std::string& title);
110

Administrator's avatar
Administrator committed
111
  /**
112
113
114
115
116
     * \brief Fit signal histogram using Fit("gaus").
     * Calculate S/BG ratio in 2 sigma region.
     * Print summary table of the efficiency, S/BG, sigma etc for each step in cout.
     * \param[in] step Analysis step.
     */
Administrator's avatar
Administrator committed
117
  void SOverBg(CbmLmvmAnalysisSteps step);
118

Administrator's avatar
Administrator committed
119
  /**
120
121
122
     * Calculates S/BG ratio for each step of the analysis
     * using SOverBg method.
     */
Administrator's avatar
Administrator committed
123
  void SOverBgAll();
124

Administrator's avatar
Administrator committed
125
  /**
126
127
128
129
     * Draw Pt vs. Y distribution of signal for one step.
     * Print integrated efficiency using DrawEfficiencyOnHist method.
     * \param[in] step Analysis step.
     */
Administrator's avatar
Administrator committed
130
  void DrawPtYDistribution(int step, bool drawAnaStep = true);
131

Administrator's avatar
Administrator committed
132
  /**
133
134
135
     * Draw Pt vs. Y distributions of signal for all steps
     * using DrawPtYDistribution method.
     */
Administrator's avatar
Administrator committed
136
  void DrawPtYDistributionAll();
137

Administrator's avatar
Administrator committed
138
  /**
139
140
     * Draw Rapidity distributions of signal for all steps
     */
Administrator's avatar
Administrator committed
141
  void DrawRapidityDistributionAll();
142

Administrator's avatar
Administrator committed
143
  /**
144
145
146
147
     * \brief Draw efficiency in dependence on Pt and Rapidity.
     * Efficiency is normalized to the previous step.
     * \param[in] step Analysis step.
     */
Administrator's avatar
Administrator committed
148
  void DrawPtYEfficiency(int step, bool drawAnaStep = true);
149

Administrator's avatar
Administrator committed
150
  /**
151
152
     * Draw efficiency in dependence on Pt and Rapidity of signal for all steps.
     */
Administrator's avatar
Administrator committed
153
  void DrawPtYEfficiencyAll();
154

Administrator's avatar
Administrator committed
155
  /**
156
157
     * Draw momentum distribution of signal for all steps.
     */
Administrator's avatar
Administrator committed
158
  void DrawMomentumDistributionAll();
159

Administrator's avatar
Administrator committed
160
  /**
161
162
     * Draw efficiency vs. momentum of pair for all steps.
     */
Administrator's avatar
Administrator committed
163
  void DrawMomentumEfficiencyAll();
164

Administrator's avatar
Administrator committed
165
  /**
166
167
     * Draw Mother PDG
     */
Administrator's avatar
Administrator committed
168
169
170
  void DrawMotherPdg();

  /**
171
172
    * Draw PP Angle hist for MC signal
    */
Administrator's avatar
Administrator committed
173
  void DrawPPAngleMCSignal();
174

Administrator's avatar
Administrator committed
175
176
  // Draw distribution and significance of 1D analysis cut
  void Draw1DSourceTypes(const std::string& hName, bool doScale = true);
177

Administrator's avatar
Administrator committed
178
179
180
  void Draw1DCut(const std::string& hName,
                 const std::string& sigOption,
                 double cutValue = -999999.);
181

Administrator's avatar
Administrator committed
182
  void DrawElPiMomHis();
183

Administrator's avatar
Administrator committed
184
  void Draw2DCutTriangle(double xCross, double yCross);
185

Administrator's avatar
Administrator committed
186
187
188
  void Draw2DCut(const std::string& hist,
                 double cutCrossX = -999999.,
                 double cutCrossY = -999999.);
189

Administrator's avatar
Administrator committed
190
  void DrawCutDistributions();
191

Administrator's avatar
Administrator committed
192
  void DrawMismatchesAndGhosts();
193

Administrator's avatar
Administrator committed
194
195
  void
  DrawSourcesBgPairsEpEm(int step, bool inPercent, bool drawAnaStep = true);
196

Administrator's avatar
Administrator committed
197
  /**
198
199
     * Draw sources of BG pairs for all steps.
     */
Administrator's avatar
Administrator committed
200
  void DrawSourcesBgPairsAll();
201

Administrator's avatar
Administrator committed
202
  void DrawGammaVertex();
203

Administrator's avatar
Administrator committed
204
205
  void Draw1DHistoForEachAnalysisStep(const std::string& hist,
                                      Bool_t logy = false);
206

Administrator's avatar
Administrator committed
207
208
  //Draw Invariant mass distributions after each cut
  void DrawMinvForEachAnalysisStep();
209

Administrator's avatar
Administrator committed
210
  void DrawMinvSandBg(int step);
211

Administrator's avatar
Administrator committed
212
213
  // Invariant mass distribution after each cut for source of BG
  void DrawMinvSandBgAll();
214
215


Administrator's avatar
Administrator committed
216
  void DrawMinvSource(int step, bool drawAnaStep = true);
217

Administrator's avatar
Administrator committed
218
219
  // Invariant mass distribution after each cut for source of BG
  void DrawMinvSourceAll();
220

Administrator's avatar
Administrator committed
221
  /*
222
223
     * \brief Remove MVD bins from histograms if MVD detector was not used.
     */
Administrator's avatar
Administrator committed
224
  void RemoveMvdCutBins();
225
226


Administrator's avatar
Administrator committed
227
228
229
230
231
  void DrawBgSource2D(const std::string& canvasName,
                      const std::string& histName,
                      const std::vector<std::string>& yLabels,
                      double scale,
                      const std::string& zTitle);
232
233


Administrator's avatar
Administrator committed
234
235
  //SOURCE TRACKS
  void DrawBgSourceTracks();
236

Administrator's avatar
Administrator committed
237
  /**
238
239
     * \brief Set labels of X axis usinf analysis steps names.
     */
Administrator's avatar
Administrator committed
240
241
242
  void SetAnalysisStepLabels(TH1* h);

  void DrawMinvPtAll();
243

Administrator's avatar
Administrator committed
244
  void DrawBgSourcesVsMomentum();
245

Administrator's avatar
Administrator committed
246
  void DrawMvdCutQa();
247

Administrator's avatar
Administrator committed
248
  void DrawMvdAndStsHist();
249

Administrator's avatar
Administrator committed
250
  void DrawPmtXY();
251

Cornelius Feier-Riesen's avatar
Cornelius Feier-Riesen committed
252
253
254
  // Draw Likelihood vs Momentum
  void DrawMomLikeHist();

Administrator's avatar
Administrator committed
255
256
  CbmAnaDielectronTaskDraw(const CbmAnaDielectronTaskDraw&);
  CbmAnaDielectronTaskDraw& operator=(const CbmAnaDielectronTaskDraw&);
257

Administrator's avatar
Administrator committed
258
  ClassDef(CbmAnaDielectronTaskDraw, 1);
259
260
261
};

#endif