AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliDJetVReader.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 #include <iostream>
17 #include <cstring>
18 #include <set>
19 
20 #include <TMath.h>
21 #include <TFile.h>
22 #include <TCanvas.h>
23 #include <TLegend.h>
24 #include <TLatex.h>
25 #include <TRandom2.h>
26 #include <TH1D.h>
27 #include <TH2.h>
28 #include <TF1.h>
29 #include <TDatabasePDG.h>
30 #include <Riostream.h>
31 #include <TLine.h>
32 
33 #include "AliDJetVReader.h"
34 
36 ClassImp(AliDJetVReader);
38 
43  TObject(),
44  fpTmin(0),
45  fpTmax(0),
46  fnDbins(0),
47  fDbinpTedges(nullptr),
48  fnJetPtbins(0),
49  fJetPtBinEdges(nullptr),
50  fnJetzbins(0),
51  fJetzBinEdges(nullptr),
52  fDEffValues(nullptr),
53  fMassRebin(1),
54  fMassPlot(nullptr),
55  fMassVsJetPtPlot(nullptr),
56  fMassVsJetzPlot(nullptr)
57 {
58 }
59 
65  TObject(),
66  fpTmin(source.fpTmin),
67  fpTmax(source.fpTmax),
68  fnDbins(0),
69  fDbinpTedges(nullptr),
70  fnJetPtbins(0),
71  fJetPtBinEdges(nullptr),
72  fnJetzbins(0),
73  fJetzBinEdges(nullptr),
74  fDEffValues(nullptr),
75  fMassRebin(source.fMassRebin),
76  fMassPlot(nullptr),
77  fMassVsJetPtPlot(nullptr),
78  fMassVsJetzPlot(nullptr)
79 {
80  if (source.fnDbins > 0) {
81  fnDbins = source.fnDbins;
82  fDbinpTedges = new Double_t[fnDbins+1];
83  memcpy(fDbinpTedges, source.fDbinpTedges, sizeof(Double_t)*(fnDbins+1));
84  fDEffValues = new Double_t[fnDbins+1];
85  memcpy(fDEffValues, source.fDEffValues, sizeof(Double_t)*(fnDbins+1));
86  }
87  if (source.fnJetPtbins > 0) {
88  fnJetPtbins = source.fnJetPtbins;
90  memcpy(fJetPtBinEdges, source.fJetPtBinEdges, sizeof(Double_t)*(fnJetPtbins+1));
91  }
92  if (source.fnJetzbins > 0) {
93  fnJetzbins = source.fnJetzbins;
95  memcpy(fJetzBinEdges, source.fJetzBinEdges, sizeof(Double_t)*(fnJetzbins+1));
96  }
97 }
98 
103 {
104  if (fMassPlot) delete fMassPlot;
106  if (fMassVsJetzPlot) delete fMassVsJetzPlot;
107 }
108 
115 {
116  fnDbins = nbins;
117  if (fDbinpTedges) {
118  delete[] fDbinpTedges;
119  fDbinpTedges = nullptr;
120  }
121  if (nbins == 0) return;
122  fDbinpTedges = new Double_t[fnDbins + 1];
123  memcpy(fDbinpTedges, ptedges, sizeof(Double_t) * (fnDbins + 1));
124 }
125 
132 {
133  fnJetPtbins = nbins;
134  if (fJetPtBinEdges) {
135  delete[] fJetPtBinEdges;
136  fJetPtBinEdges = nullptr;
137  }
138  if (nbins == 0) return;
140  memcpy(fJetPtBinEdges, ptedges, sizeof(Double_t) * (fnJetPtbins + 1));
141 }
142 
149 {
150  fnJetzbins = nbins;
151  if (fJetzBinEdges) {
152  delete[] fJetzBinEdges;
153  fJetzBinEdges = nullptr;
154  }
155  if (nbins == 0) return;
156  fJetzBinEdges = new Double_t[fnJetzbins + 1];
157  memcpy(fJetzBinEdges, zedges, sizeof(Double_t) * (fnJetzbins + 1));
158 }
159 
165 {
166  if (fDEffValues) {
167  delete[] fDEffValues;
168  fDEffValues = nullptr;
169  }
170  if (fnDbins == 0) return;
172  memcpy(fDEffValues, effvalues, sizeof(Double_t) * fnDbins);
173 }
void SetJetzBins(Int_t nbins=0, Double_t *zedges=0x0)
double Double_t
Definition: External.C:58
void SetJetPtBins(Int_t nbins=0, Double_t *ptedges=0x0)
virtual ~AliDJetVReader()
Double_t * fJetzBinEdges
Jet z bin edges to be used for spectrum.
Double_t * fDbinpTedges
D-meson pt bin edges values.
Implementation of an abstract class to read the invariant mass histograms used to extract the raw yie...
Int_t fnJetzbins
Number of jet z bins to be used for spectrum.
TH1D * fMassPlot
!Mass spectra to be fitted
Int_t fnJetPtbins
Number of jet pT bins to be used for spectrum.
int Int_t
Definition: External.C:63
Double_t * fDEffValues
D-meson efficiency values.
Int_t fnDbins
Number of D-meson pT bins (for eff scaling)
Declaration of class AliDJetVReader.
void SetDmesonEfficiency(Double_t *effvalues=0x0)
const Int_t nbins
TH2D * fMassVsJetPtPlot
!Mass vs jet pt (SB method)
void SetDmesonPtBins(Int_t nbins=0, Double_t *ptedges=0x0)
Double_t * fJetPtBinEdges
Jet pT bin edges to be used for spectrum.
TH2D * fMassVsJetzPlot
!Mass vs jet z (SB method)