]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDDisplay.cxx
Always export to FES the regional configuration file
[u/mrichter/AliRoot.git] / FMD / AliFMDDisplay.cxx
index 52ec6cef511a542dbdfb46e01ce8fa4e8a3df57e..3832b9e7d064544435536b2c0fc7aff37c4c476d 100644 (file)
@@ -54,6 +54,7 @@
 #include "AliFMDRecPoint.h"     // ALIFMDRECPOINT_H
 #include "AliFMDGeometry.h"    // ALIFMDGEOMETRY_H
 #include "AliFMDParameters.h"  // ALIFMDPARAMETERS_H
+#include "AliFMDRawReader.h"    // ALIFMDRAWREADER_H
 #include <AliESDFMD.h>          // ALIESDFMD_H
 // #include <AliLog.h>
 #include "AliFMDDebug.h" // Better debug macros
@@ -128,7 +129,9 @@ AliFMDDisplay::AliFMDDisplay(Bool_t onlyFMD, const char* gAliceFile)
     fSpec(0), 
     fSpecCut(0),
     fAux(0), 
-    fReturn(kFALSE)
+    fReturn(kFALSE), 
+    fContinous(kFALSE),
+    fTimeout("gApplication->StopIdleing()", 10)
 {
   // Constructor of an FMD display object. 
   // Must be called 
@@ -351,21 +354,6 @@ AliFMDDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py)
   }
 }
 
-//____________________________________________________________________
-Int_t          
-AliFMDDisplay::DistancetoPrimitive(Int_t px, Int_t) 
-{
-  // Calculate the distance from point to 
-  // something in the canvas. 
-  // Depends on the zoom mode. 
-  fPad->SetCursor(kCross);
-  Float_t xmin = fPad->GetX1();
-  Float_t xmax = fPad->GetX2();
-  Float_t dx   = .02 * (xmax - xmin);
-  Float_t x    = fPad->AbsPixeltoX(px);
-  if (x < xmin + dx || x > xmax - dx) return 9999;
-  return (fZoomMode ? 0 : 7);
-}
 //____________________________________________________________________
 Bool_t 
 AliFMDDisplay::Init()
@@ -405,12 +393,19 @@ AliFMDDisplay::MakeAux()
   if (!fAux) {
     fAux = new TCanvas("aux", "Aux");
     fAux->SetLogy();
+    fAux->SetFillColor(kWhite);
+    fAux->SetBorderMode(0);
+    fAux->SetBorderSize(0);
     Float_t dBin = (range->fHigh - range->fLow) / range->fNbins;
     fSpec = new TH1D("spec", "Spectra", range->fNbins, 
-                    range->fLow-dBin/2, range->fHigh-dBin/2);
+                    range->fLow-dBin/2, range->fHigh+dBin/2);
     fSpecCut = static_cast<TH1*>(fSpec->Clone("specCut"));
+    fSpec->SetXTitle("signal");
+    fSpec->SetYTitle("events");
     fSpec->SetFillColor(2);
     fSpec->SetFillStyle(3001);
+    fSpecCut->SetXTitle("signal");
+    fSpecCut->SetYTitle("events");
     fSpecCut->SetFillColor(4);
     fSpecCut->SetFillStyle(3001);
   }
@@ -430,6 +425,7 @@ AliFMDDisplay::DrawAux()
   if (!fAux) return;
   fAux->cd();
   fAux->Clear();
+  fAux->SetLogy(fSpec->GetMaximum() > 10);
   fSpec->Draw();
   fSpecCut->Draw("same");
   fAux->Modified();
@@ -501,10 +497,12 @@ AliFMDDisplay::Idle()
   // Sends the ROOT loop into the idle loop,
   // so that we can go on. 
   fWait = kTRUE;
+  if (fContinous) fTimeout.Start(10, kTRUE);
   while (fWait) {
     gApplication->StartIdleing();
     gSystem->InnerLoop();
     gApplication->StopIdleing();
+    if (fContinous) break;
   }
   AliFMDDebug(1, ("After idle loop"));
   if (fMarkers) fMarkers->Delete();
@@ -580,7 +578,8 @@ AliFMDDisplay::ChangeFactor()
   // The factor depends on what is 
   // drawn in the AUX canvas
   AliInfo(Form("Noise factor is now %4.1f, pedestal factor %3.1f", 
-              10*fFactor->GetMinimum(),fFactor->GetMaximum()));
+              10 * fFactor->GetMinimum(),
+              (fFactor->GetMaximum()-fFactor->GetMaximum())));
   Redisplay();
 }
 
@@ -724,10 +723,14 @@ AliFMDDisplay::ProcessDigit(AliFMDDigit* digit)
   UShort_t str           =  digit->Strip();
   Double_t ped           =  parm->GetPedestal(det,ring, sec, str);
   Double_t pedW          =  parm->GetPedestalWidth(det,ring, sec, str);
-  Double_t threshold     =  (ped * fFactor->GetMaximum()
-                            + pedW * fFactor->GetMinimum());
+  Double_t threshold     =  ((fFMDReader && fFMDReader->IsZeroSuppressed(det-1)
+                             ? 0 : (ped * (fFactor->GetMaximum()
+                                           -fFactor->GetMinimum())))
+                            + pedW * 10 * fFactor->GetMinimum());
   if (threshold > fgkAdcRange.fHigh) threshold = fgkAdcRange.fHigh;
   Float_t  counts        =  digit->Counts();
+  if (fFMDReader && fFMDReader->IsZeroSuppressed(det-1) && counts > 0)
+    counts += fFMDReader->NoiseFactor(det-1) * pedW;
 
   AliFMDDebug(10, ("FMD%d%c[%02d,%03d] counts %4d threshold %4d", 
                   det, ring, sec, str, Int_t(counts), Int_t(threshold)));