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 <AliFMDMultStrip.h>
21 #include <AliFMDMultRegion.h>
27 class DrawDigitsRecs : public AliFMDInputDigits
30 TH2D* fAdcVsSingle; // Histogram
33 //__________________________________________________________________
34 TArrayF MakeLogScale(Int_t n, Double_t min, Double_t max)
37 Float_t dp = n / TMath::Log10(max / min);
38 Float_t pmin = TMath::Log10(min);
40 for (Int_t i = 1; i < n+1; i++) {
41 Float_t p = pmin + i / dp;
42 bins[i] = TMath::Power(10, p);
46 //__________________________________________________________________
47 DrawDigitsRecs(Int_t m=1100, Double_t amin=-0.5, Double_t amax=1099.5,
48 Int_t n=105, Double_t mmin=-0.5, Double_t mmax=20.5)
51 fAdcVsSingle = new TH2D("adcVsSingle", "ADC vs. Multiplicity (strip)",
52 m, amin, amax, n, mmin, mmax);
53 fAdcVsSingle->SetXTitle("ADC value");
54 fAdcVsSingle->SetYTitle("Strip Multiplicity");
56 //__________________________________________________________________
57 Bool_t Begin(Int_t ev)
60 return AliFMDInputDigits::Begin(ev);
62 //__________________________________________________________________
63 Bool_t ProcessDigit(AliFMDDigit* digit)
65 // Cache the energy loss
66 if (!digit) return kFALSE;
67 UShort_t det = digit->Detector();
68 Char_t rng = digit->Ring();
69 UShort_t sec = digit->Sector();
70 UShort_t str = digit->Strip();
72 AliWarning(Form("Bad strip number %d in digit", str));
75 fMap(det, rng, sec, str) = digit->Counts();
78 //__________________________________________________________________
79 Bool_t ProcessRecPoint(AliFMDRecPoint* single)
81 if (!single) continue;
82 UShort_t det = single->Detector();
83 Char_t rng = single->Ring();
84 UShort_t sec = single->Sector();
85 UShort_t str = single->Strip();
87 AliWarning(Form("Bad strip number %d in single", str));
90 fAdcVsSingle->Fill(fMap(det, rng, sec, str), single->Particles());
93 //__________________________________________________________________
96 gStyle->SetPalette(1);
97 gStyle->SetOptTitle(0);
98 gStyle->SetCanvasColor(0);
99 gStyle->SetCanvasBorderSize(0);
100 gStyle->SetPadColor(0);
101 gStyle->SetPadBorderSize(0);
103 fAdcVsSingle->SetStats(kFALSE);
104 fAdcVsSingle->Draw("COLZ");
108 ClassDef(DrawDigitsRecs,0);
112 //____________________________________________________________________