]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeom.cxx
updated
[u/mrichter/AliRoot.git] / ITS / AliITSgeom.cxx
index 16b728afe94f0a9d517f83502612c509f060f717..502f8b0716c010abe6b23d0f4dc8388f51369293 100644 (file)
@@ -587,268 +587,7 @@ void AliITSgeom::PrintData(FILE *fp,Int_t lay,Int_t lad,Int_t det)const{
     fprintf(fp,"        dfr= %e %e %e\n",m[2][0],m[2][1],m[2][2]);
     return;
 }
-//______________________________________________________________________
-void AliITSgeom::PrintGeom(ostream *wb)const{
-    //     Stream out an object of class AliITSgeom to standard output.
-    // Intputs:
-    //     ofstream *wb    The output streaming buffer.
-    // Outputs:
-    //     none.
-    // Return:
-    //     none.
-  Int_t i;
-
-    wb->setf(ios::scientific);
-    streamsize stsiz = wb->precision();
-    *wb << fTrans << " ";
-    *wb << fNmodules << " ";
-    *wb << fNlayers << " ";
-    for(i=0;i<fNlayers;i++) *wb << fNlad[i] << " ";
-    for(i=0;i<fNlayers;i++) *wb << fNdet[i] << "\n";
-    for(i=0;i<fNmodules;i++) {
-        *wb <<setprecision(16) << *(GetGeomMatrix(i)) << "\n";
-    } // end for i
-    *wb << setprecision (stsiz);
-    return;
-}
-//______________________________________________________________________
-//     The following routines modify the transformation of "this"
-// geometry transformations in a number of different ways.
-//______________________________________________________________________
-void AliITSgeom::GlobalChange(const Float_t *tran,const Float_t *rot){
-    //     This function performs a Cartesian translation and rotation of
-    // the full ITS from its default position by an amount determined by
-    // the three element arrays tran and rot. If every element
-    // of tran and rot are zero then there is no change made
-    // the geometry. The change is global in that the exact same translation
-    // and rotation is done to every detector element in the exact same way.
-    // The units of the translation are those of the Monte Carlo, usually cm,
-    // and those of the rotation are in radians. The elements of tran
-    // are tran[0] = x, tran[1] = y, and tran[2] = z.
-    // The elements of rot are rot[0] = rx, rot[1] = ry, and
-    // rot[2] = rz. A change in x will move the hole ITS in the ALICE
-    // global x direction, the same for a change in y. A change in z will
-    // result in a translation of the ITS as a hole up or down the beam line.
-    // A change in the angles will result in the inclination of the ITS with
-    // respect to the beam line, except for an effective rotation about the
-    // beam axis which will just rotate the ITS as a hole about the beam axis.
-    // Intputs:
-    //     Float_t *tran   A 3 element array representing the global 
-    //                     translations. the elements are x,y,z in cm.
-    //     Float_t *rot    A 3 element array representing the global rotation
-    //                     angles about the three axis x,y,z in radians
-    // Outputs:
-    //     none.
-    // Return:
-    //     none.
-    Int_t    i,j;
-    Double_t t[3],r[3];
-    AliITSgeomMatrix *g;
-
-    fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
-    for(i=0;i<fNmodules;i++){
-        g = this->GetGeomMatrix(i);
-        g->GetTranslation(t);
-        g->GetAngles(r);
-        for(j=0;j<3;j++){
-            t[j] += tran[j];
-            r[j] += rot[j];
-        } // end for j
-        g->SetTranslation(t);
-        g->SetAngles(r);
-    } // end for i
-    return;
-}
-//______________________________________________________________________
-void AliITSgeom::GlobalCylindericalChange(const Float_t *tran,
-                                         const Float_t *rot){
-    //     This function performs a cylindrical translation and rotation of
-    // each ITS element by a fixed about in radius, rphi, and z from its
-    // default position by an amount determined by the three element arrays
-    // tran and rot. If every element of tran and
-    // rot are zero then there is no change made the geometry. The
-    // change is global in that the exact same distance change in translation
-    // and rotation is done to every detector element in the exact same way.
-    // The units of the translation are those of the Monte Carlo, usually cm,
-    // and those of the rotation are in radians. The elements of tran
-    // are tran[0] = r, tran[1] = rphi, and tran[2] = z.
-    // The elements of rot are rot[0] = rx, rot[1] = ry, and
-    // rot[2] = rz. A change in r will results in the increase of the
-    // radius of each layer by the same about. A change in rphi will results in
-    // the rotation of each layer by a different angle but by the same
-    // circumferential distance. A change in z will result in a translation
-    // of the ITS as a hole up or down the beam line. A change in the angles
-    // will result in the inclination of the ITS with respect to the beam
-    // line, except for an effective rotation about the beam axis which will
-    // just rotate the ITS as a hole about the beam axis.
-    // Intputs:
-    //     Float_t *tran   A 3 element array representing the global 
-    //                     translations. the elements are r,theta,z in 
-    //                     cm/radians.
-    //     Float_t *rot    A 3 element array representing the global rotation
-    //                     angles about the three axis x,y,z in radians
-    // Outputs:
-    //     none.
-    // Return:
-    //     none.
-    Int_t    i,j;
-    Double_t t[3],ro[3],r,r0,phi,rphi;
-    AliITSgeomMatrix *g;
-
-    fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
-    for(i=0;i<fNmodules;i++){
-        g = this->GetGeomMatrix(i);
-        g->GetTranslation(t);
-        g->GetAngles(ro);
-        r = r0= TMath::Hypot(t[1],t[0]);
-        phi   = TMath::ATan2(t[1],t[0]);
-        rphi  = r0*phi;
-        r    += tran[0];
-        rphi += tran[1];
-        phi   = rphi/r0;
-        t[0]  = r*TMath::Cos(phi);
-        t[1]  = r*TMath::Sin(phi);
-        t[2] += tran[2];
-        for(j=0;j<3;j++){
-            ro[j] += rot[j];
-        } // end for j
-        g->SetTranslation(t);
-        g->SetAngles(ro);
-    } // end for i
-    return;
-}
-//______________________________________________________________________
-void AliITSgeom::RandomChange(const Float_t *stran,const Float_t *srot){
-    //     This function performs a Gaussian random displacement and/or
-    // rotation about the present global position of each active
-    // volume/detector of the ITS. The sigma of the random displacement
-    // is determined by the three element array stran, for the
-    // x y and z translations, and the three element array srot,
-    // for the three rotation about the axis x y and z.
-    // Intputs:
-    //     Float_t *stran  A 3 element array representing the global 
-    //                     translations variances. The elements are x,
-    //                     y,z in cm.
-    //     Float_t *srot   A 3 element array representing the global rotation
-    //                     angles variances about the three axis x,y,z in 
-    //                     radians.
-    // Outputs:
-    //     none.
-    // Return:
-    //     none.
-    Int_t    i,j;
-    Double_t t[3],r[3];
-    AliITSgeomMatrix *g;
-
-    fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
-    for(i=0;i<fNmodules;i++){
-        g = this->GetGeomMatrix(i);
-        g->GetTranslation(t);
-        g->GetAngles(r);
-        for(j=0;j<3;j++){
-            t[j] += gRandom->Gaus(0.0,stran[j]);
-            r[j] += gRandom->Gaus(0.0, srot[j]);
-        } // end for j
-        g->SetTranslation(t);
-        g->SetAngles(r);
-    } // end for i
-    return;
-}
-//______________________________________________________________________
-void AliITSgeom::RandomCylindericalChange(const Float_t *stran,
-                                         const Float_t *srot){
-    //     This function performs a Gaussian random displacement and/or
-    // rotation about the present global position of each active
-    // volume/detector of the ITS. The sigma of the random displacement
-    // is determined by the three element array stran, for the
-    // r rphi and z translations, and the three element array srot,
-    // for the three rotation about the axis x y and z. This random change
-    // in detector position allow for the simulation of a random uncertainty
-    // in the detector positions of the ITS.
-    // Intputs:
-    //     Float_t *stran  A 3 element array representing the global 
-    //                     translations variances. The elements are r,
-    //                     theta,z in cm/radians.
-    //     Float_t *srot   A 3 element array representing the global rotation
-    //                     angles variances about the three axis x,y,z in 
-    //                     radians.
-    // Outputs:
-    //     none.
-    // Return:
-    //     none.
-    Int_t    i,j;
-    Double_t t[3],ro[3],r,r0,phi,rphi;
-    TRandom ran;
-    AliITSgeomMatrix *g;
-
-    fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
-    for(i=0;i<fNmodules;i++){
-        g = this->GetGeomMatrix(i);
-        g->GetTranslation(t);
-        g->GetAngles(ro);
-        r = r0= TMath::Hypot(t[1],t[0]);
-        phi   = TMath::ATan2(t[1],t[0]);
-        rphi  = r0*phi;
-        r    += ran.Gaus(0.0,stran[0]);
-        rphi += ran.Gaus(0.0,stran[1]);
-        phi   = rphi/r0;
-        t[0]  = r*TMath::Cos(phi);
-        t[1]  = r*TMath::Sin(phi);
-        t[2] += ran.Gaus(0.0,stran[2]);
-        for(j=0;j<3;j++){
-            ro[j] += ran.Gaus(0.0, srot[j]);
-        } // end for j
-        g->SetTranslation(t);
-        g->SetAngles(ro);
-    } // end for i
-    return;
-}
-//______________________________________________________________________
-void AliITSgeom::GeantToTracking(const AliITSgeom &source){
-    //     Copy the geometry data but change it to go between the ALICE
-    // Global coordinate system to that used by the ITS tracking. A slightly
-    // different coordinate system is used when tracking. This coordinate 
-    // system is only relevant when the geometry represents the cylindrical
-    // ALICE ITS geometry. For tracking the Z axis is left alone but X-> -Y
-    // and Y-> X such that X always points out of the ITS cylinder for every
-    // layer including layer 1 (where the detectors are mounted upside down).
-    //Begin_Html
-    /*
-      <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
-    */
-    //End_Html
-    // Input:
-    //     AliITSgeom &source  The AliITSgeom class with which to make this
-    //                         a copy of.
-    // Output:
-    //     none.
-    // Return:
-    //     none.
-    Int_t    i,j,k,l,id[3];
-    Double_t r0[3][3],r1[3][3];
-    Double_t a0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
-    Double_t a1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
 
-    *this = source;  // copy everything
-    for(i=0;i<GetIndexMax();i++){
-        GetGeomMatrix(i)->GetIndex(id);
-        GetGeomMatrix(i)->GetMatrix(r0);
-        if(id[0]==1){ // Layer 1 is treated different from the others.
-            for(j=0;j<3;j++) for(k=0;k<3;k++){
-                r1[j][k] = 0.;
-                for(l=0;l<3;l++) r1[j][k] += a0[j][l]*r0[l][k];
-            } // end for j,k
-        }else{
-            for(j=0;j<3;j++) for(k=0;k<3;k++){
-                r1[j][k] = 0.;
-                for(l=0;l<3;l++) r1[j][k] += a1[j][l]*r0[l][k];
-            } // end for j,k
-        } // end if
-        GetGeomMatrix(i)->SetMatrix(r1);
-    } // end for i
-    this->fTrans = (this->fTrans && 0xfffe) + 1;  // set bit 0 true.
-    return;
-}
 //______________________________________________________________________
 Int_t AliITSgeom::GetNearest(const Double_t g[3],Int_t lay)const{
     //      Finds the Detector (Module) that is nearest the point g [cm] in
@@ -917,7 +656,7 @@ void AliITSgeom::GetNearest27(const Double_t g[3],Int_t n[27],Int_t lay)const{
 }
 //_______________________________________________________________________
 void AliITSgeom::DetLToTrackingV2(Int_t md,Float_t xin,Float_t zin,
-                                  Float_t &yout,Float_t &zout) {
+                                  Float_t &yout,Float_t &zout) const {
 
     //Conversion from local coordinates on detectors to local
     //coordinates used for tracking ("v2")
@@ -942,7 +681,7 @@ void AliITSgeom::DetLToTrackingV2(Int_t md,Float_t xin,Float_t zin,
 }
 //_______________________________________________________________________
 void AliITSgeom::TrackingV2ToDetL(Int_t md,Float_t yin,Float_t zin,
-                                  Float_t &xout,Float_t &zout) {
+                                  Float_t &xout,Float_t &zout) const {
     //Conversion from local coordinates used for tracking ("v2") to
     //local detector coordinates  
     // Inputs: