]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFDigitizer.cxx
Added graphical reference to help DQM shifter. Updated sim TOF QA histograms. (F...
[u/mrichter/AliRoot.git] / TOF / AliTOFDigitizer.cxx
index 9711df7ef91f169aec86212e2f7695c32d96dafc..4d6203cc8e94579d59d81b521ae0ca4bd2d95424 100644 (file)
@@ -97,10 +97,15 @@ AliTOFDigitizer::AliTOFDigitizer(const AliTOFDigitizer &source):
   AliTOFDigitizer& AliTOFDigitizer::operator=(const AliTOFDigitizer &source)
 {
   // ass. op.
-  this->fDigits=source.fDigits;
-  this->fSDigitsArray=source.fSDigitsArray;
-  this->fhitMap=source.fhitMap;
-  this->fCalib=source.fCalib;
+  
+  if (this == &source)
+    return *this;
+
+  AliDigitizer::operator=(source);
+  fDigits=source.fDigits;
+  fSDigitsArray=source.fSDigitsArray;
+  fhitMap=source.fhitMap;
+  fCalib=source.fCalib;
   return *this;
 
 }
@@ -153,25 +158,6 @@ void AliTOFDigitizer::Exec(Option_t* /*option*/)
      return;
    }
    
-  /*
-  outrl->CdGAFile();
-  TFile *in=(TFile*)gFile;
-  TDirectory *savedir=gDirectory;
-
-   
-  //when fGeom was needed
-
-  if (!in->IsOpen()) {
-    AliWarning("Geometry file is not open default  TOF geometry will be used");
-    fGeom = new AliTOFGeometry();
-  }
-  else {
-    in->cd();
-    fGeom = (AliTOFGeometry*)in->Get("TOFgeometry");
-  }
-  
-  savedir->cd();
-  */
   AliLoader* outgime = outrl->GetLoader("TOFLoader");
   if (outgime == 0x0)
    {
@@ -209,7 +195,11 @@ void AliTOFDigitizer::Exec(Option_t* /*option*/)
   fSDigitsArray->Clear();
 
   treeD->Fill();
+
+  AliDebug(2,"----------------------------------------");
+  AliDebug(1,Form("%d digits have been created", fDigits->GetEntriesFast()));
+  AliDebug(2,"----------------------------------------");
+
   outgime->WriteDigits("OVERWRITE");
   outgime->UnloadDigits();
   fDigits->Clear();
@@ -256,16 +246,13 @@ void AliTOFDigitizer::CreateDigits()
     // in the while, I perform QA
     Bool_t isSDigitBad = (sector<0 || sector>17 || plate<0 || plate >4 || padz<0 || padz>1 || padx<0 || padx>47);
     
-    if (isSDigitBad) {
-      //AliFatal("strange sdigit found");
-      AliFatal(Form("strange sdigit found   %3i  %2i  %2i  %3i    %3i", sector, plate, padz, padx, strip));
-    }
+    if (isSDigitBad)
+      AliFatal(Form("strange sdigit found   %2d  %1d  %2d  %1d %2d", sector, plate, strip, padz, padx));
     //-------------------------------------------------------
     
     //------------------- Dump section ----------------------
-    if(k<ndump){
-      AliInfo(Form("%2i-th | Sector %2i | Plate %1i | Strip %2i | PadZ %1i | PadX %2i ", k, sector, plate, strip, padz, padx));
-      AliInfo(Form("%2i-th", k));
+    if (k<ndump) {
+      AliInfo(Form("%2d-th digit: Sector %2d | Plate %1d | Strip %2d | PadZ %1d | PadX %2d ", k, sector, plate, strip, padz, padx));
       AliInfo("----------------------------------------------------");
     }
     // ------------------------------------------------------
@@ -295,7 +282,7 @@ void AliTOFDigitizer::CreateDigits()
   } // end loop on sdigits - end digitizing all collected sdigits
 
   //Insert Decalibration 
-  AliInfo("in digitizer, create digits");
+  AliDebug(2,"in digitizer, create digits");
   DecalibrateTOFSignal();
 }
 
@@ -400,7 +387,7 @@ void AliTOFDigitizer::ReadSDigit(Int_t inputFile )
 
 
 //_____________________________________________________________________________
-void AliTOFDigitizer::CollectSDigit(AliTOFSDigit * sdigit)
+void AliTOFDigitizer::CollectSDigit(const AliTOFSDigit * const sdigit)
 {
   //
   // Add a TOF sdigit in container
@@ -415,7 +402,7 @@ void AliTOFDigitizer::CollectSDigit(AliTOFSDigit * sdigit)
 //_____________________________________________________________________________
 void AliTOFDigitizer::InitDecalibration() const {
   //
-  //
+  // Initialize TOF digits decalibration
   //
 
   fCalib->CreateCalArrays();
@@ -536,10 +523,10 @@ void AliTOFDigitizer::DecalibrateTOFSignal(){
       tToT*=1E3; //back to ps  
       Int_t tot=(Int_t)(tToT/AliTOFGeometry::ToTBinWidth());//(factor 1E3 as input ToT is in ns)
       dig->SetToT(tot); 
-      AliDebug(2,Form(" Final Time and ToT (counts): %i: , %i:",dig->GetTdc(),dig->GetToT()));
+      AliDebug(2,Form(" Final Time and ToT (counts): %d: , %d:",dig->GetTdc(),dig->GetToT()));
       if(tdcCorr<0){
-       AliWarning (Form(" The bad Slewed Time(TDC counts)= %i ", tdcCorr)); 
-       AliWarning(Form(" The bad ToT (TDC counts)= %i ", tot)); 
+       AliWarning (Form(" The bad Slewed Time(TDC counts)= %d ", tdcCorr)); 
+       AliWarning(Form(" The bad ToT (TDC counts)= %d ", tot)); 
       }
     }
     else{
@@ -548,16 +535,14 @@ void AliTOFDigitizer::DecalibrateTOFSignal(){
     }
   }
 
-  if(!isToTSimulated){
-    AliDebug(1,"Standard Production, no miscalibrated digits");   
-  }else{
-    if(!misCalibPars){
-    AliDebug(1,"Standard Production, no miscalibrated digits");   
-    }
-    else {
-      AliDebug(1,"Simulating miscalibrated digits");   
-    } 
-  }
+  if(!isToTSimulated)
+    AliDebug(1,"Standard Production, no miscalibrated digits");
+  else
+    if(!misCalibPars)
+      AliDebug(1,"Standard Production, no miscalibrated digits");
+    else
+      AliDebug(1,"Simulating miscalibrated digits");
+
   return;
 }