- // 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 bos 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];
-
- 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::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];
-
- 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::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];
-
- 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::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];
-
- 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::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];
-
- 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 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];
-
- 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::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];
-
- 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::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];
-
- 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::Sphere(const char *gnam,const TString &dis,
- Double_t rmin,Double_t rmax,Double_t the1,
- Double_t the2,Double_t phi1,Double_t phi2,
- Int_t med){
- // Interface to TMC->Gsvolu() for ITS SPHE geometries. Segment of a
- // sphereical shell. It has 6 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 the1 staring polar angle of the shell [degree].
- // Double_t the2 ending polar angle of the shell [degree].
- // Double_t phui staring asimuthal angle of the shell [degree].
- // Double_t phi2 ending asimuthal angle of the shell [degree].
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[6];
-
- param[0] = fScale*rmin;
- param[1] = fScale*rmax;
- param[2] = the1;
- param[3] = the2;
- param[4] = phi1;
- param[5] = phi2;
- G3name(gnam,name);
- gMC->Gsvolu(name,"SPHE",GetMed(med),param,6);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::Parallelepiped(const char *gnam,const TString &dis,
- Double_t dx,Double_t dy,Double_t dz,
- Double_t alpha,Double_t thet,
- Double_t phi,Int_t med){
- // Interface to TMC->Gsvolu() for ITS PARA geometries. Parallelepiped. It
- // has 6 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 dx half-length allong x-axis
- // Double_t dy half-length allong y-axis
- // Double_t dz half-length allong z-axis
- // Double_t alpha angle formed by the y axis and by the plane
- // joining the center of teh faces parallel to the
- // z-x plane at -dY and +dy [degree].
- // Double_t thet polar angle of the line joining the centers of
- // the faces at -dz and +dz in z [degree].
- // Double_t phi azimuthal angle of teh line joing the centers
- // of the faaces at -dz and +dz in z [degree].
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t param[6];
-
- param[0] = fScale*dx;
- param[1] = fScale*dy;
- param[2] = fScale*dz;
- param[3] = alpha;
- param[4] = thet;
- param[5] = phi;
- G3name(gnam,name);
- gMC->Gsvolu(name,"PARA",GetMed(med),param,6);
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::PolyGon(const char *gnam,const TString &dis,
- Double_t phi1,Double_t dphi,Int_t npdv,
- Int_t nz,Double_t *z,Double_t *rmin,
- Double_t *rmax,Int_t med){
- // Interface to TMC->Gsvolu() for ITS PGON geometry. Polygon It has 10
- // 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 npdv the number of sides of teh cross section
- // between the given phi limits.
- // 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 coordiates of the sections..
- // Double_t *rmin array [nz] of radius of teh circle tangent to
- // the sides of the inner polygon in teh
- // cross-section.
- // Double_t *rmax array [nz] of radius of the circle tangent to
- // the sides of the outer polygon in the
- // cross-section.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t *param;
- Int_t n,i;
-
- n = 4+3*nz;
- param = new Float_t[n];
- param[0] = phi1;
- param[1] = dphi;
- param[2] = (Float_t)npdv;
- param[3] = (Float_t)nz;
- for(i=0;i<nz;i++){
- param[4+3*i] = fScale*z[i];
- param[5+3*i] = fScale*rmin[i];
- param[6+3*i] = fScale*rmax[i];
- } // end for i
- G3name(gnam,name);
- gMC->Gsvolu(name,"PGON",GetMed(med),param,n);
-
- delete[] param;
-}
-//______________________________________________________________________
-void AliITSBaseGeometry::PolyGon(AliITSPGonData &d,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:
- // AliITSPGonData &d Object with poly cone data stored in it.
- // Int_t med media index number.
- // Output:
- // none.
- // Return.
- // none.
- char name[5];
- Float_t *param;
- Int_t n,i,k;
- char *j = (char *) &k;
-
- n = 4+3*d.Nz();
- param = new Float_t[n];
- param[0] = d.Phi0();
- param[1] = d.DPhi();
- param[2] = (Float_t) d.NPhi();
- param[3] = (Float_t) d.Nz();
- for(i=0;i<d.Nz();i++){
- param[4+3*i] = fScale*d.ZAt(i);
- param[5+3*i] = fScale*d.Rmin(i);
- param[6+3*i] = fScale*d.Rmax(i);
- } // end for i
- 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,"PGON",GetMed(med),param,n);