1 //____________________________________________________________________
5 // Script that contains a class to draw eloss from hits, versus ADC
6 // counts from digits, using the AliFMDInputHits class in the util library.
8 // It draws the energy loss versus the p/(mq^2). It can be overlayed
9 // with the Bethe-Bloc curve to show how the simulation behaves
10 // relative to the expected.
12 // Use the script `Compile.C' to compile this class using ACLic.
15 #include <AliFMDHit.h>
16 #include <AliFMDDigit.h>
17 #include <AliFMDInput.h>
18 #include <AliFMDUShortMap.h>
19 #include <AliFMDFloatMap.h>
20 #include <AliFMDRecPoint.h>
21 #include <AliESDFMD.h>
29 #include <TSpectrum.h>
34 @brief Draw digit ADC versus Rec point mult
37 Root> Compile("DrawESD.C")
43 class DrawESD : public AliFMDInput
46 TH1D* fMult; // Histogram
49 //__________________________________________________________________
50 TArrayF MakeLogScale(Int_t n, Double_t min, Double_t max)
53 Float_t dp = n / TMath::Log10(max / min);
54 Float_t pmin = TMath::Log10(min);
56 for (Int_t i = 1; i < n+1; i++) {
57 Float_t p = pmin + i / dp;
58 bins[i] = TMath::Power(10, p);
62 //__________________________________________________________________
63 DrawESD(Int_t n=420, Double_t mmin=-0.5, Double_t mmax=20.5)
64 : fCorr(1) // 0.68377 / 1.1)
67 fMult = new TH1D("mult", " Multiplicity (strip)", n, mmin, mmax);
68 fMult->SetXTitle("Strip Multiplicity");
70 //__________________________________________________________________
72 @param ev Event number
73 @return @c false on error */
74 Bool_t Begin(Int_t ev)
76 return AliFMDInput::Begin(ev);
78 //__________________________________________________________________
79 Bool_t ProcessESD(UShort_t /* det */,
86 // Cache the energy loss
87 fMult->Fill(mult/fCorr);
90 //__________________________________________________________________
93 gStyle->SetPalette(1);
94 gStyle->SetOptTitle(0);
95 gStyle->SetOptFit(1111111);
96 gStyle->SetCanvasColor(0);
97 gStyle->SetCanvasBorderSize(0);
98 gStyle->SetPadColor(0);
99 gStyle->SetPadBorderSize(0);
101 TCanvas* c = new TCanvas("c", "C");
104 // fMult->GetXaxis()->SetRangeUser(0.2,4);
106 // fMult->Scale(1. / fMult->GetMaximum());
107 fMult->SetStats(kFALSE);
108 fMult->SetFillColor(2);
109 fMult->SetFillStyle(3001);
111 Double_t x1 = .75; // .8; // .65 / fCorr;
112 Double_t x2 = 1.3; // 1.7; // fCorr;
113 Double_t x3 = 2.5; // 2.7; // fCorr;
114 Double_t x4 = 3.7; // fCorr;
115 TF1* l1 = new TF1("landau1", "landau", x1, x2);
116 TF1* l2 = new TF1("landau2", "landau", x2, x3);
117 // TF1* l3 = new TF1("landau3", "landau", x3, x4);
118 TF1* f = new TF1("user", "landau(0)+landau(3)", x1, x3);
120 fMult->SetStats(kTRUE);
121 fMult->GetXaxis()->SetRangeUser(0, 4);
122 fMult->Fit(l1, "E0L", "", x1, x2);
123 fMult->Fit(l2, "E0L", "", x2, x3);
124 // fMult->Fit(l3, "E0L", "", x3, x4);
125 f->SetParNames("A_{1}", "Mpv_{1}", "#sigma_{1}",
126 "A_{2}", "Mpv_{2}", "#sigma_{2}",
127 "A_{3}", "Mpv_{3}", "#sigma_{3}");
128 f->SetParameters(l1->GetParameter(0),
135 l1->GetParameter(1) * 3,
136 l1->GetParameter(2) * 3);
137 fMult->Fit(f, "E0L", "", x1, x3);
138 fMult->Fit(f, "MEL", "E1", x1, x3);
140 TH1* h = static_cast<TH1*>(fMult->DrawClone("same hist"));
142 // l1->SetLineStyle(2);
147 // l2->SetLineStyle(3);
152 // l3->SetLineStyle(3);
153 // l3->SetLineWidth(2);
154 // l3->SetRange(0, 5);
160 TLegend* l = new TLegend(0.2, 0.6, .6, .89);
161 l->AddEntry(l1, "1 particle Landau", "l");
162 l->AddEntry(l2, "2 particle Landau", "l");
163 l->AddEntry(f, "1+2 particle Landau", "l");
168 c = new TCanvas("c2", "Landaus");
170 fMult->DrawClone("axis");
172 TF1* ll1 = new TF1("ll1", "landau", 0, 4);
173 ll1->SetParameters(f->GetParameter(0),
176 ll1->SetLineColor(3);
178 TF1* ll2 = new TF1("ll2", "landau", 0, 4);
179 ll2->SetParameters(f->GetParameter(3),
182 ll2->SetLineColor(4);
185 Double_t y1 = fMult->GetMinimum() * 1.1;
186 Double_t y2 = fMult->GetMaximum() * .9;
187 Double_t xc1 = f->GetParameter(1)-3*f->GetParameter(2);
188 Double_t xc2 = f->GetParameter(4)-2*f->GetParameter(5);
189 TLine* c1 = new TLine(xc1, y1, xc1, y2);
191 TLine* c2 = new TLine(xc2, y1, xc2, y2);
194 l = new TLegend(0.2, 0.6, .6, .89);
195 l->AddEntry(ll1, "1 particle Landau", "l");
196 l->AddEntry(ll2, "2 particle Landau", "l");
197 l->AddEntry(f, "1+2 particle Landau", "l");
202 c = new TCanvas("s", "Spectrum");
203 TSpectrum* s = new TSpectrum(16);
204 h->GetXaxis()->SetRangeUser(0.3, 20);
205 s->Search(h, .15, "", 0.01);
207 TH1* b = s->Background(h);
209 b->SetFillStyle(3001);
220 //____________________________________________________________________