// --- Standard library ---
-#include <iostream.h>
#include <stdlib.h>
// --- AliRoot header files ---
if (fRotMatrixArray) fRotMatrixArray->Delete() ;
if (fRotMatrixArray) delete fRotMatrixArray ;
- if (fPHOSAngle ) delete fPHOSAngle ;
+ if (fPHOSAngle ) delete[] fPHOSAngle ;
}
//____________________________________________________________________________
// Initializes the PHOS parameters :
// IHEP is the Protvino CPV (cathode pad chambers)
// GPS2 is the Subatech Pre-Shower (two micromegas sandwiching a passive lead converter)
- // MIXT 4 PHOS modules withe the IHEP CPV qnd one PHOS module with the Subatche Pre-Shower
+ // MIXT 4 PHOS modules withe the IHEP CPV and one PHOS module with the Subatech Pre-Shower
+ TString test(GetName()) ;
+ if (test != "IHEP" && test != "GPS2" && test != "MIXT") {
+ Error("Init", "%s is not a known geometry (choose among IHEP, GPS2 and MIXT)", test.Data() ) ;
+ abort() ;
+ }
+
fgInit = kTRUE ;
fNModules = 5;
}
-
//____________________________________________________________________________
AliPHOSGeometry * AliPHOSGeometry::GetInstance()
{
// Returns the pointer of the unique instance; singleton specific
- return (AliPHOSGeometry *) fgGeom ;
+ return static_cast<AliPHOSGeometry *>( fgGeom ) ;
}
//____________________________________________________________________________
}
}
else {
- if ( strcmp(fgGeom->GetName(), name) != 0 ) {
- cout << "AliPHOSGeometry <E> : current geometry is " << fgGeom->GetName() << endl
- << " you cannot call " << name << endl ;
- }
+ if ( strcmp(fgGeom->GetName(), name) != 0 )
+ ::Error("GetInstance", "Current geometry is %s. You cannot call %s", fgGeom->GetName(), name) ;
else
rv = (AliPHOSGeometry *) fgGeom ;
}
Float_t pphi = 2 * TMath::ATan( GetOuterBoxSize(0) / ( 2.0 * GetIPtoUpperCPVsurface() ) ) ;
pphi *= kRADDEG ;
if (pphi > fAngle){
- cout << "AliPHOSGeometry: PHOS modules overlap!\n";
- cout << "pphi = " << pphi << " fAngle " << fAngle << endl ;
+ Error("SetPHOSAngles", "PHOS modules overlap!\n pphi = %f fAngle = %f", pphi, fAngle);
}
pphi = fAngle;
else if ( opt == Degre() )
conv = 180. / TMath::Pi() ;
else {
- cout << "<I> AliPHOSGeometry::EmcXtalCoverage : " << opt << " unknown option; result in radian " << endl ;
+ Warning("EmcModuleCoverage", "%s unknown option; result in radian", opt) ;
conv = 1. ;
}
else if ( opt == Degre() )
conv = 180. / TMath::Pi() ;
else {
- cout << "<I> AliPHOSGeometry::EmcXtalCoverage : " << opt << " unknown option; result in radian " << endl ;
+ Warning("EmcXtalCoverage", "%s unknown option; result in radian", opt) ;
conv = 1. ;
}
}
}
+Bool_t AliPHOSGeometry::Impact(const TParticle * particle) const
+{
+ Bool_t In=kFALSE;
+ Int_t ModuleNumber=0;
+ Double_t z,x;
+ ImpactOnEmc(particle->Theta(),particle->Phi(),ModuleNumber,z,x);
+ if(ModuleNumber) In=kTRUE;
+ else In=kFALSE;
+ return In;
+}
+
//____________________________________________________________________________
Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * relid, Int_t & AbsId) const
{
// Converts the relative numbering into the local PHOS-module (x, z) coordinates
// Note: sign of z differs from that in the previous version (Yu.Kharlov, 12 Oct 2000)
- Int_t row = relid[2] ; //offset along x axiz
- Int_t column = relid[3] ; //offset along z axiz
+ Int_t row = relid[2] ; //offset along x axis
+ Int_t column = relid[3] ; //offset along z axis
- if ( relid[1] == 0 ) { // its a PbW04 crystal
- x = - ( GetNPhi()/2. - row + 0.5 ) * GetCrystalSize(0) ; // position ox Xtal with respect
- z = ( GetNZ() /2. - column + 0.5 ) * GetCrystalSize(2) ; // of center of PHOS module
+ if ( relid[1] == 0 ) { // its a PbW04 crystal
+ x = - ( GetNPhi()/2. - row + 0.5 ) * GetCellStep() ; // position of Xtal with respect
+ z = ( GetNZ() /2. - column + 0.5 ) * GetCellStep() ; // of center of PHOS module
}
else {
x = - ( GetNumberOfCPVPadsPhi()/2. - row - 0.5 ) * GetPadSizePhi() ; // position of pad with respect