-//_____________________________________________________________________
-AliITSgeom::AliITSgeom(){
-////////////////////////////////////////////////////////////////////////
-// The default constructor for the AliITSgeom class. It, by default,
-// sets fNlayers to zero and zeros all pointers.
-////////////////////////////////////////////////////////////////////////
- // Default constructor.
- // Do not allocate anything zero everything
- fNlayers = 0;
- fNlad = 0;
- fNdet = 0;
- fGm = 0;
- fShape = 0;
- return;
-}
-
-//_____________________________________________________________________
-AliITSgeom::~AliITSgeom(){
-////////////////////////////////////////////////////////////////////////
-// The destructor for the AliITSgeom class. If the arrays fNlad,
-// fNdet, or fGm have had memory allocated to them, there pointer values
-// are non zero, then this memory space is freed and they are set
-// to zero. In addition, fNlayers is set to zero. The destruction of
-// TObjArray fShape is, by default, handled by the TObjArray destructor.
-////////////////////////////////////////////////////////////////////////
- // Default destructor.
- // if arrays exist delete them. Then set everything to zero.
- if(fGm!=0){
- for(Int_t i=0;i<fNlayers;i++) delete[] fGm[i];
- delete[] fGm;
- } // end if fGm!=0
- if(fNlad!=0) delete[] fNlad;
- if(fNdet!=0) delete[] fNdet;
- fNlayers = 0;
- fNlad = 0;
- fNdet = 0;
- fGm = 0;
- return;
-}
-
-//_____________________________________________________________________
-AliITSgeom::AliITSgeom(const char *filename){
-////////////////////////////////////////////////////////////////////////
-// The constructor for the AliITSgeom class. All of the data to fill
-// this structure is read in from the file given my the input filename.
-////////////////////////////////////////////////////////////////////////
- FILE *pf;
- Int_t i;
- AliITSgeomS *g;
- Int_t l,a,d;
- Float_t x,y,z,o,p,q,r,s,t;
- Double_t oor,pr,qr,rr,sr,tr; // Radians
- Double_t ppr,rrr; // Added by S. Vanadia for tracking rotation matrix;
- Double_t lr[9];
- Double_t si; // sin(angle)
- Double_t pi = TMath::Pi(), byPI = pi/180.;
-
- pf = fopen(filename,"r");
-
- fNlayers = 6; // set default number of ladders
- fNlad = new Int_t[fNlayers];
- fNdet = new Int_t[fNlayers];
- // find the number of ladders and detectors in this geometry.
- for(i=0;i<fNlayers;i++){fNlad[i]=fNdet[i]=0;} // zero out arrays
- for(;;){ // for ever loop
- i = fscanf(pf,"%d %d %d %f %f %f %f %f %f %f %f %f",
- &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
- if(i==EOF) break;
- if(l<1 || l>fNlayers) {
- printf("error in file %s layer=%d min is 1 max is %d/n",
- filename,l,fNlayers);
- continue;
- }// end if l
- if(fNlad[l-1]<a) fNlad[l-1] = a;
- if(fNdet[l-1]<d) fNdet[l-1] = d;
- } // end for ever loop
- // counted the number of ladders and detectors now allocate space.
- fGm = new AliITSgeomS* [fNlayers];
- for(i=0;i<fNlayers;i++){
- fGm[i] = 0;
- l = fNlad[i]*fNdet[i];
- fGm[i] = new AliITSgeomS[l]; // allocate space for transforms
- } // end for i
-
- // Set up Shapes for a default configuration of 6 layers.
- fShape = new TObjArray(3);
- AddShape((TObject *) new AliITSgeomSPD300()); // shape 0
- AddShape((TObject *) new AliITSgeomSDD()); // shape 1
- AddShape((TObject *) new AliITSgeomSSD()); // shape 2
-
- // prepare to read in transforms
- rewind(pf); // start over reading file
- for(;;){ // for ever loop
- i = fscanf(pf,"%d %d %d %f %f %f %f %f %f %f %f %f",
- &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
- if(i==EOF) break;
- if(l<1 || l>fNlayers) {
- printf("error in file %s layer=%d min is 1 max is %d/n",
- filename,l,fNlayers);
- continue;
- }// end if l
- l--; a--; d--; // shift layer, ladder, and detector counters to zero base
- i = d + a*fNdet[l]; // position of this detector
- g = &(fGm[l][i]);
-
- //part coming from the tracking
- g->angles[0] = o; // Added 25-05-00 S. Vanadia
- g->angles[1] = p;
- g->angles[2] = q;
- g->angles[3] = r;
- g->angles[4] = s;
- g->angles[5] = t;
- //printf("angles from file: %f %f %f %f %f %f\n",o,p,q,r,s,t);
- //printf("constructor angles: %f %f %f %f %f %f\n", g->angles[0], g->angles[1], g->angles[2], g->angles[3], g->angles[4], g->angles[5]);
- // end part coming from tracking
-
- oor = byPI*o;
- pr = byPI*p;
- qr = byPI*q;
- rr = byPI*r;
- sr = byPI*s;
- tr = byPI*t;
-
- // Tracking rotation matrix 25-5-2000
- if (l==0) {
- ppr = (Double_t)(p+90.0)*byPI;
- rrr = (Double_t)(r+90.0)*byPI;
- }
- else {
- ppr = (Double_t)(p-90.0)*byPI;
- rrr = (Double_t)(r-90.0)*byPI;
- }
-
-
- g->rottrack[0][0]=TMath::Sin(oor)*TMath::Cos(ppr);
- g->rottrack[1][0]=TMath::Sin(oor)*TMath::Sin(ppr);
- g->rottrack[2][0]=TMath::Cos(oor);
- g->rottrack[0][1]=TMath::Sin(qr)*TMath::Cos(rrr);
- g->rottrack[1][1]=TMath::Sin(qr)*TMath::Sin(rrr);
- g->rottrack[2][1]=TMath::Cos(qr);
- g->rottrack[0][2]=TMath::Sin(sr)*TMath::Cos(tr);
- g->rottrack[1][2]=TMath::Sin(sr)*TMath::Sin(tr);
- g->rottrack[2][2]=TMath::Cos(sr);
- // End tracking rotation matrix
-
-
- g->fx0 = x;
- g->fy0 = y;
- g->fz0 = z;
-//
- si = sin(oor);if(o== 90.0) si = +1.0;
- if(o==270.0) si = -1.0;
- if(o== 0.0||o==180.) si = 0.0;
- lr[0] = si * cos(pr);
- lr[1] = si * sin(pr);
- lr[2] = cos(oor);if(o== 90.0||o==270.) lr[2] = 0.0;
- if(o== 0.0) lr[2] = +1.0;
- if(o==180.0) lr[2] = -1.0;
-//
- si = sin(qr);if(q== 90.0) si = +1.0;
- if(q==270.0) si = -1.0;
- if(q== 0.0||q==180.) si = 0.0;
- lr[3] = si * cos(rr);
- lr[4] = si * sin(rr);
- lr[5] = cos(qr);if(q== 90.0||q==270.) lr[5] = 0.0;
- if(q== 0.0) lr[5] = +1.0;
- if(q==180.0) lr[5] = -1.0;
-//
- si = sin(sr);if(s== 90.0) si = +1.0;
- if(s==270.0) si = -1.0;
- if(s== 0.0||s==180.) si = 0.0;
- lr[6] = si * cos(tr);
- lr[7] = si * sin(tr);
- lr[8] = cos(sr);if(s== 90.0||s==270.0) lr[8] = 0.0;
- if(s== 0.0) lr[8] = +1.0;
- if(s==180.0) lr[8] = -1.0;
- // Normalize these elements
- for(a=0;a<3;a++){// reuse float Si and integers a and d.
- si = 0.0;
- for(d=0;d<3;d++) si += lr[3*a+d]*lr[3*a+d];
- si = TMath::Sqrt(1./si);
- for(d=0;d<3;d++) g->fr[3*a+d] = lr[3*a+d] = si*lr[3*a+d];
- } // end for a
- // get angles from matrix up to a phase of 180 degrees.
- oor = atan2(lr[7],lr[8]);if(oor<0.0) oor += 2.0*pi;
- pr = asin(lr[2]); if(pr<0.0) pr += 2.0*pi;
- qr = atan2(lr[3],lr[0]);if(qr<0.0) qr += 2.0*pi;
- g->frx = oor;
- g->fry = pr;
- g->frz = qr;
- // l = layer-1 at this point.
- if(l==0||l==1) g->fShapeIndex = 0; // SPD's
- else if(l==2||l==3) g->fShapeIndex = 1; // SDD's
- else if(l==4||l==5) g->fShapeIndex = 2; // SSD's
- } // end for ever loop
- fclose(pf);
-}
-
-//________________________________________________________________________
-AliITSgeom::AliITSgeom(const AliITSgeom &source){
-////////////////////////////////////////////////////////////////////////
-// The copy constructor for the AliITSgeom class. It calls the
-// = operator function. See the = operator function for more details.
-////////////////////////////////////////////////////////////////////////
-
- *this = source; // Just use the = operator for now.
-
- return;
-}
-
-//________________________________________________________________________
-/*void AliITSgeom::operator=(const AliITSgeom &source){
-////////////////////////////////////////////////////////////////////////
-// The = operator function for the AliITSgeom class. It makes an
-// independent copy of the class in such a way that any changes made
-// to the copied class will not affect the source class in any way.
-// This is required for many ITS alignment studies where the copied
-// class is then modified by introducing some misalignment.
-////////////////////////////////////////////////////////////////////////
- Int_t i,j,k;
-
- if(this == &source) return; // don't assign to ones self.
-
- // if there is an old structure allocated delete it first.
- if(fGm != 0){
- for(i=0;i<fNlayers;i++) delete[] fGm[i];
- delete[] fGm;
- } // end if fGm != 0
- if(fNlad != 0) delete[] fNlad;
- if(fNdet != 0) delete[] fNdet;
-
- fNlayers = source.fNlayers;
- fNlad = new Int_t[fNlayers];
- for(i=0;i<fNlayers;i++) fNlad[i] = source.fNlad[i];
- fNdet = new Int_t[fNlayers];
- for(i=0;i<fNlayers;i++) fNdet[i] = source.fNdet[i];
- fShape = new TObjArray(*(source.fShape));//This does not make a proper copy.
- fGm = new AliITSgeomS* [fNlayers];
- for(i=0;i<fNlayers;i++){
- fGm[i] = new AliITSgeomS[fNlad[i]*fNdet[i]];
- for(j=0;j<(fNlad[i]*fNdet[i]);j++){
- fGm[i][j].fShapeIndex = source.fGm[i][j].fShapeIndex;
- fGm[i][j].fx0 = source.fGm[i][j].fx0;
- fGm[i][j].fy0 = source.fGm[i][j].fy0;
- fGm[i][j].fz0 = source.fGm[i][j].fz0;
- fGm[i][j].frx = source.fGm[i][j].frx;
- fGm[i][j].fry = source.fGm[i][j].fry;
- fGm[i][j].frz = source.fGm[i][j].frz;
- for(k=0;k<9;k++) fGm[i][j].fr[k] = source.fGm[i][j].fr[k];
- } // end for j
- } // end for i
- return;
- }*/
-//________________________________________________________________________
-AliITSgeom& AliITSgeom::operator=(const AliITSgeom &source){
-////////////////////////////////////////////////////////////////////////
-// The = operator function for the AliITSgeom class. It makes an
-// independent copy of the class in such a way that any changes made
-// to the copied class will not affect the source class in any way.
-// This is required for many ITS alignment studies where the copied
-// class is then modified by introducing some misalignment.
-////////////////////////////////////////////////////////////////////////
- Int_t i,j,k;
- Int_t ii,jj;
-
- if(this == &source) return *this; // don't assign to ones self.
-
- // if there is an old structure allocated delete it first.
- if(fGm != 0){
- for(i=0;i<fNlayers;i++) delete[] fGm[i];
- delete[] fGm;
- } // end if fGm != 0
- if(fNlad != 0) delete[] fNlad;
- if(fNdet != 0) delete[] fNdet;
-
- fNlayers = source.fNlayers;
- fNlad = new Int_t[fNlayers];
- for(i=0;i<fNlayers;i++) fNlad[i] = source.fNlad[i];
- fNdet = new Int_t[fNlayers];
- for(i=0;i<fNlayers;i++) fNdet[i] = source.fNdet[i];
- fShape = new TObjArray(*(source.fShape));//This does not make a proper copy.
- fGm = new AliITSgeomS* [fNlayers];
- for(i=0;i<fNlayers;i++){
- fGm[i] = new AliITSgeomS[fNlad[i]*fNdet[i]];
- for(j=0;j<(fNlad[i]*fNdet[i]);j++){
- fGm[i][j].fShapeIndex = source.fGm[i][j].fShapeIndex;
- fGm[i][j].fx0 = source.fGm[i][j].fx0;
- fGm[i][j].fy0 = source.fGm[i][j].fy0;
- fGm[i][j].fz0 = source.fGm[i][j].fz0;
- fGm[i][j].frx = source.fGm[i][j].frx;
- fGm[i][j].fry = source.fGm[i][j].fry;
- fGm[i][j].frz = source.fGm[i][j].frz;
-
- fGm[i][j].angles[0] = source.fGm[i][j].angles[0]; // Added S.Vanadia
- fGm[i][j].angles[1] = source.fGm[i][j].angles[1];
- fGm[i][j].angles[2] = source.fGm[i][j].angles[2];
- fGm[i][j].angles[3] = source.fGm[i][j].angles[3];
- fGm[i][j].angles[4] = source.fGm[i][j].angles[4];
- fGm[i][j].angles[5] = source.fGm[i][j].angles[5];
-
- for(k=0;k<9;k++) fGm[i][j].fr[k] = source.fGm[i][j].fr[k];
- for (ii=0;ii<3;ii++) // Added S. Vanadia
- for (jj=0;jj<3;jj++)
- fGm[i][j].rottrack[ii][jj] = source.fGm[i][j].rottrack[ii][jj];
- } // end for j
- } // end for i
- return *this;
-}
-//________________________________________________________________________
-void AliITSgeom::GtoLtracking(Int_t lay,Int_t lad,Int_t det,
- const Double_t *g,Double_t *l){
-////////////////////////////////////////////////////////////////////////
-// Added by S. Vanadia 25-5-2000
-////////////////////////////////////////////////////////////////////////
- Double_t x,y,z;
- AliITSgeomS *gl;
-
- lay--;lad--;det--;
-
- gl = &(fGm[lay][fNdet[lay]*lad+det]);
-
- x = g[0] - gl->fx0;
- y = g[1] - gl->fy0;
- z = g[2] - gl->fz0;
-
- l[0] = gl->rottrack[0][0]*x + gl->rottrack[1][0]*y + gl->rottrack[2][0]*z;
- l[1] = gl->rottrack[0][1]*x + gl->rottrack[1][1]*y + gl->rottrack[2][1]*z;
- l[2] = gl->rottrack[0][2]*x + gl->rottrack[1][2]*y + gl->rottrack[2][2]*z;
-
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::LtoGtracking(Int_t lay,Int_t lad,Int_t det,
- const Double_t *l,Double_t *g){
-////////////////////////////////////////////////////////////////////////
-// Added by S. Vanadia 25-5-2000
-////////////////////////////////////////////////////////////////////////
-
- Double_t xx,yy,zz;
- AliITSgeomS *gl;
-
- lay--;lad--;det--;
-
- gl = &(fGm[lay][fNdet[lay]*lad+det]);
-
- xx = gl->rottrack[0][0]*l[0] + gl->rottrack[0][1]*l[1] + gl->rottrack[0][2]*l[2];
- yy = gl->rottrack[1][0]*l[0] + gl->rottrack[1][1]*l[1] + gl->rottrack[1][2]*l[2];
- zz = gl->rottrack[2][0]*l[0] + gl->rottrack[2][1]*l[1] + gl->rottrack[2][2]*l[2];
-
-
- g[0] = xx + gl->fx0;
- g[1] = yy + gl->fy0;
- g[2] = zz + gl->fz0;
-
-
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::GtoL(Int_t lay,Int_t lad,Int_t det,
- const Double_t *g,Double_t *l){
-////////////////////////////////////////////////////////////////////////
-// The function that does the global ALICE Cartesian coordinate
-// to local active volume detector Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the layer,
-// ladder, and detector numbers. The global coordinates are entered by
-// the three element Double_t array g and the local coordinate values
-// are returned by the three element Double_t array l. The order of the
-// three elements are g[0]=x, g[1]=y, and g[2]=z, similarly for l.
-////////////////////////////////////////////////////////////////////////
- Double_t x,y,z;
- AliITSgeomS *gl;
-
- lay--; lad--; det--;
- gl = &(fGm[lay][fNdet[lay]*lad+det]);
-
- x = g[0] - gl->fx0;
- y = g[1] - gl->fy0;
- z = g[2] - gl->fz0;
- l[0] = gl->fr[0]*x + gl->fr[1]*y + gl->fr[2]*z;
- l[1] = gl->fr[3]*x + gl->fr[4]*y + gl->fr[5]*z;
- l[2] = gl->fr[6]*x + gl->fr[7]*y + gl->fr[8]*z;
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::GtoL(const Int_t *id,const Double_t *g,Double_t *l){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the id[0]=layer,
-// id[1]=ladder, and id[2]=detector numbers. The local coordinates are
-// entered by the three element Double_t array l and the global coordinate
-// values are returned by the three element Double_t array g. The order of the
-// three elements are l[0]=x, l[1]=y, and l[2]=z, similarly for g.
-////////////////////////////////////////////////////////////////////////
- GtoL(id[0],id[1],id[2],g,l);
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::GtoL(const Int_t index,const Double_t *g,Double_t *l){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the detector
-// index numbers (see GetModuleIndex and GetModuleID). The local
-// coordinates are entered by the three element Double_t array l and the
-// global coordinate values are returned by the three element Double_t array g.
-// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z, similarly
-// for g.
-////////////////////////////////////////////////////////////////////////
- Int_t lay,lad,det;
-
- this->GetModuleId(index,lay,lad,det);
-
- GtoL(lay,lad,det,g,l);
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::GtoL(Int_t lay,Int_t lad,Int_t det,
- const Float_t *g,Float_t *l){
-////////////////////////////////////////////////////////////////////////
-// The function that does the global ALICE Cartesian coordinate
-// to local active volume detector Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the layer,
-// ladder, and detector numbers. The global coordinates are entered by
-// the three element Float_t array g and the local coordinate values
-// are returned by the three element Float_t array l. The order of the
-// three elements are g[0]=x, g[1]=y, and g[2]=z, similarly for l.
-////////////////////////////////////////////////////////////////////////
- Int_t i;
- Double_t gd[3],ld[3];
-
- for(i=0;i<3;i++) gd[i] = (Double_t) g[i];
- GtoL(lay,lad,det,(Double_t *)gd,(Double_t *)ld);
- for(i=0;i<3;i++) l[i] = (Float_t) ld[i];
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::GtoL(const Int_t *id,const Float_t *g,Float_t *l){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the Int_t array id,
-// id[0]=layer, id[1]=ladder, and id[2]=detector numbers. The local
-// coordinates are entered by the three element Float_t array l and the
-// global coordinate values are returned by the three element Float_t array g.
-// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z, similarly
-// for g. The order of the three elements are g[0]=x, g[1]=y, and g[2]=z,
-// similarly for l.
-////////////////////////////////////////////////////////////////////////
- Int_t i;
- Double_t gd[3],ld[3];
-
- for(i=0;i<3;i++) gd[i] = (Double_t) g[i];
- GtoL(id[0],id[1],id[2],(Double_t *)gd,(Double_t *)ld);
- for(i=0;i<3;i++) l[i] = (Float_t) ld[i];
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::GtoL(const Int_t index,const Float_t *g,Float_t *l){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the detector
-// index numbers (see GetModuleIndex and GetModuleID). The local
-// coordinates are entered by the three element Float_t array l and the
-// global coordinate values are returned by the three element Float_t array g.
-// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z, similarly
-// for g.
-////////////////////////////////////////////////////////////////////////
- Int_t lay,lad,det;
- Int_t i;
- Double_t gd[3],ld[3];
-
- this->GetModuleId(index,lay,lad,det);
-
- for(i=0;i<3;i++) gd[i] = (Double_t) g[i];
- GtoL(lay,lad,det,(Double_t *)gd,(Double_t *)ld);
- for(i=0;i<3;i++) l[i] = (Float_t) ld[i];
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::LtoG(Int_t lay,Int_t lad,Int_t det,
- const Double_t *l,Double_t *g){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the layer,
-// ladder, and detector numbers. The local coordinates are entered by
-// the three element Float_t array l and the global coordinate values
-// are returned by the three element Float_t array g. The order of the
-// three elements are l[0]=x, l[1]=y, and l[2]=z, similarly for g.
-////////////////////////////////////////////////////////////////////////
- Double_t x,y,z;
- AliITSgeomS *gl;
-
- lay--; lad--; det--;
- gl = &(fGm[lay][fNdet[lay]*lad+det]);
-
- x = gl->fr[0]*l[0] + gl->fr[3]*l[1] + gl->fr[6]*l[2];
- y = gl->fr[1]*l[0] + gl->fr[4]*l[1] + gl->fr[7]*l[2];
- z = gl->fr[2]*l[0] + gl->fr[5]*l[1] + gl->fr[8]*l[2];
- g[0] = x + gl->fx0;
- g[1] = y + gl->fy0;
- g[2] = z + gl->fz0;
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::LtoG(const Int_t *id,const Double_t *l,Double_t *g){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the three
-// element array Id containing as it's three elements Id[0]=layer,
-// Id[1]=ladder, and Id[2]=detector numbers. The local coordinates
-// are entered by the three element Double_t array l and the global
-// coordinate values are returned by the three element Double_t array g.
-// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z,
-// similarly for g.
-////////////////////////////////////////////////////////////////////////
- LtoG(id[0],id[1],id[2],l,g);
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::LtoG(const Int_t index,const Double_t *l,Double_t *g){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the detector
-// index number (see GetModuleIndex and GetModuleId). The local coordinates
-// are entered by the three element Double_t array l and the global
-// coordinate values are returned by the three element Double_t array g.
-// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z,
-// similarly for g.
-////////////////////////////////////////////////////////////////////////
- Int_t lay,lad,det;
-
- this->GetModuleId(index,lay,lad,det);
-
- LtoG(lay,lad,det,l,g);
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::LtoG(Int_t lay,Int_t lad,Int_t det,
- const Float_t *l,Float_t *g){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the layer,
-// ladder, and detector numbers. The local coordinates are entered by
-// the three element Float_t array l and the global coordinate values
-// are returned by the three element Float_t array g. The order of the
-// three elements are l[0]=x, l[1]=y, and l[2]=z, similarly for g.
-////////////////////////////////////////////////////////////////////////
- Int_t i;
- Double_t gd[3],ld[3];
-
- for(i=0;i<3;i++) ld[i] = (Double_t) l[i];
- LtoG(lay,lad,det,(Double_t *)ld,(Double_t *)gd);
- for(i=0;i<3;i++) g[i] = (Float_t) gd[i];
- return;
-}
-//________________________________________________________________________
-void AliITSgeom::LtoG(const Int_t *id,const Float_t *l,Float_t *g){
-////////////////////////////////////////////////////////////////////////
-// The function that does the local active volume detector Cartesian
-// coordinate to global ALICE Cartesian coordinate transformation.
-// The local detector coordinate system is determined by the three
-// element array Id containing as it's three elements Id[0]=layer,
-// Id[1]=ladder, and Id[2]=detector numbers. The local coordinates
-// are entered by the three element Float_t array l and the global
-// coordinate values are returned by the three element Float_t array g.
-// The order of the three elements are l[0]=x, l[1]=y, and l[2]=z,
-// similarly for g.
-////////////////////////////////////////////////////////////////////////
- Int_t i;
- Double_t gd[3],ld[3];
-
- for(i=0;i<3;i++) ld[i] = (Double_t) l[i];
- LtoG(id[0],id[1],id[2],(Double_t *)ld,(Double_t *)gd);
- for(i=0;i<3;i++) g[i] = (Float_t) gd[i];