]>
Commit | Line | Data |
---|---|---|
fc7e3b59 | 1 | /************************************************************************** |
2 | * This file is property of and copyright by the ALICE HLT Project * | |
3 | * ALICE Experiment at CERN, All rights reserved. * | |
4 | * * | |
5 | * Primary Author: Svein Lindal <slindal@fys.uio.no> * | |
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 | /// @file AliAnaConvCorrBase.cxx | |
17 | /// @author Svein Lindal | |
18 | /// @brief Base class for analysation of conversion particle - track correlations | |
19 | ||
20 | ||
21 | #include "AliAnaConvCorrBase.h" | |
22 | #include "AliAODTrack.h" | |
23 | ||
24 | #include "TClonesArray.h" | |
25 | #include "TH1F.h" | |
811b0806 | 26 | #include "TH3.h" |
fc7e3b59 | 27 | #include "TList.h" |
fc7e3b59 | 28 | #include "AliAODConversionParticle.h" |
29 | ||
30 | ||
31 | #include <iostream> | |
32 | ||
33 | // Gamma - jet correlation analysis task | |
34 | // Authors: Svein Lindal | |
35 | ||
36 | ||
37 | using namespace std; | |
38 | ClassImp(AliAnaConvCorrBase) | |
39 | ||
40 | //________________________________________________________________________ | |
41 | AliAnaConvCorrBase::AliAnaConvCorrBase(TString name) : TObject(), | |
42 | fName(name), | |
43 | fHistograms(NULL), | |
811b0806 | 44 | fNPhiBins(32), |
45 | fdPhiBins(NULL), | |
46 | fPtBins(NULL) | |
fc7e3b59 | 47 | { |
48 | //Constructor | |
811b0806 | 49 | fPtBins = new TArrayD(41); |
50 | for(Int_t i = 0; i < 10; i++) { | |
51 | fPtBins->SetAt(i*0.5, i); | |
52 | fPtBins->SetAt(5 + i*0.5, i + 10); | |
53 | ||
54 | fPtBins->SetAt(10. + i, i+20); | |
55 | fPtBins->SetAt(20. + 2*i, i+30); | |
56 | } | |
fc7e3b59 | 57 | |
811b0806 | 58 | fPtBins->SetAt(50., fPtBins->GetSize() -1); |
4574af57 | 59 | |
811b0806 | 60 | fdPhiBins = new TArrayD(fNPhiBins + 1); |
61 | for(Int_t i = 0; i < fNPhiBins+1; i++) { | |
62 | fdPhiBins->SetAt(-TMath::PiOver2() + i*TMath::TwoPi()/fNPhiBins, i); | |
63 | } | |
64 | ||
4574af57 | 65 | for(int iIso = 0; iIso < 2; iIso++) { |
4574af57 | 66 | fHdPhi[iIso] = NULL; |
67 | fHNTriggers[iIso] = NULL; | |
4574af57 | 68 | } |
69 | ||
811b0806 | 70 | |
71 | ||
fc7e3b59 | 72 | } |
73 | ||
74 | ||
75 | //________________________________________________________________________________ | |
76 | AliAnaConvCorrBase::~AliAnaConvCorrBase() { | |
fc7e3b59 | 77 | ///destructor |
811b0806 | 78 | if(fPtBins) |
79 | delete fPtBins; | |
80 | fPtBins = NULL; | |
81 | ||
82 | if(fdPhiBins) | |
83 | delete fdPhiBins; | |
84 | fdPhiBins = NULL; | |
85 | ||
fc7e3b59 | 86 | |
87 | } | |
88 | ||
89 | ||
fc7e3b59 | 90 | void AliAnaConvCorrBase::CreateHistograms() { |
811b0806 | 91 | CreateBaseHistograms(); |
92 | } | |
93 | ||
94 | //________________________________________________________________________ | |
95 | void AliAnaConvCorrBase::CreateBaseHistograms() { | |
fc7e3b59 | 96 | //Create histograms add, to outputlis |
97 | ||
811b0806 | 98 | cout << "Createing histograms for "<< fName.Data() << endl; |
99 | ||
fc7e3b59 | 100 | fHistograms = new TList(); |
101 | fHistograms->SetOwner(kFALSE); | |
102 | fHistograms->SetName(fName); | |
103 | ||
fc7e3b59 | 104 | for(int iIso = 0; iIso < 2; iIso++) { |
fc7e3b59 | 105 | |
811b0806 | 106 | fHdPhi[iIso] = new TH3F(Form("%s_%s_dPhi", fName.Data(), (iIso==0)?"nonIso":"isolated"), |
107 | Form("%s_%s_dPhi", fName.Data(), (iIso==0)?"nonIso":"isolated"), | |
108 | fPtBins->GetSize() -1, fPtBins->GetArray(), | |
109 | fPtBins->GetSize() - 1, fPtBins->GetArray(), | |
110 | fdPhiBins->GetSize() - 1, fdPhiBins->GetArray()); | |
111 | fHdPhi[iIso]->Sumw2(); | |
112 | ||
fc7e3b59 | 113 | fHistograms->Add(fHdPhi[iIso]); |
811b0806 | 114 | |
115 | fHNTriggers[iIso] = new TH1F(Form("%s_%s_fNTriggers", fName.Data(), (iIso==0)?"nonIso":"isolated"), | |
116 | Form("%s_%s_fNTriggers", fName.Data(), (iIso==0)?"nonIso":"isolated"), | |
117 | fPtBins->GetSize() - 1, fPtBins->GetArray()); | |
118 | fHNTriggers[iIso]->Sumw2(); | |
119 | fHistograms->Add(fHNTriggers[iIso]); | |
fc7e3b59 | 120 | |
fc7e3b59 | 121 | } |
122 | ||
fc7e3b59 | 123 | } |
124 | ||
125 | ||
126 | ///____________________________________________________________________________ | |
127 | void AliAnaConvCorrBase::FillTriggerCounters(Float_t tPt, Bool_t isolated){ | |
128 | //Fill histogram with trigger counters | |
fc7e3b59 | 129 | |
811b0806 | 130 | fHNTriggers[0]->Fill(tPt); |
131 | ||
132 | if(isolated) { | |
133 | fHNTriggers[isolated]->Fill(tPt); | |
134 | ||
135 | } | |
fc7e3b59 | 136 | } |
137 | ||
138 | ///_____________________________________________________________________________ | |
139 | void AliAnaConvCorrBase::FillHistograms(Float_t tPt, Float_t cPt, Float_t dPhi, Float_t dEta, Bool_t isolated) { | |
140 | //Fill histograms | |
fc7e3b59 | 141 | |
811b0806 | 142 | if(dEta) { ;} |
143 | fHdPhi[0]->Fill(tPt, cPt, dPhi); | |
fc7e3b59 | 144 | if(isolated) { |
811b0806 | 145 | fHdPhi[isolated]->Fill(tPt, cPt, dPhi); |
fc7e3b59 | 146 | } |
fc7e3b59 | 147 | } |
148 | ||
fc7e3b59 | 149 | //_______________________________________________________________________________ |
150 | ||
151 | void AliAnaConvCorrBase::PrintStatistics() { | |
152 | //Print some statistics between each file | |
811b0806 | 153 | for(Int_t i = 1; i <= fHNTriggers[0]->GetNbinsX(); i++) { |
6dd00233 | 154 | Int_t nTrig = (Int_t) fHNTriggers[0]->GetBinContent(i+1); |
fc7e3b59 | 155 | cout << "triggers: " << nTrig << endl; |
811b0806 | 156 | |
fc7e3b59 | 157 | } |
158 | } |