]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDHitDigitizer.cxx
Adding TOF calib task for calibration of problematic channels
[u/mrichter/AliRoot.git] / FMD / AliFMDHitDigitizer.cxx
index 20714d60f4fc715291604f5f1b950b4e1edb5ecf..3c4e1b6ae7e39af8d33ccdb722c3f7d46b94e50f 100644 (file)
@@ -211,7 +211,7 @@ ClassImp(AliFMDHitDigitizer)
 
 //____________________________________________________________________
 AliFMDHitDigitizer::AliFMDHitDigitizer(AliFMD* fmd, Output_t  output)
-  : AliFMDBaseDigitizer("FMD", (fOutput == kDigits ? 
+  : AliFMDBaseDigitizer("FMD", (output == kDigits ? 
                                "FMD Hit->Digit digitizer" :
                                "FMD Hit->SDigit digitizer")),
     fOutput(output), 
@@ -221,9 +221,27 @@ AliFMDHitDigitizer::AliFMDHitDigitizer(AliFMD* fmd, Output_t  output)
   fFMD = fmd;
 }
 
+//____________________________________________________________________
+AliFMDHitDigitizer& 
+AliFMDHitDigitizer::operator=(const AliFMDHitDigitizer& o) 
+{
+  /** 
+   * Assignment operator
+   *
+   * @param o Object to assign from 
+   * @return Reference to this 
+   */
+  if (&o == this) return *this; 
+  AliFMDBaseDigitizer::operator=(o);
+  fHoldTime    = o.fHoldTime;
+  fOutput      = o.fOutput;
+  fStack       = o.fStack;
+  return *this;
+}
+
 //____________________________________________________________________
 void
-AliFMDHitDigitizer::Exec(Option_t* /*option*/)
+AliFMDHitDigitizer::Digitize(Option_t* /*option*/)
 {
   // Run this digitizer 
   // Get an inititialize parameter manager
@@ -266,7 +284,7 @@ AliFMDHitDigitizer::Exec(Option_t* /*option*/)
     }
     
     // Read in the event
-    AliFMDDebug(5, ("Now digitizing (Hits->%s) event # %d", 
+    AliFMDDebug(1, ("Now digitizing (Hits->%s) event # %d", 
                    (fOutput == kDigits ? "digits" : "sdigits"), event));
     thisLoader->GetEvent(event);
     
@@ -337,6 +355,12 @@ AliFMDHitDigitizer::Exec(Option_t* /*option*/)
 TTree*
 AliFMDHitDigitizer::MakeOutputTree(AliLoader* loader)
 {
+  /** 
+   * Make the output tree using the passed loader 
+   *
+   * @param loader 
+   * @return The generated tree. 
+   */
   if (fOutput == kDigits) 
     return AliFMDBaseDigitizer::MakeOutputTree(loader);
   
@@ -424,17 +448,27 @@ AliFMDHitDigitizer::SumContributions(TBranch* hitsBranch)
       }
     
       // Extract parameters 
+      AliFMDDebug(15,("Adding contribution %7.5f for FMD%d%c[%2d,%3d] "
+                     " for trackno %6d (%s)", 
+                     fmdHit->Edep(),
+                     fmdHit->Detector(), 
+                     fmdHit->Ring(),
+                     fmdHit->Sector(), 
+                     fmdHit->Strip(), 
+                     trackno, 
+                     (isPrimary ? "primary" : "secondary")));
       AddContribution(fmdHit->Detector(),
                      fmdHit->Ring(),
                      fmdHit->Sector(),
                      fmdHit->Strip(),
                      fmdHit->Edep(), 
                      isPrimary, 
-                     trackno);
+                     1, 
+                     &trackno);
     }  // hit loop
   } // track loop
   AliFMDDebug(5, ("Size of cache: %d bytes, read %d bytes", 
-                  sizeof(fEdep), read));
+                 int(sizeof(fEdep)), read));
 }
 
 
@@ -469,8 +503,12 @@ AliFMDHitDigitizer::AddDigit(UShort_t        detector,
 {
   // Add a digit or summable digit
   if (fOutput == kDigits) { 
+    AliFMDDebug(15,("Adding digit for FMD%d%c[%2d,%3d] = (%x,%x,%x,%x)",
+                   detector, ring, sector, strip, 
+                   count1, count2, count3, count4));
     AliFMDBaseDigitizer::AddDigit(detector, ring, sector, strip, 0,
-                                 count1, count2, count3, count4, 0, 0, refs);
+                                 count1, count2, count3, count4, 
+                                 ntotal, nprim, refs);
     return;
   }
   if (edep <= 0) { 
@@ -484,12 +522,14 @@ AliFMDHitDigitizer::AddDigit(UShort_t        detector,
                    detector, ring, sector, strip));
     return;
   }
-  AliFMDDebug(15, ("Adding digit for FMD%d%c[%2d,%3d] = (%x,%x,%x,%x) [%d/%d]",
+  AliFMDDebug(15, ("Adding sdigit for FMD%d%c[%2d,%3d] = "
+                  "(%x,%x,%x,%x) [%d/%d] %d",
                   detector, ring, sector, strip, 
-                  count1, count2, count3, count4, nprim, ntotal));
+                  count1, count2, count3, count4, nprim, ntotal, refs.fN));
   fFMD->AddSDigitByFields(detector, ring, sector, strip, edep,
                          count1, count2, count3, count4, 
-                         ntotal, nprim, refs);
+                         ntotal, nprim, fStoreTrackRefs ? refs.fArray : 0);
+  if (fStoreTrackRefs && nprim > 3) fIgnoredLabels += nprim - 3;
 }
 
 //____________________________________________________________________
@@ -524,8 +564,13 @@ AliFMDHitDigitizer::CheckDigit(AliFMDDigit*    digit,
 
 //____________________________________________________________________
 void
-AliFMDHitDigitizer::StoreDigits(AliLoader* loader)
+AliFMDHitDigitizer::StoreDigits(const AliLoader* loader)
 {
+  /** 
+   * Store the data using the loader 
+   *
+   * @param loader The loader 
+   */
   if (fOutput == kDigits) { 
     AliFMDBaseDigitizer::StoreDigits(loader);
     return;