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 /* History of cvs commits:
20 * Revision 1.3 2007/10/29 13:48:42 gustavo
21 * Corrected coding violations
23 * Revision 1.2 2007/08/17 12:40:04 schutz
24 * New analysis classes by Gustavo Conesa
26 * Revision 1.1.2.1 2007/07/26 10:32:09 schutz
27 * new analysis classes in the the new analysis framework
32 //_________________________________________________________________________
33 // Class that contains methods to select candidate pairs to neutral meson
34 // 2 main selections, invariant mass around pi0 (also any other mass),
35 // apperture angle to distinguish from combinatorial.
36 //-- Author: Gustavo Conesa (INFN-LNF)
38 // --- ROOT system ---
39 #include <TLorentzVector.h>
44 //---- AliRoot system ----
45 #include "AliNeutralMesonSelection.h"
48 ClassImp(AliNeutralMesonSelection)
51 //____________________________________________________________________________
52 AliNeutralMesonSelection::AliNeutralMesonSelection() :
54 fInvMassMaxCut(0.), fInvMassMinCut(0.),
55 fAngleMaxParam(), fKeepNeutralMesonHistos(0),
56 fhAnglePairNoCut(0), fhAnglePairOpeningAngleCut(0),
58 fhInvMassPairNoCut(0), fhInvMassPairOpeningAngleCut(0),
59 fhInvMassPairAllCut(0)
63 //Initialize parameters
65 // kGammaHadron and kGammaJet
66 fAngleMaxParam.Set(4) ;
67 fAngleMaxParam.Reset(0.);
69 //Initialize parameters
73 //____________________________________________________________________________
74 AliNeutralMesonSelection::AliNeutralMesonSelection(const AliNeutralMesonSelection & g) :
76 fInvMassMaxCut(g.fInvMassMaxCut), fInvMassMinCut(g.fInvMassMinCut),
77 fAngleMaxParam(g.fAngleMaxParam),
78 fKeepNeutralMesonHistos(g.fKeepNeutralMesonHistos),
79 fhAnglePairNoCut(g. fhAnglePairNoCut),
80 fhAnglePairOpeningAngleCut(g. fhAnglePairOpeningAngleCut),
81 fhAnglePairAllCut(g. fhAnglePairAllCut),
82 fhInvMassPairNoCut(g.fhInvMassPairNoCut),
83 fhInvMassPairOpeningAngleCut(g.fhInvMassPairOpeningAngleCut),
84 fhInvMassPairAllCut(g.fhInvMassPairAllCut)
89 //_________________________________________________________________________
90 AliNeutralMesonSelection & AliNeutralMesonSelection::operator = (const AliNeutralMesonSelection & source)
92 // assignment operator
94 if(this == &source)return *this;
95 ((TObject *)this)->operator=(source);
98 fInvMassMaxCut = source.fInvMassMaxCut ;
99 fInvMassMinCut = source.fInvMassMinCut ;
100 fAngleMaxParam = source.fAngleMaxParam ;
101 fKeepNeutralMesonHistos = source.fKeepNeutralMesonHistos;
103 fhAnglePairNoCut = source. fhAnglePairNoCut ;
104 fhAnglePairOpeningAngleCut = source. fhAnglePairOpeningAngleCut ;
105 fhAnglePairAllCut = source. fhAnglePairAllCut ;
106 fhInvMassPairNoCut = source.fhInvMassPairNoCut ;
107 fhInvMassPairOpeningAngleCut = source.fhInvMassPairOpeningAngleCut ;
108 fhInvMassPairAllCut = source.fhInvMassPairAllCut ;
114 //____________________________________________________________________________
115 AliNeutralMesonSelection::~AliNeutralMesonSelection()
119 if(!fKeepNeutralMesonHistos){
120 //Histograms initialized and filled but not passed to output container
121 //delete here, I am not sure this is correct
123 if(fhAnglePairNoCut) delete fhAnglePairNoCut;
124 if(fhAnglePairOpeningAngleCut) delete fhAnglePairOpeningAngleCut;
125 if(fhAnglePairAllCut) delete fhAnglePairAllCut;
126 if(fhInvMassPairNoCut) delete fhInvMassPairNoCut;
127 if(fhInvMassPairOpeningAngleCut) delete fhInvMassPairOpeningAngleCut;
128 if(fhInvMassPairAllCut) delete fhInvMassPairAllCut;
133 //________________________________________________________________________
134 TList * AliNeutralMesonSelection::GetCreateOutputObjects()
137 // Create histograms to be saved in output file and
138 // store them in outputContainer of the analysis class that calls this class.
140 TList * outputContainer = new TList() ;
141 outputContainer->SetName("MesonDecayHistos") ;
143 fhAnglePairNoCut = new TH2F
145 "Angle between all #gamma pair vs E_{#pi^{0}}",200,0,50,200,0,0.2);
146 fhAnglePairNoCut->SetYTitle("Angle (rad)");
147 fhAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)");
149 fhAnglePairOpeningAngleCut = new TH2F
150 ("AnglePairOpeningAngleCut",
151 "Angle between all #gamma pair (opening angle + azimuth cut) vs E_{#pi^{0}}"
152 ,200,0,50,200,0,0.2);
153 fhAnglePairOpeningAngleCut->SetYTitle("Angle (rad)");
154 fhAnglePairOpeningAngleCut->SetXTitle("E_{ #pi^{0}} (GeV)");
156 fhAnglePairAllCut = new TH2F
158 "Angle between all #gamma pair (opening angle + inv mass cut+azimuth) vs E_{#pi^{0}}"
159 ,200,0,50,200,0,0.2);
160 fhAnglePairAllCut->SetYTitle("Angle (rad)");
161 fhAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV)");
164 fhInvMassPairNoCut = new TH2F
165 ("InvMassPairNoCut","Invariant Mass of all #gamma pair vs E_{#pi^{0}}",
166 120,0,120,360,0,0.5);
167 fhInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})");
168 fhInvMassPairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)");
170 fhInvMassPairOpeningAngleCut = new TH2F
171 ("InvMassPairOpeningAngleCut",
172 "Invariant Mass of #gamma pair (angle cut) vs E_{#pi^{0}}",
173 120,0,120,360,0,0.5);
174 fhInvMassPairOpeningAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})");
175 fhInvMassPairOpeningAngleCut->SetXTitle(" E_{#pi^{0}}(GeV)");
177 fhInvMassPairAllCut = new TH2F
178 ("InvMassPairAllCut",
179 "Invariant Mass of #gamma pair (opening angle+invmass cut) vs E_{#pi^{0}}",
180 120,0,120,360,0,0.5);
181 fhInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})");
182 fhInvMassPairAllCut->SetXTitle("E_{#pi^{0}}(GeV)");
184 outputContainer->Add(fhAnglePairNoCut) ;
185 outputContainer->Add(fhAnglePairOpeningAngleCut) ;
186 outputContainer->Add(fhAnglePairAllCut) ;
188 outputContainer->Add(fhInvMassPairNoCut) ;
189 outputContainer->Add(fhInvMassPairOpeningAngleCut) ;
190 outputContainer->Add(fhInvMassPairAllCut) ;
192 return outputContainer;
195 //____________________________________________________________________________
196 void AliNeutralMesonSelection::InitParameters()
199 //Initialize the parameters of the analysis.
200 fKeepNeutralMesonHistos = kFALSE ;
202 //-------------kHadron, kJetLeadCone-----------------
203 fAngleMaxParam.Set(4) ;
204 fAngleMaxParam.AddAt(0.4,0);//={0.4,-0.25,0.025,-2e-4};
205 fAngleMaxParam.AddAt(-0.25,1) ;
206 fAngleMaxParam.AddAt(0.025,2) ;
207 fAngleMaxParam.AddAt(-2e-4,3) ;
209 fInvMassMaxCut = 0.16 ;
210 fInvMassMinCut = 0.11 ;
212 fM = 0.1349766;//neutralMeson mass
215 //__________________________________________________________________________-
216 Bool_t AliNeutralMesonSelection::IsAngleInWindow(const Float_t angle,const Float_t e) const {
217 //Check if the opening angle of the candidate pairs is inside
218 //our selection windowd
220 Bool_t result = kFALSE;
221 Double_t max = fAngleMaxParam.At(0)*TMath::Exp(fAngleMaxParam.At(1)*e)
222 +fAngleMaxParam.At(2)+fAngleMaxParam.At(3)*e;
223 Double_t arg = (e*e-2*fM*fM)/(e*e);
224 Double_t min = 100. ;
226 min = TMath::ACos(arg);
228 if((angle<max)&&(angle>=min))
234 //____________________________________________________________________________
235 Bool_t AliNeutralMesonSelection::SelectPair(TLorentzVector gammai, TLorentzVector gammaj)
238 //Search for the neutral pion within selection cuts
239 Bool_t goodpair = kFALSE ;
241 Double_t pt = (gammai+gammaj).Pt();
242 Double_t phi = (gammai+gammaj).Phi();
245 Double_t invmass = (gammai+gammaj).M();
246 Double_t angle = gammaj.Angle(gammai.Vect());
247 Double_t e = (gammai+gammaj).E();
249 //Fill histograms with no cuts applied.
250 fhAnglePairNoCut->Fill(e,angle);
251 fhInvMassPairNoCut->Fill(e,invmass);
253 //Cut on the aperture of the pair
254 if(IsAngleInWindow(angle,e)){
255 fhAnglePairOpeningAngleCut ->Fill(e,angle);
256 fhInvMassPairOpeningAngleCut->Fill(e,invmass);
257 AliDebug(2,Form("Angle cut: pt %f, phi %f",pt,phi));
259 //Cut on the invariant mass of the pair
260 if((invmass>fInvMassMinCut) && (invmass<fInvMassMaxCut)){
261 fhInvMassPairAllCut ->Fill(e,invmass);
262 fhAnglePairAllCut ->Fill(e,angle);
264 AliDebug(2,Form("IM cut: pt %f, phi %f",pt,phi));
265 }//(invmass>0.125) && (invmass<0.145)
272 //__________________________________________________________________
273 void AliNeutralMesonSelection::Print(const Option_t * opt) const
276 //Print some relevant parameters set for the analysis
280 Info("Print", "%s %s", GetName(), GetTitle() ) ;
282 printf("mass : %f \n", fM );
283 printf("Invariant mass limits : %f < m < %f \n", fInvMassMinCut , fInvMassMinCut );
284 printf("Angle selection param: \n");
285 printf("p0 : %f", fAngleMaxParam.At(0));
286 printf("p1 : %f", fAngleMaxParam.At(1));
287 printf("p2 : %f", fAngleMaxParam.At(2));
288 printf("p3 : %f", fAngleMaxParam.At(3));
290 printf("Keep Neutral Meson Histos = %d\n",fKeepNeutralMesonHistos);