/* $Id$ */
+/* History of cvs commits:
+ *
+ * $Log$
+ */
+
//_________________________________________________________________________
// RecPoint implementation for PHOS-EMC
// An EmcRecPoint is a cluster of digits
// --- Standard library ---
// --- AliRoot header files ---
+#include "AliLog.h"
#include "AliPHOSLoader.h"
#include "AliGenerator.h"
#include "AliPHOSGeometry.h"
Bool_t aren = kFALSE ;
- AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
Int_t relid1[4] ;
phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ;
Int_t AliPHOSEmcRecPoint::Compare(const TObject * obj) const
{
// Compares two RecPoints according to their position in the PHOS modules
-
- Float_t delta = 1 ; //Width of "Sorting row". If you changibg this
+
+ const Float_t delta = 1 ; //Width of "Sorting row". If you changibg this
//value (what is senseless) change as vell delta in
//AliPHOSTrackSegmentMakerv* and other RecPoints...
Int_t rv ;
return rv ;
}
//______________________________________________________________________________
-void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t) const
+void AliPHOSEmcRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t) /*const*/
{
// Execute action corresponding to one event
// and switched off when the mouse button is released.
- AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
static TGraph * digitgraph = 0 ;
//try to get run loader from default event folder
- AliRunLoader* rn = AliRunLoader::GetRunLoader(AliConfig::fgkDefaultEventFolderName);
+ AliRunLoader* rn = AliRunLoader::GetRunLoader(AliConfig::GetDefaultEventFolderName());
if (rn == 0x0)
{
- Error("ExecuteEvent","Can not find Run Loader in Default Event Folder");
+ AliError(Form("Cannot find Run Loader in Default Event Folder"));
return;
}
AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
if (gime == 0x0)
{
- Error("ExecuteEvent","Can not find PHOS Loader from Run Loader");
+ AliError(Form("Cannot find PHOS Loader from Run Loader"));
return;
}
AliPHOSDigit * digit ;
- AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
// Calculates the center of gravity in the local PHOS-module coordinates
AliPHOSDigit * digit ;
- AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
Int_t iDigit;
AliPHOSDigit * digit ;
- AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
Int_t iDigit;
AliPHOSDigit * digit ;
- AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
Int_t iDigit;
void AliPHOSEmcRecPoint::EvalAll(Float_t logWeight, TClonesArray * digits )
{
// Evaluates all shower parameters
-
EvalLocalPosition(logWeight, digits) ;
EvalElipsAxis(logWeight, digits) ;
EvalMoments(logWeight, digits) ;
AliPHOSDigit * digit ;
- AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
+ AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
Int_t iDigit;
wtot += w ;
}
-
x /= wtot ;
z /= wtot ;
Float_t parb = 6.52 ;
Float_t xo,yo,zo ; //Coordinates of the origin
- gAlice->Generator()->GetOrigin(xo,yo,zo) ;
-
+ //We should check all 3 possibilities to avoid seg.v.
+ if(gAlice && gAlice->GetMCApp() && gAlice->Generator())
+ gAlice->Generator()->GetOrigin(xo,yo,zo) ;
+ else{
+ xo=yo=zo=0.;
+ }
Float_t phi = phosgeom->GetPHOSAngle(relid[0]) ;
//Transform to the local ref.frame
digit = maxAt[iDigit] ;
for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {
+ if(iDigit == iDigitN)
+ continue ;
+
digitN = (AliPHOSDigit *) digits->At(fDigitsList[iDigitN]) ;
if ( AreNeighbours(digit, digitN) ) {
TString message ;
message = "AliPHOSEmcRecPoint:\n" ;
message += " digits # = " ;
- Info("Print", message.Data()) ;
+ AliInfo(Form(message.Data())) ;
Int_t iDigit;
for(iDigit=0; iDigit<fMulDigit; iDigit++)
printf(" %d ", fDigitsList[iDigit] ) ;
- Info("Print", " Energies = ") ;
+ printf(" Energies = ") ;
for(iDigit=0; iDigit<fMulDigit; iDigit++)
printf(" %f ", fEnergyList[iDigit] ) ;
printf("\n") ;
- Info("Print", " Primaries ") ;
+ printf(" Primaries ") ;
for(iDigit = 0;iDigit < fMulTrack; iDigit++)
printf(" %d ", fTracksList[iDigit]) ;
printf("\n") ;
message += " Number of primaries %d" ;
message += " Stored at position %d" ;
- Info("Print", message.Data(), fMulDigit, fAmp, fMulTrack,GetIndexInList() ) ;
+ printf(message.Data(), fMulDigit, fAmp, fMulTrack,GetIndexInList() ) ;
}