]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSCpvRecPoint.cxx
Forward declaration
[u/mrichter/AliRoot.git] / PHOS / AliPHOSCpvRecPoint.cxx
index ff04696f8b75cb5a25a6481e025880ec46f31340..29b54b4b567aa7e020a07e117234314a8eb06acb 100644 (file)
 
 /* $Id$ */
 
+/* History of cvs commits:
+ *
+ * $Log$
+ * Revision 1.23  2005/12/20 14:28:47  hristov
+ * Additional protection
+ *
+ * Revision 1.22  2005/05/28 14:19:04  schutz
+ * Compilation warnings fixed by T.P.
+ *
+ */
+
 //_________________________________________________________________________
 //  RecPoint implementation for PHOS-CPV
 //  An CpvRecPoint is a cluster of digits   
@@ -30,6 +41,7 @@
 // --- Standard library ---
 
 // --- AliRoot header files ---
+#include "AliLog.h"
 #include "AliPHOSGeometry.h" 
 #include "AliPHOSDigit.h"
 #include "AliPHOSCpvRecPoint.h"
 ClassImp(AliPHOSCpvRecPoint)
 
 //____________________________________________________________________________
-AliPHOSCpvRecPoint::AliPHOSCpvRecPoint() : AliPHOSEmcRecPoint()
+AliPHOSCpvRecPoint::AliPHOSCpvRecPoint() : 
+  AliPHOSEmcRecPoint(),
+  fLengX(-1),
+  fLengZ(-1)
 {
   // ctor
-
-  fLengX = -1;
-  fLengZ = -1;
 }
 
 //____________________________________________________________________________
-AliPHOSCpvRecPoint::AliPHOSCpvRecPoint(const char * opt) : AliPHOSEmcRecPoint(opt)
+AliPHOSCpvRecPoint::AliPHOSCpvRecPoint(const char * opt) : 
+  AliPHOSEmcRecPoint(opt),
+  fLengX(-1),
+  fLengZ(-1)
 {
    // ctor
-   fLengX = -1;
-   fLengZ = -1;
- }
+}
 
 //____________________________________________________________________________
 AliPHOSCpvRecPoint::~AliPHOSCpvRecPoint()
@@ -130,7 +142,7 @@ Int_t AliPHOSCpvRecPoint::Compare(const TObject * obj) const
 }
 
 //______________________________________________________________________________
-void AliPHOSCpvRecPoint::ExecuteEvent(Int_t, Int_t, Int_t ) const
+void AliPHOSCpvRecPoint::ExecuteEvent(Int_t, Int_t, Int_t ) /*const*/
 {
 //   // Execute action corresponding to one event
 //   //  This member function is called when a AliPHOSRecPoint is clicked with the locator
@@ -269,10 +281,14 @@ void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight,TClonesArray * digi
     Float_t zi ;
     phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
     phosgeom->RelPosInModule(relid, xi, zi);
-    Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
-    x    += xi * w ;
-    z    += zi * w ;
-    wtot += w ;
+    if (fAmp>0 && fEnergyList[iDigit]>0) {
+      Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
+      x    += xi * w ;
+      z    += zi * w ;
+      wtot += w ;
+    }
+    else
+      AliError(Form("Wrong energy %f and/or amplitude %f\n", fEnergyList[iDigit], fAmp));
   }
 
   if (wtot != 0) {
@@ -282,7 +298,7 @@ void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight,TClonesArray * digi
     x = -1e6 ;
     z = -1e6 ;
     if (fMulDigit != 0) 
-      Warning(":EvalLocalPosition", "Too low log weight factor to evaluate cluster's center" ) ;
+      AliWarning(Form("Too low log weight factor to evaluate cluster's center" )) ;
   }
   fLocPos.SetX(x)  ;
   fLocPos.SetY(0.) ;
@@ -340,28 +356,28 @@ void AliPHOSCpvRecPoint::EvalClusterLengths(TClonesArray * digits)
 
 
 //____________________________________________________________________________
-void AliPHOSCpvRecPoint::Print(
+void AliPHOSCpvRecPoint::Print(const Option_t *) const
 {
   // Print the list of digits belonging to the cluster
   
   TString message ; 
   message  =  "AliPHOSCpvRecPoint: " ;
   message +=  "Digits #   " ;
-  Info("Print", message.Data()) ; 
+  AliInfo(Form(message.Data())) ; 
   
   Int_t iDigit;
 
   for(iDigit=0; iDigit<fMulDigit; iDigit++) 
-    Info("Print", " %d ", fDigitsList[iDigit]) ; 
+    printf(" %d \n", fDigitsList[iDigit]) ; 
 
-  Info("Print", "Energies: ")  ;
+  printf("Energies: \n")  ;
   for(iDigit=0; iDigit<fMulDigit; iDigit++) 
-    Info("Print", " %f ", fEnergyList[iDigit]) ; 
+    printf(" %f ", fEnergyList[iDigit]) ; 
   
   message  = "       Multiplicity    = %d\n" ;
   message += "       Cluster Energy  = %f\n" ;
   message += "       Stored at position %d\n" ; 
  
-  Info("Print", message.Data(), fMulDigit, fAmp, GetIndexInList() ) ; 
+  printf(message.Data(), fMulDigit, fAmp, GetIndexInList() ) ; 
 
 }