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>
28 /** @class DrawDigitsRecs
29 @brief Draw digit ADC versus Rec point mult
32 Root> Compile("DrawDigitsRecs.C")
33 Root> DrawDigitsRecs c
38 class DrawDigitsRecs : public AliFMDInput
41 TH2D* fAdcVsSingle; // Histogram
44 //__________________________________________________________________
45 TArrayF MakeLogScale(Int_t n, Double_t min, Double_t max)
48 Float_t dp = n / TMath::Log10(max / min);
49 Float_t pmin = TMath::Log10(min);
51 for (Int_t i = 1; i < n+1; i++) {
52 Float_t p = pmin + i / dp;
53 bins[i] = TMath::Power(10, p);
57 //__________________________________________________________________
58 DrawDigitsRecs(Int_t m=1100, Double_t amin=-0.5, Double_t amax=1099.5,
59 Int_t n=105, Double_t mmin=-0.5, Double_t mmax=20.5)
63 fAdcVsSingle = new TH2D("adcVsSingle", "ADC vs. Multiplicity (strip)",
64 m, amin, amax, n, mmin, mmax);
65 fAdcVsSingle->SetXTitle("ADC value");
66 fAdcVsSingle->SetYTitle("Strip Multiplicity");
68 //__________________________________________________________________
70 @param ev Event number
71 @return @c false on error */
72 Bool_t Begin(Int_t ev)
75 return AliFMDInput::Begin(ev);
77 //__________________________________________________________________
78 Bool_t ProcessDigit(AliFMDDigit* digit)
80 // Cache the energy loss
81 if (!digit) return kFALSE;
82 UShort_t det = digit->Detector();
83 Char_t rng = digit->Ring();
84 UShort_t sec = digit->Sector();
85 UShort_t str = digit->Strip();
87 AliWarning(Form("Bad strip number %d in digit", str));
90 fMap(det, rng, sec, str) = digit->Counts();
93 //__________________________________________________________________
94 Bool_t ProcessRecPoint(AliFMDRecPoint* single)
96 if (!single) return kFALSE;
97 UShort_t det = single->Detector();
98 Char_t rng = single->Ring();
99 UShort_t sec = single->Sector();
100 UShort_t str = single->Strip();
102 AliWarning(Form("Bad strip number %d in single", str));
105 fAdcVsSingle->Fill(fMap(det, rng, sec, str), single->Particles());
108 //__________________________________________________________________
111 gStyle->SetPalette(1);
112 gStyle->SetOptTitle(0);
113 gStyle->SetCanvasColor(0);
114 gStyle->SetCanvasBorderSize(0);
115 gStyle->SetPadColor(0);
116 gStyle->SetPadBorderSize(0);
118 fAdcVsSingle->SetStats(kFALSE);
119 fAdcVsSingle->Draw("COLZ");
123 ClassDef(DrawDigitsRecs,0);
127 //____________________________________________________________________