1 /**************************************************************************
\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
4 * Author: The ALICE Off-line Project. *
\r
5 * Contributors are mentioned in the code where appropriate. *
\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
15 // last change: 2011-04-04 by M.Knichel
\r
17 #include "AliESDtrackCuts.h"
\r
18 #include "AlidNdPtEventCuts.h"
\r
19 #include "AlidNdPtAcceptanceCuts.h"
\r
20 #include "AliPhysicsSelection.h"
\r
21 #include "AlidNdPtBackgroundCuts.h"
\r
22 #include "AlidNdPt.h"
\r
24 using namespace std;
\r
28 //_____________________________________________________________________________
\r
29 AlidNdPt::AlidNdPt(): TNamed()
\r
30 , fdNdPtEventCuts(0)
\r
31 , fdNdPtAcceptanceCuts(0)
\r
32 , fdNdPtRecAcceptanceCuts(0)
\r
34 , fUseMCInfo(kFALSE)
\r
35 , fAnalysisMode(AlidNdPtHelper::kTPC)
\r
36 , fTrigger(AliTriggerAnalysis::kMB1)
\r
38 , fParticleMode(AlidNdPtHelper::kAllPart)
\r
39 , fPhysicsSelection(0)
\r
40 , fdNdPtBackgroundCuts(0)
\r
41 , fAnalyseOutput(kFALSE)
\r
42 , fMergeTHnSparse(kTRUE)
\r
43 , fTriggerMask(AliVEvent::kMB)
\r
45 // default constructor
\r
48 //_____________________________________________________________________________
\r
49 AlidNdPt::AlidNdPt(Char_t* name, Char_t* title): TNamed(name,title)
\r
50 , fdNdPtEventCuts(0)
\r
51 , fdNdPtAcceptanceCuts(0)
\r
52 , fdNdPtRecAcceptanceCuts(0)
\r
54 , fUseMCInfo(kFALSE)
\r
55 , fAnalysisMode(AlidNdPtHelper::kTPC)
\r
56 , fTrigger(AliTriggerAnalysis::kMB1)
\r
58 , fParticleMode(AlidNdPtHelper::kAllPart)
\r
59 , fPhysicsSelection(0)
\r
60 , fdNdPtBackgroundCuts(0)
\r
61 , fAnalyseOutput(kFALSE)
\r
62 , fMergeTHnSparse(kTRUE)
\r
63 , fTriggerMask(AliVEvent::kMB)
\r
68 AlidNdPt::AlidNdPt(const AlidNdPt&): TNamed()
\r
69 , fdNdPtEventCuts(0)
\r
70 , fdNdPtAcceptanceCuts(0)
\r
71 , fdNdPtRecAcceptanceCuts(0)
\r
73 , fUseMCInfo(kFALSE)
\r
74 , fAnalysisMode(AlidNdPtHelper::kTPC)
\r
75 , fTrigger(AliTriggerAnalysis::kMB1)
\r
77 , fParticleMode(AlidNdPtHelper::kAllPart)
\r
78 , fPhysicsSelection(0)
\r
79 , fdNdPtBackgroundCuts(0)
\r
80 , fAnalyseOutput(kFALSE)
\r
81 , fMergeTHnSparse(kTRUE)
\r
82 , fTriggerMask(AliVEvent::kMB)
\r
87 AlidNdPt& AlidNdPt::operator=(const AlidNdPt&)
\r
93 //_____________________________________________________________________________
\r
94 AlidNdPt::~AlidNdPt() {
\r
96 if(fdNdPtEventCuts) delete fdNdPtEventCuts; fdNdPtEventCuts=NULL;
\r
97 if(fdNdPtAcceptanceCuts) delete fdNdPtAcceptanceCuts; fdNdPtAcceptanceCuts=NULL;
\r
98 if(fdNdPtRecAcceptanceCuts) delete fdNdPtRecAcceptanceCuts; fdNdPtRecAcceptanceCuts=NULL;
\r
99 if(fEsdTrackCuts) delete fEsdTrackCuts; fEsdTrackCuts=NULL;
\r
100 if(fPhysicsSelection) delete fPhysicsSelection; fPhysicsSelection=NULL;
\r
101 if(fdNdPtBackgroundCuts) delete fdNdPtBackgroundCuts; fdNdPtBackgroundCuts=NULL;
\r
104 //_____________________________________________________________________________
\r
105 Double_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
109 Double_t logxmin = TMath::Log10(xmin);
\r
110 Double_t logxmax = TMath::Log10(xmax);
\r
111 Double_t binwidth = (logxmax-logxmin)/nbins;
\r
113 Double_t *xbins = new Double_t[nbins+1];
\r
116 for (Int_t i=1;i<=nbins;i++) {
\r
117 xbins[i] = xmin + TMath::Power(10,logxmin+i*binwidth);
\r
122 //_____________________________________________________________________________
\r
124 Double_t* AlidNdPt::CloneArray(Int_t n, Double_t* source)
\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