AliPhysics  c7b8e89 (c7b8e89)
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  fEfficiencyWeightSB(kFALSE),
55  fMassPlot(nullptr),
56  fMassVsJetPtPlot(nullptr),
57  fMassVsJetzPlot(nullptr)
58 {
59 }
60 
66  TObject(),
67  fpTmin(source.fpTmin),
68  fpTmax(source.fpTmax),
69  fnDbins(0),
71  fnJetPtbins(0),
73  fnJetzbins(0),
76  fMassRebin(source.fMassRebin),
81 {
82  if (source.fnDbins > 0) {
83  fnDbins = source.fnDbins;
84  fDbinpTedges = new Double_t[fnDbins+1];
85  memcpy(fDbinpTedges, source.fDbinpTedges, sizeof(Double_t)*(fnDbins+1));
86  fDEffValues = new Double_t[fnDbins+1];
87  memcpy(fDEffValues, source.fDEffValues, sizeof(Double_t)*(fnDbins+1));
88  }
89  if (source.fnJetPtbins > 0) {
90  fnJetPtbins = source.fnJetPtbins;
92  memcpy(fJetPtBinEdges, source.fJetPtBinEdges, sizeof(Double_t)*(fnJetPtbins+1));
93  }
94  if (source.fnJetzbins > 0) {
95  fnJetzbins = source.fnJetzbins;
97  memcpy(fJetzBinEdges, source.fJetzBinEdges, sizeof(Double_t)*(fnJetzbins+1));
98  }
99 }
100 
105 {
106  if (fMassPlot) delete fMassPlot;
108  if (fMassVsJetzPlot) delete fMassVsJetzPlot;
109 }
110 
117 {
118  fnDbins = nbins;
119  if (fDbinpTedges) {
120  delete[] fDbinpTedges;
121  fDbinpTedges = nullptr;
122  }
123  if (nbins == 0) return;
124  fDbinpTedges = new Double_t[fnDbins + 1];
125  memcpy(fDbinpTedges, ptedges, sizeof(Double_t) * (fnDbins + 1));
126 }
127 
134 {
135  fnJetPtbins = nbins;
136  if (fJetPtBinEdges) {
137  delete[] fJetPtBinEdges;
138  fJetPtBinEdges = nullptr;
139  }
140  if (nbins == 0) return;
142  memcpy(fJetPtBinEdges, ptedges, sizeof(Double_t) * (fnJetPtbins + 1));
143 }
144 
151 {
152  fnJetzbins = nbins;
153  if (fJetzBinEdges) {
154  delete[] fJetzBinEdges;
155  fJetzBinEdges = nullptr;
156  }
157  if (nbins == 0) return;
158  fJetzBinEdges = new Double_t[fnJetzbins + 1];
159  memcpy(fJetzBinEdges, zedges, sizeof(Double_t) * (fnJetzbins + 1));
160 }
161 
167 {
168  if (fDEffValues) {
169  delete[] fDEffValues;
170  fDEffValues = nullptr;
171  }
172  if (fnDbins == 0) return;
174  memcpy(fDEffValues, effvalues, sizeof(Double_t) * fnDbins);
175 }
void SetJetzBins(Int_t nbins=0, Double_t *zedges=0x0)
double Double_t
Definition: External.C:58
Double_t fpTmax
pT upper edge of mass plot to evaluate variations of yields
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.
Bool_t fEfficiencyWeightSB
If true the efficiency is applied as a weight in the inv mass distribution also in the side-band meth...
Int_t fnDbins
Number of D-meson pT bins (for eff scaling)
Double_t fpTmin
pT lower edge of mass plot to evaluate variations of yields
UInt_t fMassRebin
Rebin the mass histogram axis.
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)