/* $Id$ */
+/* History of cvs commits:
+ *
+ * $Log$
+ */
+
//_________________________________________________________________________
// RecPoint implementation for PHOS-EMC
// An EmcRecPoint is a cluster of digits
// --- ROOT system ---
-#include "TPad.h"
#include "TH2.h"
#include "TMath.h"
#include "TCanvas.h"
// --- Standard library ---
// --- AliRoot header files ---
-
+#include "AliLog.h"
+#include "AliPHOSLoader.h"
#include "AliGenerator.h"
#include "AliPHOSGeometry.h"
+#include "AliPHOSDigit.h"
#include "AliPHOSEmcRecPoint.h"
-#include "AliRun.h"
-#include "AliPHOSGetter.h"
-
+
ClassImp(AliPHOSEmcRecPoint)
//____________________________________________________________________________
if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists
fMaxDigit*=2 ;
- Int_t * tempo = new ( Int_t[fMaxDigit] ) ;
- Float_t * tempoE = new ( Float_t[fMaxDigit] ) ;
+ Int_t * tempo = new Int_t[fMaxDigit];
+ Float_t * tempoE = new Float_t[fMaxDigit];
Int_t index ;
for ( index = 0 ; index < fMulDigit ; index++ ){
}
delete [] fDigitsList ;
- fDigitsList = new ( Int_t[fMaxDigit] ) ;
+ fDigitsList = new Int_t[fMaxDigit];
delete [] fEnergyList ;
- fEnergyList = new ( Float_t[fMaxDigit] ) ;
+ fEnergyList = new Float_t[fMaxDigit];
for ( index = 0 ; index < fMulDigit ; index++ ){
fDigitsList[index] = tempo[index] ;
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 px, Int_t py) 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) ;
EvalDispersion(logWeight, digits) ;
EvalCoreEnergy(logWeight, digits);
EvalTime(digits) ;
- AliPHOSRecPoint::EvalAll(logWeight,digits) ;
+ AliPHOSRecPoint::EvalAll(digits) ;
}
//____________________________________________________________________________
void AliPHOSEmcRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * 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
}
//____________________________________________________________________________
-Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(const Float_t H) const
+Int_t AliPHOSEmcRecPoint::GetMultiplicityAtLevel(Float_t H) const
{
// Calculates the multiplicity of digits with energy larger than H*energy
digit = maxAt[iDigit] ;
for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {
+ if(iDigit == iDigitN)
+ continue ;
+
digitN = (AliPHOSDigit *) digits->At(fDigitsList[iDigitN]) ;
if ( AreNeighbours(digit, digitN) ) {
void AliPHOSEmcRecPoint::Purify(Float_t threshold){
//Removes digits below threshold
- Int_t * tempo = new ( Int_t[fMaxDigit] ) ;
- Float_t * tempoE = new ( Float_t[fMaxDigit] ) ;
+ Int_t * tempo = new Int_t[fMaxDigit];
+ Float_t * tempoE = new Float_t[fMaxDigit];
Int_t mult = 0 ;
for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
fMulDigit = mult ;
delete [] fDigitsList ;
delete [] fEnergyList ;
- fDigitsList = new (Int_t[fMulDigit]) ;
- fEnergyList = new ( Float_t[fMulDigit]) ;
+ fDigitsList = new Int_t[fMulDigit];
+ fEnergyList = new Float_t[fMulDigit];
fAmp = 0.; //Recalculate total energy
for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
}
//____________________________________________________________________________
-void AliPHOSEmcRecPoint::Print(Option_t * option) const
+void AliPHOSEmcRecPoint::Print(Option_t *) const
{
// Print the list of digits belonging to the cluster
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() ) ;
}