X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSv11.cxx;h=a4a841dfae72c2df844d887b4db49ab515cba0b1;hb=a426f453f900bdd025b46976ba566d3c15a05e24;hp=eea001589763ec139899e11cb7f9ffc0b6721674;hpb=541f7ba6733d373227a121133ba495986345e938;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSv11.cxx b/ITS/AliITSv11.cxx index eea00158976..a4a841dfae7 100644 --- a/ITS/AliITSv11.cxx +++ b/ITS/AliITSv11.cxx @@ -1,5 +1,5 @@ /************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * @@ -13,1190 +13,1687 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* $Id$ */ - -////////////////////////////////////////////////////////////////////////////// -// // -// Inner Traking System version 11 // -// This class contains the base procedures for the Inner Tracking System // -// // -// Authors: R. Barbera // -// version 6. // -// Created 2000. // -// // -// NOTE: THIS IS THE SYMMETRIC PPR geometry of the ITS. // -// THIS WILL NOT WORK // -// with the geometry or module classes or any analysis classes. You are // -// strongly encouraged to uses AliITSv5. // -// // -////////////////////////////////////////////////////////////////////////////// -// See AliITSv11::StepManager(). -// General C/C++ includes -#include -#include -// General Root includes -#include -#include -#include // only required for Tracking function? -#include + +/* $Id: */ + + +//======================================================================== +// +// Geometry of the Inner Tracking System +// --------------------------------------- +// This geometry is fully described in TGeo geometry (v11) +// +// Ludovic Gaudichet (gaudichet@to.infn.it) +// Mario Sitta (sitta@to.infn.it) +// +//======================================================================== + + +// $Log$ +// Revision 1.1 2011/06/10 14:48:24 masera +// First version from v11Hybrid to v11 (M. Sitta) +// + + #include -#include -#include -// Root Geometry includes +#include #include -#include -#include -#include -#include -// General AliRoot includes -#include "AliRun.h" -#include "AliMagF.h" -#include "AliConst.h" -// ITS specific includes +#include +#include +#include +#include +#include +#include +#include + +#include "AliITS.h" +#include "AliITSDetTypeSim.h" #include "AliITShit.h" -#include "AliITSgeom.h" -#include "AliITSgeomSPD.h" -#include "AliITSgeomSDD.h" -#include "AliITSgeomSSD.h" -#include "AliITSDetType.h" -#include "AliITSresponseSPD.h" -#include "AliITSresponseSDD.h" -#include "AliITSresponseSSD.h" -#include "AliITSsegmentationSPD.h" +#include "AliITSCalibrationSDD.h" #include "AliITSsegmentationSDD.h" +#include "AliITSsegmentationSPD.h" #include "AliITSsegmentationSSD.h" -#include "AliITSsimulationSPD.h" -#include "AliITSsimulationSDD.h" -#include "AliITSsimulationSSD.h" -#include "AliITSClusterFinderSPD.h" -#include "AliITSClusterFinderSDD.h" -#include "AliITSClusterFinderSSD.h" -#include "AliITSBaseGeometry.h" #include "AliITSv11.h" +#include "AliLog.h" +#include "AliMC.h" +#include "AliMagF.h" +#include "AliRun.h" +#include "AliTrackReference.h" +#include "AliITSv11GeometrySPD.h" +#include "AliITSv11GeometrySDD.h" +#include "AliITSv11GeometrySSD.h" +#include "AliITSv11GeometrySupport.h" +#include "AliGeomManager.h" -// Units, Convert from k?? to cm,degree,GeV,seconds, -const Double_t kmm = 0.10; // Convert mm to TGeom's cm. -const Double_t kcm = 1.00; // Convert cv to TGeom's cm. ClassImp(AliITSv11) -/* - Some temparary #define's used untill ROOT has addoppted the proper - Getter in it's classes. - These Below are for TGeoPcon functions. -*/ - //______________________________________________________________________ -AliITSv11::AliITSv11() : AliITS() { - // Standard default constructor for the ITS version 11. +AliITSv11::AliITSv11(): + fByThick(kTRUE), + fMajorVersion(IsVersion()), + fMinorVersion(-1), + fIDMother(0), + fInitGeom((AliITSVersion_t)fMajorVersion,fMinorVersion), + fSPDgeom(0), + fSDDgeom(0), + fSSDgeom(0), + fSupgeom(0) + { + // Standard default constructor // Inputs: // none. // Outputs: // none. - // Return - // A default constructed AliITSv11 class. - - //fITSV = 0; - //fcS = 0; -// fcD = 0; -} -//______________________________________________________________________ -AliITSv11::AliITSv11(const char *title) : AliITS("ITS", title){ - // Standard constructor for the ITS version 11. - // Inputs: - // const char *title The title of for this geometry. - // Outputs: + // Return: // none. - // Return - // A Standard constructed AliITSv11 class. - - //fITSV = 0; - //fcS = 0; -// fcD = 0; } -//______________________________________________________________________ -AliITSv11::~AliITSv11() { - // Standard destructor for the ITS version 11. - // Inputs: - // none. - // Outputs: - // none. - // Return - // none. -// if(fITSV!=0) delete fITSV; -// if(fcS!=0) delete fcS; -// if(fcD!=0) delete fcD; -} //______________________________________________________________________ -AliITSv11::AliITSv11(const AliITSv11 &source) : AliITS(source){ - // Copy Constructor for ITS version 11. +AliITSv11::AliITSv11(const char *title) + : AliITS("ITS", title), + fByThick(kTRUE), + fMajorVersion(IsVersion()), + fMinorVersion(1), + fIDMother(0), + fInitGeom((AliITSVersion_t)fMajorVersion,fMinorVersion), + fSPDgeom(0), + fSDDgeom(0), + fSSDgeom(0), + fSupgeom(0) +{ + // Standard constructor for the v11 geometry. // Inputs: - // AliITSv11 &source class to be copied from. + // const char * title Arbitrary title // Outputs: // none. - // Return + // Return: // none. + Int_t i; + + fSPDgeom = new AliITSv11GeometrySPD(); + fSDDgeom = new AliITSv11GeometrySDD(0); + fSSDgeom = new AliITSv11GeometrySSD(); + fSupgeom = new AliITSv11GeometrySupport(); - if(&source == this) return; - Error("Copy Constructor","Not allowed to copy AliITSv11"); - return; -} -//______________________________________________________________________ -AliITSv11& AliITSv11::operator=(const AliITSv11 &source){ - // Assignment operator for the ITS version 11. - // Inputs: - // AliITSv11 &source class to be copied from. - // Outputs: - // none. - // Return - // none. + fIdN = 6; + fIdName = new TString[fIdN]; + + fIdName[0] = fSPDgeom->GetSenstiveVolumeName1(); + fIdName[1] = fSPDgeom->GetSenstiveVolumeName2(); + + fIdName[2] = fSDDgeom->GetSenstiveVolumeName3(); + fIdName[3] = fSDDgeom->GetSenstiveVolumeName4(); + + fIdName[4] = fSSDgeom->GetSenstiveVolumeName5(); + fIdName[5] = fSSDgeom->GetSenstiveVolumeName6(); - if(&source == this) return *this; - Error("= operator","Not allowed to copy AliITSv11"); - return *this; + fIdSens = new Int_t[fIdN]; + for(i=0;iGetSenstiveVolumeName1(); + fIdName[1] = fSPDgeom->GetSenstiveVolumeName2(); - //fcS->BuildDisplayGeometry(); + fIdName[2] = fSDDgeom->GetSenstiveVolumeName3(); + fIdName[3] = fSDDgeom->GetSenstiveVolumeName4(); + + fIdName[4] = fSSDgeom->GetSenstiveVolumeName5(); + fIdName[5] = fSSDgeom->GetSenstiveVolumeName6(); + + fIdSens = new Int_t[fIdN]; + for(i=0;iGetTopVolume(); - - TGeoPcon *itsv = new TGeoPcon("ITS Top Volume, Daughter of ALIC",0.0,360.0,2); - // DefineSection(section number, Z, Rmin, Rmax). - itsv->DefineSection(0,-100.0*kcm,0.01*kcm,50.0*kcm); - itsv->DefineSection(1,+100.0*kcm,0.01*kcm,50.0*kcm); - TGeoVolume *ITSV = new TGeoVolume("ITSV",itsv,0); - mgr->AddVolume(ITSV); - ALIC->AddNode(ITSV,1,0); - // - SSDCone(ITSV); -} -//______________________________________________________________________ -Double_t AliITSv11::RmaxFrom2Points(TGeoPcon *p,Int_t i1,Int_t i2,Double_t z){ - // functions Require at parts of Volume A to be already defined. - // Retruns the value of Rmax corresponding to point z alone the line - // defined by the two points p.Rmax(i1),p-GetZ(i1) and p->GetRmax(i2), - // p->GetZ(i2). - - return p->GetRmax(i2)+(p->GetRmax(i1)-p->GetRmax(i2))*(z-p->GetZ(i2))/ - (p->GetZ(i1)-p->GetZ(i2)); + delete fSPDgeom; + delete fSDDgeom; + delete fSSDgeom; + delete fSupgeom; } -//______________________________________________________________________ -Double_t AliITSv11::RminFrom2Points(TGeoPcon *p,Int_t i1,Int_t i2,Double_t z){ - // Retruns the value of Rmin corresponding to point z alone the line - // defined by the two points p->GetRmin(i1),p->GetZ(i1) and p->GetRmin(i2), - // p->GetZ(i2). - return p->GetRmin(i2)+(p->GetRmin(i1)-p->GetRmin(i2))*(z-p->GetZ(i2))/ - (p->GetZ(i1)-p->GetZ(i2)); -} //______________________________________________________________________ -Double_t AliITSv11::RFrom2Points(Double_t *p,Double_t *Z,Int_t i1,Int_t i2,Double_t z){ - // Retruns the value of Rmin corresponding to point z alone the line - // defined by the two points p->GetRmin(i1),p->GetZ(i1) and p->GetRmin(i2), - // p->GetZ(i2). +void AliITSv11::SetT2Lmatrix(Int_t uid, Double_t yShift, + Bool_t yFlip, Bool_t yRot180) const +{ - return p[i2]+(p[i1]-p[i2])*(z-Z[i2])/(Z[i1]-Z[i2]); -} -//______________________________________________________________________ -Double_t AliITSv11::Zfrom2MinPoints(TGeoPcon *p,Int_t i1,Int_t i2,Double_t r){ - // Retruns the value of Z corresponding to point R alone the line - // defined by the two points p->GetRmin(i1),p->GetZ(i1) and - // p->GetRmin(i2),p->GetZ(i2) + // + // Creates the TGeo Local to Tracking transformation matrix + // and sends it to the corresponding TGeoPNEntry + // + // This function is used in AddAlignableVolumes() - return p->GetZ(i2)+(p->GetZ(i1)-p->GetZ(i2))*(r-p->GetRmin(i2))/ - (p->GetRmin(i1)-p->GetRmin(i2)); -} -//______________________________________________________________________ -Double_t AliITSv11::Zfrom2MaxPoints(TGeoPcon *p,Int_t i1,Int_t i2,Double_t r){ - // Retruns the value of Z corresponding to point R alone the line - // defined by the two points p->GetRmax(i1),p->GetZ(i1) and - // p->GetRmax(i2),p->GetZ(i2) + TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(uid); + TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig(); - return p->GetZ(i2)+(p->GetZ(i1)-p->GetZ(i2))*(r-p->GetRmax(i2))/ - (p->GetRmax(i1)-p->GetRmax(i2)); -} -//______________________________________________________________________ -Double_t AliITSv11::Zfrom2Points(Double_t *Z,Double_t *p,Int_t i1,Int_t i2,Double_t r){ - // Retruns the value of Z corresponding to point R alone the line - // defined by the two points p->GetRmax(i1),p->GetZ(i1) and - // p->GetRmax(i2),p->GetZ(i2) + Double_t *gtrans = globMatrix->GetTranslation(), rotMatrix[9]; + memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t)); + Double_t al = TMath::ATan2(rotMatrix[1],rotMatrix[0]); + if (yRot180) { + al = TMath::ATan2(rotMatrix[1],-rotMatrix[0]); + } + Double_t xShift = gtrans[0]*TMath::Cos(al)+gtrans[1]*TMath::Sin(al); + Double_t zShift = -gtrans[2]; - return Z[i2]+(Z[i1]-Z[i2])*(r-p[i2])/(p[i1]-p[i2]); -} -//______________________________________________________________________ -Double_t AliITSv11::RmaxFromZpCone(TGeoPcon *p,Double_t tc,Double_t z,Double_t th){ - // General SSD Outer Cone surface equation Rmax. - Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); - Double_t costc = TMath::Cos(tc*TMath::DegToRad()); + TGeoHMatrix *matLtoT = new TGeoHMatrix; + matLtoT->SetDx( xShift ); // translation + matLtoT->SetDy( yShift ); + matLtoT->SetDz( zShift ); + rotMatrix[0]= 0; rotMatrix[1]= 1; rotMatrix[2]= 0; // + rotation + rotMatrix[3]= 1; rotMatrix[4]= 0; rotMatrix[5]= 0; + rotMatrix[6]= 0; rotMatrix[7]= 0; rotMatrix[8]=-1; + if (yFlip) rotMatrix[3] = -1; // flipping in y (for SPD1) + if (yFlip) rotMatrix[1] = -1; // flipping in y (for SPD1) - return -tantc*(z-p->GetZ(4))+p->GetRmax(4)+th/costc; -} -//______________________________________________________________________ -Double_t AliITSv11::RmaxFromZpCone(Double_t *GetRmax,Double_t *GetZ,Double_t tc,Double_t z,Double_t th){ - // General SSD Outer Cone surface equation Rmax. - Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); - Double_t costc = TMath::Cos(tc*TMath::DegToRad()); + if (yRot180) { // rotation of pi around the axis perpendicular to the wafer + if (yFlip) matLtoT->SetDx( -xShift ); // flipping in y (for SPD1) + matLtoT->SetDy( -yShift ); + matLtoT->SetDz( -zShift ); + rotMatrix[8]=1; + rotMatrix[3] = -1; + if (yFlip) rotMatrix[3] = 1; // flipping in y (for SPD1) + } - return -tantc*(z-GetZ[4])+GetRmax[4]+th/costc; + TGeoRotation rot; + rot.SetMatrix(rotMatrix); + matLtoT->MultiplyLeft(&rot); + TGeoHMatrix *matTtoL = new TGeoHMatrix(matLtoT->Inverse()); + delete matLtoT; + alignableEntry->SetMatrix(matTtoL); } -//______________________________________________________________________ -Double_t AliITSv11::RminFromZpCone(TGeoPcon *p,Double_t tc,Double_t z,Double_t th){ - // General SSD Inner Cone surface equation Rmin. - Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); - Double_t costc = TMath::Cos(tc*TMath::DegToRad()); - return -tantc*(z-p->GetZ(3))+p->GetRmin(3)+th/costc; -} //______________________________________________________________________ -Double_t AliITSv11::RminFromZpCone(Double_t *GetRmin,Double_t *GetZ,Double_t tc,Double_t z,Double_t th){ - // General SSD Inner Cone surface equation Rmin. - Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); - Double_t costc = TMath::Cos(tc*TMath::DegToRad()); +void AliITSv11::AddAlignableVolumes() const +{ + // Creates entries for alignable volumes associating the symbolic volume + // name with the corresponding volume path. + // + // Records in the alignable entries the transformation matrices converting + // TGeo local coordinates (in the RS of alignable volumes) to the tracking + // system + // For this, this function has to run before the misalignment because we + // are using the ideal positions in the AliITSgeom object. + // Inputs: + // none. + // Outputs: + // none. + // Return: + // none. - return -tantc*(z-GetZ[3])+GetRmin[3]+th/costc; -} -//______________________________________________________________________ -Double_t AliITSv11::ZFromRmaxpCone(TGeoPcon *p,Double_t tc,Double_t r,Double_t th){ - // General SSD Outer cone Surface equation for z. - Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); - Double_t costc = TMath::Cos(tc*TMath::DegToRad()); + AliInfo("Add ITS alignable volumes"); - return p->GetZ(4)+(p->GetRmax(4)+th/costc-r)/tantc; -} -//______________________________________________________________________ -Double_t AliITSv11::ZFromRmaxpCone(Double_t *GetRmax,Double_t *GetZ,Double_t tc,Double_t r,Double_t th){ - // General SSD Outer cone Surface equation for z. - Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); - Double_t costc = TMath::Cos(tc*TMath::DegToRad()); + if (!gGeoManager) { + AliFatal("TGeoManager doesn't exist !"); + return; + } - return GetZ[4]+(GetRmax[4]+th/costc-r)/tantc; -} -//______________________________________________________________________ -Double_t AliITSv11::ZFromRminpCone(TGeoPcon *p,Double_t tc,Double_t r,Double_t th){ - // General SSD Inner cone Surface equation for z. - Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); - Double_t costc = TMath::Cos(tc*TMath::DegToRad()); + AliGeomManager::ELayerID layerId; + Int_t modUID, modnum; - return p->GetZ(3)+(p->GetRmin(3)+th/costc-r)/tantc; -} -//______________________________________________________________________ -void AliITSv11::RadiusOfCurvature(Double_t rc,Double_t theta0,Double_t z0, - Double_t r0,Double_t theta1,Double_t &z1, - Double_t &r1){ - // Given a initial point z0,r0, the initial angle theta0, and the radius - // of curvature, returns the point z1, r1 at the angle theta1. Theta - // measured from the r axis in the clock wise direction [degrees]. - Double_t sin0 = TMath::Sin(theta0*TMath::DegToRad()); - Double_t cos0 = TMath::Cos(theta0*TMath::DegToRad()); - Double_t sin1 = TMath::Sin(theta1*TMath::DegToRad()); - Double_t cos1 = TMath::Cos(theta1*TMath::DegToRad()); - - z1 = rc*(sin1-sin0)+z0; - r1 = rc*(cos1-cos0)+r0; - return; -} -//______________________________________________________________________ -void AliITSv11::SPDCone(TGeoVolume *Moth){ - // Define the detail SPD support cone geometry. - // Inputs: - // none. - // Outputs: - // none. - // Return: - // none. + if( !gGeoManager->SetAlignableEntry("ITS","ALIC_1/ITSV_1") ) + AliFatal(Form("Unable to set alignable entry ! %s :: %s", + "ITS","ALIC_1/ITSV_1")); + + TString strSPD = "ITS/SPD"; + TString strSDD = "ITS/SDD"; + TString strSSD = "ITS/SSD"; + TString strStave = "/Stave"; + TString strHalfStave = "/HalfStave"; + TString strLadder = "/Ladder"; + TString strSector = "/Sector"; + TString strSensor = "/Sensor"; + TString strEntryName1; + TString strEntryName2; + TString strEntryName3; + TString strEntryName4; + + TString str0; + TString str1; + TString str2; + + TString ladder; + + //===== SPD layers ===== + + str0 = "ALIC_1/ITSV_1/ITSSPD_1/ITSSPDCarbonFiberSectorV_"; + str1 = "/ITSSPDSensitiveVirtualvolumeM0_1/ITSSPDlay1-Stave_"; + + TString str1Bis = "/ITSSPDhalf-Stave"; + TString str1Tierce = "_1"; + + str2 = "/ITSSPDlay1-Ladder_"; + + TString sector; + TString stave; + TString halfStave; + TString module; + + layerId = AliGeomManager::kSPD1; + modnum = 0; + + for(Int_t cSect = 0; cSect<10; cSect++) { + + sector = str0; + sector += cSect+1; // this is one full sector + strEntryName1 = strSPD; + strEntryName1 += 0; + strEntryName1 += strSector; + strEntryName1 += cSect; + if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),sector.Data())) + AliFatal(Form("New lay 1: Unable to set alignable entry 1! %s::%s", + strEntryName1.Data(),sector.Data())); + + for(Int_t cStave=0; cStave<2; cStave++) { + + stave = sector; + stave += str1; + stave += cStave+1; + strEntryName2 = strEntryName1; + strEntryName2 += strStave; + strEntryName2 += cStave; + + for(Int_t cHS=0; cHS<2; cHS++) { + + halfStave = stave; + halfStave += str1Bis; + halfStave += cHS; + halfStave += str1Tierce; + strEntryName3 = strEntryName2; + strEntryName3 += strHalfStave; + strEntryName3 += cHS; + + if(!gGeoManager->SetAlignableEntry(strEntryName3.Data(), + halfStave.Data())) + AliFatal(Form("New lay 1: Unable to set alignable entry 3! %s::%s", + strEntryName3.Data(),halfStave.Data())); + + for(Int_t cLad=0; cLad<2; cLad++) { + + modUID = AliGeomManager::LayerToVolUID(layerId,modnum++); + module = halfStave; + module += str2; + module += cLad+cHS*2+1; + strEntryName4 = strEntryName3; + strEntryName4 += strLadder; + strEntryName4 += cLad+cHS*2; + if(!gGeoManager->SetAlignableEntry(strEntryName4.Data(),module.Data(),modUID)) + AliFatal(Form("New lay 1: Unable to set alignable entry 4! %s::%s", + strEntryName4.Data(),module.Data())); + + SetT2Lmatrix(modUID, 0.0081, kTRUE, kTRUE); + // 0.0081 is the shift between the centers of alignable + // and sensitive volumes. It is directly extracted from + // the new SPD geometry + } // end for cLad + } // end for cHS + } // end for cStave + } // end for cSect + + layerId = AliGeomManager::kSPD2; + modnum = 0; + str1 = "/ITSSPDSensitiveVirtualvolumeM0_1/ITSSPDlay2-Stave_"; + str2 = "/ITSSPDlay2-Ladder_"; + + for(Int_t cSect = 0; cSect<10; cSect++) { + + sector = str0; + sector += cSect+1; // this is one full sector + strEntryName1 = strSPD; + strEntryName1 += 1; + strEntryName1 += strSector; + strEntryName1 += cSect; + + for(Int_t cStave=0; cStave<4; cStave++) { + + stave = sector; + stave += str1; + stave += cStave+1; + strEntryName2 = strEntryName1; + strEntryName2 += strStave; + strEntryName2 += cStave; + + for(Int_t cHS=0; cHS<2; cHS++) { + + halfStave = stave; + halfStave += str1Bis; + halfStave += cHS; + halfStave += str1Tierce; + strEntryName3 = strEntryName2; + strEntryName3 += strHalfStave; + strEntryName3 += cHS; + + if(!gGeoManager->SetAlignableEntry(strEntryName3.Data(), + halfStave.Data())) + AliFatal(Form("New lay 2: Unable to set alignable entry 3! %s::%s", + strEntryName3.Data(),halfStave.Data())); + + for(Int_t cLad=0; cLad<2; cLad++) { + + modUID = AliGeomManager::LayerToVolUID(layerId,modnum++); + module = halfStave; + module += str2; + module += cLad+cHS*2 +1; + strEntryName4 = strEntryName3; + strEntryName4 += strLadder; + strEntryName4 += cLad+cHS*2; + if(!gGeoManager->SetAlignableEntry(strEntryName4.Data(),module.Data(),modUID)) + AliFatal(Form("New lay 2: Unable to set alignable entry 4! %s::%s", + strEntryName4.Data(),module.Data())); + + SetT2Lmatrix(modUID, -0.0081, kFALSE); + } // end for cLad + } // end for cHS + } // end for cStave + } // cSect + + //===== SDD layers ===== + + layerId = AliGeomManager::kSDD1; + modnum = 0; + + str0 = "/ALIC_1/ITSV_1/ITSsddLayer3_1/ITSsddLadd_"; // SDD layer1 + str1 = "/ITSsddSensor3_"; + + TString sensor; + + for(Int_t c1 = 0; c1<14; c1++) { + + ladder = str0; + ladder += c1; // the set of wafers from one ladder + strEntryName1 = strSDD; + strEntryName1 += 2; + strEntryName1 +=strLadder; + strEntryName1 += c1; + //printf("%s == %s\n",strEntryName1.Data(),ladder.Data()); + if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data())) + AliFatal(Form("Unable to set alignable entry 1! %s :: %s", + strEntryName1.Data(),ladder.Data())); + + for(Int_t c2 =0; c2<6; c2++) { + + modUID = AliGeomManager::LayerToVolUID(layerId,modnum++); + sensor = ladder; + sensor += str1; + sensor += c2; + strEntryName2 = strEntryName1; + strEntryName2 += strSensor; + strEntryName2 += c2; + //printf("%s == %s\n",strEntryName2.Data(),wafer.Data()); + if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),sensor.Data(),modUID)) + AliFatal(Form("Unable to set alignable entry 2! %s :: %s", + strEntryName2.Data(),sensor.Data())); + + SetT2Lmatrix(modUID, 0, kFALSE, c2>=3); + } + } + + layerId = AliGeomManager::kSDD2; + modnum = 0; + str0 = "/ALIC_1/ITSV_1/ITSsddLayer4_1/ITSsddLadd_"; // SDD layer2 + str1 = "/ITSsddSensor4_"; + + for(Int_t c1 = 0; c1<22; c1++) { + + ladder = str0; + ladder += c1; // the set of wafers from one ladder + strEntryName1 = strSDD; + strEntryName1 += 3; + strEntryName1 += strLadder; + strEntryName1 += c1; + //printf("%s == %s\n",strEntryName1.Data(),ladder.Data()); + if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data())) + AliFatal(Form("Unable to set alignable entry 1! %s :: %s", + strEntryName1.Data(),ladder.Data())); + + for(Int_t c2 =0; c2<8; c2++) { + + modUID = AliGeomManager::LayerToVolUID(layerId,modnum++); + sensor = ladder; + sensor += str1; + sensor += c2; + strEntryName2 = strEntryName1; + strEntryName2 += strSensor; + strEntryName2 += c2; + //printf("%s == %s\n",strEntryName2.Data(),wafer.Data()); + if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),sensor.Data(),modUID)) + AliFatal(Form("Unable to set alignable entry 2! %s :: %s", + strEntryName2.Data(),sensor.Data())); + + SetT2Lmatrix(modUID, 0, kFALSE, c2>=4); + } + } + + //===== SSD layers ===== + + layerId = AliGeomManager::kSSD1; + modnum = 0; + + str0 = "/ALIC_1/ITSV_1/ITSssdLayer5_1/ITSssdLay5Ladd_";//SSD layer1 + str1 = "/ITSssdSensor5_"; + str2 = ""; + + TString wafer; + + for(Int_t c1 = 0; c1<34; c1++) { + + ladder = str0; + ladder += c1; // the set of wafers from one ladder + strEntryName1 = strSSD; + strEntryName1 += 4; + strEntryName1 += strLadder; + strEntryName1 += c1; + //printf("%s == %s\n",strEntryName1.Data(),ladder.Data()); + if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data())) + AliFatal(Form("Unable to set alignable entry 1! %s :: %s", + strEntryName1.Data(),ladder.Data())); + + for(Int_t c2 =0; c2<22; c2++) { + + modUID = AliGeomManager::LayerToVolUID(layerId,modnum++); + wafer = ladder; + wafer += str1; + wafer += c2; + //wafer += str2; // one wafer + strEntryName2 = strEntryName1; + strEntryName2 += strSensor; + strEntryName2 += c2; + //printf("%s == %s\n",strEntryName2.Data(),wafer.Data()); + if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data(),modUID)) + AliFatal(Form("Unable to set alignable entry 2! %s :: %s", + strEntryName2.Data(),wafer.Data())); + + SetT2Lmatrix(modUID, 0, kFALSE, kFALSE); + } + } + + layerId = AliGeomManager::kSSD2; + modnum = 0; + str0 = "/ALIC_1/ITSV_1/ITSssdLayer6_1/ITSssdLay6Ladd_"; // SSD layer2 + str1 = "/ITSssdSensor6_"; + str2 = ""; + + for(Int_t c1 = 0; c1<38; c1++) { + + ladder = str0; + ladder += c1; // the set of wafers from one ladder + strEntryName1 = strSSD; + strEntryName1 += 5; + strEntryName1 += strLadder; + strEntryName1 += c1; + //printf("%s == %s\n",strEntryName1.Data(),ladder.Data()); + if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data())) + AliFatal(Form("Unable to set alignable entry 1! %s :: %s", + strEntryName1.Data(),ladder.Data())); + + for(Int_t c2 =0; c2<25; c2++) { + + modUID = AliGeomManager::LayerToVolUID(layerId,modnum++); + wafer = ladder; + wafer += str1; + wafer += c2; + //wafer += str2; // one wafer + strEntryName2 = strEntryName1; + strEntryName2 += strSensor; + strEntryName2 += c2; + //printf("%s == %s\n",strEntryName2.Data(),wafer.Data()); + if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data(),modUID)) + AliFatal(Form("Unable to set alignable entry 2! %s :: %s", + strEntryName2.Data(),wafer.Data())); + + SetT2Lmatrix(modUID, 0, kFALSE, kFALSE); + } + } + } + //______________________________________________________________________ -void AliITSv11::SDDCone(TGeoVolume *Moth){ - // Define the detail SDD support cone geometry. - // Inputs: - // none. - // Outputs: - // none. - // Return: - // none. -} -//______________________________________________________________________ -void AliITSv11::SSDCone(TGeoVolume *Moth){ - // Define the detail SSD support cone geometry. - // Inputs: - // none. - // Outputs: - // none. - // Return: - // none. - const Double_t Thickness = 13.0*kmm; // Thickness of Rohacell+carbon fiber - const Double_t Cthick = 1.5*kmm; // Carbon finber thickness - const Double_t Rcurv = 15.0*kmm; // Radius of curvature. - const Double_t Tc = 51.0; // angle of SSD cone [degrees]. - const Double_t Sintc = TMath::Sin(Tc*TMath::DegToRad()); - const Double_t Costc = TMath::Cos(Tc*TMath::DegToRad()); - const Double_t Tantc = TMath::Tan(Tc*TMath::DegToRad()); - const Double_t ZouterMilled = (13.5-5.0)*kmm; - const Double_t Zcylinder = 170.0*kmm; - const Double_t Z0 = Zcylinder + 100.0*kmm; - const Int_t Nspoaks = 12; - const Int_t Nmounts = 4; - const Double_t DmountAngle = 9.0; // degrees - const Double_t RoutMax = 0.5*985.0*kmm; - const Double_t RoutHole = 0.5*965.0*kmm; - const Double_t RoutMin = 0.5*945.0*kmm; - const Double_t RholeMax = 0.5*890.0*kmm; - const Double_t RholeMin = 0.5*740.0*kmm; - const Double_t RpostMin = 316.0*kmm; - const Double_t ZpostMax = 196.0*kmm; - const Int_t Nposts = 6; - const Double_t Phi0Post = 0.0; // degree - const Double_t dRpost = 23.0*kmm; - const Double_t RinMax = 0.5*590.0*kmm; - const Double_t RinCylinder = 0.5*597.0*kmm; - const Double_t RinHole = 0.5*575.0*kmm; - const Double_t RinMin = 0.5*562.0*kmm; - const Double_t dZin = 15.0*kmm; - // SSD-SDD Thermal/Mechanical cylinder mounts - const Int_t NinScrews = 40; - const Double_t Phi0Screws = 0.5*360.0/((const Double_t)NinScrews);//d - const Double_t RcylinderScrews = 0.5*570.0*kmm;//from older drawing???? - const Double_t DscrewHead = 8.0*kmm; - const Double_t DscrewShaft = 4.6*kmm; - const Double_t ThScrewHeadHole = 8.5*kmm; - // SDD mounting bracket, SSD part - const Double_t NssdSupports = 3;// mounting of U and T - const Double_t DssdsddBracketAngle = 9.0; // degrees - const Double_t Phi0SDDsupports = 0.0; // degree - const Double_t RsddSupportPlate = 0.5*585.0*kmm; - const Double_t ThSDDsupportPlate = 4.0*kmm; - const Double_t WsddSupportPlate = 70.0*kmm; - TGeoMedium *SSDcf = 0; // SSD support cone Carbon Fiber materal number. - TGeoMedium *SSDfs = 0; // SSD support cone inserto stesalite 4411w. - TGeoMedium *SSDfo = 0; // SSD support cone foam, Rohacell 50A. - TGeoMedium *SSDss = 0; // SSD support cone screw material,Stainless steal - TGeoMedium *SSDair = 0; // SSD support cone Air - TGeoMedium *SSDal = 0; // SSD support cone SDD mounting bracket Al - - // Lets start with the upper left outer carbon fiber surface. - // Between za[2],rmaxa[2] and za[4],rmaxa[4] there is a curved section - // given by rmaxa = rmaxa[2]-r*Sind(t) for 0<=t<=Tc and - // za = za[2] + r*Cosd(t) for 0<=t<=Tc. Simularly between za[1],rmina[1 - // and za[3],rmina[3] there is a curve section given by - // rmina = rmina[1]-r*Sind(t) for 0<=t<=Tc and za = za[1]+r&Sind(t) - // for t<=0<=Tc. These curves have been replaced by straight lines - // between the equivelent points for simplicity. - Double_t dza = Thickness/Sintc-(RoutMax-RoutMin)/Tantc; - Int_t i,j; - Double_t z[9],rn[9],rx[9],phi,dphi; - Double_t t,t0,Z,Rmin,Rmax; // Temp variables. - if(dza<=0){ // The number or order of the points are in error for a proper - // call to pcons! - Error("SSDcone","The definition of the points for a call to PCONS is" - " in error. abort."); - return; - } // end if - // Poly-cone Volume A. Top part of SSD cone Carbon Fiber. - phi = 0.0; - dphi = 360.0; - z[0] = 0.0; - rn[0] = RoutMin; - rx[0] = RoutMax; - z[1] = z[0]+ZouterMilled - dza; // za[2] - dza. - rn[1] = rn[0]; - rx[1] = rx[0]; - z[2] = z[0]+ZouterMilled;//From Drawing ALR-0767 and ALR-0767/3 - rx[2] = rx[0]; - RadiusOfCurvature(Rcurv,0.,z[1],rn[1],Tc,z[3],rn[3]); - rn[2] = RFrom2Points(rn,z,3,1,z[2]); - RadiusOfCurvature(Rcurv,0.,z[2],rx[2],Tc,z[4],rx[4]); - rn[4] = RminFromZpCone(rn,z,Tc,z[4]); - rx[3] = RFrom2Points(rx,z,4,2,z[3]); - rn[5] = RholeMax; - z[5] = Zfrom2Points(z,rn,4,3,rn[5]); - rx[5] = RmaxFromZpCone(rx,z,Tc,z[5]); - rn[6] = RholeMax; - rx[6] = rn[6]; - z[6] = ZFromRmaxpCone(z,rx,Tc,rx[6]); - TGeoPcon *A = new TGeoPcon("ITS SSD Suport cone Carbon Fiber " - "Surface outer left",phi,dphi,7); - for(i=0;iGetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetZ(2); - rn[0] = C->GetRmin(3); - rx[0] = rn[0]; - rn[1] = A->GetRmin(5); - rx[1] = rn[0]; - z[1] = ZFromRminpCone(A,Tc,rn[1],+Cthick); - z[2] = C->GetZ(3); - rn[2] = rn[1]; - rx[2] = rx[1]; - rn[3] = A->GetRmin(6); - rx[3] = rn[3]; - z[3] = ZFromRmaxpCone(A,Tc,rx[3],-Cthick); - TGeoPcon *F = new TGeoPcon("ITS SSD Top Suport cone Rohacell foam " - "Spoak",phi,dphi,4); - for(i=0;iGetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetNz();i++){ - if(fDebug) cout<GetRmax(); - TGeoTube *S = new TGeoTube("ITS Air in front of Stainless Steal " - "Screw end, N6",rn[0],rx[0],z[0]); - // SDD support plate, SSD side. - //Poly-cone Volume T. - dphi = 180.0*WsddSupportPlate/(RsddSupportPlate*TMath::Pi()); - phi = Phi0SDDsupports-0.5*dphi; - z[0] = K->GetZ(2); - rn[0] = I->GetRmin(4); - rx[0] = RsddSupportPlate; - z[1] = I->GetZ(4) - ThSDDsupportPlate; - rn[1] = rn[0]; - rx[1] = rx[0]; - TGeoPcon *T = new TGeoPcon("ITS SSD-SDD mounting bracket Inserto->Al.", - phi,dphi,2); - for(i=0;iGetNz();i++){ - if(fDebug) cout<Al.",phi,dphi,4); - }else{ - dphi = T->GetDphi(); - phi = T->GetPhi1(); - z[0] = I->GetZ(4); - rn[0] = T->GetRmin(0); - rx[0] = T->GetRmax(0); - z[1] = K->GetZ(2); - rn[1] = rn[0]; - rx[1] = rx[0]; - U = new TGeoPcon("ITS SSD-SDD mounting bracket CF->Al.",phi,dphi,2); - }// end if - for(i=0;iGetNz();i++){ - if(fDebug) cout<GetMedium("ITSssdStaselite4411w"); - SSDfo = mgr->GetMedium("ITSssdRohacell50A"); - SSDss = mgr->GetMedium("ITSssdStainlessSteal"); - SSDair= mgr->GetMedium("ITSssdAir"); - SSDal = mgr->GetMedium("ITSssdAl"); - TGeoVolume *Av,*Bv,*Cv,*Dv,*Ev,*Fv,*Gv,*Hv,*Iv,*Jv,*Kv,*Lv,*Mv,*Nv, - *Ov,*Pv,*Qv,*Rv,*Sv,*Tv,*Uv; - Av = new TGeoVolume("ITSssdConeA",A,SSDcf); - mgr->AddVolume(Av); - Av->SetLineColor(1); - Av->SetLineWidth(1); - Bv = new TGeoVolume("ITSssdConeB",B,SSDfs); - mgr->AddVolume(Bv); - Cv = new TGeoVolume("ITSssdConeC",C,SSDfo); - mgr->AddVolume(Cv); - Dv = new TGeoVolume("ITSssdConeD",D,SSDss); - mgr->AddVolume(Dv); - Ev = new TGeoVolume("ITSssdConeE",E,SSDss); - mgr->AddVolume(Ev); - Fv = new TGeoVolume("ITSssdConeF",F,SSDfo); - mgr->AddVolume(Fv); - Gv = new TGeoVolume("ITSssdConeG",G,SSDcf); - mgr->AddVolume(Gv); - Gv->SetLineColor(2); - Gv->SetLineWidth(2); - Hv = new TGeoVolume("ITSssdConeH",H,SSDfo); - mgr->AddVolume(Hv); - Iv = new TGeoVolume("ITSssdConeI",I,SSDcf); - mgr->AddVolume(Iv); - Iv->SetLineColor(3); - Iv->SetLineWidth(3); - Jv = new TGeoVolume("ITSssdConeJ",J,SSDfo); - mgr->AddVolume(Jv); - Kv = new TGeoVolume("ITSssdConeK",K,SSDfs); - mgr->AddVolume(Kv); - Lv = new TGeoVolume("ITSssdConeL",L,SSDfo); - mgr->AddVolume(Lv); - Mv = new TGeoVolume("ITSssdConeM",M,SSDfs); - mgr->AddVolume(Mv); - Nv = new TGeoVolume("ITSssdConeN",N,SSDfs); - mgr->AddVolume(Nv); - Ov = new TGeoVolume("ITSssdConeO",O,SSDcf); - mgr->AddVolume(Ov); - Iv->SetLineColor(4); - Iv->SetLineWidth(4); - Pv = new TGeoVolume("ITSssdConeP",P,SSDfs); - mgr->AddVolume(Pv); - Qv = new TGeoVolume("ITSssdConeQ",Q,SSDss); - mgr->AddVolume(Qv); - Rv = new TGeoVolume("ITSssdConeR",R,SSDair); - mgr->AddVolume(Rv); - Sv = new TGeoVolume("ITSssdConeS",S,SSDair); - mgr->AddVolume(Sv); - Tv = new TGeoVolume("ITSssdConeT",T,SSDal); - mgr->AddVolume(Tv); - Uv = new TGeoVolume("ITSssdConeU",U,SSDal); - mgr->AddVolume(Uv); - // - TGeoTranslation *tran = new TGeoTranslation("ITSssdConeTrans",0.0,0.0,-Z0); - TGeoRotation *rot180 = new TGeoRotation("ITSssdConeRot180",0.0,180.0,0.0); - TGeoCombiTrans *flip = new TGeoCombiTrans("ITSssdConeFlip",0.0,0.0,Z0,rot180); - TGeoTranslation *tranR,*tranS; - TGeoCombiTrans *fliptran,*rottran; - TGeoRotation *rot,*zspoaks,*zspoaks180; - Av->AddNode(Bv,1,0); - Av->AddNode(Cv,1,0); - Moth->AddNode(Av,1,tran); // RB24 side - Moth->AddNode(Av,2,flip); // RB26 side (Absorber) - Moth->AddNode(Iv,1,tran); // RB24 side - Moth->AddNode(Iv,2,flip); // RB26 side (Absorber) - Gv->AddNode(Hv,1,0); - for(i=0;iAddNode(Gv,i+1,rottran); // RB24 side - Av->AddNode(Fv,i+1,zspoaks); - Iv->AddNode(Lv,i+1,zspoaks); - zspoaks180 = new TGeoRotation("",0.0,180.0, - ((Double_t)i*360.)/((Double_t)Nspoaks)); - fliptran = new TGeoCombiTrans("",0.0,0.0,Z0,zspoaks180); - Moth->AddNode(Gv,Nspoaks+i+1,fliptran); // RB26 side - } // end for i - Iv->AddNode(Jv,1,0); - Iv->AddNode(Kv,1,0); - Ov->AddNode(Pv,1,0); - //Pv->AddNode(Qv,2,?); // Screw head - //Pv->AddNode(Qv,3,?); // Screw head - //Pv->AddNode(Vv,1,?); // Air hole in Posts - //Pv->AddNode(Vv,2,?); // Air hole in Posts - //Mv->AddNode(Wv,1,?); // Air hole in Posts - //Mv->AddNode(Wv,2,?); // Air hole in Posts - //Nv->AddNode(Xv,1,?); // Air hole in Posts - //Nv->AddNode(Xv,2,?); // Air hole in Posts - TGeoRotation *zposts,*zposts180; - for(i=0;iAddNode(Ov,i+1,rottran); // RB24 side - Jv->AddNode(Mv,i+1,zposts); - Iv->AddNode(Nv,i+1,zposts); - //Jv->AddNode(Xv,2*i+3,?); // Air hole in Posts - //Jv->AddNode(Xv,2*i+4,?); // Air hole in Posts - zposts180 = new TGeoRotation("",0.0,180.0, - ((Double_t)i*360.)/((Double_t)Nposts)); - fliptran = new TGeoCombiTrans("",0.0,0.0,Z0,zposts180); - Moth->AddNode(Ov,Nposts+i+1,fliptran); // RB26 side - } // end for i - // - for(i=0;iAddNode(Qv,i+4,rottran); - if(/*not where volumes U and T are*/kTRUE){ - tranR = new TGeoTranslation("",RinHole*TMath::Cos(t), - RinHole*TMath::Sin(t), - K->GetZ(2)+R->GetDz()); - tranS = new TGeoTranslation("",RinHole*TMath::Cos(t), - RinHole*TMath::Sin(t), - I->GetZ(4)+S->GetDz()); - Kv->AddNode(Rv,i,tranR); - Iv->AddNode(Sv,i,tranS); - } // end if - } // end for i - Int_t NcD=1,NcE=1,NcR=1,NcS=1; - const Int_t Nbscrew=2,Nbpins=3,Nrailsc=4,Nrailp=2; - Double_t da[] = {-3.5,-1.5,1.5,3.5}; - for(i=0;i<2;i++){ // Mounting for ITS-TPC bracket or ITS-Rails - t0 = TMath::Pi()*((Double_t)i); - for(j=-Nbscrew/2;j<=Nbscrew/2;j++)if(j!=0){//screws per ITS-TPC bracket - t = t0 + 5.0*((Double_t)j)*TMath::DegToRad(); - tran = new TGeoTranslation("",RoutHole*TMath::Cos(t), - RoutHole*TMath::Sin(t), - B->GetZ(0)-D->GetDz()); - Bv->AddNode(Dv,NcD,tran); - if(fDebug) cout << "D: NcD="<GetZ(0)-D->GetDz()); - Bv->AddNode(Ev,NcE,tran); - if(fDebug) cout << "E: NcE="<GetZ(0)-D->GetDz()); - Bv->AddNode(Dv,NcD,tran); - if(fDebug) cout << "D2: NcD="<GetZ(0)-D->GetDz()); - Bv->AddNode(Ev,NcE,tran); - if(fDebug) cout << "E2: NcE="<GetZ(0)-D->GetDz()); - Bv->AddNode(Dv,NcD,tran); - if(fDebug) cout << "D3: NcD="<GetZ(0)-D->GetDz()); - Bv->AddNode(Ev,NcE,tran); - if(fDebug) cout << "E3: NcE="<GetPhi1()+0.5*T->GetDphi()), - TMath::Sin(T->GetPhi1()+0.5*T->GetDphi()), - T->GetZ(T->GetNz()-1)+R->GetDz()); - Tv->AddNode(Rv,NcR++,tran); - tran = new TGeoTranslation("",TMath::Cos(U->GetPhi1()+0.5*U->GetDphi()), - TMath::Sin(U->GetPhi1()+0.5*U->GetDphi()), - U->GetZ(U->GetNz()-1)+S->GetDz()); - Uv->AddNode(Sv,NcS++,tran); - for(i=0;iAddNode(Tv,i+1,rot); - Iv->AddNode(Uv,i+1,rot); - if(fDebug) cout << "T/U: copy number="<GetZ(T->GetNz()-1)-E->GetDz()); - Kv->AddNode(Ev,NcE++,tran); - } // end for j - } // end for i +void AliITSv11::CreateGeometry() +{ + // Create the geometry and insert it in ALIC + + TGeoManager *geoManager = gGeoManager; + + TGeoVolume *vALIC = geoManager->GetVolume("ALIC"); + + // This part is really ugly, needs to be redone + new TGeoVolumeAssembly("ITSV"); + new TGeoVolumeAssembly("ITSS"); + + TGeoVolume *vITSV = geoManager->GetVolume("ITSV"); + TGeoVolume *vITSS = geoManager->GetVolume("ITSS"); + + vALIC->AddNode(vITSV, 1, 0); + vALIC->AddNode(vITSS, 1, 0); + + // + const Char_t *cvsDate="$Date$"; + const Char_t *cvsRevision="$Revision$"; + const Int_t kLength=100; + Char_t vstrng[kLength]; + if(fInitGeom.WriteVersionString(vstrng,kLength,(AliITSVersion_t)IsVersion(), + fMinorVersion,cvsDate,cvsRevision)) { + vITSV->SetTitle(vstrng); + vITSS->SetTitle(vstrng); + } + + fSPDgeom->SPDSector(vITSV); + + fSDDgeom->Layer3(vITSV); + fSDDgeom->Layer4(vITSV); + fSDDgeom->ForwardLayer3(vITSV); + fSDDgeom->ForwardLayer4(vITSV); + + fSSDgeom->Layer5(vITSV); + fSSDgeom->Layer6(vITSV); + fSSDgeom->LadderSupportLayer5(vITSV); + fSSDgeom->LadderSupportLayer6(vITSV); + fSSDgeom->EndCapSupportSystemLayer6(vITSV); + fSSDgeom->EndCapSupportSystemLayer5(vITSV); + + fSupgeom->SPDCone(vITSV); + fSupgeom->SDDCone(vITSV); + fSupgeom->SSDCone(vITSV); + + fSDDgeom->SDDCables(vITSV); + fSSDgeom->SSDCables(vITSV); + fSupgeom->ServicesCableSupport(vITSS); + + fSupgeom->ITSTPCSupports(vITSS); + } + //______________________________________________________________________ -void AliITSv11::CreateMaterials(){ +void AliITSv11::CreateMaterials() +{ // Create ITS materials // This function defines the default materials used in the Geant - // Monte Carlo simulations for the geometries AliITSv11. + // Monte Carlo simulations for the geometries AliITSv1, AliITSv3, + // AliITSv11. // In general it is automatically replaced by + // the CreateMaterials routine defined in AliITSv?. Should the function + // CreateMaterials not exist for the geometry version you are using this + // one is used. See the definition found in AliITSv5 or the other routine + // for a complete definition. // Inputs: // none. // Outputs: // none. - // Return + // Return: // none. - //TGeoMaterial *C = new TGeoMaterial("ITSCarbon",12.0,6.0,2.265); - TGeoMaterial *Al = new TGeoMaterial("ITSAluminum",26.981539,13.0,2.07); - TGeoMixture *Cfiber = new TGeoMixture("ITSCarbonFiber",6,1.930); - TGeoMixture *Rohacell = new TGeoMixture("ITSRohacell",6,1.930); - TGeoMixture *Staselite = new TGeoMixture("ITSStaselite4411w",6,1.930); - TGeoMixture *Air = new TGeoMixture("ITSAir",6,1.205*1.E-3); - TGeoMixture *Stainless = new TGeoMixture("ITSStainless",6,1.930); - // - Double_t SSDcone[20]; - SSDcone[0] = 1.0; // imat - SSDcone[1] = 0.0; // isvol - SSDcone[2] = gAlice->Field()->Integ(); // ifield - SSDcone[3] = gAlice->Field()->Max(); // fieldm - SSDcone[4] = 1.0; // tmaxfd [degrees] - SSDcone[5] = 1.0; // stemax [cm] - SSDcone[6] = 0.5; // deemax [fraction] - SSDcone[7] = 1.0E-3; // epsil [cm] - SSDcone[8] = 0.0; // stmin [cm] - new TGeoMedium("ITSssdCarbonFiber",1,Cfiber,SSDcone); - SSDcone[0] += 1.0; - new TGeoMedium("ITSssdStaselite4411w",2,Staselite,SSDcone); - SSDcone[0] += 1.0; - new TGeoMedium("ITSssdRohacell50A",3,Rohacell,SSDcone); - SSDcone[0] += 1.0; - new TGeoMedium("ITSssdStainlesSteal",4,Stainless,SSDcone); - SSDcone[0] += 1.0; - new TGeoMedium("ITSssdAir",5,Air,SSDcone); - SSDcone[0] += 1.0; - new TGeoMedium("ITSssdAl",6,Al,SSDcone); -} -//______________________________________________________________________ -void AliITSv11::InitAliITSgeom(){ - // Based on the geometry tree defined in Geant 3.21, this - // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS - // geometry sturture. - // Inputs: - // none. - // Outputs: - // none. - // Return - // none. + Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); + Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); + + Float_t tmaxfd = 0.1; // 1.0; // Degree + Float_t stemax = 1.0; // cm + Float_t deemax = 0.1; // 30.0; // Fraction of particle's energy 0 + +
+ +

The Exel spread sheet from which these density number come from. + + */ + //End_Html + + // AliMaterial(86,"AIRFMDSDD$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03); + Float_t aA[13],zZ[13],wW[13],den; + // From Pierluigi Barberis calculations of 2SPD+1SDD October 2 2002. + zZ[0] = 1.0; aA[0] = 1.00794; // Hydrogen + zZ[1] = 6.0; aA[1] = 12.011; // Carbon + zZ[2] = 7.0; aA[2] = 14.00674; // Nitrogen + zZ[3] = 8.0; aA[3] = 15.9994; // Oxigen + zZ[4] = 14.0; aA[4] = 28.0855; // Silicon + zZ[5] = 24.0; aA[5] = 51.9961; //Cromium + zZ[6] = 25.0; aA[6] = 54.938049; // Manganese + zZ[7] = 26.0; aA[7] = 55.845; // Iron + zZ[8] = 28.0; aA[8] = 58.6934; // Nickle + zZ[9] = 29.0; aA[9] = 63.546; // Copper + zZ[10] = 13.0; aA[10] = 26.981539; // Alulminum + zZ[11] = 47.0; aA[11] = 107.8682; // Silver + zZ[12] = 27.0; aA[12] = 58.9332; // Cobolt + wW[0] = 0.019965; + wW[1] = 0.340961; + wW[2] = 0.041225; + wW[3] = 0.200352; + wW[4] = 0.000386; + wW[5] = 0.001467; + wW[6] = 0.000155; + wW[7] = 0.005113; + wW[8] = 0.000993; + wW[9] = 0.381262; + wW[10] = 0.008121; + wW[11] = 0.000000; + wW[12] = 0.000000; + if(fByThick){// New values seeITS_MatBudget_4B.xls + den = 1.5253276; // g/cm^3 Cell O370 + }else{ + den = 2.58423412; // g/cm^3 Cell L370 + } // end if fByThick + //den = 6161.7/(3671.58978);//g/cm^3 Volume does not exclude holes + AliMixture(86,"AIRFMDSDD$",aA,zZ,den,+11,wW); + AliMedium(86,"AIRFMDSDD$",86,0,ifield,fieldm,tmaxfdAir,stemaxAir, + deemaxAir,epsilAir,stminAir); + + //AliMaterial(87,"AIRFMDSSD$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03); + // From Pierluigi Barberis calculations of SSD October 2 2002. + wW[0] = 0.019777; + wW[1] = 0.325901; + wW[2] = 0.031848; + wW[3] = 0.147668; + wW[4] = 0.030609; + wW[5] = 0.013993; + wW[6] = 0.001479; + wW[7] = 0.048792; + wW[8] = 0.009477; + wW[9] = 0.350697; + wW[10] = 0.014546; + wW[11] = 0.005213; + wW[12] = 0.000000; + if(fByThick){// New values seeITS_MatBudget_4B.xls + den = 1.2464275; // g/cm^3 Cell O403 + }else{ + den = 1.28134409; // g/cm^3 Cell L403 + } // end if fByThick + //den = 7666.3/(9753.553259); // volume does not exclude holes + AliMixture(87,"AIRFMDSSD$",aA,zZ,den,+12,wW); + AliMedium(87,"AIRFMDSSD$",87,0,ifield,fieldm,tmaxfdAir,stemaxAir, + deemaxAir,epsilAir,stminAir); + + //AliMaterial(88,"ITS SANDW CFMDSDD$",0.12011E+02,0.60000E+01,0.41000E+00,0.90868E+02,0.99900E+03); + // From Pierluigi Barberis calculations of 1SDD+Carbon fiber October 2 2002 + wW[0] = 0.016302; + wW[1] = 0.461870; + wW[2] = 0.033662; + wW[3] = 0.163595; + wW[4] = 0.000315; + wW[5] = 0.001197; + wW[6] = 0.000127; + wW[7] = 0.004175; + wW[8] = 0.000811; + wW[9] = 0.311315; + wW[10] = 0.006631; + wW[11] = 0.000000; + wW[12] = 0.000000; + if(fByThick){// New values seeITS_MatBudget_4B.xls + den = 1.9353276; // g/cm^3 Cell N370 + }else{ + den = 3.2788626; // g/cm^3 Cell F370 + } // end if fByThick + //den = 7667.1/(3671.58978); // Volume does not excludeholes + AliMixture(88,"ITS SANDW CFMDSDD$",aA,zZ,den,+11,wW); + AliMedium(88,"ITS SANDW CFMDSDD$",88,0,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin); + + //AliMaterial(89,"ITS SANDW CFMDSSD$",0.12011E+02,0.60000E+01,0.41000E+00,0.90868E+02,0.99900E+03); + // From Pierluigi Barberis calculations of SSD+Carbon fiber October 2 2002. + wW[0] = 0.014065; + wW[1] = 0.520598; + wW[2] = 0.022650; + wW[3] = 0.105018; + wW[4] = 0.021768; + wW[5] = 0.009952; + wW[6] = 0.001051; + wW[7] = 0.034700; + wW[8] = 0.006740; + wW[9] = 0.249406; + wW[10] = 0.010345; + wW[11] = 0.0003707; + wW[12] = 0.000000; + if(fByThick){// New values seeITS_MatBudget_4B.xls + den = 1.6564275; // g/cm^3 Cell N304 + }else{ + den = 1.7028296; // g/cm^3 Cell F304 + } // end if fByThick + //den = 1166.5/(3671.58978); // Volume does not exclude holes + AliMixture(89,"ITS SANDW CFMDSSD$",aA,zZ,den,+12,wW); + AliMedium(89,"ITS SANDW CFMDSSD$",89,0,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin); + + //AliMaterial(97,"SPD SERVICES$",0.12011E+02,0.60000E+01,0.41000E+00,0.90868E+02,0.99900E+03); + // From Pierluigi Barberis calculations of 1SPD October 2 2002. + wW[0] = 0.005970; + wW[1] = 0.304704; + wW[2] = 0.042510; + wW[3] = 0.121715; + wW[4] = 0.001118; + wW[5] = 0.030948; + wW[6] = 0.003270; + wW[7] = 0.107910; + wW[8] = 0.020960; + wW[9] = 0.360895; + wW[10] = 0.000000; + wW[11] = 0.000000; + wW[12] = 0.000000; + if(fByThick){// New values seeITS_MatBudget_4B.xls + den = 80.31136576; // g/cm^3 Cell H329 + }else{ + den = 87.13062; // g/cm^3 Cell G329 + } // end if fByThick + //den = 1251.3/(0.05*2.0*TMath::Pi()*(7.75*7.75 - 3.7*3.7)); // g/cm^3 + AliMixture(97,"SPD SERVICES$",aA,zZ,den,+10,wW); + AliMedium(97,"SPD SERVICES$",97,0,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin); + + + // Special media + + AliMaterial(90,"SPD shield$", 12.011, 6., 1.93 , 22.36, 999); + AliMedium(90,"SPD shield$",90,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ); + + // SPD End Ladder (data from Petra Riedler) + Float_t aSPDel[5] = {1.00794,12.0107,14.01,15.9994,63.54 }; + Float_t zSPDel[5] = {1.,6.,7.,8.,29.}; + Float_t wSPDel[5] = {0.004092,0.107274,0.011438,0.032476,0.844719}; + Float_t dSPDel = 3.903403; + + // AliMaterial(91, "SPD End ladder$", 47.0447, 21.7963, 3.6374, 4.4711, 999); + AliMixture(91,"SPD End ladder$",aSPDel,zSPDel,dSPDel,5,wSPDel); + AliMedium(91,"SPD End ladder$",91,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ); + + AliMaterial(92, "SPD cone$",28.0855, 14., 2.33, 9.36, 999); + AliMedium(92,"SPD cone$",92,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ); + /* Material with fractional Z not actually used + AliMaterial(93, "SDD End ladder$", 69.9298, 29.8246, 0.3824, 36.5103, 999); + AliMedium(93,"SDD End ladder$",93,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ); + */ + AliMaterial(94, "SDD cone$",63.546, 29., 1.15, 1.265, 999); + AliMedium(94,"SDD cone$",94,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ); + /* Material with fractional Z not actually used + AliMaterial(95, "SSD End ladder$", 32.0988, 15.4021, 0.68, 35.3238, 999); + AliMedium(95,"SSD End ladder$",95,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ); + */ + AliMaterial(96, "SSD cone$",63.546, 29., 1.15, 1.265, 999); + AliMedium(96,"SSD cone$",96,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ); + + AliMixture(98,"SDD OPTICFIB$",aoptfib,zoptfib,doptfib,-2,woptfib); + AliMedium(98,"SDD OPTICFIB$",98,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin); + + AliMixture(95,"SSD FEP$",aFEP,zFEP,dFEP,-2,wFEP); + AliMedium(95,"SSD FEP$",95,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin); + + // Mean material for low-voltage cables on SPD trays Side A + // (Copper + PolyEthylene (C2-H4)) (D.Elia for cable number and + // cross-section area, M.Sitta for elemental computation) - 26 Feb 10 + wW[0] = 0.323024;//H + wW[2] = 0.515464;//Cu + wW[1] = 0.161512;//C + wW[3] = 0.000000;//O + wW[4] = 0.000000;//S + wW[5] = 0.000000;//F + wW[6] = 0.000000;//Sn + wW[7] = 0.000000;//Pb + wW[8] = 0.000000;//Cr + wW[9] = 0.000000;//Si + wW[10] = 0.000000;//Ni + wW[11] = 0.000000;//Ca + + den = 5.078866; + AliMixture(60,"SPD_LOWCABLES$",aA,zZ,den,+3,wW); + AliMedium(60,"SPD_LOWCABLES$",60,0,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin); + + // Mean material for high-voltage cables on SPD trays Side A & C + // (Copper + HD PolyEthylene (C2-H2)) (D.Elia for cable number and + // cross-section area, M.Sitta for elemental computation) - 10 Jun 10 + wW[0] = 0.083766;//H + wW[2] = 0.417136;//Cu + wW[1] = 0.499098;//C + wW[3] = 0.000000;//O + wW[4] = 0.000000;//S + wW[5] = 0.000000;//F + wW[6] = 0.000000;//Sn + wW[7] = 0.000000;//Pb + wW[8] = 0.000000;//Cr + wW[9] = 0.000000;//Si + wW[10] = 0.000000;//Ni + wW[11] = 0.000000;//Ca + + den = 1.514930; + AliMixture(58,"SPD_HICABLES$",aA,zZ,den,+3,wW); + AliMedium(58,"SPD_HICABLES$",58,0,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin); + + // PolyUrethane [C25-H42-N2-O6] - 07 Mar 10 + zZ[2] = 7.0; aA[2] = 14.0067; // Nitrogen - From Root TGeoElementTable + + wW[0] = 0.090724;//H + wW[2] = 0.060035;//N + wW[1] = 0.643513;//C + wW[3] = 0.205728;//O + wW[4] = 0.000000;//S + wW[5] = 0.000000;//F + wW[6] = 0.000000;//Sn + wW[7] = 0.000000;//Pb + wW[8] = 0.000000;//Cr + wW[9] = 0.000000;//Si + wW[10] = 0.000000;//Ni + wW[11] = 0.000000;//Ca + + den = 1.158910; + AliMixture(67,"POLYURETHANE$",aA,zZ,den,+4,wW); + AliMedium(67,"POLYURETHANE$",67,0,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin); + + // POM (Polyoxymethylene = (CH2O)n ) - 02 May 10 + zZ[2] = 8.0; aA[2] = 15.9994; // Oxigen + + wW[0] = 0.067137;//H + wW[1] = 0.400016;//C + wW[2] = 0.532847;//O + wW[3] = 0.000000;//O + wW[4] = 0.000000;//S + wW[5] = 0.000000;//F + wW[6] = 0.000000;//Sn + wW[7] = 0.000000;//Pb + wW[8] = 0.000000;//Cr + wW[9] = 0.000000;//Si + wW[10] = 0.000000;//Ni + wW[11] = 0.000000;//Ca + + den = 1.4200; + AliMixture(57,"POLYOXYMETHYLENE$",aA,zZ,den,+3,wW); + AliMedium(57,"POLYOXYMETHYLENE$",57,0,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin); + + + // Anticorodal (Aliminum alloy) - 08 nov 10 + // A,Z from Root TGeoElementTable, W from Web sites + zZ[0] = 13.0; aA[0] = 26.9815; // Aluminium + zZ[1] = 29.0; aA[1] = 63.546 ; // Copper + zZ[2] = 26.0; aA[2] = 55.845 ; // Iron + zZ[3] = 25.0; aA[3] = 54.938 ; // Manganese + zZ[4] = 12.0; aA[4] = 24.305 ; // Magnesium + zZ[5] = 14.0; aA[5] = 28.0855; // Silicon + zZ[6] = 30.0; aA[6] = 65.39 ; // Zinc + zZ[7] = 24.0; aA[7] = 51.9961; // Chromium + zZ[8] = 22.0; aA[8] = 47.867 ; // Titanium + + wW[1] = 0.001000;//Cu + wW[2] = 0.005000;//Fe + wW[3] = 0.007000;//Mn - mean value + wW[4] = 0.009000;//Mg - mean value + wW[5] = 0.001000;//Si - mean value + wW[6] = 0.002000;//Zn + wW[7] = 0.002500;//Cr + wW[8] = 0.001000;//Ti + + Double_t totFrac = 0; + for (Int_t j=1; j<9; j++) + totFrac += wW[j]; + wW[0] = 1. - totFrac;//Al - the remainder + + den = 2.69; + AliMixture(93,"ANTICORODAL$",aA,zZ,den,+9,wW); + AliMedium(93,"ANTICORODAL$",93,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin); + + // Hokotol (another Aluminium alloy) - 08 nov 10 + // A,Z from Root TGeoElementTable, W from Web sites + zZ[0] = 13.0; aA[0] = 26.9815; // Aluminium + zZ[1] = 29.0; aA[1] = 63.546 ; // Copper + zZ[2] = 26.0; aA[2] = 55.845 ; // Iron + zZ[3] = 25.0; aA[3] = 54.938 ; // Manganese + zZ[4] = 12.0; aA[4] = 24.305 ; // Magnesium + zZ[5] = 14.0; aA[5] = 28.0855; // Silicon + zZ[6] = 30.0; aA[6] = 65.39 ; // Zinc + zZ[7] = 24.0; aA[7] = 51.9961; // Chromium + zZ[8] = 22.0; aA[8] = 47.867 ; // Titanium + zZ[9] = 40.0; aA[9] = 91.224 ; // Zirconium + + wW[1] = 0.020500;//Cu - mean value + wW[2] = 0.000300;//Fe + wW[3] = 0.022000;//Mn - mean value + wW[4] = 0.001000;//Mg - mean value + wW[5] = 0.002000;//Si - mean value + wW[6] = 0.066500;//Zn + wW[7] = 0.005000;//Cr + wW[8] = 0.000600;//Ti + wW[9] = 0.001650;//Zr - mean value + + totFrac = 0; + for (Int_t j=1; j<10; j++) + totFrac += wW[j]; + wW[0] = 1. - totFrac;//Al - the remainder + + den = 2.69; + AliMixture(34,"HOKOTOL$",aA,zZ,den,+10,wW); + AliMedium(34,"HOKOTOL$",34,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin); + + // Ergal (7075) (yet another Aluminium alloy) - 09 nov 10 + // A,Z from Root TGeoElementTable, W from Web sites + zZ[0] = 13.0; aA[0] = 26.9815; // Aluminium + zZ[1] = 29.0; aA[1] = 63.546 ; // Copper + zZ[2] = 26.0; aA[2] = 55.845 ; // Iron + zZ[3] = 25.0; aA[3] = 54.938 ; // Manganese + zZ[4] = 12.0; aA[4] = 24.305 ; // Magnesium + zZ[5] = 14.0; aA[5] = 28.0855; // Silicon + zZ[6] = 30.0; aA[6] = 65.39 ; // Zinc + zZ[7] = 24.0; aA[7] = 51.9961; // Chromium + zZ[8] = 22.0; aA[8] = 47.867 ; // Titanium + + wW[1] = 0.016000;//Cu - mean value + wW[2] = 0.005000;//Fe + wW[3] = 0.003000;//Mn + wW[4] = 0.025000;//Mg - mean value + wW[5] = 0.004000;//Si + wW[6] = 0.056000;//Zn - mean value + wW[7] = 0.002300;//Cr - mean value + wW[8] = 0.002000;//Ti + + totFrac = 0; + for (Int_t j=1; j<9; j++) + totFrac += wW[j]; + wW[0] = 1. - totFrac;//Al - the remainder + + den = 2.69; + AliMixture(33,"ERGAL$",aA,zZ,den,+9,wW); + AliMedium(33,"ERGAL$",33,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin); + } + //______________________________________________________________________ -void AliITSv11::Init(){ - // Initialise the ITS after it has been created. +void AliITSv11::Init() +{ + // Initialise the ITS after it has been created. // Inputs: // none. // Outputs: // none. - // Return + // Return: // none. + + AliDebug(1,Form("Init: Major version %d Minor version %d",fMajorVersion, + fMinorVersion)); + UpdateInternalGeometry(); + AliITS::Init(); + + fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID. } + //______________________________________________________________________ -void AliITSv11::SetDefaults(){ - // Sets the default segmentation, response, digit and raw cluster - // classes to be used. These defaults can be overwritten in the - // macros that do these later steps. Defaults are give hear for the - // general user. +void AliITSv11::SetDefaults() +{ + // sets the default segmentation, response, digit and raw cluster classes // Inputs: // none. // Outputs: // none. - // Return + // Return: // none. + + if(!fDetTypeSim){ + Warning("SetDefaults","Error fDetTypeSim not defined"); + return; + } + + fDetTypeSim->SetDefaults(); + + + if(fgkNTYPES>3){ + Warning("SetDefaults", + "Only the four basic detector types are initialised!"); + }// end if + return; } + //______________________________________________________________________ -void AliITSv11::DrawModule(){ - // Draw a standard set of shaded view of the ITS version 11. +void AliITSv11::StepManager() +{ + // Called for every step in the ITS, then calles the AliITShit class + // creator with the information to be recoreded about that hit. + // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the + // printing of information to a file which can be used to create a .det + // file read in by the routine CreateGeometry(). If set to 0 or any other + // value except 1, the default behavior, then no such file is created nor + // it the extra variables and the like used in the printing allocated. // Inputs: // none. // Outputs: // none. - // Return + // Return: // none. + + if(!(this->IsActive())) return; + if(!(gMC->TrackCharge())) return; + + Int_t copy, lay = 0; + Int_t id = gMC->CurrentVolID(copy); + + Bool_t notSens = kFALSE; + while ((layIsTrackExiting()) { + AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kITS); + } // if Outer ITS mother Volume + + static TLorentzVector position, momentum; // Saves on calls to construtors + static AliITShit hit;// Saves on calls to constructors + + TClonesArray &lhits = *(Hits()); + Int_t cpn0, cpn1, mod, status = 0; + // + // Track status + if(gMC->IsTrackInside()) status += 1; + if(gMC->IsTrackEntering()) status += 2; + if(gMC->IsTrackExiting()) status += 4; + if(gMC->IsTrackOut()) status += 8; + if(gMC->IsTrackDisappeared()) status += 16; + if(gMC->IsTrackStop()) status += 32; + if(gMC->IsTrackAlive()) status += 64; + + // + // retrieve the indices with the volume path + // + switch (lay) { + case 0:case 1: // SPD + gMC->CurrentVolOffID(1,copy); // ladder + gMC->CurrentVolOffID(3,cpn1); // stave + gMC->CurrentVolOffID(5,cpn0); // sector + break; + case 2:case 3: // SDD + copy = 1; + gMC->CurrentVolOffID(2,cpn1); + gMC->CurrentVolOffID(3,cpn0); + break; + case 4:case 5: // SSD + copy = 1; + gMC->CurrentVolOffID(1,cpn1); + gMC->CurrentVolOffID(2,cpn0); + break; + default: + AliError(Form("Invalid value: lay= %d . Not an ITS sensitive volume",lay)); + return; // not an ITS sensitive volume. + } // + + fInitGeom.DecodeDetector(mod,lay+1,cpn0,cpn1,copy); + // We should not need to pass by the switch ! + // This is time consuming... + // therefore DecodeDetectorv11(...) shouldn't be private ! + // and we should be able to use instead : + //fInitGeom.DecodeDetectorv11(mod,lay+1,cpn0,cpn1,copy); + + // + // Fill hit structure. + // + hit.SetModule(mod); + hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber()); + gMC->TrackPosition(position); + gMC->TrackMomentum(momentum); + hit.SetPosition(position); + hit.SetTime(gMC->TrackTime()); + hit.SetMomentum(momentum); + hit.SetStatus(status); + hit.SetEdep(gMC->Edep()); + hit.SetShunt(GetIshunt()); + if(gMC->IsTrackEntering()){ + hit.SetStartPosition(position); + hit.SetStartTime(gMC->TrackTime()); + hit.SetStartStatus(status); + return; // don't save entering hit. + } // end if IsEntering + // Fill hit structure with this new hit. + //Info("StepManager","Calling Copy Constructor"); + new(lhits[fNhits++]) AliITShit(hit); // Use Copy Construtor. + // Save old position... for next hit. + hit.SetStartPosition(position); + hit.SetStartTime(gMC->TrackTime()); + hit.SetStartStatus(status); + + return; } -//______________________________________________________________________ -void AliITSv11::StepManager(){ - // Called for every step in the ITS, then calles the AliITShit class - // creator with the information to be recoreded about that hit. - // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the - // printing of information to a file which can be used to create a .det - // file read in by the routine CreateGeometry(). If set to 0 or any other - // value except 1, the default behavior, then no such file is created nor - // is the extra variables and the like used in the printing allocated. -} -