ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

/*
$Id$
*/
////////////////////////////////////////////////////////////////
//  This class initializes the class AliITSgeom
//  The initialization is done starting from 
//  a geometry coded by means of the ROOT geometrical modeler
//  This initialization can be used both for simulation and reconstruction
///////////////////////////////////////////////////////////////

#include <TArrayD.h>
#include <TArrayF.h>
#include <TStopwatch.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoVolume.h>
#include <TGeoShape.h>
#include <TGeoBBox.h>
#include <TGeoTrd1.h>
#include <TGeoTrd2.h>
#include <TGeoArb8.h>
#include <TGeoTube.h>
#include <TGeoCone.h>
#include <TGeoSphere.h>
#include <TGeoPara.h>
#include <TGeoPgon.h>
#include <TGeoPcon.h>
#include <TGeoEltu.h>
#include <TGeoHype.h>
#include <TMath.h>

#include "AliLog.h"
#include "AliITSsegmentationSPD.h"
#include "AliITSsegmentationSDD.h"
#include "AliITSsegmentationSSD.h"
#include "AliITSInitGeometry.h"
#include <TDatime.h>

ClassImp(AliITSInitGeometry)

//______________________________________________________________________
AliITSInitGeometry::AliITSInitGeometry():
TObject(),                   // Base Class
fName(0),                    // Geometry name
fMajorVersion(kvDefault),    // Major versin number
fTiming(kFALSE),             // Flag to start inilization timing
fSegGeom(kFALSE),            // Flag to switch between the old use of
                             // AliITSgeomS?D class, or AliITSsegmentation
                             // class in fShape of AliITSgeom class.
fDecode(kFALSE),             // Flag for new/old decoding
fDebug(0){                   // Debug flag
    // Default Creator
    // Inputs:
    //   none.
    // Outputs:
    //   none.
    // Return:
    //   A default inilized AliITSInitGeometry object

    fName = "Undefined";
}
//______________________________________________________________________
AliITSInitGeometry::AliITSInitGeometry(AliITSVersion_t version):
TObject(),                   // Base Class
fName(0),                    // Geometry name
fMajorVersion(version),      // Major version number
fTiming(kFALSE),             // Flag to start inilization timing
fSegGeom(kFALSE),            // Flag to switch between the old use of
                             // AliITSgeomS?D class, or AliITSsegmentation
                             // class in fShape of AliITSgeom class.
fDecode(kFALSE),             // Flag for new/old decoding
fDebug(0){                   // Debug flag
    // Default Creator
    // Inputs:
    //   none.
    // Outputs:
    //   none.
    // Return:
    //   A default inilized AliITSInitGeometry object

  switch (version) {
    case kv11:
        fName="AliITSv11";
	break;
    case kvDefault:
    default:
        AliFatal(Form("Undefined geometry: fMajorVersion=%d, ",(Int_t)fMajorVersion));
        fName = "Undefined";
	break;
    } // switch
}
//______________________________________________________________________
AliITSgeom* AliITSInitGeometry::CreateAliITSgeom(){
    // Creates and Initilizes the geometry transformation class AliITSgeom
    // to values appropreate to this specific geometry. Now that
    // the segmentation is part of AliITSgeom, the detector
    // segmentations are also defined here.
    // Inputs:
    //   none.
    // Outputs:
    //   none.
    // Return:
    //   A pointer to a new properly inilized AliITSgeom class. If
    //   pointer = 0 then failed to init.


  AliITSVersion_t version = kvDefault;
  TDatime datetime;
  TGeoVolume *itsV = gGeoManager->GetVolume("ITSV");
  if(!itsV){
    AliError("Can't find ITS volume ITSV, exiting - nothing done!");
    return 0;
  }// end if
  const Char_t *title = itsV->GetTitle();
  if(!ReadVersionString(title,version))
    Warning("UpdateInternalGeometry","Can't read title=%s\n",title);
  SetTiming(kFALSE);
  SetSegGeom(kFALSE);
  SetDecoding(kFALSE);
  AliITSgeom *geom = CreateAliITSgeom(version);
  AliDebug(1,"AliITSgeom object has been initialized from TGeo\n");
  return geom;
}
//______________________________________________________________________
AliITSgeom* AliITSInitGeometry::CreateAliITSgeom(Int_t major){
    // Creates and Initilizes the geometry transformation class AliITSgeom
    // to values appropreate to this specific geometry. Now that
    // the segmentation is part of AliITSgeom, the detector
    // segmentations are also defined here.
    // Inputs:
    //   Int_t major   major version, see AliITSVersion_t
    //   
    // Outputs:
    //   none.
    // Return:
    //   A pointer to a new properly inilized AliITSgeom class. If
    //   pointer = 0 then failed to init.

    switch(major){
    case kv11:
        SetGeometryName("AliITSv11");
        SetVersion(kv11);
        break;
    case kvDefault:
    default:
        SetGeometryName("Undefined");
        SetVersion(kvDefault);
        break;
    } // end switch
    AliITSgeom *geom = new AliITSgeom();
    if(!InitAliITSgeom(geom)){ // Error initilization failed
	delete geom;
	geom = 0;
    } // end if
    return geom;
}
//______________________________________________________________________
Bool_t AliITSInitGeometry::InitAliITSgeom(AliITSgeom *geom){
  // Initilizes the geometry transformation class AliITSgeom
  // to values appropreate to this specific geometry. Now that
  // the segmentation is part of AliITSgeom, the detector
  // segmentations are also defined here.
  // Inputs:
  //   AliITSgeom *geom  A pointer to the AliITSgeom class
  // Outputs:
  //   AliITSgeom *geom  This pointer recreated and properly inilized.
  // Return:
  //   none.

    if(!gGeoManager){
        AliFatal("The geometry manager has not been initialized (e.g. "
                 "TGeoManager::Import(\"geometry.root\")should be "
                 "called in advance) - exit forced");
        return kFALSE;
    } // end if
    switch(fMajorVersion) {
    case kv11: {
        return InitAliITSgeomV11(geom);
    } break; // end case
    case kvDefault: default: {
        AliFatal("Undefined geometry");
        return kFALSE;
    } break; // end case
    } // end switch
    return kFALSE;
}
//______________________________________________________________________
void AliITSInitGeometry::TransposeTGeoHMatrix(TGeoHMatrix *m)const{
    // Transpose the rotation matrix part of a TGeoHMatrix. This
    // is needed because TGeo stores the transpose of the rotation
    // matrix as compared to what AliITSgeomMatrix uses (and Geant3).
    // Inputs:
    //    TGeoHMatrix *m  The matrix to be transposed
    // Outputs:
    //    TGEoHMatrix *m  The transposed matrix
    // Return:
    //    none.
    Int_t i;
    Double_t r[9];

    if(m==0) return; // no matrix to transpose.
    for(i=0;i<9;i += 4) r[i] = m->GetRotationMatrix()[i]; // diagonals
    r[1] = m->GetRotationMatrix()[3];
    r[2] = m->GetRotationMatrix()[6];
    r[3] = m->GetRotationMatrix()[1];
    r[5] = m->GetRotationMatrix()[7];
    r[6] = m->GetRotationMatrix()[2];
    r[7] = m->GetRotationMatrix()[5];
    m->SetRotation(r);
    return;
}


//______________________________________________________________________
Bool_t AliITSInitGeometry::InitAliITSgeomV11(AliITSgeom *geom){
  // Initilizes the geometry transformation class AliITSgeom
  // Now that the segmentation is part of AliITSgeom, the detector
  // segmentations are also defined here.
  //
  // Inputs:
  //   AliITSgeom *geom  A pointer to the AliITSgeom class
  // Outputs:
  //   AliITSgeom *geom  This pointer recreated and properly inilized.
  // LG

  const Int_t kItype  = 0; // Type of transformation defined 0=> Geant
  const Int_t klayers = 6; // number of layers in the ITS
  const Int_t kladders[klayers]   = {20,40,14,22,34,38}; // Number of ladders
  const Int_t kdetectors[klayers] = {4,4,6,8,22,25};// number of detector/lad
  const AliITSDetector kIdet[6]   = {kSPD,kSPD,kSDD,kSDD,kSSD,kSSD};
  const TString kPathbase = "/ALIC_1/ITSV_1/";

  const char *pathSPDsens1, *pathSPDsens2;
  pathSPDsens1="%sITSSPD_1/ITSSPDCarbonFiberSectorV_%d/ITSSPDSensitiveVirtualvolumeM0_1/ITSSPDlay1-Stave_%d/ITSSPDhalf-Stave%d_1/ITSSPDlay1-Ladder_%d/ITSSPDlay1-sensor_1";
  pathSPDsens2="%sITSSPD_1/ITSSPDCarbonFiberSectorV_%d/ITSSPDSensitiveVirtualvolumeM0_1/ITSSPDlay2-Stave_%d/ITSSPDhalf-Stave%d_1/ITSSPDlay2-Ladder_%d/ITSSPDlay2-sensor_1";

  const char *pathSDDsens1, *pathSDDsens2;
  pathSDDsens1 = "%sITSsddLayer3_1/ITSsddLadd_%d/ITSsddSensor3_%d/ITSsddWafer3_%d/ITSsddSensitivL3_1";
  pathSDDsens2 = "%sITSsddLayer4_1/ITSsddLadd_%d/ITSsddSensor4_%d/ITSsddWafer4_%d/ITSsddSensitivL4_1";

  const char *pathSSDsens1, *pathSSDsens2;
  pathSSDsens1 = "%sITSssdLayer5_1/ITSssdLay5Ladd_%d/ITSssdSensor5_%d/ITSssdSensitivL5_1";
  pathSSDsens2 = "%sITSssdLayer6_1/ITSssdLay6Ladd_%d/ITSssdSensor6_%d/ITSssdSensitivL6_1";

  const TString kNames[klayers] = {
    pathSPDsens1, // lay=1
    pathSPDsens2, // lay=2
    pathSDDsens1, // lay=3
    pathSDDsens2, // lay=4
    pathSSDsens1, // lay=5
    pathSSDsens2};// Lay=6
  
  Int_t mod,nmods=0, lay, lad, det, cpn0, cpn1, cpn2, cpnHS=1;
  Double_t tran[3]={0.,0.,0.}, rot[10]={9*0.0,1.0};
  TArrayD shapePar;
  TString path, shapeName;
  TGeoHMatrix matrix;
  Bool_t initSeg[3]={kFALSE, kFALSE, kFALSE};
  TStopwatch *time = 0x0;
  if(fTiming) time = new TStopwatch();

  if(fTiming) time->Start();
  for(mod=0;mod<klayers;mod++) nmods += kladders[mod]*kdetectors[mod];
  geom->Init(kItype,klayers,kladders,kdetectors,nmods);

  for(mod=0; mod<nmods; mod++) {

    DecodeDetectorLayers(mod,lay,lad,det);
    geom->CreateMatrix(mod,lay,lad,det,kIdet[lay-1],tran,rot);
    RecodeDetector(mod,cpn0,cpn1,cpn2);

    if (kIdet[lay-1]==kSPD) { // we need 1 more copy number because of the half-stave
      if (det<3) cpnHS = 0; else cpnHS = 1;
      path.Form(kNames[lay-1].Data(),kPathbase.Data(),cpn0,cpn1,cpnHS,cpn2);
    } else {
      path.Form(kNames[lay-1].Data(),kPathbase.Data(),cpn0,cpn1,cpn2);
    };

    geom->GetGeomMatrix(mod)->SetPath(path);
    GetTransformation(path.Data(),matrix);
    geom->SetTrans(mod,matrix.GetTranslation());
    TransposeTGeoHMatrix(&matrix); //Transpose TGeo's rotation matrixes
    geom->SetRotMatrix(mod,matrix.GetRotationMatrix());
    if(initSeg[kIdet[lay-1]]) continue;
    GetShape(path,shapeName,shapePar);
    if(shapeName.CompareTo("BOX")){
      Error("InitITSgeom","Geometry changed without proper code update"
	    "or error in reading geometry. Shape is not BOX.");
      return kFALSE;
    } // end if
  } // end for module

  if(fTiming){
    time->Stop();
    time->Print();
    delete time;
  } // end if
  return kTRUE;
}

//_______________________________________________________________________
Bool_t AliITSInitGeometry::GetTransformation(const TString &volumePath,
					     TGeoHMatrix &mat){
    // Returns the Transformation matrix between the volume specified
    // by the path volumePath and the Top or mater volume. The format
    // of the path volumePath is as follows (assuming ALIC is the Top volume)
    // "/ALIC_1/DDIP_1/S05I_2/S05H_1/S05G_3". Here ALIC is the top most
    // or master volume which has only 1 instance of. Of all of the daughter
    // volumes of ALICE, DDIP volume copy #1 is indicated. Similarly for
    // the daughter volume of DDIP is S05I copy #2 and so on.
    // Inputs:
    //   TString& volumePath  The volume path to the specific volume
    //                        for which you want the matrix. Volume name
    //                        hierarchy is separated by "/" while the
    //                        copy number is appended using a "_".
    // Outputs:
    //  TGeoHMatrix &mat      A matrix with its values set to those
    //                        appropriate to the Local to Master transformation
    // Return:
    //   A logical value if kFALSE then an error occurred and no change to
    //   mat was made.

    // We have to preserve the modeler state

    // Preserve the modeler state.
    gGeoManager->PushPath();
    if (!gGeoManager->cd(volumePath.Data())) {
      gGeoManager->PopPath();
      Error("GetTransformation","Error in cd-ing to %s",volumePath.Data());
      return kFALSE;
    } // end if !gGeoManager
    mat = *gGeoManager->GetCurrentMatrix();
    // Retstore the modeler state.
    gGeoManager->PopPath();
    return kTRUE;
}
//______________________________________________________________________
Bool_t AliITSInitGeometry::GetShape(const TString &volumePath,
				    TString &shapeType,TArrayD &par){
    // Returns the shape and its parameters for the volume specified
    // by volumeName.
    // Inputs:
    //   TString& volumeName  The volume name
    // Outputs:
    //   TString &shapeType   Shape type
    //   TArrayD &par         A TArrayD of parameters with all of the
    //                        parameters of the specified shape.
    // Return:
    //   A logical indicating whether there was an error in getting this
    //   information
    Int_t npar;
    gGeoManager->PushPath();
    if (!gGeoManager->cd(volumePath.Data())) {
	gGeoManager->PopPath();
	return kFALSE;
    }
    TGeoVolume * vol = gGeoManager->GetCurrentVolume();
    gGeoManager->PopPath();
    if (!vol) return kFALSE;
    TGeoShape *shape = vol->GetShape();
    TClass *classType = shape->IsA();
    if (classType==TGeoBBox::Class()) {
	shapeType = "BOX";
	npar = 3;
	par.Set(npar);
	TGeoBBox *box = (TGeoBBox*)shape;
	par.AddAt(box->GetDX(),0);
	par.AddAt(box->GetDY(),1);
	par.AddAt(box->GetDZ(),2);
	return kTRUE;
    } // end if
    if (classType==TGeoTrd1::Class()) {
	shapeType = "TRD1";
	npar = 4;
	par.Set(npar);
	TGeoTrd1 *trd1 = (TGeoTrd1*)shape;
	par.AddAt(trd1->GetDx1(),0);
	par.AddAt(trd1->GetDx2(),1);
	par.AddAt(trd1->GetDy(), 2);
	par.AddAt(trd1->GetDz(), 3);
	return kTRUE;
    } // end if
    if (classType==TGeoTrd2::Class()) {
	shapeType = "TRD2";
	npar = 5;
	par.Set(npar);
	TGeoTrd2 *trd2 = (TGeoTrd2*)shape;
	par.AddAt(trd2->GetDx1(),0);
	par.AddAt(trd2->GetDx2(),1);
	par.AddAt(trd2->GetDy1(),2);
	par.AddAt(trd2->GetDy2(),3);
	par.AddAt(trd2->GetDz(), 4);
	return kTRUE;
    } // end if
    if (classType==TGeoTrap::Class()) {
	shapeType = "TRAP";
	npar = 11;
	par.Set(npar);
	TGeoTrap *trap = (TGeoTrap*)shape;
	Double_t tth = TMath::Tan(trap->GetTheta()*TMath::DegToRad());
	par.AddAt(trap->GetDz(),0);
	par.AddAt(tth*TMath::Cos(trap->GetPhi()*TMath::DegToRad()),1);
	par.AddAt(tth*TMath::Sin(trap->GetPhi()*TMath::DegToRad()),2);
	par.AddAt(trap->GetH1(),3);
	par.AddAt(trap->GetBl1(),4);
	par.AddAt(trap->GetTl1(),5);
	par.AddAt(TMath::Tan(trap->GetAlpha1()*TMath::DegToRad()),6);
	par.AddAt(trap->GetH2(),7);
	par.AddAt(trap->GetBl2(),8);
	par.AddAt(trap->GetTl2(),9);
	par.AddAt(TMath::Tan(trap->GetAlpha2()*TMath::DegToRad()),10);
	return kTRUE;
    } // end if
    if (classType==TGeoTube::Class()) {
	shapeType = "TUBE";
	npar = 3;
	par.Set(npar);
	TGeoTube *tube = (TGeoTube*)shape;
	par.AddAt(tube->GetRmin(),0);
	par.AddAt(tube->GetRmax(),1);
	par.AddAt(tube->GetDz(),2);
	return kTRUE;
    } // end if
    if (classType==TGeoTubeSeg::Class()) {
	shapeType = "TUBS";
	npar = 5;
	par.Set(npar);
	TGeoTubeSeg *tubs = (TGeoTubeSeg*)shape;
	par.AddAt(tubs->GetRmin(),0);
	par.AddAt(tubs->GetRmax(),1);
	par.AddAt(tubs->GetDz(),2);
	par.AddAt(tubs->GetPhi1(),3);
	par.AddAt(tubs->GetPhi2(),4);
	return kTRUE;
    } // end if
    if (classType==TGeoCone::Class()) {
	shapeType = "CONE";
	npar = 5;
	par.Set(npar);
	TGeoCone *cone = (TGeoCone*)shape;
	par.AddAt(cone->GetDz(),0);
	par.AddAt(cone->GetRmin1(),1);
	par.AddAt(cone->GetRmax1(),2);
	par.AddAt(cone->GetRmin2(),3);
	par.AddAt(cone->GetRmax2(),4);
	return kTRUE;
    } // end if
    if (classType==TGeoConeSeg::Class()) {
	shapeType = "CONS";
	npar = 7;
	par.Set(npar);
	TGeoConeSeg *cons = (TGeoConeSeg*)shape;
	par.AddAt(cons->GetDz(),0);
	par.AddAt(cons->GetRmin1(),1);
	par.AddAt(cons->GetRmax1(),2);
	par.AddAt(cons->GetRmin2(),3);
	par.AddAt(cons->GetRmax2(),4);
	par.AddAt(cons->GetPhi1(),5);
	par.AddAt(cons->GetPhi2(),6);
	return kTRUE;
    } // end if
    if (classType==TGeoSphere::Class()) {
	shapeType = "SPHE";
	npar = 6;
	par.Set(npar);
	
	TGeoSphere *sphe = (TGeoSphere*)shape;
	par.AddAt(sphe->GetRmin(),0);
	par.AddAt(sphe->GetRmax(),1);
	par.AddAt(sphe->GetTheta1(),2);
	par.AddAt(sphe->GetTheta2(),3);
	par.AddAt(sphe->GetPhi1(),4);
	par.AddAt(sphe->GetPhi2(),5);
	return kTRUE;
    } // end if
    if (classType==TGeoPara::Class()) {
	shapeType = "PARA";
	npar = 6;
	par.Set(npar);
	TGeoPara *para = (TGeoPara*)shape;
	par.AddAt(para->GetX(),0);
	par.AddAt(para->GetY(),1);
	par.AddAt(para->GetZ(),2);
	par.AddAt(para->GetTxy(),3);
	par.AddAt(para->GetTxz(),4);
	par.AddAt(para->GetTyz(),5);
	return kTRUE;
    } // end if
    if (classType==TGeoPgon::Class()) {
	shapeType = "PGON";
	TGeoPgon *pgon = (TGeoPgon*)shape;
	Int_t nz = pgon->GetNz();
	const Double_t *rmin = pgon->GetRmin();
	const Double_t *rmax = pgon->GetRmax();
	const Double_t *z = pgon->GetZ();
	npar = 4 + 3*nz;
	par.Set(npar);
	par.AddAt(pgon->GetPhi1(),0);
	par.AddAt(pgon->GetDphi(),1);
	par.AddAt(pgon->GetNedges(),2);
	par.AddAt(pgon->GetNz(),3);
	for (Int_t i=0; i<nz; i++) {
	    par.AddAt(z[i], 4+3*i);
	    par.AddAt(rmin[i], 4+3*i+1);
	    par.AddAt(rmax[i], 4+3*i+2);
	}
	return kTRUE;
    } // end if
    if (classType==TGeoPcon::Class()) {
	shapeType = "PCON";
	TGeoPcon *pcon = (TGeoPcon*)shape;
	Int_t nz = pcon->GetNz();
	const Double_t *rmin = pcon->GetRmin();
	const Double_t *rmax = pcon->GetRmax();
	const Double_t *z = pcon->GetZ();
	npar = 3 + 3*nz;
	par.Set(npar);
	par.AddAt(pcon->GetPhi1(),0);
	par.AddAt(pcon->GetDphi(),1);
	par.AddAt(pcon->GetNz(),2);
	for (Int_t i=0; i<nz; i++) {
	    par.AddAt(z[i], 3+3*i);
	    
	    par.AddAt(rmin[i], 3+3*i+1);
	    par.AddAt(rmax[i], 3+3*i+2);
	}
	return kTRUE;
    } // end if
    if (classType==TGeoEltu::Class()) {
	shapeType = "ELTU";
	npar = 3;
	par.Set(npar);
	TGeoEltu *eltu = (TGeoEltu*)shape;
	par.AddAt(eltu->GetA(),0);
	par.AddAt(eltu->GetB(),1);
	par.AddAt(eltu->GetDz(),2);
	return kTRUE;
    } // end if
    if (classType==TGeoHype::Class()) {
	shapeType = "HYPE";
	npar = 5;
	par.Set(npar);
	TGeoHype *hype = (TGeoHype*)shape;
	par.AddAt(TMath::Sqrt(hype->RadiusHypeSq(0.,kTRUE)),0);
	par.AddAt(TMath::Sqrt(hype->RadiusHypeSq(0.,kFALSE)),1);
	par.AddAt(hype->GetDZ(),2);
	par.AddAt(hype->GetStIn(),3);
	par.AddAt(hype->GetStOut(),4);
	return kTRUE;
    } // end if
    if (classType==TGeoGtra::Class()) {
	shapeType = "GTRA";
	npar = 12;
	par.Set(npar);
	TGeoGtra *trap = (TGeoGtra*)shape;
	Double_t tth = TMath::Tan(trap->GetTheta()*TMath::DegToRad());
	par.AddAt(trap->GetDz(),0);
	par.AddAt(tth*TMath::Cos(trap->GetPhi()*TMath::DegToRad()),1);
	par.AddAt(tth*TMath::Sin(trap->GetPhi()*TMath::DegToRad()),2);
	par.AddAt(trap->GetH1(),3);
	par.AddAt(trap->GetBl1(),4);
	par.AddAt(trap->GetTl1(),5);
	par.AddAt(TMath::Tan(trap->GetAlpha1()*TMath::DegToRad()),6);
	par.AddAt(trap->GetH2(),7);
	par.AddAt(trap->GetBl2(),8);
	par.AddAt(trap->GetTl2(),9);
	par.AddAt(TMath::Tan(trap->GetAlpha2()*TMath::DegToRad()),10);
	par.AddAt(trap->GetTwistAngle(),11);
	return kTRUE;
    } // end if
    if (classType==TGeoCtub::Class()) {
	shapeType = "CTUB";
	npar = 11;
	par.Set(npar);
	TGeoCtub *ctub = (TGeoCtub*)shape;
	const Double_t *lx = ctub->GetNlow();
	const Double_t *tx = ctub->GetNhigh();
	par.AddAt(ctub->GetRmin(),0);
	par.AddAt(ctub->GetRmax(),1);
	par.AddAt(ctub->GetDz(),2);
	par.AddAt(ctub->GetPhi1(),3);
	par.AddAt(ctub->GetPhi2(),4);
	par.AddAt(lx[0],5);
	par.AddAt(lx[1],6);
	par.AddAt(lx[2],7);
	par.AddAt(tx[0],8);
	par.AddAt(tx[1],9);
	par.AddAt(tx[2],10);
	return kTRUE;
    } // end if
    Error("GetShape","Getting shape parameters for shape %s not implemented",
	  shape->ClassName());
    shapeType = "Unknown";
    return kFALSE;
}
//______________________________________________________________________
void AliITSInitGeometry::DecodeDetector(
    Int_t &mod,Int_t layer,Int_t cpn0,Int_t cpn1,Int_t cpn2) const {
    // decode geometry into detector module number. There are two decoding
    // Scheams. Old which does not follow the ALICE coordinate system
    // requirements, and New which dose.
    // Inputs:
    //    Int_t layer    The ITS layer
    //    Int_t cpn0     The lowest copy number
    //    Int_t cpn1     The middle copy number
    //    Int_t cpn2     the highest copy number
    // Output:
    //    Int_t &mod     The module number assoicated with this set
    //                   of copy numbers.
    // Return:
    //    none.

    // This is a FIXED switch yard function. I (Bjorn Nilsen) Don't 
    // like them but I see not better way for the moment.
    switch (fMajorVersion){
    case kvDefault:{
        Error("DecodeDetector","Major version = kvDefault, not supported");
    }break;
    case kv11:{
        return DecodeDetectorv11(mod,layer,cpn0,cpn1,cpn2);
    }break;
    default:{
        Error("DecodeDetector","Major version = %d, not supported",
              (Int_t)fMajorVersion);
        return;
    }break;
    } // end switch
    return;
}
//______________________________________________________________________
void AliITSInitGeometry::RecodeDetector(Int_t mod,Int_t &cpn0,
                                        Int_t &cpn1,Int_t &cpn2){
    // decode geometry into detector module number. There are two decoding
    // Scheams. Old which does not follow the ALICE coordinate system
    // requirements, and New which dose.
    // Inputs:
    //    Int_t mod      The module number assoicated with this set
    //                   of copy numbers.
    // Output:
    //    Int_t cpn0     The lowest copy number
    //    Int_t cpn1     The middle copy number
    //    Int_t cpn2     the highest copy number
    // Return:
    //    none.

    // This is a FIXED switch yard function. I (Bjorn Nilsen) Don't 
    // like them but I see not better way for the moment.
    switch (fMajorVersion){
    case kvDefault:{
        Error("RecodeDetector","Major version = kvDefault, not supported");
        return;
    }
    case kv11:{
        return RecodeDetectorv11(mod,cpn0,cpn1,cpn2);
    }break;
    default:{
        Error("RecodeDetector","Major version = %d, not supported",
              (Int_t)fMajorVersion);
        return;
    }break;
    } // end switch
    return;
}
//______________________________________________________________________
void AliITSInitGeometry::DecodeDetectorLayers(Int_t mod,Int_t &layer,
                                              Int_t &lad,Int_t &det){
    // decode geometry into detector module number. There are two decoding
    // Scheams. Old which does not follow the ALICE coordinate system
    // requirements, and New which dose. Note, this use of layer ladder
    // and detector numbers are strictly for internal use of this
    // specific code. They do not represent the "standard" layer ladder
    // or detector numbering except in a very old and obsoleate sence.
    // Inputs:
    //    Int_t mod      The module number assoicated with this set
    //                   of copy numbers.
    // Output:
    //    Int_t lay     The layer number
    //    Int_t lad     The ladder number
    //    Int_t det     the dettector number
    // Return:
    //    none.

    // This is a FIXED switch yard function. I (Bjorn Nilsen) Don't 
    // like them but I see not better way for the moment.
    switch (fMajorVersion) {
    case kvDefault:{
        Error("DecodeDetectorLayers",
              "Major version = kvDefault, not supported");
        return;
    }break;
    case kv11:{
        return DecodeDetectorLayersv11(mod,layer,lad,det);
    }break;
    default:{
        Error("DecodeDetectorLayers","Major version = %d, not supported",
              (Int_t)fMajorVersion);
        return;
    }break;
    } // end switch
    return;
}

//______________________________________________________________________
void AliITSInitGeometry::DecodeDetectorv11(Int_t &mod,Int_t layer,
                                 Int_t cpn0,Int_t cpn1,Int_t cpn2) const {
    // decode geometry into detector module number
    // Inputs:
    //    Int_t layer    The ITS layer
    //    Int_t cpn0     The lowest copy number
    //    Int_t cpn1     The middle copy number
    //    Int_t cpn2     the highest copy number
    // Output:
    //    Int_t &mod     The module number assoicated with this set
    //                   of copy numbers.
    // Return:
    //    none.
  const Int_t kDetPerLadderSPD[2]={2,4};
  const Int_t kDetPerLadder[6]={4,4,6,8,22,25};
  const Int_t kLadPerLayer[6]={20,40,14,22,34,38};
  Int_t lad=-1,det=-1;
  
  switch(layer) {
  case 1: case 2:{
    lad = cpn1+kDetPerLadderSPD[layer-1]*(cpn0-1);
    det = cpn2;
  } break;
  case 3: case 4:{
    lad = cpn0+1;
    det = cpn1+1;
  } break;
  case 5: case 6:{
    lad = cpn0+1;
    det = cpn1+1;
  } break;
  default:{
  } break;
  } // end switch
  mod = 0;
  for(Int_t i=0;i<layer-1;i++) mod += kLadPerLayer[i]*kDetPerLadder[i];
  mod += kDetPerLadder[layer-1]*(lad-1)+det-1;// module start at zero.
  return;
}


//______________________________________________________________________
void AliITSInitGeometry::RecodeDetectorv11(Int_t mod,Int_t &cpn0,
					   Int_t &cpn1,Int_t &cpn2) {
    // decode geometry into detector module number using the new decoding
    // Scheme.
    // Inputs:
    //    Int_t mod      The module number assoicated with this set
    //                   of copy numbers.
    // Output:
    //    Int_t cpn0     The lowest copy number  (SPD sector or SDD/SSD ladder)
    //    Int_t cpn1     The middle copy number  (SPD stave or SDD/SSD module)
    //    Int_t cpn2     the highest copy number (SPD ladder or 1 for SDD/SSD)
    // Return:
    //    none.
    const Int_t kDetPerLadderSPD[2]={2,4};
    Int_t lay,lad,det;

    DecodeDetectorLayersv11(mod,lay,lad,det);
    if (lay<3) { // SPD
        cpn2 = det;     // Detector 1-4
        cpn0 = (lad+kDetPerLadderSPD[lay-1]-1)/kDetPerLadderSPD[lay-1];
        cpn1 = (lad+kDetPerLadderSPD[lay-1]-1)%kDetPerLadderSPD[lay-1] + 1;
    } else { // SDD and SSD
        cpn2 = 1;
        cpn1 = det;
        cpn0 = lad;
        if (lay<5) { // SDD
	  cpn1--;
	  cpn0--;
        } else { //SSD
	  cpn1--;
	  cpn0--;
        } // end if Lay<5/else
    } // end if lay<3/else

}


//______________________________________________________________________
void AliITSInitGeometry::DecodeDetectorLayersv11(Int_t mod,Int_t &lay,
						 Int_t &lad,Int_t &det) {

  // decode module number into detector indices for v11
  // mod starts from 0
  // lay, lad, det start from 1

  // Inputs:
  //    Int_t mod      The module number associated with this set
  //                   of copy numbers.
  // Output:
  //    Int_t lay     The layer number
  //    Int_t lad     The ladder number
  //    Int_t det     the dettector number

  const Int_t kDetPerLadder[6] = {4,4,6,8,22,25};
  const Int_t kLadPerLayer[6]  = {20,40,14,22,34,38};
  
  Int_t mod2 = 0;
  lay  = 0;
  
  do {
    mod2 += kLadPerLayer[lay]*kDetPerLadder[lay];
    lay++;
  } while(mod2<=mod); // end while
  if(lay>6) Error("DecodeDetectorLayers","lay=%d>6",lay);

  mod2 = kLadPerLayer[lay-1]*kDetPerLadder[lay-1] - mod2+mod;
  lad = mod2/kDetPerLadder[lay-1];

  if(lad>=kLadPerLayer[lay-1]||lad<0) Error("DecodeDetectorLayers",
				      "lad=%d not in the correct range",lad);
  det = (mod2 - lad*kDetPerLadder[lay-1])+1;
  if(det>kDetPerLadder[lay-1]||det<1) Error("DecodeDetectorLayers",
				      "det=%d not in the correct range",det);
  lad++;
}

//______________________________________________________________________
Bool_t AliITSInitGeometry::WriteVersionString(Char_t *str,Int_t length,AliITSVersion_t maj)const{
    // fills the string str with the major version number
    // Inputs:
    //   Char_t *str          The character string to hold the major version number
    //   Int_t  length        The maximum number of characters which 
    //                        can be accommodated by this string. 
    //                        str[length-1] must exist
    //   AliITSVersion_t maj  The major number


    Int_t i = (Int_t)maj;
 
    snprintf(str,length-1,"Major Version= %d",i);
    return kTRUE;
}
//______________________________________________________________________
Bool_t AliITSInitGeometry::ReadVersionString(const Char_t *str,AliITSVersion_t &maj)const{
    // fills the string str with the major and minor version number
    // Inputs:
    //   Char_t *str   The character string to holding the major version number
    //   Int_t  length The maximum number of characters which can be
    //                 accommodated by this string. str[length-1] must exist
    // Outputs:
    //   AliITSVersion_t maj  The major number

    // Return:
    //   kTRUE if no errors

  Bool_t retcode=kFALSE;
  Int_t n=strlen(str);
  if(n<15) return retcode; // not enough space for numbers
  Int_t m,i;
  m = sscanf(str,"Major Version= %2d",&i);
  maj = kvDefault;
  if(m>0){
    retcode = kTRUE;
    if(i==11){
      maj = kv11;
    }
  }
  return retcode;
}


 AliITSInitGeometry.cxx:1
 AliITSInitGeometry.cxx:2
 AliITSInitGeometry.cxx:3
 AliITSInitGeometry.cxx:4
 AliITSInitGeometry.cxx:5
 AliITSInitGeometry.cxx:6
 AliITSInitGeometry.cxx:7
 AliITSInitGeometry.cxx:8
 AliITSInitGeometry.cxx:9
 AliITSInitGeometry.cxx:10
 AliITSInitGeometry.cxx:11
 AliITSInitGeometry.cxx:12
 AliITSInitGeometry.cxx:13
 AliITSInitGeometry.cxx:14
 AliITSInitGeometry.cxx:15
 AliITSInitGeometry.cxx:16
 AliITSInitGeometry.cxx:17
 AliITSInitGeometry.cxx:18
 AliITSInitGeometry.cxx:19
 AliITSInitGeometry.cxx:20
 AliITSInitGeometry.cxx:21
 AliITSInitGeometry.cxx:22
 AliITSInitGeometry.cxx:23
 AliITSInitGeometry.cxx:24
 AliITSInitGeometry.cxx:25
 AliITSInitGeometry.cxx:26
 AliITSInitGeometry.cxx:27
 AliITSInitGeometry.cxx:28
 AliITSInitGeometry.cxx:29
 AliITSInitGeometry.cxx:30
 AliITSInitGeometry.cxx:31
 AliITSInitGeometry.cxx:32
 AliITSInitGeometry.cxx:33
 AliITSInitGeometry.cxx:34
 AliITSInitGeometry.cxx:35
 AliITSInitGeometry.cxx:36
 AliITSInitGeometry.cxx:37
 AliITSInitGeometry.cxx:38
 AliITSInitGeometry.cxx:39
 AliITSInitGeometry.cxx:40
 AliITSInitGeometry.cxx:41
 AliITSInitGeometry.cxx:42
 AliITSInitGeometry.cxx:43
 AliITSInitGeometry.cxx:44
 AliITSInitGeometry.cxx:45
 AliITSInitGeometry.cxx:46
 AliITSInitGeometry.cxx:47
 AliITSInitGeometry.cxx:48
 AliITSInitGeometry.cxx:49
 AliITSInitGeometry.cxx:50
 AliITSInitGeometry.cxx:51
 AliITSInitGeometry.cxx:52
 AliITSInitGeometry.cxx:53
 AliITSInitGeometry.cxx:54
 AliITSInitGeometry.cxx:55
 AliITSInitGeometry.cxx:56
 AliITSInitGeometry.cxx:57
 AliITSInitGeometry.cxx:58
 AliITSInitGeometry.cxx:59
 AliITSInitGeometry.cxx:60
 AliITSInitGeometry.cxx:61
 AliITSInitGeometry.cxx:62
 AliITSInitGeometry.cxx:63
 AliITSInitGeometry.cxx:64
 AliITSInitGeometry.cxx:65
 AliITSInitGeometry.cxx:66
 AliITSInitGeometry.cxx:67
 AliITSInitGeometry.cxx:68
 AliITSInitGeometry.cxx:69
 AliITSInitGeometry.cxx:70
 AliITSInitGeometry.cxx:71
 AliITSInitGeometry.cxx:72
 AliITSInitGeometry.cxx:73
 AliITSInitGeometry.cxx:74
 AliITSInitGeometry.cxx:75
 AliITSInitGeometry.cxx:76
 AliITSInitGeometry.cxx:77
 AliITSInitGeometry.cxx:78
 AliITSInitGeometry.cxx:79
 AliITSInitGeometry.cxx:80
 AliITSInitGeometry.cxx:81
 AliITSInitGeometry.cxx:82
 AliITSInitGeometry.cxx:83
 AliITSInitGeometry.cxx:84
 AliITSInitGeometry.cxx:85
 AliITSInitGeometry.cxx:86
 AliITSInitGeometry.cxx:87
 AliITSInitGeometry.cxx:88
 AliITSInitGeometry.cxx:89
 AliITSInitGeometry.cxx:90
 AliITSInitGeometry.cxx:91
 AliITSInitGeometry.cxx:92
 AliITSInitGeometry.cxx:93
 AliITSInitGeometry.cxx:94
 AliITSInitGeometry.cxx:95
 AliITSInitGeometry.cxx:96
 AliITSInitGeometry.cxx:97
 AliITSInitGeometry.cxx:98
 AliITSInitGeometry.cxx:99
 AliITSInitGeometry.cxx:100
 AliITSInitGeometry.cxx:101
 AliITSInitGeometry.cxx:102
 AliITSInitGeometry.cxx:103
 AliITSInitGeometry.cxx:104
 AliITSInitGeometry.cxx:105
 AliITSInitGeometry.cxx:106
 AliITSInitGeometry.cxx:107
 AliITSInitGeometry.cxx:108
 AliITSInitGeometry.cxx:109
 AliITSInitGeometry.cxx:110
 AliITSInitGeometry.cxx:111
 AliITSInitGeometry.cxx:112
 AliITSInitGeometry.cxx:113
 AliITSInitGeometry.cxx:114
 AliITSInitGeometry.cxx:115
 AliITSInitGeometry.cxx:116
 AliITSInitGeometry.cxx:117
 AliITSInitGeometry.cxx:118
 AliITSInitGeometry.cxx:119
 AliITSInitGeometry.cxx:120
 AliITSInitGeometry.cxx:121
 AliITSInitGeometry.cxx:122
 AliITSInitGeometry.cxx:123
 AliITSInitGeometry.cxx:124
 AliITSInitGeometry.cxx:125
 AliITSInitGeometry.cxx:126
 AliITSInitGeometry.cxx:127
 AliITSInitGeometry.cxx:128
 AliITSInitGeometry.cxx:129
 AliITSInitGeometry.cxx:130
 AliITSInitGeometry.cxx:131
 AliITSInitGeometry.cxx:132
 AliITSInitGeometry.cxx:133
 AliITSInitGeometry.cxx:134
 AliITSInitGeometry.cxx:135
 AliITSInitGeometry.cxx:136
 AliITSInitGeometry.cxx:137
 AliITSInitGeometry.cxx:138
 AliITSInitGeometry.cxx:139
 AliITSInitGeometry.cxx:140
 AliITSInitGeometry.cxx:141
 AliITSInitGeometry.cxx:142
 AliITSInitGeometry.cxx:143
 AliITSInitGeometry.cxx:144
 AliITSInitGeometry.cxx:145
 AliITSInitGeometry.cxx:146
 AliITSInitGeometry.cxx:147
 AliITSInitGeometry.cxx:148
 AliITSInitGeometry.cxx:149
 AliITSInitGeometry.cxx:150
 AliITSInitGeometry.cxx:151
 AliITSInitGeometry.cxx:152
 AliITSInitGeometry.cxx:153
 AliITSInitGeometry.cxx:154
 AliITSInitGeometry.cxx:155
 AliITSInitGeometry.cxx:156
 AliITSInitGeometry.cxx:157
 AliITSInitGeometry.cxx:158
 AliITSInitGeometry.cxx:159
 AliITSInitGeometry.cxx:160
 AliITSInitGeometry.cxx:161
 AliITSInitGeometry.cxx:162
 AliITSInitGeometry.cxx:163
 AliITSInitGeometry.cxx:164
 AliITSInitGeometry.cxx:165
 AliITSInitGeometry.cxx:166
 AliITSInitGeometry.cxx:167
 AliITSInitGeometry.cxx:168
 AliITSInitGeometry.cxx:169
 AliITSInitGeometry.cxx:170
 AliITSInitGeometry.cxx:171
 AliITSInitGeometry.cxx:172
 AliITSInitGeometry.cxx:173
 AliITSInitGeometry.cxx:174
 AliITSInitGeometry.cxx:175
 AliITSInitGeometry.cxx:176
 AliITSInitGeometry.cxx:177
 AliITSInitGeometry.cxx:178
 AliITSInitGeometry.cxx:179
 AliITSInitGeometry.cxx:180
 AliITSInitGeometry.cxx:181
 AliITSInitGeometry.cxx:182
 AliITSInitGeometry.cxx:183
 AliITSInitGeometry.cxx:184
 AliITSInitGeometry.cxx:185
 AliITSInitGeometry.cxx:186
 AliITSInitGeometry.cxx:187
 AliITSInitGeometry.cxx:188
 AliITSInitGeometry.cxx:189
 AliITSInitGeometry.cxx:190
 AliITSInitGeometry.cxx:191
 AliITSInitGeometry.cxx:192
 AliITSInitGeometry.cxx:193
 AliITSInitGeometry.cxx:194
 AliITSInitGeometry.cxx:195
 AliITSInitGeometry.cxx:196
 AliITSInitGeometry.cxx:197
 AliITSInitGeometry.cxx:198
 AliITSInitGeometry.cxx:199
 AliITSInitGeometry.cxx:200
 AliITSInitGeometry.cxx:201
 AliITSInitGeometry.cxx:202
 AliITSInitGeometry.cxx:203
 AliITSInitGeometry.cxx:204
 AliITSInitGeometry.cxx:205
 AliITSInitGeometry.cxx:206
 AliITSInitGeometry.cxx:207
 AliITSInitGeometry.cxx:208
 AliITSInitGeometry.cxx:209
 AliITSInitGeometry.cxx:210
 AliITSInitGeometry.cxx:211
 AliITSInitGeometry.cxx:212
 AliITSInitGeometry.cxx:213
 AliITSInitGeometry.cxx:214
 AliITSInitGeometry.cxx:215
 AliITSInitGeometry.cxx:216
 AliITSInitGeometry.cxx:217
 AliITSInitGeometry.cxx:218
 AliITSInitGeometry.cxx:219
 AliITSInitGeometry.cxx:220
 AliITSInitGeometry.cxx:221
 AliITSInitGeometry.cxx:222
 AliITSInitGeometry.cxx:223
 AliITSInitGeometry.cxx:224
 AliITSInitGeometry.cxx:225
 AliITSInitGeometry.cxx:226
 AliITSInitGeometry.cxx:227
 AliITSInitGeometry.cxx:228
 AliITSInitGeometry.cxx:229
 AliITSInitGeometry.cxx:230
 AliITSInitGeometry.cxx:231
 AliITSInitGeometry.cxx:232
 AliITSInitGeometry.cxx:233
 AliITSInitGeometry.cxx:234
 AliITSInitGeometry.cxx:235
 AliITSInitGeometry.cxx:236
 AliITSInitGeometry.cxx:237
 AliITSInitGeometry.cxx:238
 AliITSInitGeometry.cxx:239
 AliITSInitGeometry.cxx:240
 AliITSInitGeometry.cxx:241
 AliITSInitGeometry.cxx:242
 AliITSInitGeometry.cxx:243
 AliITSInitGeometry.cxx:244
 AliITSInitGeometry.cxx:245
 AliITSInitGeometry.cxx:246
 AliITSInitGeometry.cxx:247
 AliITSInitGeometry.cxx:248
 AliITSInitGeometry.cxx:249
 AliITSInitGeometry.cxx:250
 AliITSInitGeometry.cxx:251
 AliITSInitGeometry.cxx:252
 AliITSInitGeometry.cxx:253
 AliITSInitGeometry.cxx:254
 AliITSInitGeometry.cxx:255
 AliITSInitGeometry.cxx:256
 AliITSInitGeometry.cxx:257
 AliITSInitGeometry.cxx:258
 AliITSInitGeometry.cxx:259
 AliITSInitGeometry.cxx:260
 AliITSInitGeometry.cxx:261
 AliITSInitGeometry.cxx:262
 AliITSInitGeometry.cxx:263
 AliITSInitGeometry.cxx:264
 AliITSInitGeometry.cxx:265
 AliITSInitGeometry.cxx:266
 AliITSInitGeometry.cxx:267
 AliITSInitGeometry.cxx:268
 AliITSInitGeometry.cxx:269
 AliITSInitGeometry.cxx:270
 AliITSInitGeometry.cxx:271
 AliITSInitGeometry.cxx:272
 AliITSInitGeometry.cxx:273
 AliITSInitGeometry.cxx:274
 AliITSInitGeometry.cxx:275
 AliITSInitGeometry.cxx:276
 AliITSInitGeometry.cxx:277
 AliITSInitGeometry.cxx:278
 AliITSInitGeometry.cxx:279
 AliITSInitGeometry.cxx:280
 AliITSInitGeometry.cxx:281
 AliITSInitGeometry.cxx:282
 AliITSInitGeometry.cxx:283
 AliITSInitGeometry.cxx:284
 AliITSInitGeometry.cxx:285
 AliITSInitGeometry.cxx:286
 AliITSInitGeometry.cxx:287
 AliITSInitGeometry.cxx:288
 AliITSInitGeometry.cxx:289
 AliITSInitGeometry.cxx:290
 AliITSInitGeometry.cxx:291
 AliITSInitGeometry.cxx:292
 AliITSInitGeometry.cxx:293
 AliITSInitGeometry.cxx:294
 AliITSInitGeometry.cxx:295
 AliITSInitGeometry.cxx:296
 AliITSInitGeometry.cxx:297
 AliITSInitGeometry.cxx:298
 AliITSInitGeometry.cxx:299
 AliITSInitGeometry.cxx:300
 AliITSInitGeometry.cxx:301
 AliITSInitGeometry.cxx:302
 AliITSInitGeometry.cxx:303
 AliITSInitGeometry.cxx:304
 AliITSInitGeometry.cxx:305
 AliITSInitGeometry.cxx:306
 AliITSInitGeometry.cxx:307
 AliITSInitGeometry.cxx:308
 AliITSInitGeometry.cxx:309
 AliITSInitGeometry.cxx:310
 AliITSInitGeometry.cxx:311
 AliITSInitGeometry.cxx:312
 AliITSInitGeometry.cxx:313
 AliITSInitGeometry.cxx:314
 AliITSInitGeometry.cxx:315
 AliITSInitGeometry.cxx:316
 AliITSInitGeometry.cxx:317
 AliITSInitGeometry.cxx:318
 AliITSInitGeometry.cxx:319
 AliITSInitGeometry.cxx:320
 AliITSInitGeometry.cxx:321
 AliITSInitGeometry.cxx:322
 AliITSInitGeometry.cxx:323
 AliITSInitGeometry.cxx:324
 AliITSInitGeometry.cxx:325
 AliITSInitGeometry.cxx:326
 AliITSInitGeometry.cxx:327
 AliITSInitGeometry.cxx:328
 AliITSInitGeometry.cxx:329
 AliITSInitGeometry.cxx:330
 AliITSInitGeometry.cxx:331
 AliITSInitGeometry.cxx:332
 AliITSInitGeometry.cxx:333
 AliITSInitGeometry.cxx:334
 AliITSInitGeometry.cxx:335
 AliITSInitGeometry.cxx:336
 AliITSInitGeometry.cxx:337
 AliITSInitGeometry.cxx:338
 AliITSInitGeometry.cxx:339
 AliITSInitGeometry.cxx:340
 AliITSInitGeometry.cxx:341
 AliITSInitGeometry.cxx:342
 AliITSInitGeometry.cxx:343
 AliITSInitGeometry.cxx:344
 AliITSInitGeometry.cxx:345
 AliITSInitGeometry.cxx:346
 AliITSInitGeometry.cxx:347
 AliITSInitGeometry.cxx:348
 AliITSInitGeometry.cxx:349
 AliITSInitGeometry.cxx:350
 AliITSInitGeometry.cxx:351
 AliITSInitGeometry.cxx:352
 AliITSInitGeometry.cxx:353
 AliITSInitGeometry.cxx:354
 AliITSInitGeometry.cxx:355
 AliITSInitGeometry.cxx:356
 AliITSInitGeometry.cxx:357
 AliITSInitGeometry.cxx:358
 AliITSInitGeometry.cxx:359
 AliITSInitGeometry.cxx:360
 AliITSInitGeometry.cxx:361
 AliITSInitGeometry.cxx:362
 AliITSInitGeometry.cxx:363
 AliITSInitGeometry.cxx:364
 AliITSInitGeometry.cxx:365
 AliITSInitGeometry.cxx:366
 AliITSInitGeometry.cxx:367
 AliITSInitGeometry.cxx:368
 AliITSInitGeometry.cxx:369
 AliITSInitGeometry.cxx:370
 AliITSInitGeometry.cxx:371
 AliITSInitGeometry.cxx:372
 AliITSInitGeometry.cxx:373
 AliITSInitGeometry.cxx:374
 AliITSInitGeometry.cxx:375
 AliITSInitGeometry.cxx:376
 AliITSInitGeometry.cxx:377
 AliITSInitGeometry.cxx:378
 AliITSInitGeometry.cxx:379
 AliITSInitGeometry.cxx:380
 AliITSInitGeometry.cxx:381
 AliITSInitGeometry.cxx:382
 AliITSInitGeometry.cxx:383
 AliITSInitGeometry.cxx:384
 AliITSInitGeometry.cxx:385
 AliITSInitGeometry.cxx:386
 AliITSInitGeometry.cxx:387
 AliITSInitGeometry.cxx:388
 AliITSInitGeometry.cxx:389
 AliITSInitGeometry.cxx:390
 AliITSInitGeometry.cxx:391
 AliITSInitGeometry.cxx:392
 AliITSInitGeometry.cxx:393
 AliITSInitGeometry.cxx:394
 AliITSInitGeometry.cxx:395
 AliITSInitGeometry.cxx:396
 AliITSInitGeometry.cxx:397
 AliITSInitGeometry.cxx:398
 AliITSInitGeometry.cxx:399
 AliITSInitGeometry.cxx:400
 AliITSInitGeometry.cxx:401
 AliITSInitGeometry.cxx:402
 AliITSInitGeometry.cxx:403
 AliITSInitGeometry.cxx:404
 AliITSInitGeometry.cxx:405
 AliITSInitGeometry.cxx:406
 AliITSInitGeometry.cxx:407
 AliITSInitGeometry.cxx:408
 AliITSInitGeometry.cxx:409
 AliITSInitGeometry.cxx:410
 AliITSInitGeometry.cxx:411
 AliITSInitGeometry.cxx:412
 AliITSInitGeometry.cxx:413
 AliITSInitGeometry.cxx:414
 AliITSInitGeometry.cxx:415
 AliITSInitGeometry.cxx:416
 AliITSInitGeometry.cxx:417
 AliITSInitGeometry.cxx:418
 AliITSInitGeometry.cxx:419
 AliITSInitGeometry.cxx:420
 AliITSInitGeometry.cxx:421
 AliITSInitGeometry.cxx:422
 AliITSInitGeometry.cxx:423
 AliITSInitGeometry.cxx:424
 AliITSInitGeometry.cxx:425
 AliITSInitGeometry.cxx:426
 AliITSInitGeometry.cxx:427
 AliITSInitGeometry.cxx:428
 AliITSInitGeometry.cxx:429
 AliITSInitGeometry.cxx:430
 AliITSInitGeometry.cxx:431
 AliITSInitGeometry.cxx:432
 AliITSInitGeometry.cxx:433
 AliITSInitGeometry.cxx:434
 AliITSInitGeometry.cxx:435
 AliITSInitGeometry.cxx:436
 AliITSInitGeometry.cxx:437
 AliITSInitGeometry.cxx:438
 AliITSInitGeometry.cxx:439
 AliITSInitGeometry.cxx:440
 AliITSInitGeometry.cxx:441
 AliITSInitGeometry.cxx:442
 AliITSInitGeometry.cxx:443
 AliITSInitGeometry.cxx:444
 AliITSInitGeometry.cxx:445
 AliITSInitGeometry.cxx:446
 AliITSInitGeometry.cxx:447
 AliITSInitGeometry.cxx:448
 AliITSInitGeometry.cxx:449
 AliITSInitGeometry.cxx:450
 AliITSInitGeometry.cxx:451
 AliITSInitGeometry.cxx:452
 AliITSInitGeometry.cxx:453
 AliITSInitGeometry.cxx:454
 AliITSInitGeometry.cxx:455
 AliITSInitGeometry.cxx:456
 AliITSInitGeometry.cxx:457
 AliITSInitGeometry.cxx:458
 AliITSInitGeometry.cxx:459
 AliITSInitGeometry.cxx:460
 AliITSInitGeometry.cxx:461
 AliITSInitGeometry.cxx:462
 AliITSInitGeometry.cxx:463
 AliITSInitGeometry.cxx:464
 AliITSInitGeometry.cxx:465
 AliITSInitGeometry.cxx:466
 AliITSInitGeometry.cxx:467
 AliITSInitGeometry.cxx:468
 AliITSInitGeometry.cxx:469
 AliITSInitGeometry.cxx:470
 AliITSInitGeometry.cxx:471
 AliITSInitGeometry.cxx:472
 AliITSInitGeometry.cxx:473
 AliITSInitGeometry.cxx:474
 AliITSInitGeometry.cxx:475
 AliITSInitGeometry.cxx:476
 AliITSInitGeometry.cxx:477
 AliITSInitGeometry.cxx:478
 AliITSInitGeometry.cxx:479
 AliITSInitGeometry.cxx:480
 AliITSInitGeometry.cxx:481
 AliITSInitGeometry.cxx:482
 AliITSInitGeometry.cxx:483
 AliITSInitGeometry.cxx:484
 AliITSInitGeometry.cxx:485
 AliITSInitGeometry.cxx:486
 AliITSInitGeometry.cxx:487
 AliITSInitGeometry.cxx:488
 AliITSInitGeometry.cxx:489
 AliITSInitGeometry.cxx:490
 AliITSInitGeometry.cxx:491
 AliITSInitGeometry.cxx:492
 AliITSInitGeometry.cxx:493
 AliITSInitGeometry.cxx:494
 AliITSInitGeometry.cxx:495
 AliITSInitGeometry.cxx:496
 AliITSInitGeometry.cxx:497
 AliITSInitGeometry.cxx:498
 AliITSInitGeometry.cxx:499
 AliITSInitGeometry.cxx:500
 AliITSInitGeometry.cxx:501
 AliITSInitGeometry.cxx:502
 AliITSInitGeometry.cxx:503
 AliITSInitGeometry.cxx:504
 AliITSInitGeometry.cxx:505
 AliITSInitGeometry.cxx:506
 AliITSInitGeometry.cxx:507
 AliITSInitGeometry.cxx:508
 AliITSInitGeometry.cxx:509
 AliITSInitGeometry.cxx:510
 AliITSInitGeometry.cxx:511
 AliITSInitGeometry.cxx:512
 AliITSInitGeometry.cxx:513
 AliITSInitGeometry.cxx:514
 AliITSInitGeometry.cxx:515
 AliITSInitGeometry.cxx:516
 AliITSInitGeometry.cxx:517
 AliITSInitGeometry.cxx:518
 AliITSInitGeometry.cxx:519
 AliITSInitGeometry.cxx:520
 AliITSInitGeometry.cxx:521
 AliITSInitGeometry.cxx:522
 AliITSInitGeometry.cxx:523
 AliITSInitGeometry.cxx:524
 AliITSInitGeometry.cxx:525
 AliITSInitGeometry.cxx:526
 AliITSInitGeometry.cxx:527
 AliITSInitGeometry.cxx:528
 AliITSInitGeometry.cxx:529
 AliITSInitGeometry.cxx:530
 AliITSInitGeometry.cxx:531
 AliITSInitGeometry.cxx:532
 AliITSInitGeometry.cxx:533
 AliITSInitGeometry.cxx:534
 AliITSInitGeometry.cxx:535
 AliITSInitGeometry.cxx:536
 AliITSInitGeometry.cxx:537
 AliITSInitGeometry.cxx:538
 AliITSInitGeometry.cxx:539
 AliITSInitGeometry.cxx:540
 AliITSInitGeometry.cxx:541
 AliITSInitGeometry.cxx:542
 AliITSInitGeometry.cxx:543
 AliITSInitGeometry.cxx:544
 AliITSInitGeometry.cxx:545
 AliITSInitGeometry.cxx:546
 AliITSInitGeometry.cxx:547
 AliITSInitGeometry.cxx:548
 AliITSInitGeometry.cxx:549
 AliITSInitGeometry.cxx:550
 AliITSInitGeometry.cxx:551
 AliITSInitGeometry.cxx:552
 AliITSInitGeometry.cxx:553
 AliITSInitGeometry.cxx:554
 AliITSInitGeometry.cxx:555
 AliITSInitGeometry.cxx:556
 AliITSInitGeometry.cxx:557
 AliITSInitGeometry.cxx:558
 AliITSInitGeometry.cxx:559
 AliITSInitGeometry.cxx:560
 AliITSInitGeometry.cxx:561
 AliITSInitGeometry.cxx:562
 AliITSInitGeometry.cxx:563
 AliITSInitGeometry.cxx:564
 AliITSInitGeometry.cxx:565
 AliITSInitGeometry.cxx:566
 AliITSInitGeometry.cxx:567
 AliITSInitGeometry.cxx:568
 AliITSInitGeometry.cxx:569
 AliITSInitGeometry.cxx:570
 AliITSInitGeometry.cxx:571
 AliITSInitGeometry.cxx:572
 AliITSInitGeometry.cxx:573
 AliITSInitGeometry.cxx:574
 AliITSInitGeometry.cxx:575
 AliITSInitGeometry.cxx:576
 AliITSInitGeometry.cxx:577
 AliITSInitGeometry.cxx:578
 AliITSInitGeometry.cxx:579
 AliITSInitGeometry.cxx:580
 AliITSInitGeometry.cxx:581
 AliITSInitGeometry.cxx:582
 AliITSInitGeometry.cxx:583
 AliITSInitGeometry.cxx:584
 AliITSInitGeometry.cxx:585
 AliITSInitGeometry.cxx:586
 AliITSInitGeometry.cxx:587
 AliITSInitGeometry.cxx:588
 AliITSInitGeometry.cxx:589
 AliITSInitGeometry.cxx:590
 AliITSInitGeometry.cxx:591
 AliITSInitGeometry.cxx:592
 AliITSInitGeometry.cxx:593
 AliITSInitGeometry.cxx:594
 AliITSInitGeometry.cxx:595
 AliITSInitGeometry.cxx:596
 AliITSInitGeometry.cxx:597
 AliITSInitGeometry.cxx:598
 AliITSInitGeometry.cxx:599
 AliITSInitGeometry.cxx:600
 AliITSInitGeometry.cxx:601
 AliITSInitGeometry.cxx:602
 AliITSInitGeometry.cxx:603
 AliITSInitGeometry.cxx:604
 AliITSInitGeometry.cxx:605
 AliITSInitGeometry.cxx:606
 AliITSInitGeometry.cxx:607
 AliITSInitGeometry.cxx:608
 AliITSInitGeometry.cxx:609
 AliITSInitGeometry.cxx:610
 AliITSInitGeometry.cxx:611
 AliITSInitGeometry.cxx:612
 AliITSInitGeometry.cxx:613
 AliITSInitGeometry.cxx:614
 AliITSInitGeometry.cxx:615
 AliITSInitGeometry.cxx:616
 AliITSInitGeometry.cxx:617
 AliITSInitGeometry.cxx:618
 AliITSInitGeometry.cxx:619
 AliITSInitGeometry.cxx:620
 AliITSInitGeometry.cxx:621
 AliITSInitGeometry.cxx:622
 AliITSInitGeometry.cxx:623
 AliITSInitGeometry.cxx:624
 AliITSInitGeometry.cxx:625
 AliITSInitGeometry.cxx:626
 AliITSInitGeometry.cxx:627
 AliITSInitGeometry.cxx:628
 AliITSInitGeometry.cxx:629
 AliITSInitGeometry.cxx:630
 AliITSInitGeometry.cxx:631
 AliITSInitGeometry.cxx:632
 AliITSInitGeometry.cxx:633
 AliITSInitGeometry.cxx:634
 AliITSInitGeometry.cxx:635
 AliITSInitGeometry.cxx:636
 AliITSInitGeometry.cxx:637
 AliITSInitGeometry.cxx:638
 AliITSInitGeometry.cxx:639
 AliITSInitGeometry.cxx:640
 AliITSInitGeometry.cxx:641
 AliITSInitGeometry.cxx:642
 AliITSInitGeometry.cxx:643
 AliITSInitGeometry.cxx:644
 AliITSInitGeometry.cxx:645
 AliITSInitGeometry.cxx:646
 AliITSInitGeometry.cxx:647
 AliITSInitGeometry.cxx:648
 AliITSInitGeometry.cxx:649
 AliITSInitGeometry.cxx:650
 AliITSInitGeometry.cxx:651
 AliITSInitGeometry.cxx:652
 AliITSInitGeometry.cxx:653
 AliITSInitGeometry.cxx:654
 AliITSInitGeometry.cxx:655
 AliITSInitGeometry.cxx:656
 AliITSInitGeometry.cxx:657
 AliITSInitGeometry.cxx:658
 AliITSInitGeometry.cxx:659
 AliITSInitGeometry.cxx:660
 AliITSInitGeometry.cxx:661
 AliITSInitGeometry.cxx:662
 AliITSInitGeometry.cxx:663
 AliITSInitGeometry.cxx:664
 AliITSInitGeometry.cxx:665
 AliITSInitGeometry.cxx:666
 AliITSInitGeometry.cxx:667
 AliITSInitGeometry.cxx:668
 AliITSInitGeometry.cxx:669
 AliITSInitGeometry.cxx:670
 AliITSInitGeometry.cxx:671
 AliITSInitGeometry.cxx:672
 AliITSInitGeometry.cxx:673
 AliITSInitGeometry.cxx:674
 AliITSInitGeometry.cxx:675
 AliITSInitGeometry.cxx:676
 AliITSInitGeometry.cxx:677
 AliITSInitGeometry.cxx:678
 AliITSInitGeometry.cxx:679
 AliITSInitGeometry.cxx:680
 AliITSInitGeometry.cxx:681
 AliITSInitGeometry.cxx:682
 AliITSInitGeometry.cxx:683
 AliITSInitGeometry.cxx:684
 AliITSInitGeometry.cxx:685
 AliITSInitGeometry.cxx:686
 AliITSInitGeometry.cxx:687
 AliITSInitGeometry.cxx:688
 AliITSInitGeometry.cxx:689
 AliITSInitGeometry.cxx:690
 AliITSInitGeometry.cxx:691
 AliITSInitGeometry.cxx:692
 AliITSInitGeometry.cxx:693
 AliITSInitGeometry.cxx:694
 AliITSInitGeometry.cxx:695
 AliITSInitGeometry.cxx:696
 AliITSInitGeometry.cxx:697
 AliITSInitGeometry.cxx:698
 AliITSInitGeometry.cxx:699
 AliITSInitGeometry.cxx:700
 AliITSInitGeometry.cxx:701
 AliITSInitGeometry.cxx:702
 AliITSInitGeometry.cxx:703
 AliITSInitGeometry.cxx:704
 AliITSInitGeometry.cxx:705
 AliITSInitGeometry.cxx:706
 AliITSInitGeometry.cxx:707
 AliITSInitGeometry.cxx:708
 AliITSInitGeometry.cxx:709
 AliITSInitGeometry.cxx:710
 AliITSInitGeometry.cxx:711
 AliITSInitGeometry.cxx:712
 AliITSInitGeometry.cxx:713
 AliITSInitGeometry.cxx:714
 AliITSInitGeometry.cxx:715
 AliITSInitGeometry.cxx:716
 AliITSInitGeometry.cxx:717
 AliITSInitGeometry.cxx:718
 AliITSInitGeometry.cxx:719
 AliITSInitGeometry.cxx:720
 AliITSInitGeometry.cxx:721
 AliITSInitGeometry.cxx:722
 AliITSInitGeometry.cxx:723
 AliITSInitGeometry.cxx:724
 AliITSInitGeometry.cxx:725
 AliITSInitGeometry.cxx:726
 AliITSInitGeometry.cxx:727
 AliITSInitGeometry.cxx:728
 AliITSInitGeometry.cxx:729
 AliITSInitGeometry.cxx:730
 AliITSInitGeometry.cxx:731
 AliITSInitGeometry.cxx:732
 AliITSInitGeometry.cxx:733
 AliITSInitGeometry.cxx:734
 AliITSInitGeometry.cxx:735
 AliITSInitGeometry.cxx:736
 AliITSInitGeometry.cxx:737
 AliITSInitGeometry.cxx:738
 AliITSInitGeometry.cxx:739
 AliITSInitGeometry.cxx:740
 AliITSInitGeometry.cxx:741
 AliITSInitGeometry.cxx:742
 AliITSInitGeometry.cxx:743
 AliITSInitGeometry.cxx:744
 AliITSInitGeometry.cxx:745
 AliITSInitGeometry.cxx:746
 AliITSInitGeometry.cxx:747
 AliITSInitGeometry.cxx:748
 AliITSInitGeometry.cxx:749
 AliITSInitGeometry.cxx:750
 AliITSInitGeometry.cxx:751
 AliITSInitGeometry.cxx:752
 AliITSInitGeometry.cxx:753
 AliITSInitGeometry.cxx:754
 AliITSInitGeometry.cxx:755
 AliITSInitGeometry.cxx:756
 AliITSInitGeometry.cxx:757
 AliITSInitGeometry.cxx:758
 AliITSInitGeometry.cxx:759
 AliITSInitGeometry.cxx:760
 AliITSInitGeometry.cxx:761
 AliITSInitGeometry.cxx:762
 AliITSInitGeometry.cxx:763
 AliITSInitGeometry.cxx:764
 AliITSInitGeometry.cxx:765
 AliITSInitGeometry.cxx:766
 AliITSInitGeometry.cxx:767
 AliITSInitGeometry.cxx:768
 AliITSInitGeometry.cxx:769
 AliITSInitGeometry.cxx:770
 AliITSInitGeometry.cxx:771
 AliITSInitGeometry.cxx:772
 AliITSInitGeometry.cxx:773
 AliITSInitGeometry.cxx:774
 AliITSInitGeometry.cxx:775
 AliITSInitGeometry.cxx:776
 AliITSInitGeometry.cxx:777
 AliITSInitGeometry.cxx:778
 AliITSInitGeometry.cxx:779
 AliITSInitGeometry.cxx:780
 AliITSInitGeometry.cxx:781
 AliITSInitGeometry.cxx:782
 AliITSInitGeometry.cxx:783
 AliITSInitGeometry.cxx:784
 AliITSInitGeometry.cxx:785
 AliITSInitGeometry.cxx:786
 AliITSInitGeometry.cxx:787
 AliITSInitGeometry.cxx:788
 AliITSInitGeometry.cxx:789
 AliITSInitGeometry.cxx:790
 AliITSInitGeometry.cxx:791
 AliITSInitGeometry.cxx:792
 AliITSInitGeometry.cxx:793
 AliITSInitGeometry.cxx:794
 AliITSInitGeometry.cxx:795
 AliITSInitGeometry.cxx:796
 AliITSInitGeometry.cxx:797
 AliITSInitGeometry.cxx:798
 AliITSInitGeometry.cxx:799
 AliITSInitGeometry.cxx:800
 AliITSInitGeometry.cxx:801
 AliITSInitGeometry.cxx:802
 AliITSInitGeometry.cxx:803
 AliITSInitGeometry.cxx:804
 AliITSInitGeometry.cxx:805
 AliITSInitGeometry.cxx:806
 AliITSInitGeometry.cxx:807
 AliITSInitGeometry.cxx:808
 AliITSInitGeometry.cxx:809
 AliITSInitGeometry.cxx:810
 AliITSInitGeometry.cxx:811
 AliITSInitGeometry.cxx:812
 AliITSInitGeometry.cxx:813
 AliITSInitGeometry.cxx:814
 AliITSInitGeometry.cxx:815
 AliITSInitGeometry.cxx:816
 AliITSInitGeometry.cxx:817
 AliITSInitGeometry.cxx:818
 AliITSInitGeometry.cxx:819
 AliITSInitGeometry.cxx:820
 AliITSInitGeometry.cxx:821
 AliITSInitGeometry.cxx:822
 AliITSInitGeometry.cxx:823
 AliITSInitGeometry.cxx:824
 AliITSInitGeometry.cxx:825
 AliITSInitGeometry.cxx:826
 AliITSInitGeometry.cxx:827
 AliITSInitGeometry.cxx:828
 AliITSInitGeometry.cxx:829
 AliITSInitGeometry.cxx:830
 AliITSInitGeometry.cxx:831
 AliITSInitGeometry.cxx:832
 AliITSInitGeometry.cxx:833
 AliITSInitGeometry.cxx:834
 AliITSInitGeometry.cxx:835
 AliITSInitGeometry.cxx:836
 AliITSInitGeometry.cxx:837
 AliITSInitGeometry.cxx:838
 AliITSInitGeometry.cxx:839
 AliITSInitGeometry.cxx:840
 AliITSInitGeometry.cxx:841
 AliITSInitGeometry.cxx:842
 AliITSInitGeometry.cxx:843
 AliITSInitGeometry.cxx:844
 AliITSInitGeometry.cxx:845
 AliITSInitGeometry.cxx:846
 AliITSInitGeometry.cxx:847
 AliITSInitGeometry.cxx:848
 AliITSInitGeometry.cxx:849
 AliITSInitGeometry.cxx:850
 AliITSInitGeometry.cxx:851
 AliITSInitGeometry.cxx:852
 AliITSInitGeometry.cxx:853
 AliITSInitGeometry.cxx:854
 AliITSInitGeometry.cxx:855
 AliITSInitGeometry.cxx:856
 AliITSInitGeometry.cxx:857
 AliITSInitGeometry.cxx:858
 AliITSInitGeometry.cxx:859
 AliITSInitGeometry.cxx:860
 AliITSInitGeometry.cxx:861
 AliITSInitGeometry.cxx:862
 AliITSInitGeometry.cxx:863
 AliITSInitGeometry.cxx:864
 AliITSInitGeometry.cxx:865
 AliITSInitGeometry.cxx:866
 AliITSInitGeometry.cxx:867
 AliITSInitGeometry.cxx:868
 AliITSInitGeometry.cxx:869
 AliITSInitGeometry.cxx:870
 AliITSInitGeometry.cxx:871
 AliITSInitGeometry.cxx:872
 AliITSInitGeometry.cxx:873
 AliITSInitGeometry.cxx:874
 AliITSInitGeometry.cxx:875
 AliITSInitGeometry.cxx:876
 AliITSInitGeometry.cxx:877
 AliITSInitGeometry.cxx:878
 AliITSInitGeometry.cxx:879
 AliITSInitGeometry.cxx:880
 AliITSInitGeometry.cxx:881