]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
A new (final?) geometry developed
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Sep 2001 12:31:19 +0000 (12:31 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Sep 2001 12:31:19 +0000 (12:31 +0000)
PHOS/AliPHOSGeometry.cxx
PHOS/AliPHOSGeometry.h
PHOS/PHOSLinkDef.h

index 132da14fbc4f49f43814583bac62058f8a8b7c54..7e999214a13c133bd3edb848bb568e351a895590 100644 (file)
@@ -24,7 +24,7 @@
 // can be easily implemented 
 // The title is used to identify the version of CPV used.
 //                  
-//*-- Author: Yves Schutz (SUBATECH)
+//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC "KI" & SUBATECH)
 
 // --- ROOT system ---
 
@@ -42,7 +42,7 @@
 
 #include "AliPHOSGeometry.h"
 #include "AliPHOSEMCAGeometry.h" 
-#include "AliPHOSPpsdRecPoint.h"
+#include "AliPHOSRecPoint.h"
 #include "AliConst.h"
 
 ClassImp(AliPHOSGeometry) ;
@@ -60,7 +60,6 @@ AliPHOSGeometry::~AliPHOSGeometry(void)
   if (fRotMatrixArray) delete fRotMatrixArray ; 
   if (fPHOSAngle     ) delete fPHOSAngle ; 
 }
-
 //____________________________________________________________________________
 
 void AliPHOSGeometry::Init(void)
@@ -69,85 +68,51 @@ void AliPHOSGeometry::Init(void)
   //  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
-
-  if ( ((strcmp( fName, "GPS2" ))    == 0) ||
-       ((strcmp( fName, "IHEP" ))    == 0) ||
-       ((strcmp( fName, "MIXT" ))    == 0) ) {
-    fgInit     = kTRUE ; 
-
-    fNModules     = 5;
-    fNPPSDModules = 0;
-    fAngle        = 20;
-
-      fGeometryEMCA = new AliPHOSEMCAGeometry();
-    if      ( ((strcmp( fName, "GPS2" ))  == 0) ) {
-      fGeometryPPSD = new AliPHOSPPSDGeometry();
-      fGeometryCPV  = 0;
-      fNPPSDModules = fNModules;
-    }
-    else if ( ((strcmp( fName, "IHEP" ))  == 0) ) {
-      fGeometryCPV  = new AliPHOSCPVGeometry ();
-      fGeometryPPSD = 0;
-      fNPPSDModules = 0;
-    }
-    else if ( ((strcmp( fName, "MIXT" ))  == 0) ) {
-      fGeometryCPV  = new AliPHOSCPVGeometry ();
-      fGeometryPPSD = new AliPHOSPPSDGeometry();
-      fNPPSDModules = 1;
-    }
-      fGeometrySUPP = new AliPHOSSupportGeometry();
-
-    fPHOSAngle = new Float_t[fNModules] ;
-    Int_t index ;
-    for ( index = 0; index < fNModules; index++ )
+  
+  fgInit     = kTRUE ; 
+  
+  fNModules     = 5;
+  fAngle        = 20;
+  
+  fGeometryEMCA = new AliPHOSEMCAGeometry();
+  
+  fGeometryCPV  = new AliPHOSCPVGeometry ();
+  
+  fGeometrySUPP = new AliPHOSSupportGeometry();
+  
+  fPHOSAngle = new Float_t[fNModules] ;
+  
+  Float_t * emcParams = fGeometryEMCA->GetEMCParams() ;
+  
+  fPHOSParams[0] =  TMath::Max(fGeometryCPV->GetCPVBoxSize(0)/2., 
+                              (emcParams[0]*(fGeometryCPV->GetCPVBoxSize(1)+emcParams[3]) - 
+                               emcParams[1]* fGeometryCPV->GetCPVBoxSize(1))/emcParams[3] ) ;
+  fPHOSParams[1] = emcParams[1] ;
+  fPHOSParams[2] = TMath::Max(emcParams[2], fGeometryCPV->GetCPVBoxSize(2)/2.);
+  fPHOSParams[3] = emcParams[3] + fGeometryCPV->GetCPVBoxSize(1)/2. ;
+  
+  fIPtoUpperCPVsurface = fGeometryEMCA->GetIPtoOuterCoverDistance() - fGeometryCPV->GetCPVBoxSize(1) ;
+  
+  Int_t index ;
+  for ( index = 0; index < fNModules; index++ )
     fPHOSAngle[index] = 0.0 ; // Module position angles are set in CreateGeometry()
-
-    this->SetPHOSAngles() ; 
-    fRotMatrixArray = new TObjArray(fNModules) ; 
-
-    // post the geometry into the appropriate folder
-    TFolder * folder = (TFolder*)gROOT->FindObjectAny("YSAlice/WhiteBoard/Geometry/PHOS"); 
-    if ( !folder ) {
-      cerr << "ERROR: AliPHOSGeometry::Init -> No WhiteBoard/Geometry/PHOS found !" << endl ; 
-      abort();
-    } else {
+  
+  this->SetPHOSAngles() ; 
+  fRotMatrixArray = new TObjArray(fNModules) ; 
+  
+  // post the geometry into the appropriate folder
+  TFolder * folder = (TFolder*)gROOT->FindObjectAny("YSAlice/WhiteBoard/Geometry/PHOS"); 
+  if ( !folder ) {
+    cerr << "ERROR: AliPHOSGeometry::Init -> No WhiteBoard/Geometry/PHOS found !" << endl ; 
+    abort();
+  } else {
     folder->SetOwner() ;
     folder->Add(this) ; 
-    }
-  }
-  else {
-    fgInit = kFALSE ; 
-    cout << "PHOS Geometry setup: option not defined " << fName << endl ; 
-    abort() ; 
   }
+  
 }
 
 
-//____________________________________________________________________________
-Bool_t AliPHOSGeometry::IsInEMC(const Int_t id) const { 
-    Int_t relid[4] ; 
-    AbsToRelNumbering(id, relid) ; 
-    if ( relid[1] == 0 ) 
-      return kTRUE ; 
-    else 
-      return kFALSE ; 
-  }
-
-//____________________________________________________________________________
-Float_t AliPHOSGeometry::GetCPVBoxSize(Int_t index)  const
-{
-  // returns the coarse dimension CPV depending on the CPV option set
-  
-    if      (strcmp(fName,"GPS2") ==0 ) 
-      return fGeometryPPSD->GetCPVBoxSize(index);
-    else if (strcmp(fName,"IHEP")==0) 
-      return fGeometryCPV ->GetCPVBoxSize(index);
-    else if (strcmp(fName,"MIXT")==0) 
-      return TMath::Max(fGeometryCPV ->GetCPVBoxSize(index), fGeometryPPSD->GetCPVBoxSize(index));
-    else                              
-      return 0;
-}  
-
 //____________________________________________________________________________
 AliPHOSGeometry *  AliPHOSGeometry::GetInstance() 
 { 
@@ -194,9 +159,13 @@ void AliPHOSGeometry::SetPHOSAngles()
   // Calculates the position of the PHOS modules in ALICE global coordinate system
   
   Double_t const kRADDEG = 180.0 / kPI ;
-  Float_t pphi =  2 * TMath::ATan( GetOuterBoxSize(0)  / ( 2.0 * GetIPtoOuterCoverDistance() ) ) ;
+  Float_t pphi =  2 * TMath::ATan( GetOuterBoxSize(0)  / ( 2.0 * GetIPtoUpperCPVsurface() ) ) ;
   pphi *= kRADDEG ;
-  if (pphi > fAngle) cout << "AliPHOSGeometry: PHOS modules overlap!\n";
+  if (pphi > fAngle){ 
+    cout << "AliPHOSGeometry: PHOS modules overlap!\n";
+    cout <<  "pphi = " << pphi << " fAngle  " << fAngle << endl ;
+
+  }
   pphi = fAngle;
   
   for( Int_t i = 1; i <= fNModules ; i++ ) {
@@ -211,66 +180,32 @@ Bool_t AliPHOSGeometry::AbsToRelNumbering(const Int_t AbsId, Int_t * relid) cons
   // Converts the absolute numbering into the following array/
   //  relid[0] = PHOS Module number 1:fNModules 
   //  relid[1] = 0 if PbW04
-  //           = PPSD Module number 1:fNumberOfModulesPhi*fNumberOfModulesZ*2 (2->up and bottom level)
-  //  relid[2] = Row number inside a PHOS or PPSD module
-  //  relid[3] = Column number inside a PHOS or PPSD module
+  //           = -1 if CPV
+  //  relid[2] = Row number inside a PHOS module
+  //  relid[3] = Column number inside a PHOS module
 
   Bool_t rv  = kTRUE ; 
   Float_t id = AbsId ;
 
-  Int_t phosmodulenumber = (Int_t)TMath:: Ceil( id / ( GetNPhi() * GetNZ() ) ) ; 
+  Int_t phosmodulenumber = (Int_t)TMath:: Ceil( id / GetNCristalsInModule() ) ; 
   
-  if ( phosmodulenumber >  GetNModules() ) { // it is a PPSD or CPV pad
-
-    if      ( strcmp(fName,"GPS2") == 0 ) {
-      id -=  GetNPhi() * GetNZ() *  GetNModules() ; 
-      Float_t tempo = 2 *  GetNumberOfModulesPhi() * GetNumberOfModulesZ() *  GetNumberOfPadsPhi() * GetNumberOfPadsZ() ; 
-      relid[0] = (Int_t)TMath::Ceil( id / tempo ) ; 
-      id -= ( relid[0] - 1 ) * tempo ;
-      relid[1] = (Int_t)TMath::Ceil( id / ( GetNumberOfPadsPhi() * GetNumberOfPadsZ() ) ) ; 
-      id -= ( relid[1] - 1 ) * GetNumberOfPadsPhi() * GetNumberOfPadsZ() ;
-      relid[2] = (Int_t)TMath::Ceil( id / GetNumberOfPadsPhi() ) ;
-      relid[3] = (Int_t) ( id - ( relid[2] - 1 )  * GetNumberOfPadsPhi() ) ; 
-    }
-    else if ( strcmp(fName,"IHEP") == 0 ) {
-      id -=  GetNPhi() * GetNZ() *  GetNModules() ; 
-      Float_t nCPV  = GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ() ;
-      relid[0] = (Int_t) TMath::Ceil( id / nCPV ) ;
-      relid[1] = 1 ;
-      id -= ( relid[0] - 1 ) * nCPV ; 
-      relid[2] = (Int_t) TMath::Ceil( id / GetNumberOfCPVPadsZ() ) ;
-      relid[3] = (Int_t) ( id - ( relid[2] - 1 ) * GetNumberOfCPVPadsZ() ) ; 
-    }
-    else if ( strcmp(fName,"MIXT") == 0 ) {
-      id -=  GetNPhi() * GetNZ() *  GetNModules() ; 
-      Float_t nPPSD = 2 * GetNumberOfModulesPhi() * GetNumberOfModulesZ() *  GetNumberOfPadsPhi() * GetNumberOfPadsZ() ; 
-      Float_t nCPV  = GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ() ;
-      if (id <= nCPV*GetNCPVModules()) { // this pad belons to CPV
-       relid[0] = (Int_t) TMath::Ceil( id / nCPV ) ;
-       relid[1] = 1 ;
-       id -= ( relid[0] - 1 ) * nCPV ; 
-       relid[2] = (Int_t) TMath::Ceil( id / GetNumberOfCPVPadsZ() ) ;
-       relid[3] = (Int_t) ( id - ( relid[2] - 1 ) * GetNumberOfCPVPadsZ() ) ; 
-      }
-      else {                             // this pad belons to PPSD
-       id -= nCPV*GetNCPVModules();
-       relid[0] = (Int_t)TMath::Ceil( id / nPPSD ); 
-       id -= ( relid[0] - 1 ) * nPPSD ;
-       relid[0] += GetNCPVModules();
-       relid[1] = (Int_t)TMath::Ceil( id / ( GetNumberOfPadsPhi() * GetNumberOfPadsZ() ) ) ; 
-       id -= ( relid[1] - 1 ) * GetNumberOfPadsPhi() * GetNumberOfPadsZ() ;
-       relid[2] = (Int_t)TMath::Ceil( id / GetNumberOfPadsPhi() ) ;
-       relid[3] = (Int_t) ( id - ( relid[2] - 1 )  * GetNumberOfPadsPhi() ) ; 
-      }
-    }
+  if ( phosmodulenumber >  GetNModules() ) { // it is a CPV pad
+    
+    id -=  GetNPhi() * GetNZ() *  GetNModules() ; 
+    Float_t nCPV  = GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ() ;
+    relid[0] = (Int_t) TMath::Ceil( id / nCPV ) ;
+    relid[1] = -1 ;
+    id -= ( relid[0] - 1 ) * nCPV ; 
+    relid[2] = (Int_t) TMath::Ceil( id / GetNumberOfCPVPadsZ() ) ;
+    relid[3] = (Int_t) ( id - ( relid[2] - 1 ) * GetNumberOfCPVPadsZ() ) ; 
   } 
-  else { // its a PW04 crystal
+  else { // it is a PW04 crystal
 
     relid[0] = phosmodulenumber ;
     relid[1] = 0 ;
     id -= ( phosmodulenumber - 1 ) *  GetNPhi() * GetNZ() ; 
-    relid[2] = (Int_t)TMath::Ceil( id / GetNPhi() ) ;
-    relid[3] = (Int_t)( id - ( relid[2] - 1 ) * GetNPhi() ) ; 
+    relid[2] = (Int_t)TMath::Ceil( id / GetNZ() )  ;
+    relid[3] = (Int_t)( id - ( relid[2] - 1 ) * GetNZ() ) ; 
   } 
   return rv ; 
 }
@@ -290,18 +225,19 @@ void AliPHOSGeometry::EmcModuleCoverage(const Int_t mod, Double_t & tm, Double_t
     conv = 1. ;
       }
 
-  Float_t phi =  GetPHOSAngle(mod) *  (TMath::Pi() / 180.)  ;  
-  Float_t y0  =  GetIPtoOuterCoverDistance() + GetUpperPlateThickness()
-                 + GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness()  ;  
-  
-  Double_t angle = TMath::ATan( GetCrystalSize(0)*GetNPhi() / (2 * y0) ) ;
-  phi = phi + 1.5 * TMath::Pi() ; // to follow the convention of the particle generator(PHOS is between 230 and 310 deg.)
+  Float_t phi = GetPHOSAngle(mod) *  (TMath::Pi() / 180.)  ;  
+  Float_t y0  = GetIPtoCrystalSurface() ; 
+  Float_t * strip = fGeometryEMCA->GetStripHalfSize() ;
+  Float_t x0  = fGeometryEMCA->GetNStripX()*strip[0] ;
+  Float_t z0  = fGeometryEMCA->GetNStripZ()*strip[2] ;
+  Double_t angle = TMath::ATan( x0 / y0 ) ;
+  phi = phi + 1.5 * TMath::Pi() ; // to follow the convention of the particle generator(PHOS is between 220 and 320 deg.)
   Double_t max  = phi - angle ;
   Double_t min   = phi + angle ;
   pM = TMath::Max(max, min) * conv ;
   pm = TMath::Min(max, min) * conv ; 
   
-  angle =  TMath::ATan( GetCrystalSize(2)*GetNZ() / (2 * y0) ) ;
+  angle =  TMath::ATan( z0 /  y0 ) ;
   max  = TMath::Pi() / 2.  + angle ; // to follow the convention of the particle generator(PHOS is at 90 deg.)
   min  = TMath::Pi() / 2.  - angle ;
   tM = TMath::Max(max, min) * conv ;
@@ -324,8 +260,7 @@ void AliPHOSGeometry::EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t
     conv = 1. ;
       }
 
-  Float_t y0   =  GetIPtoOuterCoverDistance() + GetUpperPlateThickness()
-    + GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness()  ;  
+  Float_t y0  = GetIPtoCrystalSurface() ; 
   theta = 2 * TMath::ATan( GetCrystalSize(2) / (2 * y0) ) * conv ;
   phi   = 2 * TMath::ATan( GetCrystalSize(0) / (2 * y0) ) * conv ;
 }
@@ -343,21 +278,12 @@ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TM
 
 
   if ( tmpPHOS->IsEmc() ) // it is a EMC crystal 
-    {  gpos.SetY( -(GetIPtoOuterCoverDistance() + GetUpperPlateThickness() +
-                   GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness()) ) ;  
+    {  gpos.SetY( - GetIPtoCrystalSurface()) ;  
 
     }
   else
-    { // it is a PPSD pad
-      AliPHOSPpsdRecPoint * tmpPpsd = (AliPHOSPpsdRecPoint *) RecPoint ;
-      if (tmpPpsd->GetUp() ) // it is an upper module
-       {
-         gpos.SetY(-( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() - 
-                      GetLeadToMicro2Gap() - GetLeadConverterThickness() -  
-                      GetMicro1ToLeadGap() - GetMicromegas1Thickness() / 2.0 )  ) ; 
-       } 
-      else // it is a lower module
-       gpos.SetY(-( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() / 2.0) ) ; 
+    { // it is a CPV
+      gpos.SetY(- GetIPtoUpperCPVsurface()  ) ; 
     }  
 
   Float_t phi           = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ; 
@@ -383,20 +309,11 @@ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) co
 
 
   if ( tmpPHOS->IsEmc() ) // it is a EMC crystal 
-    {  gpos.SetY( -(GetIPtoOuterCoverDistance() + GetUpperPlateThickness() +
-                   GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness()) ) ;  
+    {  gpos.SetY( - GetIPtoCrystalSurface()  ) ;  
     }
   else
-    { // it is a PPSD pad
-      AliPHOSPpsdRecPoint * tmpPpsd = (AliPHOSPpsdRecPoint *) RecPoint ;
-      if (tmpPpsd->GetUp() ) // it is an upper module
-       {
-         gpos.SetY(-( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() - 
-                      GetLeadToMicro2Gap() - GetLeadConverterThickness() -  
-                      GetMicro1ToLeadGap() - GetMicromegas1Thickness() / 2.0 )  ) ; 
-       } 
-      else // it is a lower module
-       gpos.SetY(-( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() / 2.0) ) ; 
+    { // it is a CPV
+         gpos.SetY(- GetIPtoUpperCPVsurface()  ) ; 
     }  
 
   Float_t phi           = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ; 
@@ -428,8 +345,7 @@ void AliPHOSGeometry::ImpactOnEmc(const Double_t theta, const Double_t phi, Int_
   }
   if ( ModuleNumber != 0 ) {
     Float_t phi0 =  GetPHOSAngle(ModuleNumber) *  (TMath::Pi() / 180.) + 1.5 * TMath::Pi()  ;  
-    Float_t y0  =  GetIPtoOuterCoverDistance() + GetUpperPlateThickness()
-      + GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness()  ;   
+    Float_t y0  =  GetIPtoCrystalSurface()  ;   
     Double_t angle = phi - phi0; 
     x = y0 * TMath::Tan(angle) ; 
     angle = theta - TMath::Pi() / 2 ; 
@@ -443,47 +359,22 @@ Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * relid, Int_t &  AbsId) c
   // Converts the relative numbering into the absolute numbering
   // EMCA crystals:
   //  AbsId = from 1 to fNModules * fNPhi * fNZ
-  // PPSD gas cell:
-  //  AbsId = from N(total EMCA crystals) + 1
-  //          to NCPVModules * fNumberOfCPVPadsPhi * fNumberOfCPVPadsZ +
-  //          fNModules * 2 * (fNumberOfModulesPhi * fNumberOfModulesZ) * fNumberOfPadsPhi * fNumberOfPadsZ
   // CPV pad:
   //  AbsId = from N(total PHOS crystals) + 1
   //          to NCPVModules * fNumberOfCPVPadsPhi * fNumberOfCPVPadsZ
 
   Bool_t rv = kTRUE ; 
-  if      ( relid[1] > 0 && strcmp(fName,"GPS2")==0) { // it is a PPSD pad
-    AbsId =    GetNPhi() * GetNZ() * GetNModules()                         // the offset to separate EMCA crystals from PPSD pads
-      + ( relid[0] - 1 ) * GetNumberOfModulesPhi() * GetNumberOfModulesZ() // the pads offset of PPSD modules 
-                         * GetNumberOfPadsPhi() * GetNumberOfPadsZ() * 2
-      + ( relid[1] - 1 ) * GetNumberOfPadsPhi() * GetNumberOfPadsZ()       // the pads offset of PPSD modules 
-      + ( relid[2] - 1 ) * GetNumberOfPadsPhi()                            // the pads offset of a PPSD row
-      +   relid[3] ;                                                       // the column number
-  } 
-
-  else if ( relid[1] > 0 && strcmp(fName,"MIXT")==0) { // it is a PPSD pad
-    AbsId =    GetNPhi() * GetNZ() * GetNModules()                         // the offset to separate EMCA crystals from PPSD pads
-      + GetNCPVModules() * GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ() // the pads offset of CPV modules if any
-      + ( relid[0] - 1 - GetNCPVModules())
-                         * GetNumberOfModulesPhi() * GetNumberOfModulesZ() // the pads offset of PPSD modules 
-                         * GetNumberOfPadsPhi() * GetNumberOfPadsZ() * 2
-      + ( relid[1] - 1 ) * GetNumberOfPadsPhi() * GetNumberOfPadsZ()       // the pads offset of PPSD modules 
-      + ( relid[2] - 1 ) * GetNumberOfPadsPhi()                            // the pads offset of a PPSD row
-      +   relid[3] ;                                                       // the column number
-  } 
-
-  else if ( relid[1] ==  0 ) { // it is a Phos crystal
+  
+  if ( relid[1] ==  0 ) {                            // it is a Phos crystal
     AbsId =
-        ( relid[0] - 1 ) * GetNPhi() * GetNZ()                               // the offset of PHOS modules
-      + ( relid[2] - 1 ) * GetNPhi()                                         // the offset of a xtal row
-      +   relid[3] ;                                                         // the column number
+      ( relid[0] - 1 ) * GetNPhi() * GetNZ()         // the offset of PHOS modules
+      + ( relid[2] - 1 ) * GetNZ()                   // the offset along phi
+      +   relid[3] ;                                 // the offset along z
   }
-
-  else if ( relid[1] == -1 ) { // it is a CPV pad
-    AbsId =    GetNPhi() * GetNZ() *  GetNModules()                          // the offset to separate EMCA crystals from CPV pads
-      + ( relid[0] - 1 ) * GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ()         // the pads offset of PHOS modules 
-      + ( relid[2] - 1 ) * GetNumberOfCPVPadsZ()                                // the pads offset of a CPV row
+  else { // it is a CPV pad
+    AbsId =    GetNPhi() * GetNZ() *  GetNModules()         // the offset to separate EMCA crystals from CPV pads
+      + ( relid[0] - 1 ) * GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ()   // the pads offset of PHOS modules 
+      + ( relid[2] - 1 ) * GetNumberOfCPVPadsZ()                             // the pads offset of a CPV row
       +   relid[3] ;                                                         // the column number
   }
   
@@ -495,9 +386,7 @@ Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * relid, Int_t &  AbsId) c
 void AliPHOSGeometry::RelPosInAlice(const Int_t id, TVector3 & pos ) const
 {
   // Converts the absolute numbering into the global ALICE coordinate system
-  // It works only for the GPS2 geometry
   
-  if (id > 0 && strcmp(fName,"GPS2")==0) { 
     
     Int_t relid[4] ;
     
@@ -507,27 +396,17 @@ void AliPHOSGeometry::RelPosInAlice(const Int_t id, TVector3 & pos ) const
     
     Float_t y0 = 0 ; 
     
-    if ( relid[1] == 0 ) { // it is a PbW04 crystal 
-      y0 =  -(GetIPtoOuterCoverDistance() + GetUpperPlateThickness()
-             + GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness())  ;  
-    }
-    if ( relid[1] > 0 ) { // its a PPSD pad
-      if ( relid[1] >  GetNumberOfModulesPhi() *  GetNumberOfModulesZ() ) { // its an bottom module
-       y0 = -( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() / 2.0)  ;
-      } 
-      else // its an upper module
-       y0 = -( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() - GetLeadToMicro2Gap()
-               -  GetLeadConverterThickness() -  GetMicro1ToLeadGap() - GetMicromegas1Thickness() / 2.0) ; 
-    }
-    
+    if ( relid[1] == 0 )  // it is a PbW04 crystal 
+      y0 =  - GetIPtoCrystalSurface() ;  
+    else
+      y0 =  - GetIPtoUpperCPVsurface() ; 
+
     Float_t x, z ; 
     RelPosInModule(relid, x, z) ; 
     
     pos.SetX(x) ;
     pos.SetZ(z) ;
-    pos.SetY(- TMath::Sqrt(x*x + z*z + y0*y0) ) ; 
-    
-    
+    pos.SetY(y0) ;
     
     Float_t phi           = GetPHOSAngle( phosmodule) ; 
     Double_t const kRADDEG = 180.0 / kPI ;
@@ -538,15 +417,7 @@ void AliPHOSGeometry::RelPosInAlice(const Int_t id, TVector3 & pos ) const
     
     TRotation dummy = rot.Invert() ;  // to transform from original frame to rotate frame
     
-    cout << "before X,Y,Z " << pos.X() << endl << pos.Y() << endl << pos.Z() << endl;
     pos.Transform(rot) ; // rotate the baby 
-    cout << "X,Y,Z " << pos.X() << endl << pos.Y() << endl << pos.Z() << endl;
-  }
-  else {
-    pos.SetX(0.);
-    pos.SetY(0.);
-    pos.SetZ(0.);
-  }
 } 
 
 //____________________________________________________________________________
@@ -554,53 +425,17 @@ void AliPHOSGeometry::RelPosInModule(const Int_t * relid, Float_t & x, Float_t &
 {
   // 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)
-
-  Bool_t padOfCPV  = (strcmp(fName,"IHEP")==0) ||
-                    ((strcmp(fName,"MIXT")==0) && relid[0]<=GetNCPVModules()) ;
-  Bool_t padOfPPSD = (strcmp(fName,"GPS2")==0) ||
-                    ((strcmp(fName,"MIXT")==0) && relid[0]> GetNCPVModules()) ;
   
-  Int_t ppsdmodule  ; 
-  Float_t x0,z0;
   Int_t row        = relid[2] ; //offset along x axiz
   Int_t column     = relid[3] ; //offset along z axiz
 
-  Float_t padsizeZ = 0;
-  Float_t padsizeX = 0;
-  Int_t   nOfPadsPhi = 0;
-  Int_t   nOfPadsZ   = 0;
-  if      ( padOfPPSD ) {
-    padsizeZ   = GetPPSDModuleSize(2) / GetNumberOfPadsZ();
-    padsizeX   = GetPPSDModuleSize(0) / GetNumberOfPadsPhi();
-    nOfPadsPhi = GetNumberOfPadsPhi();
-    nOfPadsZ   = GetNumberOfPadsZ();
-  }
-  else if ( padOfCPV  ) {
-    padsizeZ   = GetPadSizeZ();
-    padsizeX   = GetPadSizePhi();
-    nOfPadsPhi = GetNumberOfCPVPadsPhi();
-    nOfPadsZ   = GetNumberOfCPVPadsZ();
-  }
   
   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  
   }  
   else  {    
-    if ( padOfPPSD ) {
-      if ( relid[1] >  GetNumberOfModulesPhi() *  GetNumberOfModulesZ() )
-       ppsdmodule =  relid[1]-GetNumberOfModulesPhi() *  GetNumberOfModulesZ(); 
-      else
-       ppsdmodule =  relid[1] ;
-      Int_t modrow = 1+(Int_t)TMath::Ceil( (Float_t)ppsdmodule / GetNumberOfModulesPhi()-1. ) ; 
-      Int_t modcol = ppsdmodule -  ( modrow - 1 ) * GetNumberOfModulesPhi() ;     
-      x0 = (  GetNumberOfModulesPhi() / 2.  - modrow  + 0.5 ) * GetPPSDModuleSize(0) ;
-      z0 = (  GetNumberOfModulesZ()   / 2.  - modcol  + 0.5 ) * GetPPSDModuleSize(2)  ;     
-    } else {
-      x0 = 0;
-      z0 = 0;
-    }
-    x = - ( nOfPadsPhi/2. - row    - 0.5 ) * padsizeX + x0 ; // position of pad  with respect
-    z =   ( nOfPadsZ  /2. - column - 0.5 ) * padsizeZ - z0 ; // of center of PHOS module  
+    x = - ( GetNumberOfCPVPadsPhi()/2. - row    - 0.5 ) * GetPadSizePhi()  ; // position of pad  with respect
+    z =   ( GetNumberOfCPVPadsZ()  /2. - column - 0.5 ) * GetPadSizeZ()  ; // of center of PHOS module  
   }
 }
index e92195f22bdbf228221c0ae45d006314500d90e0..7b511f6891992ae17899ab822b895f3d3ff4ec75 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "AliPHOSEMCAGeometry.h"
 #include "AliPHOSCPVGeometry.h"
-#include "AliPHOSPPSDGeometry.h"
 #include "AliPHOSSupportGeometry.h"
 
 
@@ -63,96 +62,52 @@ public:
  
   // General
 
-  static TString Degre(void) {
-    // a global for degree (deg)
-    return TString("deg") ; 
-  }
+  static TString Degre(void) { return TString("deg") ; }  // a global for degree (deg)
 
-  static TString Radian(void) { 
-    // a global for radian (rad)
-    return TString("rad") ; 
-  }
+  static TString Radian(void){ return TString("rad") ; }  // a global for radian (rad)
 
-  Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) const ; // converts the absolute PHOS numbering to a relative 
+  Bool_t AbsToRelNumbering(const Int_t AbsId, Int_t * RelId) const ; 
+                                          // converts the absolute PHOS numbering to a relative 
 
-  void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt = Radian() ) const ;
-                                                         // calculates the angular coverage in theta and phi of a EMC module
+  void EmcModuleCoverage(const Int_t m, Double_t & tm, Double_t & tM, Double_t & pm, 
+                                         Double_t & pM, Option_t * opt = Radian() ) const ;
+                                         // calculates the angular coverage in theta and phi of a EMC module
   void EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt = Radian() ) const ; 
-                                                         // calculates the angular coverage in theta and phi of a 
-                                                         // single crystal in a EMC module
-
-  void ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, Double_t & z, Double_t & x) const ; 
-                                                         // calculates the impact coordinates of a neutral particle  
-                                                         // emitted in direction theta and phi in ALICE
-  Bool_t IsInEMC(const Int_t id) const ;
-  void   RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) const ; // gets the position of element (pad or Xtal) relative to 
-                                                                         // center of PHOS module  
-  void   RelPosInAlice(const Int_t AbsId, TVector3 &  pos) const ;             // gets the position of element (pad or Xtal) relative to 
-                                                                         // Alice
-  Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ;         // converts the absolute PHOS numbering to a relative 
-
-  Bool_t  IsInitialized(void)                  const { return fgInit ; }  
+                                         // calculates the angular coverage in theta and phi of a  
+                                         // single crystal in a EMC module
+  void ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, 
+                        Double_t & z, Double_t & x) const ; 
+                                         // calculates the impact coordinates of a neutral particle  
+                                         // emitted in direction theta and phi in ALICE
+  void RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) const ; 
+                                         // gets the position of element (pad or Xtal) relative to 
+                                         // center of PHOS module  
+  void RelPosInAlice(const Int_t AbsId, TVector3 &  pos) const ;             
+                                         // gets the position of element (pad or Xtal) relative to Alice
+  Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ;         
+                                         // converts the absolute PHOS numbering to a relative 
+
+  Bool_t IsInitialized(void)                  const { return fgInit ; }  
                                                                        
   // Return general PHOS parameters
-
-  Int_t   GetNModules(void)                    const { return fNModules ; }
-  Int_t   GetNPPSDModules(void)                const { return fNPPSDModules ; }
-  Int_t   GetNCPVModules(void)                 const { return fNModules - fNPPSDModules ; }
-  Float_t GetPHOSAngle(Int_t index)            const { return fPHOSAngle[index-1] ; }
-
-  // Return EMCA geometrical parameters
-
-  Float_t GetOuterBoxSize(Int_t index)         const { return fGeometryEMCA->GetOuterBoxSize(index);            }
-  Float_t GetAirFilledBoxSize(Int_t index)     const { return fGeometryEMCA->GetAirFilledBoxSize(index) ;       }
-  Float_t GetCrystalHolderThickness(void)      const { return fGeometryEMCA->GetCrystalHolderThickness() ;      }
-  Float_t GetCrystalSize(Int_t index)          const { return fGeometryEMCA->GetCrystalSize(index) ;            }
-  Float_t GetCrystalSupportHeight(void)        const { return fGeometryEMCA->GetCrystalSupportHeight() ;        }
-  Float_t GetCrystalWrapThickness(void)        const { return fGeometryEMCA->GetCrystalWrapThickness() ;        }
-  Float_t GetGapBetweenCrystals(void)          const { return fGeometryEMCA->GetGapBetweenCrystals() ;          }
-  Float_t GetIPtoCrystalSurface(void)          const { return fGeometryEMCA->GetIPtoCrystalSurface() ;          }
-  Float_t GetIPtoOuterCoverDistance(void)      const { return fGeometryEMCA->GetIPtoOuterCoverDistance() ;      }
-  Float_t GetLowerThermoPlateThickness(void)   const { return fGeometryEMCA->GetLowerThermoPlateThickness() ;   }
-  Float_t GetLowerTextolitPlateThickness(void) const { return fGeometryEMCA->GetLowerTextolitPlateThickness() ; }
-  Float_t GetModuleBoxThickness(void)          const { return fGeometryEMCA->GetModuleBoxThickness() ;          }
-  Int_t   GetNPhi(void)                        const { return fGeometryEMCA->GetNPhi() ;                        }
-  Int_t   GetNZ(void)                          const { return fGeometryEMCA->GetNZ() ;                          }
-  Float_t GetOuterBoxThickness(Int_t index)    const { return fGeometryEMCA->GetOuterBoxThickness(index) ;      }
-  Float_t GetPinDiodeSize(Int_t index)         const { return fGeometryEMCA->GetPinDiodeSize(index) ;           }
-  Float_t GetSecondUpperPlateThickness(void)   const { return fGeometryEMCA->GetSecondUpperPlateThickness() ;   }
-  Float_t GetSupportPlateThickness(void)       const { return fGeometryEMCA->GetSupportPlateThickness() ;       }
-  Float_t GetTextolitBoxSize(Int_t index)      const { return fGeometryEMCA->GetTextolitBoxSize(index) ;        }
-  Float_t GetTextolitBoxThickness(Int_t index) const { return fGeometryEMCA->GetTextolitBoxThickness(index);    }
-  Float_t GetUpperPlateThickness(void)         const { return fGeometryEMCA->GetUpperPlateThickness() ;         }
-  Float_t GetUpperCoolingPlateThickness(void)  const { return fGeometryEMCA->GetUpperCoolingPlateThickness() ;  }
-
-  // Return PPSD geometrical parameters
-
-  Float_t GetAnodeThickness(void)              const { return fGeometryPPSD->GetAnodeThickness();         }
-  Float_t GetAvalancheGap(void)                const { return fGeometryPPSD->GetAvalancheGap();           }
-  Float_t GetCathodeThickness(void)            const { return fGeometryPPSD->GetCathodeThickness();       }
-  Float_t GetCompositeThickness(void)          const { return fGeometryPPSD->GetCompositeThickness();     }
-  Float_t GetConversionGap(void)               const { return fGeometryPPSD->GetConversionGap();          }
-  Float_t GetLeadConverterThickness(void)      const { return fGeometryPPSD->GetLeadConverterThickness(); }
-  Float_t GetLeadToMicro2Gap(void)             const { return fGeometryPPSD->GetLeadToMicro2Gap();        }
-  Float_t GetLidThickness(void)                const { return fGeometryPPSD->GetLidThickness();           }
-  Float_t GetMicromegas1Thickness(void)        const { return fGeometryPPSD->GetMicromegas1Thickness();   }
-  Float_t GetMicromegas2Thickness(void)        const { return fGeometryPPSD->GetMicromegas2Thickness();   }
-  Float_t GetMicromegasWallThickness(void)     const { return fGeometryPPSD->GetMicromegasWallThickness();}
-  Float_t GetMicro1ToLeadGap(void)             const { return fGeometryPPSD->GetMicro1ToLeadGap();        }
-  Int_t   GetNumberOfModulesPhi(void)          const { return fGeometryPPSD->GetNumberOfModulesPhi();     }
-  Int_t   GetNumberOfModulesZ(void)            const { return fGeometryPPSD->GetNumberOfModulesZ();       }
-  Int_t   GetNumberOfPadsPhi(void)             const { return fGeometryPPSD->GetNumberOfPadsPhi();        }
-  Int_t   GetNumberOfPadsZ(void)               const { return fGeometryPPSD->GetNumberOfPadsZ();          }
-  Float_t GetPCThickness(void)                 const { return fGeometryPPSD->GetPCThickness();            }
-  Float_t GetPhiDisplacement(void)             const { return fGeometryPPSD->GetPhiDisplacement();        }
-  Float_t GetPPSDModuleSize(Int_t index)       const { return fGeometryPPSD->GetPPSDModuleSize(index);    }
-  Float_t GetZDisplacement(void)               const { return fGeometryPPSD->GetZDisplacement();          }
-  void    SetLeadConverterThickness(Float_t x) const {        fGeometryPPSD->SetLeadConverterThickness(x);}
-
-  // Return CPV geometrical parameters
-
+  Int_t    GetNModules(void)                    const { return fNModules ; }
+  Float_t  GetPHOSAngle(Int_t index)            const { return fPHOSAngle[index-1] ; }
+  Float_t* GetPHOSParams(void)                        { return fPHOSParams;}  //Half-sizes of PHOS trapecoid
+  Float_t  GetIPtoUpperCPVsurface(void)         const { return fIPtoUpperCPVsurface ; }
+  Float_t  GetOuterBoxSize(Int_t index)         const { return 2.*fPHOSParams[index]; }
+  Float_t  GetCrystalSize(Int_t index)          const { return fGeometryEMCA->GetCrystalSize(index) ;  }
+
+  // Return EMCA geometry parameters
+
+  AliPHOSEMCAGeometry * GetEMCAGeometry()      const {return fGeometryEMCA ;}
+  Float_t   GetIPtoCrystalSurface(void)        const { return fGeometryEMCA->GetIPtoCrystalSurface() ; }
+  Float_t   GetIPtoOuterCoverDistance(void)    const { return fGeometryEMCA->GetIPtoOuterCoverDistance() ; }
+  Int_t     GetNPhi(void)                      const { return fGeometryEMCA->GetNPhi() ; }
+  Int_t     GetNZ(void)                        const { return fGeometryEMCA->GetNZ() ; }
+  Int_t     GetNCristalsInModule(void)         const { return fGeometryEMCA->GetNPhi() * fGeometryEMCA->GetNZ() ; }
+
+  // Return CPV geometry parameters
   Int_t   GetNumberOfCPVLayers(void)           const { return fGeometryCPV ->GetNumberOfCPVLayers();      }
-  Bool_t  IsLeadConverterExists(void)          const { return fGeometryCPV->IsLeadConverterExists();      }
   Float_t GetCPVActiveSize(Int_t index)        const { return fGeometryCPV->GetCPVActiveSize(index);      }
   Int_t   GetNumberOfCPVChipsPhi(void)         const { return fGeometryCPV->GetNumberOfCPVChipsPhi();     }
   Int_t   GetNumberOfCPVChipsZ(void)           const { return fGeometryCPV->GetNumberOfCPVChipsZ();       }
@@ -166,37 +121,22 @@ public:
   Float_t GetCPVCuNiFoilThickness(void)        const { return fGeometryCPV->GetCPVCuNiFoilThickness();    }
   Float_t GetFTPosition(Int_t index)           const { return fGeometryCPV->GetFTPosition(index);         }
   Float_t GetCPVFrameSize(Int_t index)         const { return fGeometryCPV->GetCPVFrameSize(index);       }
+  Float_t GetCPVBoxSize(Int_t index)           const { return fGeometryCPV ->GetCPVBoxSize(index);        } 
+  Float_t GetIPtoCPVDistance(void)             const { return  GetIPtoOuterCoverDistance() - 
+                                                              GetCPVBoxSize(1) - 1.0; }
 
-  // Common PPSD and CPV parameters
-
-  Float_t GetCPVBoxSize(Int_t index)  const ;
-
-  // Mixed EMCA and PPSD parameters
-
-  Float_t GetIPtoPpsdUp(void)                  const {
-    return (GetIPtoOuterCoverDistance() - GetCPVBoxSize(1) + GetPPSDModuleSize(1)/2 ); } 
-  Float_t GetIPtoTopLidDistance(void)          const { 
-    return  GetIPtoOuterCoverDistance() - GetCPVBoxSize(1) - 1. ; } 
-  Float_t GetIPtoPpsdLow(void)                 const { 
-    return (GetIPtoOuterCoverDistance() - GetPPSDModuleSize(1)/2 ); } 
-
-  // Mixed EMCA and CPV parameters
-
-  Float_t GetIPtoCPVDistance(void)             const {
-    return  GetIPtoOuterCoverDistance() - GetCPVBoxSize(1) - 1.0; }
-
-  // Return PHOS' support geometrical parameters
+  // Return PHOS' support geometry parameters
 
   Float_t GetRailOuterSize(Int_t index)  const { return fGeometrySUPP->GetRailOuterSize(index); }
   Float_t GetRailPart1    (Int_t index)  const { return fGeometrySUPP->GetRailPart1    (index); }
   Float_t GetRailPart2    (Int_t index)  const { return fGeometrySUPP->GetRailPart2    (index); }
   Float_t GetRailPart3    (Int_t index)  const { return fGeometrySUPP->GetRailPart3    (index); }
   Float_t GetRailPos      (Int_t index)  const { return fGeometrySUPP->GetRailPos      (index); }
-  Float_t GetRailLength   ()             const { return fGeometrySUPP->GetRailLength   ();      }
-  Float_t GetDistanceBetwRails()         const { return fGeometrySUPP->GetDistanceBetwRails();  }
-  Float_t GetRailsDistanceFromIP()       const { return fGeometrySUPP->GetRailsDistanceFromIP();}
+  Float_t GetRailLength   (void)         const { return fGeometrySUPP->GetRailLength   ();      }
+  Float_t GetDistanceBetwRails(void)     const { return fGeometrySUPP->GetDistanceBetwRails();  }
+  Float_t GetRailsDistanceFromIP(void)   const { return fGeometrySUPP->GetRailsDistanceFromIP();}
   Float_t GetRailRoadSize (Int_t index)  const { return fGeometrySUPP->GetRailRoadSize (index); }
-  Float_t GetCradleWallThickness()       const { return fGeometrySUPP->GetCradleWallThickness();}
+  Float_t GetCradleWallThickness(void)   const { return fGeometrySUPP->GetCradleWallThickness();}
   Float_t GetCradleWall   (Int_t index)  const { return fGeometrySUPP->GetCradleWall   (index); }
   Float_t GetCradleWheel  (Int_t index)  const { return fGeometrySUPP->GetCradleWheel  (index); }
 
@@ -211,13 +151,13 @@ protected:
 private:
 
   Int_t                    fNModules ;       // Number of modules constituing PHOS
-  Int_t                    fNPPSDModules ;   // Number of PPSD modules
   Float_t                  fAngle ;          // Position angles between modules
   Float_t                 *fPHOSAngle ;      //[fNModules] Position angles of modules
+  Float_t                  fPHOSParams[4] ;  // Half-sizes of PHOS trapecoid
+  Float_t                  fIPtoUpperCPVsurface; // Minimal distance from IP to PHOS
   TObjArray               *fRotMatrixArray ; // Liste of rotation matrices (one per phos module)
   AliPHOSEMCAGeometry     *fGeometryEMCA ;   // Geometry object for Electromagnetic calorimeter
   AliPHOSCPVGeometry      *fGeometryCPV ;    // Geometry object for CPV  (IHEP)
-  AliPHOSPPSDGeometry     *fGeometryPPSD ;   // Geometry object for PPSD (GPS2)
   AliPHOSSupportGeometry  *fGeometrySUPP ;   // Geometry object for PHOS support
 
   void                     SetPHOSAngles();  // calculates the PHOS modules PHI angle
index c4c47dfa5ced97b4f1d4c5dbf5a6c585d5e49519..f502fe504fcf0779ad40bc318aa764c1d4f719fe 100644 (file)
@@ -7,20 +7,16 @@
 #pragma link C++ class AliPHOSEMCAGeometry+;
 #pragma link C++ class AliPHOSCPVBaseGeometry+;
 #pragma link C++ class AliPHOSCPVGeometry+;
-#pragma link C++ class AliPHOSPPSDGeometry+;
 #pragma link C++ class AliPHOSSupportGeometry+;
 #pragma link C++ class AliPHOSGeometry+;
 #pragma link C++ class AliPHOSHit+;
 #pragma link C++ class AliPHOS+;
 #pragma link C++ class AliPHOSv0+;
 #pragma link C++ class AliPHOSv1+;
-#pragma link C++ class AliPHOSv2+;
-#pragma link C++ class AliPHOSv3+;
-#pragma link C++ class AliPHOSv4+;
+#pragma link C++ class AliPHOSvFast+;
 #pragma link C++ class AliPHOSvImpacts+;
 #pragma link C++ class AliPHOSImpact+;
 #pragma link C++ class AliPHOSLink+;
-#pragma link C++ class AliPHOSPpsdRecPoint+;
 #pragma link C++ class AliPHOSReconstructioner+;
 #pragma link C++ class AliPHOSRecPoint+;
 #pragma link C++ class AliPHOSSDigitizer+;