]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSGeometry.cxx
Compilation warnings fixed
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeometry.cxx
index 5e0b93df7288756d5452c6533336792c00d17ef4..d50991e6229d935b684a6d13755eab6b74cdba2c 100644 (file)
@@ -35,7 +35,6 @@
 
 // --- Standard library ---
 
-#include <iostream.h>
 #include <stdlib.h>
 
 // --- AliRoot header files ---
@@ -66,9 +65,12 @@ void AliPHOSGeometry::Init(void)
 {
   // 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
   
+  TString test(GetName()) ; 
+  if (test != "IHEP" ) {
+    Fatal("Init", "%s is not a known geometry (choose among IHEP)", test.Data() ) ; 
+  }
+
   fgInit     = kTRUE ; 
   
   fNModules     = 5;
@@ -102,13 +104,12 @@ void AliPHOSGeometry::Init(void)
   
 }
 
-
 //____________________________________________________________________________
 AliPHOSGeometry *  AliPHOSGeometry::GetInstance() 
 { 
   // Returns the pointer of the unique instance; singleton specific
   
-  return (AliPHOSGeometry *) fgGeom ; 
+  return static_cast<AliPHOSGeometry *>( fgGeom ) ; 
 }
 
 //____________________________________________________________________________
@@ -133,10 +134,8 @@ AliPHOSGeometry *  AliPHOSGeometry::GetInstance(const Text_t* name, const Text_t
     }
   }
   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 ; 
   } 
@@ -148,12 +147,11 @@ void AliPHOSGeometry::SetPHOSAngles()
 { 
   // Calculates the position of the PHOS modules in ALICE global coordinate system
   
-  Double_t const kRADDEG = 180.0 / kPI ;
+  Double_t const kRADDEG = 180.0 / TMath::Pi() ;
   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;
@@ -211,7 +209,7 @@ void AliPHOSGeometry::EmcModuleCoverage(const Int_t mod, Double_t & tm, Double_t
   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. ;
       }
 
@@ -246,7 +244,7 @@ void AliPHOSGeometry::EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t
   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. ;
       }
 
@@ -277,7 +275,7 @@ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TM
     }  
 
   Float_t phi           = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ; 
-  Double_t const kRADDEG = 180.0 / kPI ;
+  Double_t const kRADDEG = 180.0 / TMath::Pi() ;
   Float_t rphi          = phi / kRADDEG ; 
   
   TRotation rot ;
@@ -285,6 +283,7 @@ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TM
   
   TRotation dummy = rot.Invert() ;  // to transform from original frame to rotate frame
   gpos.Transform(rot) ; // rotate the baby 
+  gmat = 0;             // Not implemented yet
 
 }
 
@@ -307,7 +306,7 @@ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) co
     }  
 
   Float_t phi           = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ; 
-  Double_t const kRADDEG = 180.0 / kPI ;
+  Double_t const kRADDEG = 180.0 / TMath::Pi() ;
   Float_t rphi          = phi / kRADDEG ; 
   
   TRotation rot ;
@@ -343,6 +342,17 @@ void AliPHOSGeometry::ImpactOnEmc(const Double_t theta, const Double_t phi, Int_
   }
 }
 
+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
 {
@@ -399,7 +409,7 @@ void AliPHOSGeometry::RelPosInAlice(const Int_t id, TVector3 & pos ) const
     pos.SetY(y0) ;
     
     Float_t phi           = GetPHOSAngle( phosmodule) ; 
-    Double_t const kRADDEG = 180.0 / kPI ;
+    Double_t const kRADDEG = 180.0 / TMath::Pi() ;
     Float_t rphi          = phi / kRADDEG ; 
     
     TRotation rot ;
@@ -420,9 +430,9 @@ void AliPHOSGeometry::RelPosInModule(const Int_t * relid, Float_t & x, Float_t &
   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 of 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