-Bool_t AliPHOSGeometry::AbsToRelNumbering(const Int_t AbsId, Int_t * relid) const
-{
- // 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
-
- Bool_t rv = kTRUE ;
- Float_t id = AbsId ;
-
- Int_t phosmodulenumber = (Int_t)TMath:: Ceil( id / ( GetNPhi() * GetNZ() ) ) ;
-
- 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() ) ;
- }
- }
- }
- else { // its 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() ) ;
- }
- return rv ;
-}
-
-//____________________________________________________________________________
-void AliPHOSGeometry::EmcModuleCoverage(const Int_t mod, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt) const