1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //_________________________________________________________________________
19 // Geometry class for EMCAL : singleton
20 // EMCAL consists of layers of scintillator and lead
21 // Places the the Barrel Geometry of The EMCAL at Midrapidity
22 // between 0 and 120 degrees of Phi and
24 // Number of Modules and Layers may be controlled by
25 // the name of the instance defined
26 //*-- Author: Sahal Yacoob (LBL / UCT)
27 // and : Yves Schutz (SUBATECH)
28 // and : Jennifer Klay (LBL)
29 // SHASHLYK : Aleksei Pavlinov (WSU)
31 // --- AliRoot header files ---
36 //#include "AliConst.h"
39 #include "AliEMCALGeometry.h"
41 ClassImp(AliEMCALGeometry)
43 AliEMCALGeometry *AliEMCALGeometry::fgGeom = 0;
44 Bool_t AliEMCALGeometry::fgInit = kFALSE;
45 TString name; // contains name of geometry
47 //______________________________________________________________________
48 AliEMCALGeometry::~AliEMCALGeometry(void){
52 //______________________________________________________________________
53 Bool_t AliEMCALGeometry::AreInSameTower(Int_t id1, Int_t id2) const {
54 // Find out whether two hits are in the same tower
55 Int_t idmax = TMath::Max(id1, id2) ;
56 Int_t idmin = TMath::Min(id1, id2) ;
57 if ( ((idmax - GetNZ() * GetNPhi()) == idmin ) ||
58 ((idmax - 2 * GetNZ() * GetNPhi()) == idmin ) )
64 //______________________________________________________________________
65 void AliEMCALGeometry::Init(void){
66 // Initializes the EMCAL parameters
67 // naming convention : GUV_WX_N_ gives the composition of a tower
68 // WX inform about the composition of the EM calorimeter section:
69 // thickness in mm of Pb radiator (W) and of scintillator (X), and number of scintillator layers (N)
70 // New geometry: EMCAL_55_25
71 // 24-aug-04 for shish-kebab
72 // SHISH_25 or SHISH_62
73 fgInit = kFALSE; // Assume failed until proven otherwise.
77 fNZ = 114; // granularity along Z (eta)
78 fNPhi = 168; // granularity in phi (azimuth)
79 fArm1PhiMin = 60.0; // degrees, Starting EMCAL Phi position
80 fArm1PhiMax = 180.0; // degrees, Ending EMCAL Phi position
81 fArm1EtaMin = -0.7; // pseudorapidity, Starting EMCAL Eta position
82 fArm1EtaMax = +0.7; // pseudorapidity, Ending EMCAL Eta position
83 fIPDistance = 454.0; // cm, Radial distance to inner surface of EMCAL
86 if (name == "EMCAL_55_25") {
87 fECPbRadThickness = 0.5; // cm, Thickness of the Pb radiators
88 fECScintThick = 0.5; // cm, Thickness of the scintillator
89 fNECLayers = 25; // number of scintillator layers
91 fSampling = 13.1; // calculated with Birk's law implementation
93 fAlFrontThick = 3.5; // cm, Thickness of front Al layer
94 fGap2Active = 1.0; // cm, Gap between Al and 1st Scintillator
96 else if( name == "G56_2_55_19" || name == "EMCAL_5655_21" || name == "G56_2_55_19_104_14"|| name == "G65_2_64_19" || name == "EMCAL_6564_21"){
97 Fatal("Init", "%s is an old geometry! Please update your Config file", name.Data()) ;
99 else if(name.Contains("SHISH")){
100 fNumberOfSuperModules = 12; // 12 = 6 * 2 (6 in phi, 2 in Z);
101 fSteelFrontThick = 2.54; // 9-sep-04
103 fFrontSteelStrip = fPassiveScintThick = 0.0; // 13-may-05
104 fLateralSteelStrip = 0.025; // before MAY 2005
105 fPhiModuleSize = fEtaModuleSize = 11.4;
106 fPhiTileSize = fEtaTileSize = 5.52; // (11.4-5.52*2)/2. = 0.18 cm (wall thickness)
109 fAlFrontThick = fGap2Active = 0;
110 fNPHIdiv = fNETAdiv = 2;
113 fECScintThick = fECPbRadThickness = 0.2;
114 fSampling = 1.; // 30-aug-04 - should be calculated
115 if(name.Contains("TWIST")) { // all about EMCAL module
116 fNZ = 27; // 16-sep-04
117 } else if(name.Contains("TRD")) {
118 fIPDistance = 428.0; // 11-may-05
119 fSteelFrontThick = 0.0; // 3.17 -> 0.0; 28-mar-05 : no stell plate
122 fPhiModuleSize = fEtaModuleSize = 12.26;
123 fNZ = 26; // 11-oct-04
124 fTrd1Angle = 1.3; // in degree
125 // 18-nov-04; 1./0.08112=12.327
126 // http://pdsfweb01.nersc.gov/~pavlinov/ALICE/SHISHKEBAB/RES/linearityAndResolutionForTRD1.html
127 if(name.Contains("TRD1")) { // 30-jan-05
129 if(name.Contains("MAY05") || name.Contains("WSUC")){
130 fNumberOfSuperModules = 12; // 20-may-05
131 if(name.Contains("WSUC")) fNumberOfSuperModules = 1; // 27-may-05
132 fNECLayers = 77; // (13-may-05 from V.Petrov)
133 fPhiModuleSize = 12.5; // 20-may-05 - rectangular shape
134 fEtaModuleSize = 11.9;
135 fECScintThick = fECPbRadThickness = 0.16;// (13-may-05 from V.Petrov)
136 fFrontSteelStrip = 0.025;// 0.025cm = 0.25mm (13-may-05 from V.Petrov)
137 fLateralSteelStrip = 0.01; // 0.01cm = 0.1mm (13-may-05 from V.Petrov) - was 0.025
138 fPassiveScintThick = 0.8; // 0.8cm = 8mm (13-may-05 from V.Petrov)
140 fTrd1Angle = 1.5; // 1.3 or 1.5
142 } else if(name.Contains("TRD2")) { // 30-jan-05
143 fSteelFrontThick = 0.0; // 11-mar-05
144 fIPDistance+= fSteelFrontThick; // 1-feb-05 - compensate absence of steel plate
145 fTrd1Angle = 1.64; // 1.3->1.64
146 fTrd2AngleY = fTrd1Angle; // symmetric case now
147 fEmptySpace = 0.2; // 2 mm
148 fTubsR = fIPDistance; // 31-jan-05 - as for Fred case
150 fPhiModuleSize = fTubsR*2.*TMath::Tan(fTrd2AngleY*TMath::DegToRad()/2.);
151 fPhiModuleSize -= fEmptySpace/2.; // 11-mar-05
152 fEtaModuleSize = fPhiModuleSize; // 20-may-05
155 fNPHIdiv = fNETAdiv = 2; // 13-oct-04 - division again
156 if(name.Contains("3X3")) { // 23-nov-04
157 fNPHIdiv = fNETAdiv = 3;
158 } else if(name.Contains("4X4")) {
159 fNPHIdiv = fNETAdiv = 4;
162 fPhiTileSize = fPhiModuleSize/2. - fLateralSteelStrip; // 13-may-05
163 fEtaTileSize = fEtaModuleSize/2. - fLateralSteelStrip; // 13-may-05
165 if(name.Contains("25")){
167 fECScintThick = fECPbRadThickness = 0.5;
169 if(name.Contains("WSUC")){ // 18-may-05 - about common structure
170 fShellThickness = 30.; // should be change
173 // constant for transition absid <--> indexes
174 fNCellsInTower = fNPHIdiv*fNETAdiv;
175 fNCellsInSupMod = fNCellsInTower*fNPhi*fNZ;
176 fNCells = fNCellsInSupMod*fNumberOfSuperModules;
178 fLongModuleSize = fNECLayers*(fECScintThick + fECPbRadThickness);
179 if(name.Contains("MAY05")) fLongModuleSize += (fFrontSteelStrip + fPassiveScintThick);
182 if(name.Contains("TRD")) {
183 f2Trd1Dx2 = fEtaModuleSize + 2.*fLongModuleSize*TMath::Tan(fTrd1Angle*TMath::DegToRad()/2.);
184 if(name.Contains("TRD2")) { // 27-jan-05
185 f2Trd2Dy2 = fPhiModuleSize + 2.*fLongModuleSize*TMath::Tan(fTrd2AngleY*TMath::DegToRad()/2.);
190 Fatal("Init", "%s is an undefined geometry!", name.Data()) ;
193 fNPhiSuperModule = fNumberOfSuperModules/2;
194 if(fNPhiSuperModule<1) fNPhiSuperModule = 1;
195 //There is always one more scintillator than radiator layer because of the first block of aluminium
196 fShellThickness = fAlFrontThick + fGap2Active + fNECLayers*GetECScintThick()+(fNECLayers-1)*GetECPbRadThick();
197 if(name.Contains("SHISH")) {
198 fShellThickness = fSteelFrontThick + fLongModuleSize;
199 if(name.Contains("TWIST")) { // 13-sep-04
200 fShellThickness = TMath::Sqrt(fLongModuleSize*fLongModuleSize + fPhiModuleSize*fEtaModuleSize);
201 fShellThickness += fSteelFrontThick;
202 } else if(name.Contains("TRD")) { // 1-oct-04
203 fShellThickness = TMath::Sqrt(fLongModuleSize*fLongModuleSize + f2Trd1Dx2*f2Trd1Dx2);
204 fShellThickness += fSteelFrontThick;
208 fZLength = 2.*ZFromEtaR(fIPDistance+fShellThickness,fArm1EtaMax); // Z coverage
209 fEnvelop[0] = fIPDistance; // mother volume inner radius
210 fEnvelop[1] = fIPDistance + fShellThickness; // mother volume outer r.
211 fEnvelop[2] = 1.00001*fZLength; // add some padding for mother volume.
216 printf("Init: geometry of EMCAL named %s is as follows:\n", name.Data());
217 printf( " ECAL : %d x (%f mm Pb, %f mm Sc) \n", GetNECLayers(), GetECPbRadThick(), GetECScintThick() ) ;
218 if(name.Contains("SHISH")){
219 printf(" fIPDistance %6.3f cm \n", fIPDistance);
220 if(fSteelFrontThick>0.)
221 printf(" fSteelFrontThick %6.3f cm \n", fSteelFrontThick);
222 printf(" fNPhi %i | fNZ %i \n", fNPhi, fNZ);
223 if(name.Contains("MAY05")){
224 printf(" fFrontSteelStrip %6.4f cm (thickness of front steel strip)\n",
226 printf(" fLateralSteelStrip %6.4f cm (thickness of lateral steel strip)\n",
228 printf(" fPassiveScintThick %6.4f cm (thickness of front passive Sc tile)\n",
231 printf(" X:Y module size %6.3f , %6.3f cm \n", fPhiModuleSize, fEtaModuleSize);
232 printf(" X:Y tile size %6.3f , %6.3f cm \n", fPhiTileSize, fEtaTileSize);
233 printf(" fLongModuleSize %6.3f cm \n", fLongModuleSize);
234 printf(" #supermodule in phi direction %i \n", fNPhiSuperModule );
236 if(name.Contains("TRD")) {
237 printf(" fTrd1Angle %7.4f\n", fTrd1Angle);
238 printf(" f2Trd1Dx2 %7.4f\n", f2Trd1Dx2);
239 if(name.Contains("TRD2")) {
240 printf(" fTrd2AngleY %7.4f\n", fTrd2AngleY);
241 printf(" f2Trd2Dy2 %7.4f\n", f2Trd2Dy2);
242 printf(" fTubsR %7.2f\n", fTubsR);
243 printf(" fTubsTurnAngle %7.4f\n", fTubsTurnAngle);
244 printf(" fEmptySpace %7.4f\n", fEmptySpace);
247 printf("Granularity: %d in eta and %d in phi\n", GetNZ(), GetNPhi()) ;
248 printf("Layout: phi = (%7.1f, %7.1f), eta = (%5.2f, %5.2f), IP = %7.2f\n",
249 GetArm1PhiMin(), GetArm1PhiMax(),GetArm1EtaMin(), GetArm1EtaMax(), GetIPDistance() );
253 //______________________________________________________________________
254 AliEMCALGeometry * AliEMCALGeometry::GetInstance(){
255 // Returns the pointer of the unique instance
257 return static_cast<AliEMCALGeometry *>( fgGeom ) ;
260 //______________________________________________________________________
261 AliEMCALGeometry* AliEMCALGeometry::GetInstance(const Text_t* name,
262 const Text_t* title){
263 // Returns the pointer of the unique instance
265 AliEMCALGeometry * rv = 0;
267 if ( strcmp(name,"") == 0 ) rv = 0;
269 fgGeom = new AliEMCALGeometry(name, title);
270 if ( fgInit ) rv = (AliEMCALGeometry * ) fgGeom;
276 } // end if strcmp(name,"")
278 if ( strcmp(fgGeom->GetName(), name) != 0 ) {
279 printf("\ncurrent geometry is ") ;
280 printf(fgGeom->GetName());
281 printf("\n you cannot call ");
284 rv = (AliEMCALGeometry *) fgGeom;
290 //______________________________________________________________________
291 Int_t AliEMCALGeometry::TowerIndex(Int_t ieta,Int_t iphi) const {
292 // Returns the tower index number from the based on the Z and Phi
295 // Int_t ieta // index along z axis [1-fNZ]
296 // Int_t iphi // index along phi axis [1-fNPhi]
300 // Int_t index // Tower index number
302 if ( (ieta <= 0 || ieta>GetNEta()) ||
303 (iphi <= 0 || iphi>GetNPhi())) {
304 Error("TowerIndex", "Unexpected parameters eta = %d phi = %d!", ieta, iphi) ;
307 return ( (iphi - 1)*GetNEta() + ieta );
310 //______________________________________________________________________
311 void AliEMCALGeometry::TowerIndexes(Int_t index,Int_t &ieta,Int_t &iphi) const {
313 // Int_t index // Tower index number [1-fNZ*fNPhi]
315 // Int_t ieta // index allong z axis [1-fNZ]
316 // Int_t iphi // index allong phi axis [1-fNPhi]
322 if ( IsInECA(index) ) { // ECAL index
326 Error("TowerIndexes", "Unexpected Id number!") ;
333 iphi = nindex / GetNZ() + 1 ;
335 iphi = nindex / GetNZ() ;
336 ieta = nindex - (iphi - 1) * GetNZ() ;
339 printf("TowerIndexes: index=%d,%d, ieta=%d, iphi = %d", index, nindex,ieta, iphi) ;
344 //______________________________________________________________________
345 void AliEMCALGeometry::EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi) const {
346 // given the tower index number it returns the based on the eta and phi
349 // Int_t index // Tower index number [1-fNZ*fNPhi]
351 // Float_t eta // eta of center of tower in pseudorapidity
352 // Float_t phi // phi of center of tower in degrees
358 TowerIndexes(index,ieta,iphi);
361 printf("EtaPhiFromIndex: index = %d, ieta = %d, iphi = %d", index, ieta, iphi) ;
363 deta = (GetArm1EtaMax()-GetArm1EtaMin())/(static_cast<Float_t>(GetNEta()));
364 eta = GetArm1EtaMin() + ((static_cast<Float_t>(ieta) - 0.5 ))*deta;
366 dphi = (GetArm1PhiMax() - GetArm1PhiMin())/(static_cast<Float_t>(GetNPhi())); // in degrees.
367 phi = GetArm1PhiMin() + dphi*(static_cast<Float_t>(iphi) - 0.5);//iphi range [1-fNphi].
370 //______________________________________________________________________
371 Int_t AliEMCALGeometry::TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const {
372 // returns the tower index number based on the eta and phi of the tower.
374 // Float_t eta // eta of center of tower in pseudorapidity
375 // Float_t phi // phi of center of tower in degrees
379 // Int_t index // Tower index number [1-fNZ*fNPhi]
383 ieta = static_cast<Int_t> ( 1 + (static_cast<Float_t>(GetNEta()) * (eta - GetArm1EtaMin()) / (GetArm1EtaMax() - GetArm1EtaMin())) ) ;
385 if( ieta <= 0 || ieta > GetNEta() ) {
386 Error("TowerIndexFromEtaPhi", "Unexpected (eta, phi) = (%f, %f) value, outside of EMCAL!", eta, phi) ;
390 iphi = static_cast<Int_t> ( 1 + (static_cast<Float_t>(GetNPhi()) * (phi - GetArm1PhiMin()) / (GetArm1PhiMax() - GetArm1PhiMin())) ) ;
392 if( iphi <= 0 || iphi > GetNPhi() ) {
393 Error("TowerIndexFromEtaPhi", "Unexpected (eta, phi) = (%f, %f) value, outside of EMCAL!", eta, phi) ;
397 return TowerIndex(ieta,iphi);
400 //______________________________________________________________________
401 Bool_t AliEMCALGeometry::AbsToRelNumbering(Int_t AbsId, Int_t *relid) const {
402 // Converts the absolute numbering into the following array/
403 // relid[0] = Row number inside EMCAL
404 // relid[1] = Column number inside EMCAL
406 // Int_t AbsId // Tower index number [1-2*fNZ*fNPhi]
408 // Int_t *relid // array of 2. Described above.
410 Int_t ieta=0,iphi=0,index=AbsId;
412 TowerIndexes(index,ieta,iphi);
419 //______________________________________________________________________
420 void AliEMCALGeometry::PosInAlice(const Int_t *relid, Float_t &theta, Float_t &phi) const
422 // Converts the relative numbering into the local EMCAL-module (x, z)
424 Int_t ieta = relid[0]; // offset along x axis
425 Int_t iphi = relid[1]; // offset along z axis
429 index = TowerIndex(ieta,iphi);
430 EtaPhiFromIndex(index,eta,phi);
431 //theta = 180.*(2.0*TMath::ATan(TMath::Exp(-eta)))/TMath::Pi();
432 theta = 2.0*TMath::ATan(TMath::Exp(-eta));
434 // correct for distance to IP
435 Float_t d = GetIP2ECASection() - GetIPDistance() ;
437 Float_t correction = 1 + d/GetIPDistance() ;
438 Float_t tantheta = TMath::Tan(theta) * correction ;
439 theta = TMath::ATan(tantheta) * TMath::RadToDeg() ;
446 //______________________________________________________________________
447 void AliEMCALGeometry::PosInAlice(Int_t absid, Float_t &theta, Float_t &phi) const
449 // Converts the relative numbering into the local EMCAL-module (x, z)
452 AbsToRelNumbering(absid, relid) ;
453 Int_t ieta = relid[0]; // offset along x axis
454 Int_t iphi = relid[1]; // offset along z axis
458 index = TowerIndex(ieta,iphi);
459 EtaPhiFromIndex(index,eta,phi);
460 theta = 2.0*TMath::ATan(TMath::Exp(-eta)) ;
462 // correct for distance to IP
465 d = GetIP2ECASection() - GetIPDistance() ;
467 Error("PosInAlice", "Unexpected id # %d!", absid) ;
471 Float_t correction = 1 + d/GetIPDistance() ;
472 Float_t tantheta = TMath::Tan(theta) * correction ;
473 theta = TMath::ATan(tantheta) * TMath::RadToDeg() ;
480 //______________________________________________________________________
481 void AliEMCALGeometry::XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const {
482 // given the tower relative number it returns the X, Y and Z
486 // Float_t x // x of center of tower in cm
487 // Float_t y // y of center of tower in cm
488 // Float_t z // z of centre of tower in cm
492 Float_t eta,theta, phi,cylradius=0. ;
494 Int_t ieta = relid[0]; // offset along x axis
495 Int_t iphi = relid[1]; // offset along z axis.
498 index = TowerIndex(ieta,iphi);
499 EtaPhiFromIndex(index,eta,phi);
500 theta = 180.*(2.0*TMath::ATan(TMath::Exp(-eta)))/TMath::Pi();
502 cylradius = GetIP2ECASection() ;
504 Double_t kDeg2Rad = TMath::DegToRad() ;
505 x = cylradius * TMath::Cos(phi * kDeg2Rad ) ;
506 y = cylradius * TMath::Sin(phi * kDeg2Rad ) ;
507 z = cylradius / TMath::Tan(theta * kDeg2Rad ) ;
512 //______________________________________________________________________
513 void AliEMCALGeometry::XYZFromIndex(Int_t absid, TVector3 &v) const {
514 // given the tower relative number it returns the X, Y and Z
518 // Float_t x // x of center of tower in cm
519 // Float_t y // y of center of tower in cm
520 // Float_t z // z of centre of tower in cm
524 Float_t theta, phi,cylradius=0. ;
526 PosInAlice(absid, theta, phi) ;
528 if ( IsInECA(absid) )
529 cylradius = GetIP2ECASection() ;
531 Error("XYZFromIndex", "Unexpected Tower section") ;
535 Double_t kDeg2Rad = TMath::DegToRad() ;
536 v.SetX(cylradius * TMath::Cos(phi * kDeg2Rad ) );
537 v.SetY(cylradius * TMath::Sin(phi * kDeg2Rad ) );
538 v.SetZ(cylradius / TMath::Tan(theta * kDeg2Rad ) ) ;
543 Bool_t AliEMCALGeometry::IsInEMCAL(Double_t x, Double_t y, Double_t z) const {
544 // Checks whether point is inside the EMCal volume
546 // Code uses cylindrical approximation made of inner radius (for speed)
548 // Points behind EMCAl, i.e. R > outer radius, but eta, phi in acceptance
549 // are considered to inside
551 Double_t r=sqrt(x*x+y*y);
553 if ( r > fEnvelop[0] ) {
555 theta = TMath::ATan2(r,z);
560 eta = -TMath::Log(TMath::Tan(theta/2.));
561 if (eta < fArm1EtaMin || eta > fArm1EtaMax)
564 Double_t phi = TMath::ATan2(y,x) * 180./TMath::Pi();
565 if (phi > fArm1PhiMin && phi < fArm1PhiMax)
572 // == Shish-kebab cases ==
574 Int_t AliEMCALGeometry::GetAbsCellId(const int nSupMod, const int nTower, const int nIphi, const int nIeta)
575 { // 27-aug-04; corr. 21-sep-04
576 static Int_t id; // have to change from 1 to fNCells
577 id = fNCellsInSupMod*(nSupMod-1);
578 id += fNCellsInTower *(nTower-1);
579 id += fNPHIdiv *(nIphi-1);
581 if(id<=0 || id > fNCells) {
582 // printf(" wrong numerations !!\n");
583 // printf(" id %6i(will be force to -1)\n", id);
584 // printf(" fNCells %6i\n", fNCells);
585 // printf(" nSupMod %6i\n", nSupMod);
586 // printf(" nTower %6i\n", nTower);
587 // printf(" nIphi %6i\n", nIphi);
588 // printf(" nIeta %6i\n", nIeta);
594 Bool_t AliEMCALGeometry::CheckAbsCellId(Int_t ind)
595 { // 17-niv-04 - analog of IsInECA
596 if(name.Contains("TRD")) {
597 if(ind<=0 || ind > fNCells) return kFALSE;
599 } else return IsInECA(ind);
602 Bool_t AliEMCALGeometry::GetCellIndex(const Int_t absId,Int_t &nSupMod,Int_t &nTower,Int_t &nIphi,Int_t &nIeta)
605 if(absId<=0 || absId>fNCells) {
606 // Info("GetCellIndex"," wrong abs Id %i !! \n", absId);
609 nSupMod = (absId-1) / fNCellsInSupMod + 1;
610 tmp = (absId-1) % fNCellsInSupMod;
612 nTower = tmp / fNCellsInTower + 1;
613 tmp = tmp % fNCellsInTower;
615 nIphi = tmp / fNPHIdiv + 1;
616 nIeta = tmp % fNPHIdiv + 1;
621 void AliEMCALGeometry::GetCellPhiEtaIndexInSModule(const int nTower, const int nIphi, const int nIeta,
622 int &iphi, int &ieta)
623 { // don't check validity of nTower, nIphi and nIeta index
624 // have to change - 1-nov-04 ??
625 static Int_t iphit, ietat;
627 ietat = (nTower-1)/fNPhi;
628 ieta = ietat*fNETAdiv + nIeta; // change from 1 to fNZ*fNETAdiv
630 iphit = (nTower-1)%fNPhi;
631 iphi = iphit*fNPHIdiv + nIphi; // change from 1 to fNPhi*fNPHIdiv