]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDDisplay.cxx
use new emcal jet class
[u/mrichter/AliRoot.git] / FMD / AliFMDDisplay.cxx
index 4aa91730de8a8efe0e99e3fe95dab7758165bd49..572a3815741686f4bf5a55ad85a8b98a907e157f 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 /* $Id$ */
-/** @file    AliFMDDisplay.cxx
-    @author  Christian Holm Christensen <cholm@nbi.dk>
-    @date    Mon Mar 27 12:39:09 2006
-    @brief   FMD Event display 
-*/
+/** 
+ * @file    AliFMDDisplay.cxx
+ * @author  Christian Holm Christensen <cholm@nbi.dk>
+ * @date    Mon Mar 27 12:39:09 2006
+ * @brief   FMD Event display 
+ */
 //___________________________________________________________________
 //
 // The classes defined here, are utility classes for reading in data
@@ -131,7 +132,10 @@ AliFMDDisplay::AliFMDDisplay(Bool_t onlyFMD, const char* gAliceFile)
     fAux(0), 
     fReturn(kFALSE), 
     fContinous(kFALSE),
-    fTimeout("gApplication->StopIdleing()", 10)
+    fTimeout("gApplication->StopIdleing()", 10), 
+    fInitialMin(0), 
+    fInitialMax(1), 
+    fInitialFactor(3/10.)
 {
   // Constructor of an FMD display object. 
   // Must be called 
@@ -181,8 +185,9 @@ AliFMDDisplay::MakeCanvas(const char** which)
     xb = .66;
     fFactor = new TSlider("pedFactor", "Pedestal Factor", xb+.01, 0, 1, yb);
     fFactor->SetMethod("AliFMDDisplay::Instance()->ChangeFactor()");
-    fFactor->SetRange(3./10, 1);
+    fFactor->SetRange(fInitialFactor, 1);
     fFactor->Draw();
+    fFactor->SetMinimum(fInitialFactor);
     TSliderBox *sbox = 
       static_cast<TSliderBox*>(fFactor->GetListOfPrimitives()->
                               FindObject("TSliderBox"));
@@ -200,7 +205,7 @@ AliFMDDisplay::MakeCanvas(const char** which)
     yb = .05;
     fSlider = new TSlider("genCut", "Multiplicity cut", 0, 0, xb, yb);
     fSlider->SetMethod("AliFMDDisplay::Instance()->ChangeCut()");
-    fSlider->SetRange(0,1);
+    fSlider->SetRange(fInitialMin,fInitialMax);
     fSlider->Draw();
     TSliderBox *sbox = 
       static_cast<TSliderBox*>(fSlider->GetListOfPrimitives()->
@@ -209,6 +214,9 @@ AliFMDDisplay::MakeCanvas(const char** which)
       sbox->SetToolTipText("Adjust lower and upper limit on data signal");
     }
   }
+  // fCanvas->Modified();
+  // fCanvas->Update();
+  // fCanvas->cd();
   Float_t      x0 = 0;
   Float_t      dx = 1. / n;
   p               = which;
@@ -241,9 +249,9 @@ AliFMDDisplay::ShowOnlyFMD()
   TGeoIterator next(top);
   TGeoNode* node;
   TGeoVolume* v = 0;
-  Bool_t hasFMD1 = kFALSE;
-  Bool_t hasFMD2 = kFALSE;
-  Bool_t hasFMD3 = kFALSE;
+  // Bool_t hasFMD1 = kFALSE;
+  // Bool_t hasFMD2 = kFALSE;
+  // Bool_t hasFMD3 = kFALSE;
   AliFMDDebug(1, ("Getting material FMD_Si$"));
   TGeoMaterial* si   = gGeoManager->GetMaterial("FMD_Si$");      // kRed 
   AliFMDDebug(1, ("Getting material FMD_Carbon$"));
@@ -277,13 +285,13 @@ AliFMDDisplay::ShowOnlyFMD()
       }
       if (name[2] == 'M' && (name[3] == 'T' || name[3] == 'B')) {
        // Virtual Master half-ring volume - top-level
-       Int_t det = node->GetNumber();
-       switch (det) {
-       case 1: hasFMD1 = true; break;
-       case 2: hasFMD2 = true; break;
-       case 3: hasFMD3 = true; break;
-       default: continue;
-       }
+       // Int_t det = node->GetNumber();
+       /* switch (det) {
+          case 1: hasFMD1 = true; break;
+          case 2: hasFMD2 = true; break;
+          case 3: hasFMD3 = true; break;
+          default: continue;
+          } */
        toshow.Add(v);
       }
       else if (name[3] == 'V' && (name[2] == 'T' || name[2] == 'B')) 
@@ -394,7 +402,8 @@ AliFMDDisplay::MakeAux()
   if (!range) return;
   
   if (!fAux) {
-    fAux = new TCanvas("aux", "Aux");
+    fAux = new TCanvas(Form("aux_%s", GetName()), 
+                      Form("Aux - %s", GetTitle()));
     fAux->SetLogy();
     fAux->SetFillColor(kWhite);
     fAux->SetBorderMode(0);
@@ -403,11 +412,17 @@ AliFMDDisplay::MakeAux()
     fSpec = new TH1D("spec", "Spectra", range->fNbins, 
                     range->fLow-dBin/2, range->fHigh+dBin/2);
     fSpecCut = static_cast<TH1*>(fSpec->Clone("specCut"));
-    fSpec->SetXTitle("signal");
+    TString xTitle((TESTBIT(fTreeMask, kRawCalib) || 
+                   TESTBIT(fTreeMask, kESD)) ? "#Delta E/#Delta E_{mip}" :
+                  (TESTBIT(fTreeMask, kDigits) ||
+                   TESTBIT(fTreeMask, kSDigits) || 
+                   TESTBIT(fTreeMask, kRaw)) ? "ADC [counts]" :
+                  TESTBIT(fTreeMask, kHits) ? "Hits" : "signal");
+    fSpec->SetXTitle(xTitle.Data());
     fSpec->SetYTitle("events");
     fSpec->SetFillColor(2);
     fSpec->SetFillStyle(3001);
-    fSpecCut->SetXTitle("signal");
+    fSpecCut->SetXTitle(xTitle.Data());
     fSpecCut->SetYTitle("events");
     fSpecCut->SetFillColor(4);
     fSpecCut->SetFillStyle(3001);
@@ -507,10 +522,10 @@ AliFMDDisplay::Idle()
     gApplication->StopIdleing();
     if (fContinous) break;
   }
-  AliFMDDebug(1, ("After idle loop"));
+  AliFMDDebug(3, ("After idle loop"));
   if (fMarkers) fMarkers->Delete();
   if (fHits)    fHits->Clear();
-  AliFMDDebug(1, ("After clearing caches"));
+  AliFMDDebug(3, ("After clearing caches"));
 }
 
 //____________________________________________________________________
@@ -547,11 +562,25 @@ void
 AliFMDDisplay::SetCut(Float_t l, Float_t h) 
 {
   // Change the cut on the slider. 
-  fSlider->SetMinimum(l);
-  fSlider->SetMaximum(h);
+  fInitialMin = l;
+  fInitialMax = h;
+  if (!fSlider) return;
+  fSlider->SetMinimum(fInitialMin);
+  fSlider->SetMaximum(fInitialMax);
   ChangeCut();
 }
 
+//____________________________________________________________________
+void
+AliFMDDisplay::SetFactor(Float_t f) 
+{
+  // Change the cut on the slider. 
+  fInitialFactor = f / 10;
+  if (!fFactor) return;
+  fFactor->SetMinimum(fInitialFactor);
+  ChangeFactor();
+}
+
 //____________________________________________________________________
 void
 AliFMDDisplay::ChangeCut() 
@@ -674,12 +703,23 @@ Bool_t
 AliFMDDisplay::InsideCut(Float_t val, const Float_t& min, 
                         const Float_t& max) const
 {
+  // 
+  // Whether a point is inside 
+  // 
+  // Parameters:
+  //    v   Point
+  //    min Minimum
+  //    max Maximum
+  // 
+  // Return:
+  //    true if @a v is inside cut 
+  //
   Float_t r = max - min;
   Float_t l = fSlider->GetMinimum();
   Float_t h = fSlider->GetMaximum();
   if (l == h) { l = 0; h = 1; }
   if (val < r * l + min || val > r * h + min) { 
-    AliFMDDebug(1, ("Value %f is outside cut %f - %f (range %f - %f)", 
+    AliFMDDebug(2, ("Value %f is outside cut %f - %f (range %f - %f)", 
                    val, min+r*l, min+r*h, min, max));
     return kFALSE;
   }
@@ -777,7 +817,7 @@ AliFMDDisplay::ProcessRawDigit(AliFMDDigit* digit)
   // Parameters: 
   //   digit Digit information 
   AliFMDDebug(50, ("Forwarding call of ProcessRaw to ProcessDigit "
-                 "for FMD%d&c[%02d,%03d] %d", 
+                 "for FMD%d%c[%02d,%03d] %d", 
                  digit->Detector(), digit->Ring(), digit->Sector(), 
                  digit->Strip(), digit->Counts()));
   return ProcessDigit(digit);
@@ -811,6 +851,7 @@ AliFMDDisplay::ProcessRawCalibDigit(AliFMDDigit* digit)
   //   Double_t edep = ((counts * parm->GetEdepMip() / 
   //               (gain * parm->GetDACPerMIP()));
   Double_t mult = (counts-ped) / (gain * parm->GetDACPerMIP());
+  if (gain < 0.1 || gain > 10) mult = 0;
   
 
   AliFMDDebug(10, ("FMD%d%c[%02d,%03d] adc %4d "
@@ -872,10 +913,23 @@ AliFMDDisplay::ProcessESD(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
   return kTRUE;
 }
 
+//____________________________________________________________________
 Double_t
 AliFMDDisplay::GetADCThreshold(UShort_t d, Char_t r, 
                               UShort_t s, UShort_t t) const
 {
+  // 
+  // Get the ADC threshold
+  // 
+  // Parameters:
+  //    d Detector
+  //    r Ring 
+  //    s Sector 
+  //    t Strip 
+  // 
+  // Return:
+  //    The threshold 
+  //
   AliFMDParameters* parm = AliFMDParameters::Instance();
   Double_t ped           =  parm->GetPedestal(d,r, s, t);
   Double_t pedW          =  parm->GetPedestalWidth(d,r, s, t);
@@ -895,3 +949,4 @@ AliFMDDisplay::GetADCThreshold(UShort_t d, Char_t r,
 //
 // EOF
 //
+