AliPhysics  4e47bdd (4e47bdd)
 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 
38 
43  TObject(),
44  fpTmin(0),
45  fpTmax(0),
46  fzmin(0),
47  fzmax(0),
48  fnDbins(0),
49  fDbinpTedges(nullptr),
50  fnJetbins(0),
51  fJetbinpTedges(nullptr),
52  fDEffValues(nullptr),
53  fMassPlot(nullptr),
54  fMassVsJetPtPlot(nullptr)
55 {
56 }
57 
63  TObject(),
64  fpTmin(source.fpTmin),
65  fpTmax(source.fpTmax),
66  fzmin(source.fzmin),
67  fzmax(source.fzmax),
68  fnDbins(0),
69  fDbinpTedges(nullptr),
70  fnJetbins(0),
71  fJetbinpTedges(nullptr),
72  fDEffValues(nullptr),
73  fMassPlot(nullptr),
74  fMassVsJetPtPlot(nullptr)
75 {
76  if (source.fnDbins > 0) {
77  fnDbins = source.fnDbins;
78  fDbinpTedges = new Double_t[fnDbins+1];
79  memcpy(fDbinpTedges, source.fDbinpTedges, sizeof(Double_t)*(fnDbins+1));
80  fDEffValues = new Double_t[fnDbins+1];
81  memcpy(fDEffValues, source.fDEffValues, sizeof(Double_t)*(fnDbins+1));
82  }
83  if (source.fnJetbins > 0) {
84  fnJetbins = source.fnJetbins;
86  memcpy(fJetbinpTedges, source.fJetbinpTedges, sizeof(Double_t)*(fnJetbins+1));
87  }
88 }
89 
94 {
95  if (fMassPlot) delete fMassPlot;
97 }
98 
105 {
106  fnDbins = nbins;
107  if (fDbinpTedges) {
108  delete[] fDbinpTedges;
109  fDbinpTedges = nullptr;
110  }
111  if (nbins == 0) return;
112  fDbinpTedges = new Double_t[fnDbins + 1];
113  memcpy(fDbinpTedges, ptedges, sizeof(Double_t) * (fnDbins + 1));
114 }
115 
122 {
123  fnJetbins = nbins;
124  if (fJetbinpTedges) {
125  delete[] fJetbinpTedges;
126  fJetbinpTedges = nullptr;
127  }
128  if (nbins == 0) return;
129  fJetbinpTedges = new Double_t[fnJetbins + 1];
130  memcpy(fJetbinpTedges, ptedges, sizeof(Double_t) * (fnJetbins + 1));
131 }
132 
138 {
139  if (fDEffValues) {
140  delete[] fDEffValues;
141  fDEffValues = nullptr;
142  }
143  if (fnDbins == 0) return;
145  memcpy(fDEffValues, effvalues, sizeof(Double_t) * fnDbins);
146 }
double Double_t
Definition: External.C:58
void SetJetPtBins(Int_t nbins=0, Double_t *ptedges=0x0)
virtual ~AliDJetVReader()
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...
TH1D * fMassPlot
!Mass spectra to be fitted
Double_t * fJetbinpTedges
Jet pT bin edges 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)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Int_t fnJetbins
Number of pT-bins to be used for spectrum.
const Int_t nbins
TH2D * fMassVsJetPtPlot
!Mass vs jet pt (SB method)
void SetDmesonPtBins(Int_t nbins=0, Double_t *ptedges=0x0)