]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDReconstructor.cxx
Production file not written anymore
[u/mrichter/AliRoot.git] / FMD / AliFMDReconstructor.cxx
index b6f4f5f8ec86d1827870bc3b7724894b7a7b08e8..f9f3f7f7730b6a48ca801ddf1ec49d6908c4838d 100644 (file)
@@ -1,3 +1,16 @@
+//____________________________________________________________________
+//
+// This is a class that constructs AliFMDRecPoint objects from of Digits
+// This class reads either digits from a TClonesArray or raw data from 
+// a DDL file (or similar), and stores the read ADC counts in an
+// internal cache (fAdcs).   The rec-points are made via the naiive
+// method. 
+//
+//-- Authors: Evgeny Karpechev(INR) and Alla Maevsksia
+//  Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+//
+//
+//____________________________________________________________________
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 /* $Id$ */
-/** @file    AliFMDReconstructor.cxx
-    @author  Christian Holm Christensen <cholm@nbi.dk>
-    @date    Mon Mar 27 12:47:09 2006
-    @brief   FMD reconstruction 
+/** 
+ * @file    AliFMDReconstructor.cxx
+ * @author  Christian Holm Christensen <cholm@nbi.dk>
+ * @date    Mon Mar 27 12:47:09 2006
+ * @brief   FMD reconstruction 
 */
-//____________________________________________________________________
-//
-// This is a class that constructs AliFMDRecPoint objects from of Digits
-// This class reads either digits from a TClonesArray or raw data from 
-// a DDL file (or similar), and stores the read ADC counts in an
-// internal cache (fAdcs).   The rec-points are made via the naiive
-// method. 
-//
-//-- Authors: Evgeny Karpechev(INR) and Alla Maevsksia
-//  Latest changes by Christian Holm Christensen <cholm@nbi.dk>
-//
-//
-//____________________________________________________________________
 
 // #include <AliLog.h>                        // ALILOG_H
 // #include <AliRun.h>                        // ALIRUN_H
@@ -81,7 +82,8 @@ AliFMDReconstructor::AliFMDReconstructor()
     fDiagStep2(0),
     fDiagStep3(0),
     fDiagStep4(0),
-    fDiagAll(0)
+    fDiagAll(0),
+    fBad(0)
 {
   // Make a new FMD reconstructor object - default CTOR.  
   SetNoiseFactor();
@@ -248,6 +250,14 @@ AliFMDReconstructor::GetParameters() const
 void 
 AliFMDReconstructor::UseRecoParam(Bool_t set) const
 {
+  // 
+  // Set-up reconstructor to use values from reconstruction
+  // parameters, if present, for this event.   If the argument @a set
+  // is @c false, then restore preset values. 
+  // 
+  // Parameters:
+  //    set 
+  //  
   static Float_t savedNoiseFactor  = fNoiseFactor;
   static Bool_t  savedAngleCorrect = fAngleCorrect;
   if (set) { 
@@ -282,13 +292,18 @@ AliFMDReconstructor::MarkDeadChannels(AliESDFMD* esd) const
 
       for (UShort_t s = 0; s < nS; s++) { 
        for (UShort_t t = 0; t < nT; t++) {
+         if (fBad(d, r, s, t)) { 
+           AliDebug(5, Form("Marking FMD%d%c[%2d,%3d] as bad", d, r, s, t));
+           esd->SetMultiplicity(d, r, s, t, AliESDFMD::kInvalidMult);
+         }         
          if (param->IsDead(d, r, s, t)) { 
            AliDebug(5, Form("Marking FMD%d%c[%2d,%3d] as dead", d, r, s, t));
            esd->SetMultiplicity(d, r, s, t, AliESDFMD::kInvalidMult);
-           esd->SetEta(d, r, s, t, AliESDFMD::kInvalidEta);
+           // esd->SetEta(d, r, s, t, AliESDFMD::kInvalidEta);
          }
          else if (esd->Multiplicity(d, r, s, t) == AliESDFMD::kInvalidMult) {
-           AliDebug(10, Form("Setting null signal in FMD%d%c[%2d,%3d]", d, r, s, t));
+           AliDebug(10, Form("Setting null signal in FMD%d%c[%2d,%3d]", 
+                             d, r, s, t));
            esd->SetMultiplicity(d, r, s, t, 0);
          }
        }
@@ -309,7 +324,7 @@ AliFMDReconstructor::Reconstruct(AliRawReader* reader, TTree*) const
   //   ctree    Not used - 'cluster tree' to store rec-points in. 
   AliFMDDebug(1, ("Reconstructing from raw reader"));
   AliFMDRawReader rawReader(reader, 0);
-
+  fBad.Reset(false);
   UShort_t det, sec, str, fac;
   Short_t  adc, oldDet = -1;
   Bool_t   zs;
@@ -425,6 +440,7 @@ AliFMDReconstructor::ProcessDigits(TClonesArray* digits) const
   AliFMDDebug(2, ("Got %d digits", nDigits));
   fESDObj->SetNoiseFactor(fNoiseFactor);
   fESDObj->SetAngleCorrected(fAngleCorrect);
+  fBad.Reset(false);
   for (Int_t i = 0; i < nDigits; i++) {
     AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
     if (!digit) continue;
@@ -436,6 +452,12 @@ AliFMDReconstructor::ProcessDigits(TClonesArray* digits) const
 void
 AliFMDReconstructor::ProcessDigit(AliFMDDigit* digit) const
 {
+  // 
+  // Process a single digit 
+  // 
+  // Parameters:
+  //    digit Digiti to process
+  // 
   UShort_t det = digit->Detector();
   Char_t   rng = digit->Ring();
   UShort_t sec = digit->Sector();
@@ -462,10 +484,17 @@ AliFMDReconstructor::ProcessSignal(UShort_t det,
   //    rng    Strip ID
   //    adc     ADC counts
   // 
-  AliFMDParameters* param  = AliFMDParameters::Instance();
+  if (adc >= AliFMDRawReader::kBadSignal) { 
+    AliFMDDebug(1, ("FMD%d%c[%2d,%3d] is marked bad", det, rng, sec, str));
+    fBad(det,rng,sec,str) = true;
+    return;
+  }
+
   // Check that the strip is not marked as dead 
+  AliFMDParameters* param  = AliFMDParameters::Instance();
   if (param->IsDead(det, rng, sec, str)) {
     AliFMDDebug(1, ("FMD%d%c[%2d,%3d] is dead", det, rng, sec, str));
+    fBad(det,rng,sec,str) = true;
     return;
   }
   
@@ -565,6 +594,25 @@ AliFMDReconstructor::SubtractPedestal(UShort_t det,
                                      Bool_t   zsEnabled, 
                                      UShort_t zsNoiseFactor) const
 {
+  // 
+  // Subtract the pedestal off the ADC counts. 
+  // 
+  // Parameters:
+  //    det           Detector number
+  //    rng           Ring identifier
+  //    sec           Sector number
+  //    str           Strip number
+  //    adc           ADC counts
+  //    noiseFactor   If pedestal substracted pedestal is less then
+  //        this times the noise, then consider this to be 0. 
+  //    zsEnabled     Whether zero-suppression is on.
+  //    zsNoiseFactor Noise factor used in on-line pedestal
+  //        subtraction. 
+  // 
+  // Return:
+  //    The pedestal subtracted ADC counts (possibly 0), or @c
+  //         USHRT_MAX in case of problems.
+  //  
   AliFMDParameters* param  = AliFMDParameters::Instance();
   Float_t           ped    = (zsEnabled ? 0 : 
                                param->GetPedestal(det, rng, sec, str));
@@ -913,6 +961,9 @@ void
 AliFMDReconstructor::FillESD(AliRawReader*, TTree* clusterTree, 
                             AliESDEvent* esd) const
 {
+  // 
+  // Forwards to above member function 
+  //
   TTree* dummy = 0;
   FillESD(dummy, clusterTree, esd);
 }