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.
64 for (int i = 0; i < 6; i++) fName[i] = '\0';
67 //____________________________________________________________________
68 AliFMDAnaRing::AliFMDAnaRing(UShort_t det, Char_t ring,
69 TH2* bg, Float_t c0, Float_t c1)
75 fUseBgCor(bg ? kTRUE : kFALSE),
76 fNSeq(ring == 'I' || ring == 'i' ? 20 : 40),
77 fBareMult(Form("bareMult%d%c", fDet, fRing), "Bare multiplicity",
78 ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
79 fMergedMult(Form("mergedMult%d%c", fDet, fRing), "Merged multiplicity",
80 ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
81 fRemovedMult(Form("removedMult%d%c", fDet, fRing), "Removed multiplicity",
82 ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
83 fMult(Form("mult%d%c", fDet, fRing), "Multiplicity",
84 ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
85 fStep1(Form("step1_%d%c",fDet,fRing), "Step 1", nm,mmin,mmax,nm,mmin,mmax),
86 fStep2(Form("step2_%d%c",fDet,fRing), "Step 2", nm,mmin,mmax,nm,mmin,mmax),
87 fStep3(Form("step3_%d%c",fDet,fRing), "Step 3", nm,mmin,mmax,nm,mmin,mmax),
98 fName[0] = 'F'; fName[1] = 'M'; fName[2] = 'D';
99 fName[3] = Char_t(det+48); fName[4] = ring;
101 fBareMult.SetDirectory(0);
102 fBareMult.SetXTitle("#eta");
103 fBareMult.SetYTitle("#varphi");
104 fBareMult.SetZTitle("d^2M_{ch}'/d#etad#varphi");
105 fMergedMult.SetDirectory(0);
106 fMergedMult.SetXTitle("#eta");
107 fMergedMult.SetYTitle("#varphi");
108 fMergedMult.SetZTitle("d^2M_{ch}''/d#etad#varphi");
109 fRemovedMult.SetDirectory(0);
110 fRemovedMult.SetXTitle("#eta");
111 fRemovedMult.SetYTitle("#varphi");
112 fRemovedMult.SetZTitle("d^2M_{ch}'''/d#etad#varphi");
113 fMult.SetDirectory(0);
114 fMult.SetXTitle("#eta");
115 fMult.SetYTitle("#varphi");
116 fMult.SetZTitle("d^2M_{ch}/d#etad#varphi");
117 fStep1.SetDirectory(0);
118 fStep1.SetXTitle("Bare multiplicity");
119 fStep1.SetYTitle("Merged multiplicity");
120 fStep2.SetDirectory(0);
121 fStep2.SetXTitle("Merged multiplicity");
122 fStep2.SetYTitle("Cut multiplicity");
123 fStep3.SetDirectory(0);
124 fStep3.SetXTitle("Cut multiplicity");
125 fStep3.SetYTitle("Multiplicity");
128 //____________________________________________________________________
129 AliFMDAnaRing::AliFMDAnaRing(const AliFMDAnaRing& o)
136 fUseBgCor(o.fUseBgCor),
138 fBareMult(o.fBareMult),
139 fMergedMult(o.fMergedMult),
140 fRemovedMult(o.fRemovedMult),
150 fBareMult.SetDirectory(0);
151 fBareMult.SetXTitle("#eta");
152 fBareMult.SetYTitle("#varphi");
153 fBareMult.SetZTitle("dM_{ch}'/d#eta");
154 fMergedMult.SetDirectory(0);
155 fMergedMult.SetXTitle("#eta");
156 fMergedMult.SetYTitle("#varphi");
157 fMergedMult.SetZTitle("dM_{ch}''/d#eta");
158 fRemovedMult.SetDirectory(0);
159 fRemovedMult.SetXTitle("#eta");
160 fRemovedMult.SetYTitle("#varphi");
161 fRemovedMult.SetZTitle("dM_{ch}'''/d#eta");
162 fMult.SetDirectory(0);
163 fMult.SetXTitle("#eta");
164 fMult.SetYTitle("#varphi");
165 fMult.SetZTitle("dM_{ch}/d#eta");
166 for (int i = 0; i < 6; i++) fName[i] = o.fName[i];
169 //____________________________________________________________________
171 AliFMDAnaRing::operator=(const AliFMDAnaRing& o)
173 // Assignment operator
176 // o Object to assign from
178 // Reference to this object.
180 this->fRing = o.fRing;
182 this->fCut0 = o.fCut0;
183 this->fCut1 = o.fCut1;
184 this->fUseBgCor = o.fUseBgCor;
185 this->fNSeq = o.fNSeq;
186 fBareMult.Reset(); fBareMult.Add(&o.fBareMult);
187 fMergedMult.Reset(); fMergedMult.Add(&o.fMergedMult);
188 fRemovedMult.Reset(); fRemovedMult.Add(&o.fRemovedMult);
189 fMult.Reset(); fMult.Add(&o.fMult);
194 //____________________________________________________________________
196 AliFMDAnaRing::ProcessESD(Float_t phi, Float_t eta, Float_t& m1, Float_t m2)
200 // phi Azimuthal angle @f$ \varphi @f$ of the hit
201 // eta Psuedo-rapidity @f$ \eta@f$ of hit
202 // m1 Multiplicity of this strip. C ontains the corrected
204 // m2 Multiplicity of neighbor strip
206 // true if hits are merged */
209 Bool_t merged = false;
211 fBareMult.Fill(eta, phi, m1);
212 if ((m1 < fCut0 || m2 < fCut0) && m2 > 0.001) {
215 fRemovedMult.Fill(eta, phi, TMath::Min(m1,m2));
217 fMergedMult.Fill(eta, phi, sig);
218 fStep1.Fill(m1, sig);
222 if (sig < fCut0 / 2) cmult = 0; // return merged; // cmult = 0;
223 if (sig > fCut1) cmult = 2;
224 fStep2.Fill(sig, cmult);
226 // Background correction
227 Float_t bmult = cmult;
228 if (fUseBgCor && fBg) {
229 // Float_t bgPhi = phi + (phi > TMath::Pi() ? -2*TMath::Pi() : 0);
230 Float_t bgPhi = phi - TMath::Pi();
231 Int_t bgBin = fBg->FindBin(eta, bgPhi);
232 Float_t bgCor = (bgBin > 0 ? fBg->GetBinContent(bgBin) : 0);
233 bmult = (bgCor < 0.01 ? 0 : cmult / bgCor);
235 fStep3.Fill(cmult, bmult);
236 fMult.Fill(eta, phi, bmult);
239 Fill(phi, eta, bmult);
244 //____________________________________________________________________
246 AliFMDAnaRing::Finish()
254 Double_t de = (fMult.GetXaxis()->GetXmax() -
255 fMult.GetXaxis()->GetXmin())/fMult.GetNbinsX();
256 Double_t dp = 2*TMath::Pi() / fNSeq;
257 Double_t scale = ((fNEvents == 0 ? 1. : 1. / fNEvents) * 1 / de * 1 / dp);
258 fBareMult.Scale(scale);
259 fMergedMult.Scale(scale);
260 fRemovedMult.Scale(scale);
263 //____________________________________________________________________
265 AliFMDAnaRing::Color() const
267 // Get the ring specific color
270 // The color of the current ring
272 case 1: return kGreen + 2;
273 case 2: return kRed + (fRing == 'I' || fRing == 'i' ? 2 : -7);
274 case 3: return kBlue + (fRing == 'I' || fRing == 'i' ? 2 : -7);
278 //____________________________________________________________________
280 AliFMDAnaRing::Browse(TBrowser* b)
282 // Browse this object
289 b->Add(&fMergedMult);
290 b->Add(&fRemovedMult);
295 if (fBg) b->Add(fBg);
298 //____________________________________________________________________