1 /**************************************************************************
2 * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /** @file AliFMDDisplay.cxx
17 @author Christian Holm Christensen <cholm@nbi.dk>
18 @date Mon Mar 27 12:39:09 2006
19 @brief FMD Event display
21 //___________________________________________________________________
23 // The classes defined here, are utility classes for reading in data
24 // for the FMD. They are put in a seperate library to not polute the
25 // normal libraries. The classes are intended to be used as base
26 // classes for customized class that do some sort of analysis on the
27 // various types of data produced by the FMD.
29 // Latest changes by Christian Holm Christensen
33 #include <TApplication.h>
36 #include <TGeoManager.h>
38 #include <TMarker3DBox.h>
41 #include <TSliderBox.h>
44 #include <TVirtualX.h>
45 #include <TVirtualViewer3D.h>
47 // #include <TArrayF.h>
48 // #include <TParticle.h>
50 #include "AliFMDDisplay.h" // ALIFMDDISPLAY_H
51 #include "AliFMDHit.h" // ALIFMDHIT_H
52 #include "AliFMDDigit.h" // ALIFMDDIGIT_H
53 #include "AliFMDSDigit.h" // ALIFMDSDIGIT_H
54 #include "AliFMDRecPoint.h" // ALIFMDRECPOINT_H
55 #include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
56 #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
57 #include "AliFMDRawReader.h" // ALIFMDRAWREADER_H
58 #include <AliESDFMD.h> // ALIESDFMD_H
59 // #include <AliLog.h>
60 #include "AliFMDDebug.h" // Better debug macros
62 //____________________________________________________________________
63 ClassImp(AliFMDDisplay)
65 ; // This is here to keep Emacs for indenting the next line
68 //____________________________________________________________________
69 AliFMDDisplay* AliFMDDisplay::fgInstance = 0;
71 //____________________________________________________________________
72 const AliFMDDisplay::Range_t AliFMDDisplay::fgkEdepRange = { 100, 0., 2. };
73 const AliFMDDisplay::Range_t AliFMDDisplay::fgkAdcRange = { 1024, 0., 1023. };
74 const AliFMDDisplay::Range_t AliFMDDisplay::fgkMultRange = { 500, 0., 20. };
77 //____________________________________________________________________
79 AliFMDDisplay::Instance()
81 // Return static instance
82 // If the instance does not exist
87 //____________________________________________________________________
88 AliFMDDisplay::~AliFMDDisplay()
101 if (fPad) delete fPad;
103 if (fSlider) delete fSlider;
104 if (fCanvas) delete fCanvas;
107 //____________________________________________________________________
108 AliFMDDisplay::AliFMDDisplay(Bool_t onlyFMD, const char* gAliceFile)
109 : AliFMDInput(gAliceFile),
134 fTimeout("gApplication->StopIdleing()", 10),
137 fInitialFactor(3/10.)
139 // Constructor of an FMD display object.
142 SetName("AliFMDDisplay");
143 SetTitle("3D Display of various kinds of FMD data");
145 if (fgInstance) delete fgInstance;
149 //____________________________________________________________________
151 AliFMDDisplay::MakeCanvas(const char** which)
155 // which Which button to put up.
156 gStyle->SetPalette(1);
157 // gStyle->SetCanvasPreferGL(kTRUE);
160 fCanvas = new TCanvas(Form("gl%s", GetName()),
161 Form("%s - Display", GetTitle()),
162 w, Int_t(w / (1-y1)));
163 fCanvas->SetFillColor(1);
164 fCanvas->ToggleEventStatus();
166 fPad = new TPad("glview", "3DView", 0.0, y1, 1.0, 1.0, 1, 0, 0);
169 const char** p = which;
174 AliFMDDebug(1, ("Got %d buttons", n));
180 if (TESTBIT(fTreeMask, kDigits) ||
181 TESTBIT(fTreeMask, kRawCalib) ||
182 TESTBIT(fTreeMask, kRaw)) {
185 fFactor = new TSlider("pedFactor", "Pedestal Factor", xb+.01, 0, 1, yb);
186 fFactor->SetMethod("AliFMDDisplay::Instance()->ChangeFactor()");
187 fFactor->SetRange(fInitialFactor, 1);
189 fFactor->SetMinimum(fInitialFactor);
191 static_cast<TSliderBox*>(fFactor->GetListOfPrimitives()->
192 FindObject("TSliderBox"));
194 sbox->SetToolTipText("Adjust the noise suppression factor by moving "
198 if (TESTBIT(fTreeMask, kHits) ||
199 TESTBIT(fTreeMask, kESD) ||
200 TESTBIT(fTreeMask, kDigits) ||
201 TESTBIT(fTreeMask, kSDigits) ||
202 TESTBIT(fTreeMask, kRaw) ||
203 TESTBIT(fTreeMask, kRawCalib)) {
205 fSlider = new TSlider("genCut", "Multiplicity cut", 0, 0, xb, yb);
206 fSlider->SetMethod("AliFMDDisplay::Instance()->ChangeCut()");
207 fSlider->SetRange(fInitialMin,fInitialMax);
210 static_cast<TSliderBox*>(fSlider->GetListOfPrimitives()->
211 FindObject("TSliderBox"));
213 sbox->SetToolTipText("Adjust lower and upper limit on data signal");
216 // fCanvas->Modified();
217 // fCanvas->Update();
222 while ((m = *(p++))) {
224 AliFMDDebug(1, ("Adding button %s", m));
225 TButton* b = new TButton(m, Form("AliFMDDisplay::Instance()->%s()", m),
226 x0, yb, TMath::Min(x0 + dx,.999F), y1);
234 //____________________________________________________________________
236 AliFMDDisplay::ShowOnlyFMD()
241 if (!fGeoManager) return;
242 static bool once = false;
245 AliInfo("Will only show the FMD");
246 TGeoVolume* top = gGeoManager->GetTopVolume();
247 top->InvisibleAll(kTRUE);
248 TGeoIterator next(top);
251 Bool_t hasFMD1 = kFALSE;
252 Bool_t hasFMD2 = kFALSE;
253 Bool_t hasFMD3 = kFALSE;
254 AliFMDDebug(1, ("Getting material FMD_Si$"));
255 TGeoMaterial* si = gGeoManager->GetMaterial("FMD_Si$"); // kRed
256 AliFMDDebug(1, ("Getting material FMD_Carbon$"));
257 TGeoMaterial* c = gGeoManager->GetMaterial("FMD_Carbon$"); // kGray
258 AliFMDDebug(1, ("Getting material FMD_Aluminum$"));
259 TGeoMaterial* al = gGeoManager->GetMaterial("FMD_Aluminum$");// kGray-2
260 AliFMDDebug(1, ("Getting material FMD_Copper$"));
261 TGeoMaterial* cu = gGeoManager->GetMaterial("FMD_Copper$"); // kGreen-2
262 AliFMDDebug(1, ("Getting material FMD_PCB$"));
263 TGeoMaterial* pcb = gGeoManager->GetMaterial("FMD_PCB$"); // kGreen+2
264 AliFMDDebug(1, ("Getting material FMD_PCB$"));
265 TGeoMaterial* chip = gGeoManager->GetMaterial("FMD_Si Chip$");// kGreen+2
267 while ((node = static_cast<TGeoNode*>(next()))) {
268 const char* name = node->GetName();
270 if (!(v = node->GetVolume())) continue;
272 if (name[0] == 'F') {
273 TGeoMaterial* m = (v->IsAssembly() ? 0 : v->GetMaterial());
275 if (m == si) col = kRed;
276 else if (m == c) col = kGray;
277 else if (m == al) col = kYellow+4;
278 else if (m == cu) col = kRed+6;
279 else if (m == pcb) col = kGreen+2;
280 else if (m == chip) col = kGreen+4;
282 v->SetLineColor(col);
283 v->SetFillColor(col);
285 if (name[2] == 'M' && (name[3] == 'T' || name[3] == 'B')) {
286 // Virtual Master half-ring volume - top-level
287 Int_t det = node->GetNumber();
289 case 1: hasFMD1 = true; break;
290 case 2: hasFMD2 = true; break;
291 case 3: hasFMD3 = true; break;
296 else if (name[3] == 'V' && (name[2] == 'T' || name[2] == 'B'))
297 toshow.Add(v); // Virtual Half-ring, bare detectors
298 else if (name[3] == 'H' && (name[2] == 'F' || name[2] == 'B'))
299 toshow.Add(v); // Virtual Hybrid container
300 else if (name[2] == 'S' && name[3] == 'U')
301 toshow.Add(v); // Virtual support structre
302 // else if (name[3] == 'H' && (name[2] == 'F' || name[2] == 'B'))
303 // toshow.Add(v); // Virtual Hybrid container
305 v->SetVisibility(kFALSE);
306 v->SetVisDaughters(kFALSE);
307 v->InvisibleAll(kTRUE);
310 while ((v = static_cast<TGeoVolume*>(i()))) {
311 if (!v->IsAssembly())
312 v->SetVisibility(kTRUE);
313 v->InvisibleAll(kFALSE);
314 v->SetVisDaughters(kTRUE);
320 //____________________________________________________________________
322 AliFMDDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py)
324 // Execute an event on canvas
326 // event What happened
327 // px, py Pixel coordinates
328 if (px == 0 && py == 0) return;
329 if (!fZoomMode && fPad->GetView()) {
330 fPad->GetView()->ExecuteRotateView(event, px, py);
333 fPad->SetCursor(kCross);
336 fPad->TAttLine::Modify();
337 fX0 = fPad->AbsPixeltoX(px);
338 fY0 = fPad->AbsPixeltoY(py);
339 fXPixel = fOldXPixel = px;
340 fYPixel = fOldYPixel = py;
345 gVirtualX->DrawBox(fXPixel, fYPixel, fOldXPixel, fOldYPixel,
350 gVirtualX->DrawBox(fXPixel, fYPixel, fOldXPixel, fOldYPixel,
354 fPad->GetCanvas()->FeedbackMode(kFALSE);
355 if (px == fXPixel || py == fYPixel) return;
356 fX1 = fPad->AbsPixeltoX(px);
357 fY1 = fPad->AbsPixeltoY(py);
358 if (fX1 < fX0) std::swap(fX0, fX1);
359 if (fY1 < fY0) std::swap(fY0, fY1);
360 fPad->Range(fX0, fY0, fX1, fY1);
366 //____________________________________________________________________
368 AliFMDDisplay::Init()
370 // Initialize. GEt transforms and such,
371 // so that we can draw thins properly
372 // Returns true on success
373 if (!AliFMDInput::Init()) return kFALSE;
374 AliFMDGeometry* geom = AliFMDGeometry::Instance();
376 geom->InitTransformations();
377 if (TESTBIT(fTreeMask, kDigits) || TESTBIT(fTreeMask, kRaw))
378 AliFMDParameters::Instance()->Init();
380 fMarkers = new TObjArray;
381 fHits = new TObjArray;
382 fMarkers->SetOwner(kTRUE);
383 fHits->SetOwner(kFALSE);
387 //____________________________________________________________________
389 AliFMDDisplay::MakeAux()
391 // MAke the aux canvas
392 // This is used to display spectra
394 const Range_t* range = 0;
395 if (TESTBIT(fTreeMask, kESD)) range = &fgkMultRange;
396 else if (TESTBIT(fTreeMask, kRawCalib)) range = &fgkMultRange;
397 else if (TESTBIT(fTreeMask, kDigits)) range = &fgkAdcRange;
398 else if (TESTBIT(fTreeMask, kSDigits)) range = &fgkAdcRange;
399 else if (TESTBIT(fTreeMask, kRaw)) range = &fgkAdcRange;
400 else if (TESTBIT(fTreeMask, kHits)) range = &fgkEdepRange;
404 fAux = new TCanvas(Form("aux_%s", GetName()),
405 Form("Aux - %s", GetTitle()));
407 fAux->SetFillColor(kWhite);
408 fAux->SetBorderMode(0);
409 fAux->SetBorderSize(0);
410 Float_t dBin = (range->fHigh - range->fLow) / range->fNbins;
411 fSpec = new TH1D("spec", "Spectra", range->fNbins,
412 range->fLow-dBin/2, range->fHigh+dBin/2);
413 fSpecCut = static_cast<TH1*>(fSpec->Clone("specCut"));
414 TString xTitle((TESTBIT(fTreeMask, kRawCalib) ||
415 TESTBIT(fTreeMask, kESD)) ? "#Delta E/#Delta E_{mip}" :
416 (TESTBIT(fTreeMask, kDigits) ||
417 TESTBIT(fTreeMask, kSDigits) ||
418 TESTBIT(fTreeMask, kRaw)) ? "ADC [counts]" :
419 TESTBIT(fTreeMask, kHits) ? "Hits" : "signal");
420 fSpec->SetXTitle(xTitle.Data());
421 fSpec->SetYTitle("events");
422 fSpec->SetFillColor(2);
423 fSpec->SetFillStyle(3001);
424 fSpecCut->SetXTitle(xTitle.Data());
425 fSpecCut->SetYTitle("events");
426 fSpecCut->SetFillColor(4);
427 fSpecCut->SetFillStyle(3001);
435 //____________________________________________________________________
437 AliFMDDisplay::DrawAux()
439 // Draw in the Aux the canvas
440 // For example draw the spectra
445 fAux->SetLogy(fSpec->GetMaximum() > 10);
447 fSpecCut->Draw("same");
453 //____________________________________________________________________
455 AliFMDDisplay::Begin(Int_t event)
457 // Begin of event. Make canvas is not already done
459 // event The event number
461 const char* m[] = { "Continue",
473 // AliInfo("Clearing canvas");
476 Warning("End", "No geometry manager");
479 AliFMDDebug(1, ("Drawing geometry"));
481 fGeoManager->GetTopVolume()->Draw();
482 if (fOnlyFMD) ShowOnlyFMD();
483 AliFMDDebug(1, ("Adjusting view"));
485 if (fPad->GetView()) {
486 fPad->GetView()->SetView(-200, -40, 80, irep);
487 fPad->GetView()->Zoom();
491 return AliFMDInput::Begin(event);
494 //____________________________________________________________________
496 AliFMDDisplay::AtEnd()
498 // Called at of the event.
509 //____________________________________________________________________
511 AliFMDDisplay::Idle()
514 // Sends the ROOT loop into the idle loop,
515 // so that we can go on.
517 if (fContinous) fTimeout.Start(10, kTRUE);
519 gApplication->StartIdleing();
520 gSystem->InnerLoop();
521 gApplication->StopIdleing();
522 if (fContinous) break;
524 AliFMDDebug(3, ("After idle loop"));
525 if (fMarkers) fMarkers->Delete();
526 if (fHits) fHits->Clear();
527 AliFMDDebug(3, ("After clearing caches"));
530 //____________________________________________________________________
534 // End of event. Draw everything
537 if (fReturn) return kFALSE;
538 return AliFMDInput::End();
541 //____________________________________________________________________
543 AliFMDDisplay::LookupColor(Float_t x, Float_t min, Float_t max) const
546 // Get a colour from the current palette depending
547 // on the ratio x/max
548 Float_t range = (max-min);
549 Float_t l = fSlider->GetMinimum();
550 Float_t h = fSlider->GetMaximum();
551 if (l == h) { l = 0; h = 1; }
552 Float_t cmin = range * l;
553 Float_t cmax = range * h;
554 Float_t crange = (cmax-cmin);
555 Int_t idx = Int_t((x-cmin) / crange * gStyle->GetNumberOfColors());
556 return gStyle->GetColorPalette(idx);
559 //____________________________________________________________________
561 AliFMDDisplay::SetCut(Float_t l, Float_t h)
563 // Change the cut on the slider.
566 if (!fSlider) return;
567 fSlider->SetMinimum(fInitialMin);
568 fSlider->SetMaximum(fInitialMax);
572 //____________________________________________________________________
574 AliFMDDisplay::SetFactor(Float_t f)
576 // Change the cut on the slider.
577 fInitialFactor = f / 10;
578 if (!fFactor) return;
579 fFactor->SetMinimum(fInitialFactor);
583 //____________________________________________________________________
585 AliFMDDisplay::ChangeCut()
587 // Change the cut on the slider.
588 // The factor depends on what is
589 // drawn in the AUX canvas
590 AliInfo(Form("Range is now %7.5f - %7.5f", fSlider->GetMinimum(),
591 fSlider->GetMaximum()));
592 if ((TESTBIT(fTreeMask, kESD) ||
593 TESTBIT(fTreeMask, kDigits) ||
594 TESTBIT(fTreeMask, kSDigits) ||
595 TESTBIT(fTreeMask, kRaw) ||
596 TESTBIT(fTreeMask, kRawCalib))) {
597 Float_t l = fSlider->GetMinimum();
598 Float_t h = fSlider->GetMaximum();
601 AliInfo(Form("ADC range is now %4d - %4d", int(l), int(h)));
605 //____________________________________________________________________
607 AliFMDDisplay::ChangeFactor()
609 // Change the cut on the slider.
610 // The factor depends on what is
611 // drawn in the AUX canvas
612 AliInfo(Form("Noise factor is now %4.1f", 10 * fFactor->GetMinimum()));
616 //____________________________________________________________________
618 AliFMDDisplay::Redisplay()
621 // Redraw markers, hits,
623 if (fMarkers) fMarkers->Delete();
624 if (fHits) fHits->Clear();
625 if (fSpec) fSpec->Reset();
626 if (fSpecCut) fSpecCut->Reset();
630 //____________________________________________________________________
632 AliFMDDisplay::Break()
635 // Redraw markers, hits,
637 if (fMarkers) fMarkers->Delete();
638 if (fHits) fHits->Clear();
639 if (fSpec) fSpec->Reset();
640 if (fSpecCut) fSpecCut->Reset();
644 //____________________________________________________________________
646 AliFMDDisplay::Render()
649 TVirtualViewer3D* viewer = fPad->GetViewer3D("ogl");
653 //____________________________________________________________________
655 AliFMDDisplay::AddMarker(Float_t x, Float_t y, Float_t z,
656 TObject* o, Float_t s, Float_t min, Float_t max)
658 // Add a marker to the display
664 // o Object to refer to
666 // max Maximum of signal
669 Float_t zsize = (s - min) / (max-min) * 10;
670 Float_t r = TMath::Sqrt(x * x + y * y);
671 Float_t theta = TMath::ATan2(r, z);
672 Float_t phi = TMath::ATan2(y, x);
673 Float_t rz = z + (z < 0 ? 1 : -1) * zsize;
674 TMarker3DBox* marker = new TMarker3DBox(x,y,rz,size,size,zsize,theta,phi);
675 if (o) marker->SetRefObject(o);
676 marker->SetLineColor(LookupColor(s, min, max));
677 fMarkers->Add(marker);
679 //____________________________________________________________________
681 AliFMDDisplay::AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
682 TObject* o, Float_t s, Float_t min, Float_t max)
684 // Add a marker to the display
690 // o Object to refer to
692 // max Maximum of signal
694 AliFMDGeometry* geom = AliFMDGeometry::Instance();
696 geom->Detector2XYZ(det, rng, sec, str, x, y, z);
697 AddMarker(x,y,z,o,s,min,max);
700 //____________________________________________________________________
702 AliFMDDisplay::InsideCut(Float_t val, const Float_t& min,
703 const Float_t& max) const
705 Float_t r = max - min;
706 Float_t l = fSlider->GetMinimum();
707 Float_t h = fSlider->GetMaximum();
708 if (l == h) { l = 0; h = 1; }
709 if (val < r * l + min || val > r * h + min) {
710 AliFMDDebug(2, ("Value %f is outside cut %f - %f (range %f - %f)",
711 val, min+r*l, min+r*h, min, max));
718 //____________________________________________________________________
720 AliFMDDisplay::ProcessHit(AliFMDHit* hit, TParticle* /* p */)
725 static const Float_t rMin = fgkEdepRange.fLow;
726 static const Float_t rMax = fgkEdepRange.fHigh;
728 if (!hit) { AliError("No hit"); return kFALSE; }
729 // if (!p) { AliError("No track"); return kFALSE; }
730 Float_t edep = hit->Edep();
732 if (fHits) fHits->Add(hit);
733 if (fSpec) fSpec->Fill(edep);
734 if (!InsideCut(edep, rMin, rMax)) return kTRUE;
735 if (fSpecCut) fSpecCut->Fill(edep);
737 AddMarker(hit->X(), hit->Y(), hit->Z(), hit, edep, rMin, rMax);
741 //____________________________________________________________________
743 AliFMDDisplay::ProcessDigit(AliFMDDigit* digit)
747 // digit Digit information
748 static const Float_t rMin = fgkAdcRange.fLow;
749 static const Float_t rMax = fgkAdcRange.fHigh;
751 if (!digit) { AliError("No digit"); return kFALSE; }
753 UShort_t det = digit->Detector();
754 Char_t ring = digit->Ring();
755 UShort_t sec = digit->Sector();
756 UShort_t str = digit->Strip();
757 Double_t threshold = GetADCThreshold(det, ring, sec, str);
758 Float_t counts = digit->Counts();
759 if (threshold < 0) { counts += -threshold; threshold = 0; }
761 AliFMDDebug(10, ("FMD%d%c[%02d,%03d] counts %4d threshold %4d",
762 det, ring, sec, str, Int_t(counts), Int_t(threshold)));
763 if (fHits) fHits->Add(digit);
764 if (fSpec) fSpec->Fill(counts);
765 if (!InsideCut(counts-threshold, rMin, rMax)) return kTRUE;
766 if (fSpecCut) fSpecCut->Fill(counts);
769 AddMarker(det, ring, sec, str, digit, counts, rMin, rMax);
773 //____________________________________________________________________
775 AliFMDDisplay::ProcessSDigit(AliFMDSDigit* sdigit)
779 // sdigit Digit information
780 static const Float_t rMin = fgkAdcRange.fLow;
781 static const Float_t rMax = fgkAdcRange.fHigh;
783 if (!sdigit) { AliError("No sdigit"); return kFALSE; }
785 UShort_t det = sdigit->Detector();
786 Char_t ring = sdigit->Ring();
787 UShort_t sec = sdigit->Sector();
788 UShort_t str = sdigit->Strip();
789 Float_t counts = sdigit->Counts();
791 if (fHits) fHits->Add(sdigit);
792 if (fSpec) fSpec->Fill(counts);
793 if (!InsideCut(counts, rMin, rMax)) return kTRUE;
794 if (fSpecCut) fSpecCut->Fill(counts);
796 AddMarker(det, ring, sec, str, sdigit, counts, rMin, rMax);
800 //____________________________________________________________________
802 AliFMDDisplay::ProcessRawDigit(AliFMDDigit* digit)
806 // digit Digit information
807 AliFMDDebug(50, ("Forwarding call of ProcessRaw to ProcessDigit "
808 "for FMD%d&c[%02d,%03d] %d",
809 digit->Detector(), digit->Ring(), digit->Sector(),
810 digit->Strip(), digit->Counts()));
811 return ProcessDigit(digit);
814 //____________________________________________________________________
816 AliFMDDisplay::ProcessRawCalibDigit(AliFMDDigit* digit)
820 // digit Digit information
821 static const Float_t rMin = fgkMultRange.fLow;
822 static const Float_t rMax = fgkMultRange.fHigh;
823 static const Float_t aMin = fgkAdcRange.fLow;
824 static const Float_t aMax = fgkAdcRange.fHigh;
826 if (!digit) { AliError("No digit"); return kFALSE; }
828 AliFMDParameters* parm = AliFMDParameters::Instance();
829 UShort_t det = digit->Detector();
830 Char_t ring = digit->Ring();
831 UShort_t sec = digit->Sector();
832 UShort_t str = digit->Strip();
833 Double_t gain = parm->GetPulseGain(det, ring, sec, str);
834 Double_t ped = parm->GetPedestal(det, ring, sec, str);
835 Double_t threshold = GetADCThreshold(det, ring, sec, str);
836 Float_t counts = digit->Counts();
837 if (threshold < 0) { counts += -threshold; threshold = 0; ped = 0; }
839 // Double_t edep = ((counts * parm->GetEdepMip() /
840 // (gain * parm->GetDACPerMIP()));
841 Double_t mult = (counts-ped) / (gain * parm->GetDACPerMIP());
842 if (gain < 0.1 || gain > 10) mult = 0;
845 AliFMDDebug(10, ("FMD%d%c[%02d,%03d] adc %4d "
846 "(threshold %4d, gain %6.3f) -> mult %7.4f",
847 det, ring, sec, str, int(counts), int(threshold),
849 if (fHits) fHits->Add(digit);
850 if (fSpec) fSpec->Fill(mult);
851 if (!InsideCut(counts-threshold, aMin, aMax)) return kTRUE;
852 if (fSpecCut) fSpecCut->Fill(mult);
855 AddMarker(det, ring, sec, str, digit, mult, rMin, rMax);
859 //____________________________________________________________________
861 AliFMDDisplay::ProcessRecPoint(AliFMDRecPoint* recpoint)
863 // Process reconstructed point
865 // recpoint Reconstructed multiplicity/energy
866 static const Float_t rMin = fgkMultRange.fLow;
867 static const Float_t rMax = fgkMultRange.fHigh;
870 if (!recpoint) { AliError("No recpoint"); return kFALSE; }
872 if (!InsideCut(recpoint->Particles(), rMin, rMax)) return kTRUE;
874 if (fHits) fHits->Add(recpoint);
875 AddMarker(recpoint->Detector(), recpoint->Ring(), recpoint->Sector(),
876 recpoint->Strip(), recpoint, recpoint->Particles(), rMin, rMax);
880 //____________________________________________________________________
882 AliFMDDisplay::ProcessESD(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
883 Float_t, Float_t mult)
885 // Process data from ESD
887 // det,rng,sec,str Detector coordinates.
888 // mult Multiplicity.
889 static const Float_t rMin = fgkMultRange.fLow;
890 static const Float_t rMax = fgkMultRange.fHigh;
892 Double_t cmult = mult;
893 if (fSpec) fSpec->Fill(cmult);
894 if (!InsideCut(cmult, rMin, rMax) || cmult == AliESDFMD::kInvalidMult)
897 AddMarker(det,rng,sec,str, 0, cmult, rMin, rMax);
899 if (fSpecCut) fSpecCut->Fill(cmult);
904 //____________________________________________________________________
906 AliFMDDisplay::GetADCThreshold(UShort_t d, Char_t r,
907 UShort_t s, UShort_t t) const
909 AliFMDParameters* parm = AliFMDParameters::Instance();
910 Double_t ped = parm->GetPedestal(d,r, s, t);
911 Double_t pedW = parm->GetPedestalWidth(d,r, s, t);
912 Double_t threshold = 0;
913 if (fFMDReader && fFMDReader->IsZeroSuppressed(d-1))
914 threshold = - fFMDReader->NoiseFactor(d-1) * pedW;
916 threshold = ped + pedW * 10 * fFactor->GetMinimum();
917 AliFMDDebug(10, ("FMD%d%c[%2d,%3d] ped: %f +/- %f [factor: %f-%f]",
918 d, r, s, t, ped, pedW,
919 fFactor->GetMinimum(), fFactor->GetMaximum()));
920 if (threshold > fgkAdcRange.fHigh) threshold = fgkAdcRange.fHigh;
924 //____________________________________________________________________