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 **************************************************************************/
15 //____________________________________________________________________
17 // Utility class for analysing ESD data.
18 // This class does sharing and background correction
19 // It can form a base class for other things too.
20 // This line is here to make the silly code checker happy!
21 // This line is here to make the silly code checker happy!
23 #include "AliFMDAnaRing.h"
27 // #include <AliLog.h>
36 // Float_t emin = -3.7;
37 // Float_t emax = 5.3;
43 //____________________________________________________________________
44 AliFMDAnaRing::AliFMDAnaRing()
61 // Default constructor.
66 //____________________________________________________________________
67 AliFMDAnaRing::AliFMDAnaRing(UShort_t det, Char_t ring,
68 TH2* bg, Float_t c0, Float_t c1)
74 fUseBgCor(bg ? kTRUE : kFALSE),
75 fNSeq(ring == 'I' || ring == 'i' ? 20 : 40),
76 fBareMult(Form("bareMult%d%c", fDet, fRing), "Bare multiplicity",
77 ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
78 fMergedMult(Form("mergedMult%d%c", fDet, fRing), "Merged multiplicity",
79 ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
80 fRemovedMult(Form("removedMult%d%c", fDet, fRing), "Removed multiplicity",
81 ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
82 fMult(Form("mult%d%c", fDet, fRing), "Multiplicity",
83 ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
84 fStep1(Form("step1_%d%c",fDet,fRing), "Step 1", nm,mmin,mmax,nm,mmin,mmax),
85 fStep2(Form("step2_%d%c",fDet,fRing), "Step 2", nm,mmin,mmax,nm,mmin,mmax),
86 fStep3(Form("step3_%d%c",fDet,fRing), "Step 3", nm,mmin,mmax,nm,mmin,mmax),
97 fName[0] = 'F'; fName[1] = 'M'; fName[2] = 'D';
98 fName[3] = Char_t(det+48); fName[4] = ring;
100 fBareMult.SetDirectory(0);
101 fBareMult.SetXTitle("#eta");
102 fBareMult.SetYTitle("#varphi");
103 fBareMult.SetZTitle("d^2M_{ch}'/d#etad#varphi");
104 fMergedMult.SetDirectory(0);
105 fMergedMult.SetXTitle("#eta");
106 fMergedMult.SetYTitle("#varphi");
107 fMergedMult.SetZTitle("d^2M_{ch}''/d#etad#varphi");
108 fRemovedMult.SetDirectory(0);
109 fRemovedMult.SetXTitle("#eta");
110 fRemovedMult.SetYTitle("#varphi");
111 fRemovedMult.SetZTitle("d^2M_{ch}'''/d#etad#varphi");
112 fMult.SetDirectory(0);
113 fMult.SetXTitle("#eta");
114 fMult.SetYTitle("#varphi");
115 fMult.SetZTitle("d^2M_{ch}/d#etad#varphi");
116 fStep1.SetDirectory(0);
117 fStep1.SetXTitle("Bare multiplicity");
118 fStep1.SetYTitle("Merged multiplicity");
119 fStep2.SetDirectory(0);
120 fStep2.SetXTitle("Merged multiplicity");
121 fStep2.SetYTitle("Cut multiplicity");
122 fStep3.SetDirectory(0);
123 fStep3.SetXTitle("Cut multiplicity");
124 fStep3.SetYTitle("Multiplicity");
127 //____________________________________________________________________
128 AliFMDAnaRing::AliFMDAnaRing(const AliFMDAnaRing& o)
135 fUseBgCor(o.fUseBgCor),
137 fBareMult(o.fBareMult),
138 fMergedMult(o.fMergedMult),
139 fRemovedMult(o.fRemovedMult),
149 fBareMult.SetDirectory(0);
150 fBareMult.SetXTitle("#eta");
151 fBareMult.SetYTitle("#varphi");
152 fBareMult.SetZTitle("dM_{ch}'/d#eta");
153 fMergedMult.SetDirectory(0);
154 fMergedMult.SetXTitle("#eta");
155 fMergedMult.SetYTitle("#varphi");
156 fMergedMult.SetZTitle("dM_{ch}''/d#eta");
157 fRemovedMult.SetDirectory(0);
158 fRemovedMult.SetXTitle("#eta");
159 fRemovedMult.SetYTitle("#varphi");
160 fRemovedMult.SetZTitle("dM_{ch}'''/d#eta");
161 fMult.SetDirectory(0);
162 fMult.SetXTitle("#eta");
163 fMult.SetYTitle("#varphi");
164 fMult.SetZTitle("dM_{ch}/d#eta");
167 //____________________________________________________________________
169 AliFMDAnaRing::operator=(const AliFMDAnaRing& o)
171 // Assignment operator
174 // o Object to assign from
176 // Reference to this object.
178 this->fRing = o.fRing;
180 this->fCut0 = o.fCut0;
181 this->fCut1 = o.fCut1;
182 this->fUseBgCor = o.fUseBgCor;
183 this->fNSeq = o.fNSeq;
184 fBareMult.Reset(); fBareMult.Add(&o.fBareMult);
185 fMergedMult.Reset(); fMergedMult.Add(&o.fMergedMult);
186 fRemovedMult.Reset(); fRemovedMult.Add(&o.fRemovedMult);
187 fMult.Reset(); fMult.Add(&o.fMult);
192 //____________________________________________________________________
194 AliFMDAnaRing::ProcessESD(Float_t phi, Float_t eta, Float_t& m1, Float_t m2)
198 // phi Azimuthal angle @f$ \varphi @f$ of the hit
199 // eta Psuedo-rapidity @f$ \eta@f$ of hit
200 // m1 Multiplicity of this strip. C ontains the corrected
202 // m2 Multiplicity of neighbor strip
204 // true if hits are merged */
207 Bool_t merged = false;
209 fBareMult.Fill(eta, phi, m1);
210 if ((m1 < fCut0 || m2 < fCut0) && m2 > 0.001) {
213 fRemovedMult.Fill(eta, phi, TMath::Min(m1,m2));
215 fMergedMult.Fill(eta, phi, sig);
216 fStep1.Fill(m1, sig);
220 if (sig < fCut0 / 2) cmult = 0; // return merged; // cmult = 0;
221 if (sig > fCut1) cmult = 2;
222 fStep2.Fill(sig, cmult);
224 // Background correction
225 Float_t bmult = cmult;
226 if (fUseBgCor && fBg) {
227 // Float_t bgPhi = phi + (phi > TMath::Pi() ? -2*TMath::Pi() : 0);
228 Float_t bgPhi = phi - TMath::Pi();
229 Int_t bgBin = fBg->FindBin(eta, bgPhi);
230 Float_t bgCor = (bgBin > 0 ? fBg->GetBinContent(bgBin) : 0);
231 bmult = (bgCor < 0.01 ? 0 : cmult / bgCor);
233 fStep3.Fill(cmult, bmult);
234 fMult.Fill(eta, phi, bmult);
237 Fill(phi, eta, bmult);
242 //____________________________________________________________________
244 AliFMDAnaRing::Finish()
252 Double_t de = (fMult.GetXaxis()->GetXmax() -
253 fMult.GetXaxis()->GetXmin())/fMult.GetNbinsX();
254 Double_t dp = 2*TMath::Pi() / fNSeq;
255 Double_t scale = ((fNEvents == 0 ? 1. : 1. / fNEvents) * 1 / de * 1 / dp);
256 fBareMult.Scale(scale);
257 fMergedMult.Scale(scale);
258 fRemovedMult.Scale(scale);
261 //____________________________________________________________________
263 AliFMDAnaRing::Color() const
265 // Get the ring specific color
268 // The color of the current ring
270 case 1: return kGreen + 2;
271 case 2: return kRed + (fRing == 'I' || fRing == 'i' ? 2 : -7);
272 case 3: return kBlue + (fRing == 'I' || fRing == 'i' ? 2 : -7);
276 //____________________________________________________________________
278 AliFMDAnaRing::Browse(TBrowser* b)
280 // Browse this object
287 b->Add(&fMergedMult);
288 b->Add(&fRemovedMult);
293 if (fBg) b->Add(fBg);
296 //____________________________________________________________________