/* $Id$ */
+/* History of cvs commits:
+ *
+ * $Log$
+ * Revision 1.24 2006/08/28 10:01:56 kharlov
+ * Effective C++ warnings fixed (Timur Pocheptsov)
+ *
+ * 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 October 2000
// --- ROOT system ---
-#include "TPad.h"
-#include "TH2.h"
+
#include "TMath.h"
-#include "TCanvas.h"
#include "TClonesArray.h"
// --- Standard library ---
// --- AliRoot header files ---
-
+#include "AliLog.h"
+#include "AliPHOSGeometry.h"
+#include "AliPHOSDigit.h"
#include "AliPHOSCpvRecPoint.h"
#include "AliPHOSLoader.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()
}
//______________________________________________________________________________
-void AliPHOSCpvRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) 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
}
//____________________________________________________________________________
-void AliPHOSCpvRecPoint::EvalAll(Float_t logWeight,TClonesArray * digits)
+void AliPHOSCpvRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits)
{
- // wraps other methods
AliPHOSEmcRecPoint::EvalAll(logWeight,digits) ;
EvalClusterLengths(digits) ;
}
//____________________________________________________________________________
-void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight,TClonesArray * digits)
+void AliPHOSCpvRecPoint::EvalAll(Float_t logWeight, TVector3 &vtx, TClonesArray * digits)
+{
+ // wraps other methods
+ AliPHOSEmcRecPoint::EvalAll(logWeight,vtx,digits) ;
+}
+//____________________________________________________________________________
+void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight, TVector3 & /*vtx */, TClonesArray * digits)
{
// Calculates the center of gravity in the local PHOS-module coordinates
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) {
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.) ;
}
}
-
-
//____________________________________________________________________________
-void AliPHOSCpvRecPoint::Print(Option_t * option)
+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() ) ;
}