-// 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 dtranslation and drotation. If every element
-// of dtranslation and drotation 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 dtranslation
-// are dtranslation[0] = x, dtranslation[1] = y, and dtranslation[2] = z.
-// The elements of drotation are drotation[0] = rx, drotation[1] = ry, and
-// drotation[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.
-////////////////////////////////////////////////////////////////////////
- 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
-// dtranslation and drotation. If every element of dtranslation and
-// drotation 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 dtranslation
-// are dtranslation[0] = r, dtranslation[1] = rphi, and dtranslation[2] = z.
-// The elements of drotation are drotation[0] = rx, drotation[1] = ry, and
-// drotation[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.
-////////////////////////////////////////////////////////////////////////
- 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.
-////////////////////////////////////////////////////////////////////////
- Int_t i,j;
- Double_t t[3],r[3];
- 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(r);
- for(j=0;j<3;j++){
- t[j] += ran.Gaus(0.0,stran[j]);
- r[j] += ran.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.
-////////////////////////////////////////////////////////////////////////
- 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;