+//____________________________________________________________________
//
// $Id$
//
#include <AliFMDInput.h>
#include <AliFMDUShortMap.h>
#include <AliFMDFloatMap.h>
-#include <AliFMDMultStrip.h>
-#include <AliFMDMultRegion.h>
+#include <AliFMDRecPoint.h>
+#include <AliESDFMD.h>
+#include <AliLog.h>
#include <iostream>
#include <TStyle.h>
#include <TArrayF.h>
#include <TCanvas.h>
-class DrawDigitsRecs : public AliFMDInputDigits
+/** @class DrawDigitsRecs
+ @brief Draw digit ADC versus Rec point mult
+ @code
+ Root> .L Compile.C
+ Root> Compile("DrawDigitsRecs.C")
+ Root> DrawDigitsRecs c
+ Root> c.Run();
+ @endcode
+ @ingroup FMD_script
+ */
+class DrawDigitsRecs : public AliFMDInput
{
private:
TH2D* fAdcVsSingle; // Histogram
- TH2D* fAdcVsRegion; // Histogram
- TH2D* fSingleVsRegion; // Histogram
AliFMDUShortMap fMap;
- AliFMDFloatMap fEta;
- AliFMDFloatMap fPhi;
- AliFMDFloatMap fMult;
public:
+ //__________________________________________________________________
TArrayF MakeLogScale(Int_t n, Double_t min, Double_t max)
{
TArrayF bins(n+1);
}
return bins;
}
+ //__________________________________________________________________
DrawDigitsRecs(Int_t m=1100, Double_t amin=-0.5, Double_t amax=1099.5,
Int_t n=105, Double_t mmin=-0.5, Double_t mmax=20.5)
{
+ AddLoad(kDigits);
AddLoad(kRecPoints);
fAdcVsSingle = new TH2D("adcVsSingle", "ADC vs. Multiplicity (strip)",
m, amin, amax, n, mmin, mmax);
fAdcVsSingle->SetXTitle("ADC value");
fAdcVsSingle->SetYTitle("Strip Multiplicity");
-
- mmin *= 20;
- mmax *= 20;
- amin *= 50;
- amax *= 50;
- fAdcVsRegion = new TH2D("adcVsRegion", "ADC vs Muliplcity (region)",
- m, amin, amax, n, mmin, mmax);
- fAdcVsRegion->SetXTitle("ADC value");
- fAdcVsRegion->SetYTitle("Region Multiplicity");
-
- fSingleVsRegion = new TH2D("singleVsRegion", "Single vs Region",
- n, mmin, mmax, n, mmin, mmax);
- fSingleVsRegion->SetXTitle("Strip Multiplicity");
- fSingleVsRegion->SetYTitle("Region Multiplicity");
}
+ //__________________________________________________________________
+ /** Begining of event
+ @param ev Event number
+ @return @c false on error */
Bool_t Begin(Int_t ev)
{
fMap.Reset();
- fEta.Reset();
- fPhi.Reset();
- return AliFMDInputDigits::Begin(ev);
+ return AliFMDInput::Begin(ev);
}
+ //__________________________________________________________________
Bool_t ProcessDigit(AliFMDDigit* digit)
{
// Cache the energy loss
fMap(det, rng, sec, str) = digit->Counts();
return kTRUE;
}
- Bool_t Event()
+ //__________________________________________________________________
+ Bool_t ProcessRecPoint(AliFMDRecPoint* single)
{
- if (!AliFMDInputDigits::Event()) return kFALSE;
- Int_t nEv = fTreeR->GetEntries();
- for (Int_t i = 0; i < nEv; i++) {
- Int_t recoRead = fTreeR->GetEntry(i);
- if (recoRead <= 0) continue;
- Int_t nSingle = fArrayN->GetEntries();
- if (nSingle <= 0) continue;
- for (Int_t j = 0; j < nSingle; j++) {
- AliFMDMultStrip* single =
- static_cast<AliFMDMultStrip*>(fArrayN->At(j));
- if (!single) continue;
- UShort_t det = single->Detector();
- Char_t rng = single->Ring();
- UShort_t sec = single->Sector();
- UShort_t str = single->Strip();
- if (str > 511) {
- AliWarning(Form("Bad strip number %d in single", str));
- continue;
- }
- fAdcVsSingle->Fill(fMap(det, rng, sec, str), single->Particles());
- fEta(det, rng, sec, str) = single->Eta();
- fPhi(det, rng, sec, str) = single->Phi() * 180 / TMath::Pi();
- fMult(det, rng, sec, str) = single->Particles();
- }
-
- Int_t nRegion = fArrayP->GetEntries();
- if (nRegion <= 0) continue;
- for (Int_t j = 0; j < nRegion; j++) {
- AliFMDMultRegion* region =
- static_cast<AliFMDMultRegion*>(fArrayP->At(j));
- if (!region) continue;
- UShort_t det = region->Detector();
- Char_t rng = region->Ring();
- UInt_t suma = 0;
- Float_t summ = 0;
-
- for (size_t sec = 0; sec < AliFMDMap::kMaxSectors; sec++) {
- Float_t phi = fPhi(det, rng, sec, 0);
- Bool_t ok = (phi <= region->MaxPhi() && phi >= region->MinPhi());
- if (!ok) continue;
- for (size_t str = 0; str < AliFMDMap::kMaxStrips; str++) {
- Float_t eta = fEta(det, rng, sec, str);
- Float_t sign = eta < 0 ? -1. : 1.;
- ok = (sign * eta <= sign * region->MaxEta()
- && sign * eta >= sign * region->MinEta());
- if (!ok) continue;
- suma += fMap(det, rng, sec, str);
- summ += fMult(det, rng, sec, str);
- }
- }
- fAdcVsRegion->Fill(suma, region->Particles());
- fSingleVsRegion->Fill(summ, region->Particles());
- }
+ if (!single) return kFALSE;
+ UShort_t det = single->Detector();
+ Char_t rng = single->Ring();
+ UShort_t sec = single->Sector();
+ UShort_t str = single->Strip();
+ if (str > 511) {
+ AliWarning(Form("Bad strip number %d in single", str));
+ return kFALSE;
}
+ fAdcVsSingle->Fill(fMap(det, rng, sec, str), single->Particles());
return kTRUE;
}
+ //__________________________________________________________________
Bool_t Finish()
{
gStyle->SetPalette(1);
gStyle->SetPadColor(0);
gStyle->SetPadBorderSize(0);
- new TCanvas("c1", "ADC vs. Strip Multiplicity");
fAdcVsSingle->SetStats(kFALSE);
fAdcVsSingle->Draw("COLZ");
-
- new TCanvas("c2", "ADC vs. Region Multiplicity");
- fAdcVsRegion->SetStats(kFALSE);
- fAdcVsRegion->Draw("COLZ");
-
- new TCanvas("c3", "Single vs. Region Multiplicity");
- fSingleVsRegion->SetStats(kFALSE);
- fSingleVsRegion->Draw("COLZ");
-
return kTRUE;
}