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 <AliFMDEdepMap.h>
25 /** @class DrawHitsDigits
26 @brief Draw hit energy loss versus digit ADC
29 Root> Compile("DrawHitsDigits.C")
30 Root> DrawHitsDigits c
35 class DrawHitsDigits : public AliFMDInput
38 TH2D* fElossVsAdc; // Histogram
41 //__________________________________________________________________
42 DrawHitsDigits(Int_t n=900, Double_t emin=1e-3, Double_t emax=10,
43 Int_t m=1100, Double_t amin=-0.5, Double_t amax=1099.5)
47 TArrayF eloss(MakeLogScale(n, emin, emax));
50 for (Int_t i = 1; i < m+1; i++) adcs[i] = adcs[i-1] + (amax-amin)/m;
51 fElossVsAdc = new TH2D("bad", "#Delta E vs. ADC",
52 eloss.fN-1, eloss.fArray, adcs.fN-1, adcs.fArray);
53 fElossVsAdc->SetXTitle("#Delta E/#Delta x [MeV/cm]");
54 fElossVsAdc->SetYTitle("ADC value");
56 //__________________________________________________________________
58 @param ev Event number
59 @return @c false on error */
60 Bool_t Begin(Int_t ev)
63 return AliFMDInput::Begin(ev);
65 //__________________________________________________________________
66 Bool_t ProcessHit(AliFMDHit* hit, TParticle*)
68 // Cache the energy loss
69 if (!hit) return kFALSE;
70 UShort_t det = hit->Detector();
71 Char_t rng = hit->Ring();
72 UShort_t sec = hit->Sector();
73 UShort_t str = hit->Strip();
75 AliWarning(Form("Bad strip number %d in hit", str));
78 fMap(det, rng, sec, str).fEdep += hit->Edep();
79 fMap(det, rng, sec, str).fN++;
82 //__________________________________________________________________
83 Bool_t ProcessDigit(AliFMDDigit* digit)
85 if (!digit) return kFALSE;
86 UShort_t det = digit->Detector();
87 Char_t rng = digit->Ring();
88 UShort_t sec = digit->Sector();
89 UShort_t str = digit->Strip();
91 AliWarning(Form("Bad strip number %d in digit", str));
94 fElossVsAdc->Fill(fMap(det, rng, sec, str).fEdep, digit->Counts());
97 //__________________________________________________________________
100 gStyle->SetPalette(1);
101 gStyle->SetOptTitle(0);
102 gStyle->SetCanvasColor(0);
103 gStyle->SetCanvasBorderSize(0);
104 gStyle->SetPadColor(0);
105 gStyle->SetPadBorderSize(0);
106 fElossVsAdc->SetStats(kFALSE);
107 fElossVsAdc->Draw("COLZ");
111 ClassDef(DrawHitsDigits,0);
114 //____________________________________________________________________