- fVolName[fVolNameLast] = name;
- fVolNameLast++;
- return fVolNameLast-1; // return the index
-}
-//______________________________________________________________________
-Int_t AliITSBaseGeometry::ITSIndexToITSG3name(const Int_t i){
- // Given the ITS volume index i, it returns the Geant3 ITS volume
- // name. The valid characters must be in the range
- // '0' through 'Z'. This will include all upper case letter and the
- // numbers 0-9. In addition it does not will include the following simbols
- // ":;<=>?@"
- // Inputs:
- // const Int_t i the ITS volume index
- // Output:
- // none.
- // Return:
- // char[4] with the ITS volume name starting from "I000" to "IZZZ"
- const Int_t rangen=(Int_t)('9'-'0'+1); // range of numbers
- const Int_t rangel=(Int_t)('Z'-'A'+1); // range of letters
- const Int_t range = rangen+rangel; // the number of characters between
- // 0-9 and A-Z.
- Int_t k;
- Byte_t *a = (Byte_t*) &k;
- Int_t j = i;
-
- k = 0;
- a[0] = (Byte_t)('I');
- a[1] = (Byte_t)('0'+j/(range*range));
- if(a[1]>'9') a[1] += 'A'-'9'-1;//if it is a letter add in gap for simples.
- j -= range*range*((Int_t)(j/(range*range)));
- a[2] = (Byte_t)('0'+j/range);
- if(a[2]>'9') a[2] += 'A'-'9'-1;//if it is a letter add in gap for simples.
- j -= range*((Int_t)(j/range));
- a[3] = (Byte_t)('0'+j);
- if(a[3]>'9') a[3] += 'A'-'9'-1;//if it is a letter add in gap for simples.
- return k;
-}
-//______________________________________________________________________
-Int_t AliITSBaseGeometry::ITSG3VnameToIndex(const char *name){
- // Given the last three characters of the ITS Geant3 volume name,
- // this returns the index. The valid characters must be in the range
- // '0' through 'Z'. This will include all upper case letter and the
- // numbers 0-9. In addition it will include the following simbles
- // ":;<=>?@"
- // Inputs:
- // const char name[3] The last three characters of the ITS Geant3
- // volume name
- // Output:
- // none.
- // Return:
- // Int_t the index.
- const Int_t rangen = (Int_t)('9'-'0'+1); // range of numbers
- const Int_t rangel = (Int_t)('Z'-'A'+1); // range of letters
- const Int_t range = rangen+rangel; // the number of characters between
- // 0-9 + A-Z.
- Int_t i=0,j,k;
-
- k = strlen(name)-1;
- for(j=k;j>k-3;j--) if(isdigit(name[j])) // number
- i += (Int_t)((name[j]-'0')*TMath::Power((Double_t)range,
- (Double_t)(k-j)));
- else
- i += (Int_t)((name[j]-'A'+rangen)*TMath::Power((Double_t)range,
- (Double_t)(k-j)));
- return i;
-}
-//______________________________________________________________________
-TString AliITSBaseGeometry::GetVolName(const Int_t i)const{
- // Returns the volume name at a given index i. Index must be in
- // range and the array of volume names must exist. If there is an
- // error, a message is written and 0 is returned.
- // Inputs:
- // const Int_t i Index
- // Output:
- // none.
- // Return:
- // A TString contianing the ITS volume name.
-
- if(i<0||i>=fVolNameLast){
- Error("GetVolName","Index=%d out of range but be witin 0<%d",i,
- fVolName-1);
- return 0;
- } // end if Error
- return fVolName[i];
-}
-//______________________________________________________________________
-Int_t AliITSBaseGeometry::GetVolumeIndex(const TString &a){
- // Return the index corresponding the the volume name a. If the
- // Volumen name is not found, return -1, and a warning message given.
- // Inputs:
- // const TString &a Name of volume for which index is wanted.
- // Output:
- // none.
- // Return:
- // Int_t Index corresponding the volume a. If not found -1 is returned.
- Int_t i;
-
- for(i=0;i<fVolNameLast;i++) if(fVolName[i].CompareTo(a)==0) return i;
- Info("GetVolumeIndex","Volume name %s not found",a.Data());
- return -1;
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Box(const char *gnam,const TString &dis,
- Double_t dx,Double_t dy,Double_t dz,Int_t med){
- // Interface to TMC->Gsvolu() for ITS box geometries. Box with faces
- // perpendicular to the axes. It has 3 paramters. See SetScale() for
- // units. Default units are geant 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t dx half-length of box in x-axis
- // Double_t dy half-length of box in y-axis
- // Double_t dz half-length of box in z-axis
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[3];
-
- AddVolName(dis);
- param[0] = fScale*dx;
- param[1] = fScale*dy;
- param[2] = fScale*dz;
- G3name(gnam,name);
- gMC->Gsvolu(name,"BOX ",GetMed(med),param,3);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Box(AliITSBoxData &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS box geometries. Box with faces
- // perpendicular to the axes. It has 3 paramters. See SetScale() for
- // units. Default units are geant 3 [cm].
- // Inputs:
- // AliITSBoxData &d Structure with the Box parameters defined.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[3];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.DxAt();
- param[1] = fScale*d.DyAt();
- param[2] = fScale*d.DzAt();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"BOX ",GetMed(med),param,3);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid1(const char *gnam,const TString &dis,
- Double_t dxn,Double_t dxp,Double_t dy,
- Double_t dz,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TRD1 geometries. Trapezoid with the
- // x dimension varing along z. It has 4 parameters. See SetScale() for
- // units. Default units are geant 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t dxn half-length along x at the z surface positioned
- // at -DZ
- // Double_t dxp half-length along x at the z surface positioned
- // at +DZ
- // Double_t dy half-length along the y-axis
- // Double_t dz half-length along the z-axis
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[4];
-
- AddVolName(dis);
- param[0] = fScale*dxn;
- param[1] = fScale*dxp;
- param[2] = fScale*dy;
- param[3] = fScale*dz;
- G3name(gnam,name);
- gMC->Gsvolu(name,"TRD1",GetMed(med),param,4);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid1(AliITSTrapezoid1Data &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TRD1 geometries. Trapezoid with the
- // x dimension varing along z. It has 4 parameters. See SetScale() for
- // units. Default units are geant 3 [cm].
- // Inputs:
- // AliITSTrapezoid1Data &d Structure with the Trapazoid data in it.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[4];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.DxAt(0);
- param[1] = fScale*d.DxAt(1);
- param[2] = fScale*d.DyAt();
- param[3] = fScale*d.DzAt();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"TRD1",GetMed(med),param,4);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid2(const char *gnam,const TString &dis,
- Double_t dxn,Double_t dxp,Double_t dyn,
- Double_t dyp,Double_t dz,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TRD2 geometries. Trapezoid with the
- // x and y dimension varing along z. It has 5 parameters. See SetScale()
- // for units. Default units are geant 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t dxn half-length along x at the z surface positioned
- // at -DZ
- // Double_t dxp half-length along x at the z surface positioned
- // at +DZ
- // Double_t dyn half-length along x at the z surface positioned
- // at -DZ
- // Double_t dyp half-length along x at the z surface positioned
- // at +DZ
- // Double_t dz half-length along the z-axis
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[5];
-
- AddVolName(dis);
- param[0] = fScale*dxn;
- param[1] = fScale*dxp;
- param[2] = fScale*dyn;
- param[3] = fScale*dyp;
- param[4] = fScale*dz;
- G3name(gnam,name);
- gMC->Gsvolu(name,"TRD2",GetMed(med),param,5);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid2(AliITSTrapezoid2Data &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TRD2 geometries. Trapezoid with the
- // x and y dimension varing along z. It has 5 parameters. See SetScale()
- // for units. Default units are geant 3 [cm].
- // Inputs:
- // AliITSTrapezoid2Data &d Structure with the Trapazoid data in it.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[5];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.DxAt(0);
- param[1] = fScale*d.DxAt(1);
- param[2] = fScale*d.DyAt(0);
- param[3] = fScale*d.DyAt(1);
- param[4] = fScale*d.DzAt();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"TRD2",GetMed(med),param,5);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid(const char *gnam,const TString &dis,
- Double_t dz,Double_t thet,Double_t phi,
- Double_t h1,Double_t bl1,Double_t tl1,
- Double_t alp1,Double_t h2,Double_t bl2,
- Double_t tl2,Double_t alp2,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TRAP geometries. General Trapezoid,
- // The faces perpendicular to z are trapezia and their centers are not
- // necessarily on a line parallel to the z axis. This shape has 11
- // parameters, but only cosidering that the faces should be planar, only
- // 9 are really independent. A check is performed on the user parameters
- // and a message is printed in case of non-planar faces. Ignoring this
- // warning may cause unpredictable effects at tracking time. See
- // SetScale() for units. Default units are geant 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t dz Half-length along the z-asix
- // Double_t thet Polar angle of the line joing the center of the
- // face at -dz to the center of the one at dz
- // [degree].
- // Double_t phi aximuthal angle of the line joing the center of
- // the face at -dz to the center of the one at +dz
- // [degree].
- // Double_t h1 half-length along y of the face at -dz.
- // Double_t bl1 half-length along x of the side at -h1 in y of
- // the face at -dz in z.
- // Double_t tl1 half-length along x of teh side at +h1 in y of
- // the face at -dz in z.
- // Double_t alp1 angle with respect to the y axis from the
- // center of the side at -h1 in y to the cetner
- // of the side at +h1 in y of the face at -dz in z
- // [degree].
- // Double_t h2 half-length along y of the face at +dz
- // Double_t bl2 half-length along x of the side at -h2 in y of
- // the face at +dz in z.
- // Double_t tl2 half-length along x of the side at _h2 in y of
- // the face at +dz in z.
- // Double_t alp2 angle with respect to the y axis from the
- // center of the side at -h2 in y to the center
- // of the side at +h2 in y of the face at +dz in z
- // [degree].
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[11];
-
- AddVolName(dis);
- param[0] = fScale*dz;
- param[1] = thet;
- param[2] = phi;
- param[3] = fScale*h1;
- param[4] = fScale*bl1;
- param[5] = fScale*tl1;
- param[6] = alp1;
- param[7] = fScale*h2;
- param[8] = fScale*bl2;
- param[9] = fScale*tl2;
- param[10] = alp2;
- G3name(gnam,name);
- gMC->Gsvolu(name,"TRAP",GetMed(med),param,11);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid(AliITSTrapezoidData &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TRAP geometries. General Trapezoid,
- // The faces perpendicular to z are trapezia and their centers are not
- // necessarily on a line parallel to the z axis. This shape has 11
- // parameters, but only cosidering that the faces should be planar, only
- // 9 are really independent. A check is performed on the user parameters
- // and a message is printed in case of non-planar faces. Ignoring this
- // warning may cause unpredictable effects at tracking time. See
- // SetScale() for units. Default units are geant 3 [cm].
- // Inputs:
- // AliITSTrapezoidData &d Structure with the Trapazoid data in it.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[11];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.DzAt();
- param[1] = d.Theta();
- param[2] = d.Phi();
- param[3] = fScale*d.HAt(0);
- param[4] = fScale*d.Bl(0);
- param[5] = fScale*d.Tl(0);
- param[6] = d.Alpha(0);
- param[7] = fScale*d.HAt(1);
- param[8] = fScale*d.Bl(1);
- param[9] = fScale*d.Tl(1);
- param[10] = d.Alpha(1);
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"TRAP",GetMed(med),param,11);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::TwistedTrapezoid(const char *gnam,
- const TString &dis,
- Double_t dz,Double_t thet,Double_t phi,
- Double_t twist,Double_t h1,Double_t bl1,
- Double_t tl1,Double_t apl1,Double_t h2,
- Double_t bl2,Double_t tl2,Double_t apl2,
- Int_t med){
- // Interface to TMC->Gsvolu() for ITS GTRA geometries. General twisted
- // trapazoid. The faces perpendicular to z are trapazia and their centers
- // are not necessarily on a line parallel to the z axis as the TRAP.
- // Additionally, the faces may be twisted so that none of their edges are
- // parallel. It is a TRAP shape, exept that it is twisted in the x-y
- // plane as a function of z. The parallel sides perpendicular to the x
- // axis are rotated with respect to the x axis by an angle TWIST, which
- // is one of the parameters. The shape is defined by the eight corners
- // and is assumed to be constructed of straight lines joingin points on
- // the boundry of the trapezoidal face at Z=-dz to the coresponding
- // points on the face at z=+dz. Divisions are not allowed. It has 12
- // parameters. See SetScale() for units. Default units are geant 3 [cm].
- // Note: This shape suffers from the same limitations than the TRAP. The
- // tracking routines assume that the faces are planar, but htis
- // constraint is not easily expressed in terms of the 12 parameters.
- // Additionally, no check on th efaces is performed in this case. Users
- // should avoid to use this shape as much as possible, and if they have
- // to do so, they should make sure that the faces are really planes.
- // If this is not the case, the result of the trasport is unpredictable.
- // To accelerat ethe computations necessary for trasport, 18 additioanl
- // parameters are calculated for this shape are 1 DXODZ dx/dz of the
- // line joing the centers of the faces at z=+_dz. 2 DYODZ dy/dz of the
- // line joing the centers of the faces at z=+_dz.
- // 3 XO1 x at z=0 for line joing the + on parallel side, perpendicular
- // corners at z=+_dz.
- // 4 YO1 y at z=0 for line joing the + on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 5 DXDZ1 dx/dz for line joing the + on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 6 DYDZ1 dy/dz for line joing the + on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 7 X02 x at z=0 for line joing the - on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 8 YO2 y at z=0 for line joing the - on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 9 DXDZ2 dx/dz for line joing the - on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 10 DYDZ2dy/dz for line joing the - on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 11 XO3 x at z=0 for line joing the - on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 12 YO3 y at z=0 for line joing the - on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 13 DXDZ3 dx/dzfor line joing the - on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 14 DYDZ3 dydz for line joing the - on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 15 XO4 x at z=0 for line joing the + on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 16 YO4 y at z=0 for line joing the + on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 17 DXDZ4 dx/dz for line joing the + on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 18 DYDZ4 dydz for line joing the + on parallel side, - on
- // perpendicular corners at z=+-dz.
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t dz half-length along the z axis.
- // Double_t thet polar angle of the line joing the center of the
- // face at -dz to the center of the one at +dz
- // [degrees].
- // Double_t phi Azymuthal angle of teh line joing the centre of
- // the face at -dz to the center of the one at +dz
- // [degrees].
- // Double_t twist Twist angle of the faces parallel to the x-y
- // plane at z=+-dz around an axis parallel to z
- // passing through their centre [degrees].
- // Double_t h1 Half-length along y of the face at -dz.
- // Double_t bl1 half-length along x of the side -h1 in y of the
- // face at -dz in z.
- // Double_t tl1 half-length along x of the side at +h1 in y of
- // the face at -dz in z.
- // Double_t apl1 Angle with respect to the y ais from the center
- // of the side at -h1 in y to the centere of the
- // side at +h1 in y of the face at -dz in z
- // [degrees].
- // Double_t h2 half-length along the face at +dz.
- // Double_t bl2 half-length along x of the side at -h2 in y of
- // the face at -dz in z.
- // Double_t tl2 half-length along x of the side at +h2 in y of
- // the face at +dz in z.
- // Double_t apl2 angle with respect to the y axis from the
- // center of the side at -h2 in y to the center
- // of the side at +h2 in y of the face at +dz in
- // z [degrees].
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[12];
-
- AddVolName(dis);
- param[0] = fScale*dz;
- param[1] = thet;
- param[2] = phi;
- param[3] = twist;
- param[4] = fScale*h1;
- param[5] = fScale*bl1;
- param[6] = fScale*tl1;
- param[7] = apl1;
- param[8] = fScale*h2;
- param[9] = fScale*bl2;
- param[10] = fScale*tl2;
- param[11] = apl2;
- G3name(gnam,name);
- gMC->Gsvolu(name,"GTRA",GetMed(med),param,12);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::TwistedTrapezoid(AliITSTrapezoidTwistedData &d,
- Int_t med){
- // Interface to TMC->Gsvolu() for ITS GTRA geometries. General twisted
- // trapazoid. The faces perpendicular to z are trapazia and their centers
- // are not necessarily on a line parallel to the z axis as the TRAP.
- // Additionally, the faces may be twisted so that none of their edges are
- // parallel. It is a TRAP shape, exept that it is twisted in the x-y
- // plane as a function of z. The parallel sides perpendicular to the x
- // axis are rotated with respect to the x axis by an angle TWIST, which
- // is one of the parameters. The shape is defined by the eight corners
- // and is assumed to be constructed of straight lines joingin points on
- // the boundry of the trapezoidal face at Z=-dz to the coresponding
- // points on the face at z=+dz. Divisions are not allowed. It has 12
- // parameters. See SetScale() for units. Default units are geant 3 [cm].
- // Note: This shape suffers from the same limitations than the TRAP. The
- // tracking routines assume that the faces are planar, but htis
- // constraint is not easily expressed in terms of the 12 parameters.
- // Additionally, no check on th efaces is performed in this case. Users
- // should avoid to use this shape as much as possible, and if they have
- // to do so, they should make sure that the faces are really planes.
- // If this is not the case, the result of the trasport is unpredictable.
- // To accelerat ethe computations necessary for trasport, 18 additioanl
- // parameters are calculated for this shape are 1 DXODZ dx/dz of the
- // line joing the centers of the faces at z=+_dz. 2 DYODZ dy/dz of the
- // line joing the centers of the faces at z=+_dz.
- // 3 XO1 x at z=0 for line joing the + on parallel side, perpendicular
- // corners at z=+_dz.
- // 4 YO1 y at z=0 for line joing the + on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 5 DXDZ1 dx/dz for line joing the + on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 6 DYDZ1 dy/dz for line joing the + on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 7 X02 x at z=0 for line joing the - on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 8 YO2 y at z=0 for line joing the - on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 9 DXDZ2 dx/dz for line joing the - on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 10 DYDZ2dy/dz for line joing the - on parallel side, + on
- // perpendicular corners at z=+-dz.
- // 11 XO3 x at z=0 for line joing the - on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 12 YO3 y at z=0 for line joing the - on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 13 DXDZ3 dx/dzfor line joing the - on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 14 DYDZ3 dydz for line joing the - on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 15 XO4 x at z=0 for line joing the + on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 16 YO4 y at z=0 for line joing the + on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 17 DXDZ4 dx/dz for line joing the + on parallel side, - on
- // perpendicular corners at z=+-dz.
- // 18 DYDZ4 dydz for line joing the + on parallel side, - on
- // perpendicular corners at z=+-dz.
- // Inputs:
- // AliITSTrapezoidTwistedData &d Structure with the tube parameters
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[12];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.DzAt();
- param[1] = d.Theta();
- param[2] = d.Phi();
- param[3] = d.Twist();
- param[4] = fScale*d.HAt(0);
- param[5] = fScale*d.Bl(0);
- param[6] = fScale*d.Tl(0);
- param[7] = d.Alpha(0);
- param[8] = fScale*d.HAt(1);
- param[9] = fScale*d.Bl(1);
- param[10] = fScale*d.Tl(1);
- param[11] = d.Alpha(1);
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"GTRA",GetMed(med),param,12);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Tube(const char *gnam,const TString &dis,
- Double_t rmin,Double_t rmax,Double_t dz,
- Int_t med){
- // Interface to TMC->Gsvolu() for ITS TUBE geometries. Simple Tube. It has
- // 3 parameters. See SetScale()
- // for units. Default units are geant 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t rmin Inside Radius.
- // Double_t rmax Outside Radius.
- // Double_t dz half-length along the z-axis
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[3];
-
- AddVolName(dis);
- param[0] = fScale*rmin;
- param[1] = fScale*rmax;
- param[2] = fScale*dz;
- G3name(gnam,name);
- gMC->Gsvolu(name,"TUBE",GetMed(med),param,3);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Tube(AliITSTubeData &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TUBE geometries. Simple Tube. It has
- // 3 parameters. See SetScale()
- // for units. Default units are geant 3 [cm].
- // Inputs:
- // AliITSTubeData &d Structure with the tube parameters
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[3];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.Rmin();
- param[1] = fScale*d.Rmax();
- param[2] = fScale*d.DzAt();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"TUBE",GetMed(med),param,3);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::TubeSegment(const char *gnam,const TString &dis,
- Double_t rmin,Double_t rmax,Double_t dz,
- Double_t phi1,Double_t phi2,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TUBE geometries. Phi segment of a
- // tube. It has 5 parameters. Phi1 should be smaller than phi2. If this
- // is not the case, the system adds 360 degrees to phi2. See SetScale()
- // for units. Default units are geant 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t rmin Inside Radius.
- // Double_t rmax Outside Radius.
- // Double_t dz half-length along the z-axis
- // Double_t phi1 Starting angle of the segment [degree].
- // Double_t phi2 Ending angle of the segment [degree].
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[5];
-
- AddVolName(dis);
- param[0] = fScale*rmin;
- param[1] = fScale*rmax;
- param[2] = fScale*dz;
- param[3] = phi1;
- param[4] = phi2;
- G3name(gnam,name);
- gMC->Gsvolu(name,"TUBS",GetMed(med),param,5);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::TubeSegment(AliITSTubeSegData &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS TUBE geometries. Phi segment of a
- // tube. It has 5 parameters. Phi1 should be smaller than phi2. If this
- // is not the case, the system adds 360 degrees to phi2. See SetScale()
- // for units. Default units are geant 3 [cm].
- // Inputs:
- // AliITSTubeSegData &d Structure with the tube parameters
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[5];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.Rmin();
- param[1] = fScale*d.Rmax();
- param[2] = fScale*d.DzAt();
- param[3] = d.Phi0();
- param[4] = d.Phi1();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"TUBS",GetMed(med),param,5);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::CutTube(const char *gnam,const TString &dis,
- Double_t rmin,Double_t rmax,Double_t dz,
- Double_t phi1,Double_t phi2,Double_t lx,
- Double_t ly,Double_t lz,Double_t hx,
- Double_t hy,Double_t hz,Int_t med){
- // Interface to TMC->Gsvolu() for ITS CTUB geometries. Cut tube. A tube
- // cut at the extremities with planes not necessarily perpendicular to
- // the z axis. It has 11 parameters. See SetScale() for units. Default
- // units are geant 3 [cm]. phi1 should be smaller than phi2. If this is
- // not the case, the system adds 360 degrees to phi2.
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t rmin Inner radius at z=0 where tube is narrowest.
- // Double_t rmax Outer radius at z=0 where tube is narrowest.
- // Double_t dz half-length along the z-axis
- // Double_t phi1 Starting angle of the segment [degree].
- // Double_t phi2 Ending angle of the segment [degree].
- // Double_t lx x component of a unit vector perpendicular to
- // the face at -dz.
- // Double_t ly y component of a unit vector perpendicular to
- // the face at -dz.
- // Double_t lz z component of a unit vector perpendicular to
- // the face at -dz.
- // Double_t hx x component of a unit vector perpendicular to
- // the face at +dz.
- // Double_t hy y component of a unit vector perpendicular to
- // the face at +dz.
- // Double_t hz z component of a unit vector perpendicular to
- // the face at +dz.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[11];
-
- AddVolName(dis);
- param[0] = fScale*rmin;
- param[1] = fScale*rmax;
- param[2] = fScale*dz;
- param[3] = phi1;
- param[4] = phi2;
- param[5] = lx;
- param[6] = ly;
- param[7] = lz;
- param[8] = hx;
- param[9] = hy;
- param[10] = hz;
- G3name(gnam,name);
- gMC->Gsvolu(name,"CTUB",GetMed(med),param,11);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::CutTube(AliITSTubeCutData &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS CTUB geometries. Cut tube. A tube
- // cut at the extremities with planes not necessarily perpendicular to
- // the z axis. It has 11 parameters. See SetScale() for units. Default
- // units are geant 3 [cm]. phi1 should be smaller than phi2. If this is
- // not the case, the system adds 360 degrees to phi2.
- // Inputs:
- // AliITSTubeCutData &d Structure with the tube parameters
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[11];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.Rmin();
- param[1] = fScale*d.Rmax();
- param[2] = fScale*d.DzAt();
- param[3] = d.Phi0();
- param[4] = d.Phi1();
- param[5] = d.Normal(0,0);
- param[6] = d.Normal(0,1);
- param[7] = d.Normal(0,2);
- param[8] = d.Normal(1,0);
- param[9] = d.Normal(1,1);
- param[10] = d.Normal(1,2);
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"CTUB",GetMed(med),param,11);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::TubeElliptical(const char *gnam,const TString &dis,
- Double_t p1,Double_t p2,Double_t dz,Int_t med){
- // Interface to TMC->Gsvolu() for ITS ELTU geometries. Elliptical
- // cross-section Tube. It has 3 parameters. See SetScale()
- // for units. Default units are geant 3 [cm]. The equation of the surface
- // is x^2 * p1^-2 + y^2 * p2^-2 = 1.
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t p1 semi-axis of the elipse along x.
- // Double_t p2 semi-axis of the elipse along y.
- // Double_t dz half-length along the z-axis
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[3];
-
- AddVolName(dis);
- param[0] = fScale*p1;
- param[1] = fScale*p2;
- param[2] = fScale*dz;
- G3name(gnam,name);
- gMC->Gsvolu(name,"ELTU",GetMed(med),param,3);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::TubeElliptical(AliITSTubeEllipticalData &d,
- Int_t med){
- // Interface to TMC->Gsvolu() for ITS ELTU geometries. Elliptical
- // cross-section Tube. It has 3 parameters. See SetScale()
- // for units. Default units are geant 3 [cm]. The equation of the surface
- // is x^2 * p1^-2 + y^2 * p2^-2 = 1.
- // Inputs:
- // AliITSTubeElipticData &d Structure with the tube parameters
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[3];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.P0();
- param[1] = fScale*d.P1();
- param[2] = fScale*d.DzAt();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"ELTU",GetMed(med),param,3);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::HyperbolicTube(const char *gnam,const TString &dis,
- Double_t rmin,Double_t rmax,Double_t dz,
- Double_t thet,Int_t med){
- // Interface to TMC->Gsvolu() for ITS HYPE geometries. Hyperbolic tube.
- // Fore example the inner and outer surfaces are hyperboloids, as would
- // be foumed by a system of cylinderical wires which were then rotated
- // tangentially about their centers. It has 4 parameters. See SetScale()
- // for units. Default units are geant 3 [cm]. The hyperbolic surfaces are
- // given by r^2 = (ztan(thet)^2 + r(z=0)^2.
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t rmin Inner radius at z=0 where tube is narrowest.
- // Double_t rmax Outer radius at z=0 where tube is narrowest.
- // Double_t dz half-length along the z-axis
- // Double_t thet stero angel of rotation of the two faces
- // [degrees].
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[4];
-
- AddVolName(dis);
- param[0] = fScale*rmin;
- param[1] = fScale*rmax;
- param[2] = fScale*dz;
- param[3] = thet;
- G3name(gnam,name);
- gMC->Gsvolu(name,"HYPE",GetMed(med),param,4);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::HyperbolicTube(AliITSTubeHyperbolicData &d,
- Int_t med){
- // Interface to TMC->Gsvolu() for ITS HYPE geometries. Hyperbolic tube.
- // Fore example the inner and outer surfaces are hyperboloids, as would
- // be foumed by a system of cylinderical wires which were then rotated
- // tangentially about their centers. It has 4 parameters. See SetScale()
- // for units. Default units are geant 3 [cm]. The hyperbolic surfaces are
- // given by r^2 = (ztan(thet)^2 + r(z=0)^2.
- // Inputs:
- // AliITSTubeHyperbolicData &d Structure with the tube parameters
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[4];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.Rmin();
- param[1] = fScale*d.Rmax();
- param[2] = fScale*d.DzAt();
- param[3] = d.Theta();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"HYPE",GetMed(med),param,4);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Cone(const char *gnam,const TString &dis,
- Double_t dz,Double_t rmin1,Double_t rmax1,
- Double_t rmin2,Double_t rmax2,Int_t med){
- // Interface to TMC->Gsvolu() for ITS Cone geometries. Conical tube. It
- // has 5 parameters. See SetScale()
- // for units. Default units are geant 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t dz half-length along the z-axis
- // Double_t rmin1 Inside Radius at -dz.
- // Double_t rmax1 Outside Radius at -dz.
- // Double_t rmin2 inside radius at +dz.
- // Double_t rmax2 outside radius at +dz.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[5];
-
- AddVolName(dis);
- param[0] = fScale*dz;
- param[1] = fScale*rmin1;
- param[2] = fScale*rmax1;
- param[3] = fScale*rmin2;
- param[4] = fScale*rmax2;
- G3name(gnam,name);
- gMC->Gsvolu(name,"CONS",GetMed(med),param,5);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Cone(AliITSConeData &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS Cone geometries. Conical tube. It
- // has 5 parameters. See SetScale()
- // for units. Default units are geant 3 [cm].
- // Inputs:
- // AliITSConeData &d Structure with the tube parameters
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[5];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.DzAt();
- param[1] = fScale*d.Rmin0();
- param[2] = fScale*d.Rmax0();
- param[3] = fScale*d.Rmin1();
- param[4] = fScale*d.Rmax1();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"CONS",GetMed(med),param,5);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::ConeSegment(const char *gnam,const TString &dis,
- Double_t dz,Double_t rmin1,
- Double_t rmax1,Double_t rmin2,
- Double_t rmax2,Double_t phi1,
- Double_t phi2,Int_t med){
- // Interface to TMC->Gsvolu() for ITS ConS geometries. One segment of a
- // conical tube. It has 7 parameters. Phi1 should be smaller than phi2.
- // If this is not the case, the system adds 360 degrees to phi2. See
- // SetScale() for units. Default units are geant 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that
- // this is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t dz half-length along the z-axis
- // Double_t rmin1 Inside Radius at -dz.
- // Double_t rmax1 Outside Radius at -dz.
- // Double_t rmin2 inside radius at +dz.
- // Double_t rmax2 outside radius at +dz.
- // Double_t phi1 Starting angle of the segment [degree].
- // Double_t phi2 Ending angle of the segment [degree].
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[7];
-
- AddVolName(dis);
- param[0] = fScale*dz;
- param[1] = fScale*rmin1;
- param[2] = fScale*rmax1;
- param[3] = fScale*rmin2;
- param[4] = fScale*rmax2;
- param[5] = phi1;
- param[6] = phi2;
- G3name(gnam,name);
- gMC->Gsvolu(name,"CONS",GetMed(med),param,7);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::ConeSegment(AliITSConeSegData &d,Int_t med){
- // Interface to TMC->Gsvolu() for ITS ConS geometries. One segment of a
- // conical tube. It has 7 parameters. Phi1 should be smaller than phi2.
- // If this is not the case, the system adds 360 degrees to phi2. See
- // SetScale() for units. Default units are geant 3 [cm].
- // Inputs:
- // AliITSConeSegData &d Structure with the tube parameters
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[7];
- Int_t i,k;
- char *j = (char *) &k;
-
- param[0] = fScale*d.DzAt();
- param[1] = fScale*d.Rmin0();
- param[2] = fScale*d.Rmax0();
- param[3] = fScale*d.Rmin1();
- param[4] = fScale*d.Rmax1();
- param[5] = d.Phi0();
- param[6] = d.Phi1();
- d.SetVid(AddVolName((d.GetName())->Data()));
- k = ITSIndexToITSG3name(d.GetVid());
- for(i=0;i<4;i++) name[i] = j[i];
- name[4] = '\0';
- gMC->Gsvolu(name,"CONS",GetMed(med),param,7);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::PolyCone(const char *gnam,const TString &dis,
- Double_t phi1,Double_t dphi,Int_t nz,
- Double_t *z,Double_t *rmin,Double_t *rmax,
- Int_t med){
- // Interface to TMC->Gsvolu() for ITS PCON geometry. Poly-cone It has 9
- // parameters or more. See SetScale() for units. Default units are geant
- // 3 [cm].
- // Inputs:
- // const char *gnam 3 character geant volume name. The letter "I"
- // is appended to the front to indecate that this
- // is an ITS volume.
- // TString &dis String containging part discription.
- // Double_t phi1 the azimuthal angle at which the volume begins
- // (angles are counted clouterclockwise) [degrees].
- // Double_t dphi opening angle of the volume, which extends from
- // phi1 to phi1+dphi [degree].
- // Int_t nz number of planes perpendicular to the z axis
- // where the dimension of the section is given -
- // this number should be at least 2 and NP triples
- // of number must follow.
- // Double_t *z Array [nz] of z coordinate of the section.
- // Double_t *rmin Array [nz] of radius of teh inner circle in the
- // cross-section.
- // Double_t *rmax Array [nz] of radius of the outer circle in the
- // cross-section.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t *param;
- Int_t n,i;
-
- AddVolName(dis);
- n = 3+3*nz;
- param = new Float_t[n];
- param[0] = phi1;
- param[1] = dphi;
- param[2] = (Float_t) nz;
- for(i=0;i<nz;i++){
- param[3+3*i] = fScale*z[i];
- param[4+3*i] = fScale*rmin[i];
- param[5+3*i] = fScale*rmax[i];