1 //____________________________________________________________________
5 // Script that contains a class to draw hits, using the
6 // 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.
14 #include <AliESDFMD.h>
15 #include <AliFMDInput.h>
26 @brief Make a poisson reconstruction
29 Root> Compile("Poisson.C")
35 class Poisson : public AliFMDInput
38 TH2D* fEmpty; // Histogram
39 TH2D* fTotal; // Histogram
40 TH2D* fMult; // Histogram
42 Int_t fEv; // Event number
46 @param threshold Threshold
47 @param nEta # of @f$ \eta@f$ bins
48 @param minEta minimum @f$ \eta@f$
49 @param maxEta maximum @f$ \eta@f$
50 @param nPhi # of @f$ \eta@f$ bins
51 @param minPhi minimum @f$ \varphi@f$
52 @param maxPhi maximum @f$ \varphi@f$ */
53 Poisson(Double_t threshold=.3,
54 Int_t nEta=120, Float_t minEta=-6, Float_t maxEta=6,
55 Int_t nPhi=4, Float_t minPhi=0, Float_t maxPhi=2*TMath::Pi())
56 : fFile(0), fEv(0), fThreshold(threshold)
60 fEmpty = new TH2D("empty", "# of empty strips", nEta, minEta, maxEta,
61 nPhi, minPhi, maxPhi);
62 fTotal = new TH2D("total", "Total # of strips", nEta, minEta, maxEta,
63 nPhi, minPhi, maxPhi);
64 fMult = new TH2D("mult", "Multiplicity", nEta, minEta, maxEta,
65 nPhi, minPhi, maxPhi);
66 fEmpty->SetXTitle("#eta");
67 fEmpty->SetYTitle("#phi");
68 fEmpty->SetZTitle("N");
69 fTotal->SetXTitle("#eta");
70 fTotal->SetYTitle("#phi");
71 fTotal->SetZTitle("N");
72 fMult->SetXTitle("#eta");
73 fMult->SetYTitle("#phi");
74 fMult->SetZTitle("<M_{ch}>");
77 /** Initialize the analyser. Opens the output file.
78 @return @c true on success. */
81 if (!AliFMDInput::Init()) return kFALSE;
82 fFile = TFile::Open("poisson.root", "RECREATE");
83 if (!fFile) return kFALSE;
87 @param event Event number
88 @return @c false on error */
89 virtual Bool_t Begin(Int_t event)
91 if (!AliFMDInput::Begin(event)) return kFALSE;
98 /** Process ESD data. For each strip, check if the
99 psuedo-multiplicity is less than the threshold. If it is, then
100 count the strip as empty.
102 @return @c true on success. */
103 virtual Bool_t ProcessESD(AliESDFMD* esd)
105 for (UShort_t det = 1; det <= 3; det++) {
106 for (UShort_t rng = 0; rng < 2; rng++) {
107 Char_t ring = (rng == 0 ? 'I' : 'O');
108 // Not covered channels
109 for (UShort_t sec = 0; sec < 40; sec++) {
110 for (UShort_t str = 0; str < 512; str++) {
111 Float_t mult = esd->Multiplicity(det, ring, sec, str);
112 Float_t eta = esd->Eta(det, ring, sec, str);
113 // Dead channels, or not covered.
114 if (mult >= AliESDFMD::kInvalidMult) continue;
115 if (eta >= AliESDFMD::kInvalidEta) continue;
118 case 'I': phi = (sec + .5) * 2 * TMath::Pi() / 20; break;
119 case 'O': phi = (sec + .5) * 2 * TMath::Pi() / 40; break;
121 fTotal->Fill(eta, phi);
122 if (mult < fThreshold) fEmpty->Fill(eta, phi);
123 } // Loop over strips
124 } // Loop over sectors
126 } // Loop over detectors
129 /** For each bin, reconstruct the charge particle multiplicity as
131 m = - N_{total} \log\left(\frac{N_{empty}}{N_{total}}\right)
133 where @f$ N_{total}@f$ is the total number of strips in the bin,
134 and @f$ N_{empty}@f$ is the number of strips in the bin that did
139 for (Int_t etaBin = 1; etaBin <= fEmpty->GetNbinsX(); etaBin++) {
140 for (Int_t phiBin = 1; phiBin <= fEmpty->GetNbinsY(); phiBin++) {
141 Double_t empty = fEmpty->GetBinContent(etaBin, phiBin);
142 Double_t total = fTotal->GetBinContent(etaBin, phiBin);
143 Double_t lambda = (empty > 0 ? - TMath::Log(empty / total) : 1);
144 Double_t mult = lambda * total;
145 fMult->SetBinContent(etaBin, phiBin, mult);
149 fMult->Write(Form("mult%03d", fEv));
150 if (!gROOT->IsBatch()) {
151 gStyle->SetPalette(1);
152 TCanvas* c = new TCanvas("poisson", "Poisson multiplicity");
156 return AliFMDInput::End();
159 /** At end of run. Write and close output file @c poisson.root
160 @return @c true on success */
161 virtual Bool_t Finish()
166 return AliFMDInput::Finish();
171 //____________________________________________________________________