1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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)
23 // --- ROOT system ---
24 #include <TLorentzVector.h>
29 //---- AliRoot system ----
30 #include "AliNeutralMesonSelection.h"
33 ClassImp(AliNeutralMesonSelection)
36 //____________________________________________________________________________
37 AliNeutralMesonSelection::AliNeutralMesonSelection() :
39 fInvMassMaxCut(0.), fInvMassMinCut(0.),
40 fAngleMaxParam(), fKeepNeutralMesonHistos(0),
41 fhAnglePairNoCut(0), fhAnglePairOpeningAngleCut(0),
43 fhInvMassPairNoCut(0), fhInvMassPairOpeningAngleCut(0),
44 fhInvMassPairAllCut(0)
48 //Initialize parameters
50 // kGammaHadron and kGammaJet
51 fAngleMaxParam.Set(4) ;
52 fAngleMaxParam.Reset(0.);
54 //Initialize parameters
58 //____________________________________________________________________________
59 AliNeutralMesonSelection::AliNeutralMesonSelection(const AliNeutralMesonSelection & g) :
61 fInvMassMaxCut(g.fInvMassMaxCut), fInvMassMinCut(g.fInvMassMinCut),
62 fAngleMaxParam(g.fAngleMaxParam),
63 fKeepNeutralMesonHistos(g.fKeepNeutralMesonHistos),
64 fhAnglePairNoCut(g. fhAnglePairNoCut),
65 fhAnglePairOpeningAngleCut(g. fhAnglePairOpeningAngleCut),
66 fhAnglePairAllCut(g. fhAnglePairAllCut),
67 fhInvMassPairNoCut(g.fhInvMassPairNoCut),
68 fhInvMassPairOpeningAngleCut(g.fhInvMassPairOpeningAngleCut),
69 fhInvMassPairAllCut(g.fhInvMassPairAllCut)
74 //_________________________________________________________________________
75 AliNeutralMesonSelection & AliNeutralMesonSelection::operator = (const AliNeutralMesonSelection & source)
77 // assignment operator
79 if(this == &source)return *this;
80 ((TObject *)this)->operator=(source);
83 fInvMassMaxCut = source.fInvMassMaxCut ;
84 fInvMassMinCut = source.fInvMassMinCut ;
85 fAngleMaxParam = source.fAngleMaxParam ;
86 fKeepNeutralMesonHistos = source.fKeepNeutralMesonHistos;
88 fhAnglePairNoCut = source. fhAnglePairNoCut ;
89 fhAnglePairOpeningAngleCut = source. fhAnglePairOpeningAngleCut ;
90 fhAnglePairAllCut = source. fhAnglePairAllCut ;
91 fhInvMassPairNoCut = source.fhInvMassPairNoCut ;
92 fhInvMassPairOpeningAngleCut = source.fhInvMassPairOpeningAngleCut ;
93 fhInvMassPairAllCut = source.fhInvMassPairAllCut ;
99 //____________________________________________________________________________
100 AliNeutralMesonSelection::~AliNeutralMesonSelection()
104 if(!fKeepNeutralMesonHistos){
105 //Histograms initialized and filled but not passed to output container
106 //delete here, I am not sure this is correct
108 if(fhAnglePairNoCut) delete fhAnglePairNoCut;
109 if(fhAnglePairOpeningAngleCut) delete fhAnglePairOpeningAngleCut;
110 if(fhAnglePairAllCut) delete fhAnglePairAllCut;
111 if(fhInvMassPairNoCut) delete fhInvMassPairNoCut;
112 if(fhInvMassPairOpeningAngleCut) delete fhInvMassPairOpeningAngleCut;
113 if(fhInvMassPairAllCut) delete fhInvMassPairAllCut;
118 //________________________________________________________________________
119 TList * AliNeutralMesonSelection::GetCreateOutputObjects()
122 // Create histograms to be saved in output file and
123 // store them in outputContainer of the analysis class that calls this class.
125 TList * outputContainer = new TList() ;
126 outputContainer->SetName("MesonDecayHistos") ;
128 fhAnglePairNoCut = new TH2F
130 "Angle between all #gamma pair vs E_{#pi^{0}}",200,0,50,200,0,0.2);
131 fhAnglePairNoCut->SetYTitle("Angle (rad)");
132 fhAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)");
134 fhAnglePairOpeningAngleCut = new TH2F
135 ("AnglePairOpeningAngleCut",
136 "Angle between all #gamma pair (opening angle + azimuth cut) vs E_{#pi^{0}}"
137 ,200,0,50,200,0,0.2);
138 fhAnglePairOpeningAngleCut->SetYTitle("Angle (rad)");
139 fhAnglePairOpeningAngleCut->SetXTitle("E_{ #pi^{0}} (GeV)");
141 fhAnglePairAllCut = new TH2F
143 "Angle between all #gamma pair (opening angle + inv mass cut+azimuth) vs E_{#pi^{0}}"
144 ,200,0,50,200,0,0.2);
145 fhAnglePairAllCut->SetYTitle("Angle (rad)");
146 fhAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV)");
149 fhInvMassPairNoCut = new TH2F
150 ("InvMassPairNoCut","Invariant Mass of all #gamma pair vs E_{#pi^{0}}",
151 120,0,120,360,0,0.5);
152 fhInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})");
153 fhInvMassPairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)");
155 fhInvMassPairOpeningAngleCut = new TH2F
156 ("InvMassPairOpeningAngleCut",
157 "Invariant Mass of #gamma pair (angle cut) vs E_{#pi^{0}}",
158 120,0,120,360,0,0.5);
159 fhInvMassPairOpeningAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})");
160 fhInvMassPairOpeningAngleCut->SetXTitle(" E_{#pi^{0}}(GeV)");
162 fhInvMassPairAllCut = new TH2F
163 ("InvMassPairAllCut",
164 "Invariant Mass of #gamma pair (opening angle+invmass cut) vs E_{#pi^{0}}",
165 120,0,120,360,0,0.5);
166 fhInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})");
167 fhInvMassPairAllCut->SetXTitle("E_{#pi^{0}}(GeV)");
169 outputContainer->Add(fhAnglePairNoCut) ;
170 outputContainer->Add(fhAnglePairOpeningAngleCut) ;
171 outputContainer->Add(fhAnglePairAllCut) ;
173 outputContainer->Add(fhInvMassPairNoCut) ;
174 outputContainer->Add(fhInvMassPairOpeningAngleCut) ;
175 outputContainer->Add(fhInvMassPairAllCut) ;
177 return outputContainer;
180 //____________________________________________________________________________
181 void AliNeutralMesonSelection::InitParameters()
184 //Initialize the parameters of the analysis.
185 fKeepNeutralMesonHistos = kFALSE ;
187 //-------------kHadron, kJetLeadCone-----------------
188 fAngleMaxParam.Set(4) ;
189 fAngleMaxParam.AddAt(0.4,0);//={0.4,-0.25,0.025,-2e-4};
190 fAngleMaxParam.AddAt(-0.25,1) ;
191 fAngleMaxParam.AddAt(0.025,2) ;
192 fAngleMaxParam.AddAt(-2e-4,3) ;
194 fInvMassMaxCut = 0.16 ;
195 fInvMassMinCut = 0.11 ;
197 fM = 0.1349766;//neutralMeson mass
200 //__________________________________________________________________________-
201 Bool_t AliNeutralMesonSelection::IsAngleInWindow(const Float_t angle,const Float_t e) const {
202 //Check if the opening angle of the candidate pairs is inside
203 //our selection windowd
205 Bool_t result = kFALSE;
206 Double_t max = fAngleMaxParam.At(0)*TMath::Exp(fAngleMaxParam.At(1)*e)
207 +fAngleMaxParam.At(2)+fAngleMaxParam.At(3)*e;
208 Double_t arg = (e*e-2*fM*fM)/(e*e);
209 Double_t min = 100. ;
211 min = TMath::ACos(arg);
213 if((angle<max)&&(angle>=min))
219 //____________________________________________________________________________
220 Bool_t AliNeutralMesonSelection::SelectPair(TLorentzVector gammai, TLorentzVector gammaj)
223 //Search for the neutral pion within selection cuts
224 Bool_t goodpair = kFALSE ;
226 Double_t pt = (gammai+gammaj).Pt();
227 Double_t phi = (gammai+gammaj).Phi();
230 Double_t invmass = (gammai+gammaj).M();
231 Double_t angle = gammaj.Angle(gammai.Vect());
232 Double_t e = (gammai+gammaj).E();
234 //Fill histograms with no cuts applied.
235 fhAnglePairNoCut->Fill(e,angle);
236 fhInvMassPairNoCut->Fill(e,invmass);
238 //Cut on the aperture of the pair
239 if(IsAngleInWindow(angle,e)){
240 fhAnglePairOpeningAngleCut ->Fill(e,angle);
241 fhInvMassPairOpeningAngleCut->Fill(e,invmass);
242 AliDebug(2,Form("Angle cut: pt %f, phi %f",pt,phi));
244 //Cut on the invariant mass of the pair
245 if((invmass>fInvMassMinCut) && (invmass<fInvMassMaxCut)){
246 fhInvMassPairAllCut ->Fill(e,invmass);
247 fhAnglePairAllCut ->Fill(e,angle);
249 AliDebug(2,Form("IM cut: pt %f, phi %f",pt,phi));
250 }//(invmass>0.125) && (invmass<0.145)
257 //__________________________________________________________________
258 void AliNeutralMesonSelection::Print(const Option_t * opt) const
261 //Print some relevant parameters set for the analysis
265 Info("Print", "%s %s", GetName(), GetTitle() ) ;
267 printf("mass : %f \n", fM );
268 printf("Invariant mass limits : %f < m < %f \n", fInvMassMinCut , fInvMassMinCut );
269 printf("Angle selection param: \n");
270 printf("p0 : %f", fAngleMaxParam.At(0));
271 printf("p1 : %f", fAngleMaxParam.At(1));
272 printf("p2 : %f", fAngleMaxParam.At(2));
273 printf("p3 : %f", fAngleMaxParam.At(3));
275 printf("Keep Neutral Meson Histos = %d\n",fKeepNeutralMesonHistos);