PWGUD/dNdPt -> PWGLF/SPECTRA/ChargedHadrons/dNdPt
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / dNdPt / AlidNdPt.cxx
CommitLineData
0aaa8b91 1/**************************************************************************\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3 * *\r
4 * Author: The ALICE Off-line Project. *\r
5 * Contributors are mentioned in the code where appropriate. *\r
6 * *\r
7 * Permission to use, copy, modify and distribute this software and its *\r
8 * documentation strictly for non-commercial purposes is hereby granted *\r
9 * without fee, provided that the above copyright notice appears in all *\r
10 * copies and that both the copyright notice and this permission notice *\r
11 * appear in the supporting documentation. The authors make no claims *\r
12 * about the suitability of this software for any purpose. It is *\r
13 * provided "as is" without express or implied warranty. *\r
14 **************************************************************************/\r
68f10917 15 // last change: 2011-04-04 by M.Knichel\r
0aaa8b91 16\r
17#include "AliESDtrackCuts.h" \r
18#include "AlidNdPtEventCuts.h"\r
19#include "AlidNdPtAcceptanceCuts.h"\r
d269b0e6 20#include "AliPhysicsSelection.h"\r
7f7dd416 21#include "AlidNdPtBackgroundCuts.h"\r
0aaa8b91 22#include "AlidNdPt.h"\r
23\r
24using namespace std;\r
25\r
26ClassImp(AlidNdPt)\r
27\r
28//_____________________________________________________________________________\r
29AlidNdPt::AlidNdPt(): TNamed()\r
30, fdNdPtEventCuts(0)\r
31, fdNdPtAcceptanceCuts(0)\r
68f10917 32, fdNdPtRecAcceptanceCuts(0)\r
0aaa8b91 33, fEsdTrackCuts(0)\r
34, fUseMCInfo(kFALSE)\r
35, fAnalysisMode(AlidNdPtHelper::kTPC) \r
70fdd197 36, fTrigger(AliTriggerAnalysis::kMB1) \r
985bdfd5 37, fTriggerClass(0) \r
847e74b2 38, fParticleMode(AlidNdPtHelper::kAllPart) \r
d269b0e6 39, fPhysicsSelection(0)\r
7f7dd416 40, fdNdPtBackgroundCuts(0)\r
a26e43aa 41, fAnalyseOutput(kFALSE)\r
42, fMergeTHnSparse(kTRUE)\r
b2c68775 43, fTriggerMask(AliVEvent::kMB)\r
0aaa8b91 44{\r
45 // default constructor\r
46}\r
47\r
48//_____________________________________________________________________________\r
49AlidNdPt::AlidNdPt(Char_t* name, Char_t* title): TNamed(name,title)\r
50, fdNdPtEventCuts(0)\r
51, fdNdPtAcceptanceCuts(0)\r
68f10917 52, fdNdPtRecAcceptanceCuts(0)\r
0aaa8b91 53, fEsdTrackCuts(0)\r
54, fUseMCInfo(kFALSE)\r
55, fAnalysisMode(AlidNdPtHelper::kTPC) \r
70fdd197 56, fTrigger(AliTriggerAnalysis::kMB1) \r
985bdfd5 57, fTriggerClass(0) \r
847e74b2 58, fParticleMode(AlidNdPtHelper::kAllPart) \r
d269b0e6 59, fPhysicsSelection(0)\r
7f7dd416 60, fdNdPtBackgroundCuts(0)\r
a26e43aa 61, fAnalyseOutput(kFALSE)\r
62, fMergeTHnSparse(kTRUE)\r
b2c68775 63, fTriggerMask(AliVEvent::kMB)\r
0aaa8b91 64{\r
65 // constructor\r
66}\r
67\r
154caed0 68AlidNdPt::AlidNdPt(const AlidNdPt&): TNamed()\r
69, fdNdPtEventCuts(0)\r
70, fdNdPtAcceptanceCuts(0)\r
68f10917 71, fdNdPtRecAcceptanceCuts(0)\r
154caed0 72, fEsdTrackCuts(0)\r
73, fUseMCInfo(kFALSE)\r
74, fAnalysisMode(AlidNdPtHelper::kTPC) \r
75, fTrigger(AliTriggerAnalysis::kMB1) \r
76, fTriggerClass(0) \r
77, fParticleMode(AlidNdPtHelper::kAllPart) \r
78, fPhysicsSelection(0)\r
79, fdNdPtBackgroundCuts(0)\r
a26e43aa 80, fAnalyseOutput(kFALSE)\r
81, fMergeTHnSparse(kTRUE)\r
b2c68775 82, fTriggerMask(AliVEvent::kMB)\r
154caed0 83{\r
84 // not implemented\r
85}\r
86\r
87AlidNdPt& AlidNdPt::operator=(const AlidNdPt&)\r
88{\r
89 // not implemented\r
90 return *this;\r
91}\r
92\r
0aaa8b91 93//_____________________________________________________________________________\r
d269b0e6 94AlidNdPt::~AlidNdPt() {\r
0aaa8b91 95 // destructor\r
96 if(fdNdPtEventCuts) delete fdNdPtEventCuts; fdNdPtEventCuts=NULL; \r
97 if(fdNdPtAcceptanceCuts) delete fdNdPtAcceptanceCuts; fdNdPtAcceptanceCuts=NULL;\r
68f10917 98 if(fdNdPtRecAcceptanceCuts) delete fdNdPtRecAcceptanceCuts; fdNdPtRecAcceptanceCuts=NULL; \r
0aaa8b91 99 if(fEsdTrackCuts) delete fEsdTrackCuts; fEsdTrackCuts=NULL;\r
d269b0e6 100 if(fPhysicsSelection) delete fPhysicsSelection; fPhysicsSelection=NULL;\r
7f7dd416 101 if(fdNdPtBackgroundCuts) delete fdNdPtBackgroundCuts; fdNdPtBackgroundCuts=NULL;\r
0aaa8b91 102}\r
10360c58 103\r
104//_____________________________________________________________________________\r
105Double_t * AlidNdPt::CreateLogAxis(Int_t nbins, Double_t xmin, Double_t xmax) {\r
106 // retun pointer to the array with log axis\r
107 // it is user responsibility to delete the array\r
108 \r
109 Double_t logxmin = TMath::Log10(xmin);\r
110 Double_t logxmax = TMath::Log10(xmax);\r
111 Double_t binwidth = (logxmax-logxmin)/nbins;\r
112 \r
113 Double_t *xbins = new Double_t[nbins+1];\r
114\r
115 xbins[0] = xmin;\r
116 for (Int_t i=1;i<=nbins;i++) {\r
117 xbins[i] = xmin + TMath::Power(10,logxmin+i*binwidth);\r
118 }\r
119\r
120return xbins;\r
121}\r
fc98fbb5 122//_____________________________________________________________________________\r
123\r
124Double_t* AlidNdPt::CloneArray(Int_t n, Double_t* source)\r
125{\r
126 if (!source || n==0) return 0;\r
127 Double_t* dest = new Double_t[n];\r
128 for (Int_t i=0; i<n ; i++) { dest[i] = source[i]; }\r
129 return dest;\r
130}\r