]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrBase/AliNeutralMesonSelection.cxx
add calibration histograms for vzero centroids
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / AliNeutralMesonSelection.cxx
CommitLineData
1c5acb87 1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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/* $Id: AliNeutralMesonSelection.cxx 27413 2008-07-18 13:28:12Z gconesab $ */
16
17//_________________________________________________________________________
18// Class that contains methods to select candidate pairs to neutral meson
19// 2 main selections, invariant mass around pi0 (also any other mass),
20// apperture angle to distinguish from combinatorial.
21//-- Author: Gustavo Conesa (INFN-LNF)
22
23// --- ROOT system ---
24#include <TLorentzVector.h>
25#include <TH2.h>
26#include <TList.h>
1c5acb87 27
28//---- AliRoot system ----
29#include "AliNeutralMesonSelection.h"
1c5acb87 30
31ClassImp(AliNeutralMesonSelection)
32
33
34//____________________________________________________________________________
35 AliNeutralMesonSelection::AliNeutralMesonSelection() :
a5fb4114 36 TObject(),
37 fM(0), fInvMassMaxCut(0.), fInvMassMinCut(0.),
38 fAngleMaxParam(), fUseAngleCut(0), fShiftMinAngle(0),
39 fKeepNeutralMesonHistos(0),
1c5acb87 40 fhAnglePairNoCut(0), fhAnglePairOpeningAngleCut(0),
41 fhAnglePairAllCut(0),
42 fhInvMassPairNoCut(0), fhInvMassPairOpeningAngleCut(0),
43 fhInvMassPairAllCut(0),
477d6cee 44 fHistoNEBins(0), fHistoEMax(0.), fHistoEMin(0.),
45 fHistoNPtBins(0), fHistoPtMax(0.), fHistoPtMin(0.),
46 fHistoNAngleBins(0), fHistoAngleMax(0.), fHistoAngleMin(0.),
47 fHistoNIMBins(0), fHistoIMMax(0.), fHistoIMMin(0.)
48{
1c5acb87 49 //Default Ctor
50
51 //Initialize parameters
52
53 // kGammaHadron and kGammaJet
54 fAngleMaxParam.Set(4) ;
55 fAngleMaxParam.Reset(0.);
56
57 //Initialize parameters
58 InitParameters();
59}
1c5acb87 60
1c5acb87 61//____________________________________________________________________________
62AliNeutralMesonSelection::~AliNeutralMesonSelection()
63{
64 //dtor
65
7787a778 66// if(!fKeepNeutralMesonHistos){
67// //Histograms initialized and filled but not passed to output container
68// //delete here, I am not sure this is correct
69//
70// if(fhAnglePairNoCut) delete fhAnglePairNoCut;
71// if(fhAnglePairOpeningAngleCut) delete fhAnglePairOpeningAngleCut;
72// if(fhAnglePairAllCut) delete fhAnglePairAllCut;
73// if(fhInvMassPairNoCut) delete fhInvMassPairNoCut;
74// if(fhInvMassPairOpeningAngleCut) delete fhInvMassPairOpeningAngleCut;
75// if(fhInvMassPairAllCut) delete fhInvMassPairAllCut;
76//
77// }
1c5acb87 78
79}
80//________________________________________________________________________
81TList * AliNeutralMesonSelection::GetCreateOutputObjects()
82{
477d6cee 83 // Create histograms to be saved in output file and
84 // store them in outputContainer of the analysis class that calls this class.
85
86 TList * outputContainer = new TList() ;
87 outputContainer->SetName("MesonDecayHistos") ;
fad7739b 88 if(fKeepNeutralMesonHistos){
89
90 outputContainer->SetOwner(kFALSE);
91
92 fhAnglePairNoCut = new TH2F
93 ("AnglePairNoCut",
94 "Angle between all #gamma pair vs E_{#pi^{0}}",fHistoNEBins,fHistoEMin,fHistoEMax,fHistoNAngleBins,fHistoAngleMin,fHistoAngleMax);
95 fhAnglePairNoCut->SetYTitle("Angle (rad)");
96 fhAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)");
97
98 fhAnglePairOpeningAngleCut = new TH2F
99 ("AnglePairOpeningAngleCut",
100 "Angle between all #gamma pair (opening angle + azimuth cut) vs E_{#pi^{0}}"
101 ,fHistoNEBins,fHistoEMin,fHistoEMax,fHistoNAngleBins,fHistoAngleMin,fHistoAngleMax);
102 fhAnglePairOpeningAngleCut->SetYTitle("Angle (rad)");
103 fhAnglePairOpeningAngleCut->SetXTitle("E_{ #pi^{0}} (GeV)");
104
105 fhAnglePairAllCut = new TH2F
106 ("AnglePairAllCut",
107 "Angle between all #gamma pair (opening angle + inv mass cut+azimuth) vs E_{#pi^{0}}"
108 ,fHistoNEBins,fHistoEMin,fHistoEMax,fHistoNAngleBins,fHistoAngleMin,fHistoAngleMax);
109 fhAnglePairAllCut->SetYTitle("Angle (rad)");
110 fhAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV)");
111
112 //
113 fhInvMassPairNoCut = new TH2F
114 ("InvMassPairNoCut","Invariant Mass of all #gamma pair vs E_{#pi^{0}}",
115 fHistoNPtBins,fHistoPtMin,fHistoPtMax,fHistoNIMBins,fHistoIMMin,fHistoIMMax);
116 fhInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})");
117 fhInvMassPairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)");
118
119 fhInvMassPairOpeningAngleCut = new TH2F
120 ("InvMassPairOpeningAngleCut",
121 "Invariant Mass of #gamma pair (angle cut) vs E_{#pi^{0}}",
122 fHistoNPtBins,fHistoPtMin,fHistoPtMax,fHistoNIMBins,fHistoIMMin,fHistoIMMax);
123 fhInvMassPairOpeningAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})");
124 fhInvMassPairOpeningAngleCut->SetXTitle(" E_{#pi^{0}}(GeV)");
125
126 fhInvMassPairAllCut = new TH2F
127 ("InvMassPairAllCut",
128 "Invariant Mass of #gamma pair (opening angle+invmass cut) vs E_{#pi^{0}}",
129 fHistoNPtBins,fHistoPtMin,fHistoPtMax,fHistoNIMBins,fHistoIMMin,fHistoIMMax);
130 fhInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})");
131 fhInvMassPairAllCut->SetXTitle("E_{#pi^{0}}(GeV)");
132
133 outputContainer->Add(fhAnglePairNoCut) ;
134 outputContainer->Add(fhAnglePairOpeningAngleCut) ;
135 outputContainer->Add(fhAnglePairAllCut) ;
136
137 outputContainer->Add(fhInvMassPairNoCut) ;
138 outputContainer->Add(fhInvMassPairOpeningAngleCut) ;
139 outputContainer->Add(fhInvMassPairAllCut) ;
140 }
477d6cee 141 return outputContainer;
1c5acb87 142}
143
477d6cee 144//____________________________________________________________________________
1c5acb87 145void AliNeutralMesonSelection::InitParameters()
146{
477d6cee 147
1c5acb87 148 //Initialize the parameters of the analysis.
149 fKeepNeutralMesonHistos = kFALSE ;
a5fb4114 150 fUseAngleCut = kFALSE ;
1c5acb87 151 fAngleMaxParam.Set(4) ;
a5fb4114 152 fAngleMaxParam.AddAt(0.4,0);
1c5acb87 153 fAngleMaxParam.AddAt(-0.25,1) ;
154 fAngleMaxParam.AddAt(0.025,2) ;
155 fAngleMaxParam.AddAt(-2e-4,3) ;
a5fb4114 156 fShiftMinAngle = 0.02 ;
157 fInvMassMaxCut = 0.16 ;
158 fInvMassMinCut = 0.11 ;
1c5acb87 159
a5fb4114 160 fM = 0.1349766 ;//neutralMeson mass, pi0
1c5acb87 161
162 //Histogrammes settings
a5fb4114 163 fHistoNEBins = 100 ;
164 fHistoEMax = 20 ;
165 fHistoEMin = 0. ;
1c5acb87 166
a5fb4114 167 fHistoNPtBins = 100 ;
168 fHistoPtMax = 20 ;
169 fHistoPtMin = 0. ;
1c5acb87 170
4df35693 171 fHistoNAngleBins = 100 ;
1c5acb87 172 fHistoAngleMax = 0.2;
173 fHistoAngleMin = 0. ;
174
a5fb4114 175 fHistoNIMBins = 100 ;
176 fHistoIMMax = 0.3 ;
177 fHistoIMMin = 0. ;
1c5acb87 178}
179
180//__________________________________________________________________________-
a5fb4114 181Bool_t AliNeutralMesonSelection::IsAngleInWindow(const Float_t angle,const Float_t e) const
182{
183
184 // Check if the opening angle of the candidate pairs is inside
185 // our selection window
186 // Attention, only valid for Pi0, if needed for Eta need to revise
b6991fc4 187
188 if (!fUseAngleCut) return kTRUE; //Accept any angle
189
1c5acb87 190 Bool_t result = kFALSE;
191 Double_t max = fAngleMaxParam.At(0)*TMath::Exp(fAngleMaxParam.At(1)*e)
192 +fAngleMaxParam.At(2)+fAngleMaxParam.At(3)*e;
193 Double_t arg = (e*e-2*fM*fM)/(e*e);
194 Double_t min = 100. ;
195 if(arg>0.)
a5fb4114 196 min = TMath::ACos(arg)-fShiftMinAngle;
1c5acb87 197
198 if((angle<max)&&(angle>=min))
199 result = kTRUE;
200
201 return result;
202}
203
204//____________________________________________________________________________
205Bool_t AliNeutralMesonSelection::SelectPair(TLorentzVector gammai, TLorentzVector gammaj)
206{
207
208 //Search for the neutral pion within selection cuts
209 Bool_t goodpair = kFALSE ;
210
477d6cee 211// Double_t pt = (gammai+gammaj).Pt();
1c5acb87 212 Double_t phi = (gammai+gammaj).Phi();
213 if(phi < 0)
214 phi+=TMath::TwoPi();
215 Double_t invmass = (gammai+gammaj).M();
216 Double_t angle = gammaj.Angle(gammai.Vect());
217 Double_t e = (gammai+gammaj).E();
218
219 //Fill histograms with no cuts applied.
fad7739b 220 if(fKeepNeutralMesonHistos){
221 fhAnglePairNoCut ->Fill(e,angle);
222 fhInvMassPairNoCut->Fill(e,invmass);
223 }
1c5acb87 224 //Cut on the aperture of the pair
225 if(IsAngleInWindow(angle,e)){
fad7739b 226 if(fKeepNeutralMesonHistos){
227 fhAnglePairOpeningAngleCut ->Fill(e,angle);
228 fhInvMassPairOpeningAngleCut->Fill(e,invmass);
229 }
477d6cee 230 //AliDebug(2,Form("Angle cut: pt %f, phi %f",pt,phi));
1c5acb87 231
232 //Cut on the invariant mass of the pair
233 if((invmass>fInvMassMinCut) && (invmass<fInvMassMaxCut)){
fad7739b 234 if(fKeepNeutralMesonHistos){
235 fhInvMassPairAllCut ->Fill(e,invmass);
236 fhAnglePairAllCut ->Fill(e,angle);
237 }
1c5acb87 238 goodpair = kTRUE;
477d6cee 239 //AliDebug(2,Form("IM cut: pt %f, phi %f",pt,phi));
1c5acb87 240 }//(invmass>0.125) && (invmass<0.145)
241 }//Opening angle cut
242
243 return goodpair;
244
245}
246
247//__________________________________________________________________
248void AliNeutralMesonSelection::Print(const Option_t * opt) const
249{
250
251 //Print some relevant parameters set for the analysis
252 if(! opt)
253 return;
254
a3aebfff 255 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
1c5acb87 256
257 printf("mass : %f \n", fM );
258 printf("Invariant mass limits : %f < m < %f \n", fInvMassMinCut , fInvMassMinCut );
259 printf("Angle selection param: \n");
fbeaf916 260 printf("p0 : %f\n", fAngleMaxParam.At(0));
261 printf("p1 : %f\n", fAngleMaxParam.At(1));
262 printf("p2 : %f\n", fAngleMaxParam.At(2));
263 printf("p3 : %f\n", fAngleMaxParam.At(3));
1c5acb87 264
a5fb4114 265 printf("Min angle shift : %1.2f\n", fShiftMinAngle);
266
1c5acb87 267 printf("Keep Neutral Meson Histos = %d\n",fKeepNeutralMesonHistos);
268
269 if(fKeepNeutralMesonHistos){
a5fb4114 270 printf("Histograms: %3.1f < E < %3.1f, Nbin = %d\n", fHistoEMin, fHistoEMax, fHistoNEBins);
271 printf("Histograms: %3.1f < pT < %3.1f, Nbin = %d\n", fHistoPtMin, fHistoPtMax, fHistoNPtBins);
477d6cee 272 printf("Histograms: %3.1f < angle < %3.1f, Nbin = %d\n", fHistoAngleMin, fHistoAngleMax, fHistoNAngleBins);
a5fb4114 273 printf("Histograms: %3.1f < IM < %3.1f, Nbin = %d\n", fHistoIMMin, fHistoIMMax, fHistoNIMBins);
477d6cee 274
1c5acb87 275 }
477d6cee 276
1c5acb87 277}