/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * Copyright(c) 2007-2008, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors are mentioned in the code where appropriate. *
* 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 <stdio.h>
-#include <stdlib.h>
-// General Root includes
-#include <Riostream.h>
-#include <TMath.h>
-#include <float.h>
-#include <TObjArray.h>
+
+//************************************************************************
+//
+// Inner Traking System geometry v11
+//
+// Based on ROOT geometrical modeler
+//
+// B. Nilsen, L. Gaudichet
+//************************************************************************
+
#include <TClonesArray.h>
-#include <TLorentzVector.h>
-#include <TObjString.h>
-// Root Geometry includes
#include <TGeoManager.h>
-#include <TGeoVolume.h>
#include <TGeoPcon.h>
-#include <TGeoCone.h>
-#include <TGeoTube.h> // contaings TGeoTubeSeg
-#include <TGeoArb8.h>
-#include <TGeoCompositeShape.h>
-#include <TGeoMatrix.h>
-#include <TGeoNode.h>
-#include <TGeoMaterial.h>
-#include <TGeoMedium.h>
-#include "AliITSv11GeometrySupport.h"
-// General AliRoot includes
-#include "AliRun.h"
-#include "AliMagF.h"
-#include "AliConst.h"
-// ITS specific includes
-#include "AliITSgeomSPD.h"
-#include "AliITSgeomSDD.h"
-#include "AliITSDetType.h"
-#include "AliITSresponseSPD.h"
-#include "AliITSresponseSDD.h"
-#include "AliITSsegmentationSPD.h"
+#include <TGeoVolume.h>
+#include <TLorentzVector.h>
+#include <TVirtualMC.h>
+
+#include "AliITS.h"
+#include "AliITSCalibrationSDD.h"
+#include "AliITSDetTypeSim.h"
+#include "AliITShit.h"
#include "AliITSsegmentationSDD.h"
-#include "AliITSsimulationSPD.h"
-#include "AliITSsimulationSDD.h"
-#include "AliITSClusterFinderSSD.h"
+#include "AliITSsegmentationSPD.h"
+#include "AliITSsegmentationSSD.h"
#include "AliITSv11.h"
-#include "AliITSv11GeometrySPD.h"
#include "AliITSv11GeometrySDD.h"
+#include "AliITSv11GeometrySPD.h"
+#include "AliITSv11GeometrySSD.h"
#include "AliITSv11GeometrySupport.h"
+#include "AliMC.h"
+#include "AliMagF.h"
+#include "AliRun.h"
+#include "AliTrackReference.h"
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(),
- fGeomDetOut(kFALSE),
- fGeomDetIn(kFALSE),
- fMajorVersion(11),
- fMinorVersion(0),
- fDet1(0.0),
- fDet2(0.0),
- fChip1(0.0),
- fChip2(0.0),
- fRails(0),
- fFluid(1),
- fSPDgeom(0),
- fSupgeom(0){
- // Standard default constructor for the ITS version 11.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return
- // A default constructed AliITSv11 class.
-
- //fITSV = 0;
- //fcS = 0;
-// fcD = 0;
+fByThick(kTRUE),
+fMajorVersion(IsVersion()),
+fMinorVersion(0),
+fSPDgeom(),
+fSDDgeom(0),
+fSSDgeom(),
+fSupgeom(),
+fIgm(kv11)
+{
+ // Standard default constructor for the ITS version 11.
- SetEUCLID(kFALSE);
-}
-//______________________________________________________________________
-AliITSv11::AliITSv11(Int_t debugITS,Int_t debugSPD,Int_t debugSDD,
- Int_t debugSSD,Int_t debugSUP) :
- AliITS(),
- fGeomDetOut(kFALSE),
- fGeomDetIn(kFALSE),
- fMajorVersion(11),
- fMinorVersion(0),
- fDet1(0.0),
- fDet2(0.0),
- fChip1(0.0),
- fChip2(0.0),
- fRails(0),
- fFluid(1),
- fSPDgeom(0),
- fSupgeom(0){
- // Standard default constructor for the ITS version 11.
- // Inputs:
- // Int_t debugITS Debug flag for ITS code (required).
- // Int_t debugSPD Debug flag for SPD geometry (default = 0).
- // Int_t debugSDD Debug flag for SDD geometry (default = 0).
- // Int_t debugSSD Debug flag for SSD geometry (default = 0).
- // Int_t debugSUP Debug flag for SUPort geometry (default = 0).
- // Outputs:
- // none.
- // Return
- // A Constructor for ITS geometry version 11 useful for Geometry display.
-
- SetEUCLID(kFALSE);
- debugSSD = debugSDD; // remove waring for unused variables.
- SetDebug(debugITS);
- fSPDgeom = new AliITSv11GeometrySPD(debugSPD);
- fSDDgeom = new AliITSv11GeometrySDD(debugSDD);
- fSupgeom = new AliITSv11GeometrySupport(debugSUP);
-}
-//______________________________________________________________________
-AliITSv11::AliITSv11(const char *title) :
- AliITS("ITS", title),
- fGeomDetOut(kFALSE),
- fGeomDetIn(kFALSE),
- fMajorVersion(11),
- fMinorVersion(0),
- fDet1(0.0),
- fDet2(0.0),
- fChip1(0.0),
- fChip2(0.0),
- fRails(0),
- fFluid(1),
- fSPDgeom(0),
- fSupgeom(0){
- // Standard constructor for the ITS version 11.
- // Inputs:
- // const char *title The title of for this geometry.
- // Outputs:
- // none.
- // Return
- // A Standard constructed AliITSv11 class.
- SetEUCLID(kFALSE);
- fSPDgeom = new AliITSv11GeometrySPD(GetDebug());
- fSupgeom = new AliITSv11GeometrySupport(GetDebug());
+ fIdN = 0;
+ fIdName = 0;
+ fIdSens = 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.
- // Inputs:
- // AliITSv11 &source class to be copied from.
- // Outputs:
- // none.
- // Return
- // none.
- 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.
+AliITSv11::AliITSv11(const char *name, const char *title):
+AliITS("ITS", title),
+fByThick(kTRUE),
+fMajorVersion(IsVersion()),
+fMinorVersion(0),
+fSPDgeom(),
+fSDDgeom(0),
+fSSDgeom(),
+fSupgeom(),
+fIgm(kv11)
+{
+ // Standard constructor for the ITS version 11.
+
+ fSDDgeom = new AliITSv11GeometrySDD(0);
- if(&source == this) return *this;
- Error("= operator","Not allowed to copy AliITSv11");
- return *this;
+ Int_t i;
+ fIdN = 6;
+ fIdName = new TString[fIdN];
+ fIdName[0] = name; // removes warning message
+ fIdName[0] = "ITS1";
+ fIdName[1] = "ITS2";
+ fIdName[2] = fSDDgeom->GetSenstiveVolumeName3();
+ fIdName[3] = fSDDgeom->GetSenstiveVolumeName4();
+ fIdName[4] = "ITS5";
+ fIdName[5] = "ITS6";
+ fIdSens = new Int_t[fIdN];
+ for(i=0;i<fIdN;i++) fIdSens[i] = 0;
+ // not needed, fByThick set to kTRUE in in the member initialization lis
+
}
//______________________________________________________________________
-void AliITSv11::BuildGeometry(){
- // This routine defines and Creates the geometry for version 11 of
- // the ITS for use in the simulation display routines. This is a
- // very simplified geometry for speed of viewing.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return
- // none.
- //TVector3 t(0.0,0.0,0.0);
+AliITSv11::AliITSv11(Int_t /* debugITS */,Int_t debugSPD,Int_t debugSDD,
+ Int_t debugSSD,Int_t debugSUP) :
+AliITS("ITS","ITS geometry v11"),
+fByThick(kTRUE),
+fMajorVersion(IsVersion()),
+fMinorVersion(0),
+fSPDgeom(),
+fSDDgeom(0),
+fSSDgeom(),
+fSupgeom(),
+fIgm(kv11)
+{
+ // Standard default constructor for the ITS version 11.
+
- //if(fITSV==0) fITSV = new AliITSGeometryITSV(this,"ALIC");
- //if(fcS==0) fcS = new AliITSGeometrySSDCone(this,t,"TSV",1);
+ fSPDgeom = new AliITSv11GeometrySPD(debugSPD);
+ fSDDgeom = new AliITSv11GeometrySDD(debugSDD);
+ fSDDgeom->SetDebug(debugSDD);
+ fSSDgeom = new AliITSv11GeometrySSD();
+ fSSDgeom->SetDebug(debugSSD);
+ fSupgeom = new AliITSv11GeometrySupport(debugSUP);
- //fcS->BuildDisplayGeometry();
+ Int_t i;
+ 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();
+ fIdSens = new Int_t[fIdN];
+ for(i=0;i<fIdN;i++) fIdSens[i] = 0;
+ // debugITS = (debugSPD && debugSSD && debugSUP && debugSDD); //remove temp. warnings
+}
+//______________________________________________________________________
+AliITSv11::~AliITSv11() {
+ delete fSDDgeom;
}
//______________________________________________________________________
void AliITSv11::CreateGeometry(){
- // This routine defines and Creates the geometry for version 11 of
- // the ITS. The geometry is used by the particle trasport routines,
- // and therefore, is very detailed.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return
- // none.
- TVector3 t(0.0,0.0,0.0);
- const Double_t kcm = 1.0;
+ //
+ // Create ROOT geometry
+ //
+ // These constant character strings are set by cvs during commit
+ // do not change them unless you know what you are doing!
+ const Char_t *cvsDate="$Date$";
+ const Char_t *cvsRevision="$Revision$";
+
+ TGeoManager *geoManager = gGeoManager;
+ TGeoVolume *vALIC = geoManager->GetTopVolume();
- TGeoManager *mgr = gGeoManager;
- TGeoVolume *vALIC = mgr->GetTopVolume();
+ TGeoPcon *sITS = new TGeoPcon("ITS Top Volume",0.0,360.0,2);
- TGeoPcon *sITS = new TGeoPcon("ITS Top Volume, Daughter of ALIC",
- 0.0,360.0,2);
// DefineSection(section number, Z, Rmin, Rmax).
+ const Double_t kcm = 1.0;
sITS->DefineSection(0,-300.0*kcm,0.01*kcm,50.0*kcm);
sITS->DefineSection(1,+300.0*kcm,0.01*kcm,50.0*kcm);
- TGeoVolume *vITS = new TGeoVolume("ITSV",sITS,0);
- mgr->AddVolume(vITS);
+
+ TGeoMedium *air = gGeoManager->GetMedium("ITS_AIR$");
+ TGeoVolume *vITS = new TGeoVolume("ITSV",sITS,air);
vITS->SetVisibility(kFALSE);
+ const Int_t length=100;
+ Char_t vstrng[length];
+ if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(),
+ fMinorVersion,cvsDate,cvsRevision))
+ vITS->SetTitle(vstrng);
+ //printf("Title set to %s\n",vstrng);
vALIC->AddNode(vITS,1,0);
- //
- fSPDgeom->CenteralSPD(vITS);
- fSDDgeom->SetGeomParameters(); // needed
- fSDDgeom->Layer3(vITS);
- fSDDgeom->Layer4(vITS);
- fSupgeom->SPDCone(vITS);
- fSupgeom->SPDThermalSheald(vITS);
- fSupgeom->SDDCone(vITS);
- fSupgeom->SSDCone(vITS);
- fSupgeom->ServicesCableSupport(vITS);
+
+// fSPDgeom->CenteralSPD(vITS);
+
+ fSDDgeom->Layer3(vITS);
+ fSDDgeom->Layer4(vITS);
+
+// fSupgeom->SPDCone(vITS);
+// fSupgeom->SPDThermalSheald(vITS);
+// fSupgeom->SDDCone(vITS);
+// fSupgeom->SSDCone(vITS);
+// fSupgeom->ServicesCableSupport(vITS);
+
}
//______________________________________________________________________
void AliITSv11::CreateMaterials(){
- // Create ITS materials
- // This function defines the default materials used in the Geant
- // Monte Carlo simulations for the geometries AliITSv11.
- // In general it is automatically replaced by
+ // Create Standard ITS Materials
// Inputs:
- // none.
+ // none.
// Outputs:
- // none.
- // Return
- // none.
-
- //TGeoMaterial *C = new TGeoMaterial("ITSCarbon",12.0,6.0,2.265);
- TGeoMaterial *matAl = new TGeoMaterial("ITSAluminum",26.981539,13.0,2.07);
- TGeoMixture *matCfiber = new TGeoMixture("ITSCarbonFiber",6,1.930);
- TGeoMixture *matRohacell = new TGeoMixture("ITSRohacell",6,1.930);
- TGeoMixture *matStaselite = new TGeoMixture("ITSStaselite4411w",6,1.930);
- TGeoMixture *matAir = new TGeoMixture("ITSAir",6,1.205*1.E-3);
- TGeoMixture *matStainless = new TGeoMixture("ITSStainless",6,1.930);
- //
- Double_t medSPDcone[20];
- medSPDcone[0] = 1.0; // imat
- medSPDcone[1] = 0.0; // isvol
- medSPDcone[2] = gAlice->Field()->Integ(); // ifield
- medSPDcone[3] = gAlice->Field()->Max(); // fieldm
- medSPDcone[4] = 1.0; // tmaxfd [degrees]
- medSPDcone[5] = 1.0; // stemax [cm]
- medSPDcone[6] = 0.5; // deemax [fraction]
- medSPDcone[7] = 1.0E-3; // epsil [cm]
- medSPDcone[8] = 0.0; // stmin [cm]
- new TGeoMedium("ITSspdCarbonFiber",1,matCfiber,medSPDcone);
- medSPDcone[0] += 1.0;
- new TGeoMedium("ITSspdStaselite4411w",2,matStaselite,medSPDcone);
- medSPDcone[0] += 1.0;
- new TGeoMedium("ITSspdRohacell50A",3,matRohacell,medSPDcone);
- medSPDcone[0] += 1.0;
- new TGeoMedium("ITSspdStainlesSteal",4,matStainless,medSPDcone);
- medSPDcone[0] += 1.0;
- new TGeoMedium("ITSspdAir",5,matAir,medSPDcone);
- medSPDcone[0] += 1.0;
- new TGeoMedium("ITSspdAl",6,matAl,medSPDcone);
+ // none.
+ // Return:
+ // none.
+
+
//
- Double_t medSSDcone[20];
- medSSDcone[0] = 1.0; // imat
- medSSDcone[1] = 0.0; // isvol
- medSSDcone[2] = gAlice->Field()->Integ(); // ifield
- medSSDcone[3] = gAlice->Field()->Max(); // fieldm
- medSSDcone[4] = 1.0; // tmaxfd [degrees]
- medSSDcone[5] = 1.0; // stemax [cm]
- medSSDcone[6] = 0.5; // deemax [fraction]
- medSSDcone[7] = 1.0E-3; // epsil [cm]
- medSSDcone[8] = 0.0; // stmin [cm]
- new TGeoMedium("ITSssdCarbonFiber",1,matCfiber,medSSDcone);
- medSSDcone[0] += 1.0;
- new TGeoMedium("ITSssdStaselite4411w",2,matStaselite,medSSDcone);
- medSSDcone[0] += 1.0;
- new TGeoMedium("ITSssdRohacell50A",3,matRohacell,medSSDcone);
- medSSDcone[0] += 1.0;
- new TGeoMedium("ITSssdStainlesSteal",4,matStainless,medSSDcone);
- medSSDcone[0] += 1.0;
- new TGeoMedium("ITSssdAir",5,matAir,medSSDcone);
- medSSDcone[0] += 1.0;
- new TGeoMedium("ITSssdAl",6,matAl,medSSDcone);
-}
-//______________________________________________________________________
-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.
+ fSPDgeom->AliITSv11Geometry::CreateDefaultMaterials();
+ // Detector specific material definistions
+ fSPDgeom->CreateMaterials();
+ fSDDgeom->CreateMaterials();
+ fSSDgeom->CreateMaterials();
+ fSupgeom->CreateMaterials();
}
+
//______________________________________________________________________
void AliITSv11::Init(){
- // Initialise the ITS after it has been created.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return
- // none.
+ //
+ // Initialise the ITS after it has been created.
+ //
+
+ //AliInfo(Form("Minor version %d",fMinorVersion));
+ //
+ UpdateInternalGeometry();
+ AliITS::Init();
+
}
+
//______________________________________________________________________
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.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return
- // none.
-}
-//______________________________________________________________________
-void AliITSv11::DrawModule(){
- // Draw a standard set of shaded view of the ITS version 11.
- // Inputs:
- // none.
- // Outputs:
- // none.
- // Return
- // none.
+ //
+ // Set response and segmentation models for SPD, SDD and SSD
+ //
+
+// if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
+// fDetTypeSim->SetITSgeom(GetITSgeom());
+ if(!fDetTypeSim) {
+ Warning("SetDefaults","Error fDetTypeSim not defined");
+ return;
+ }
+
+ fDetTypeSim->ResetCalibrationArray();
+ fDetTypeSim->ResetSegmentation();
+ fDetTypeSim->SetDefaults();
+
+ if(fgkNTYPES>3){
+ Warning("SetDefaults",
+ "Only the four basic detector types are initialised!");
+ }// end if
+
+
+ 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.
+// //
+// Int_t copy, id;
+// TLorentzVector position, momentum;
+// static TLorentzVector position0;
+// static Int_t stat0=0;
+
+// if(!(this->IsActive())){
+// return;
+// } // end if !Active volume.
+
+// if(!(gMC->TrackCharge())) return;
+
+// id=gMC->CurrentVolID(copy);
+
+// Bool_t sensvol = kFALSE;
+// for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE;
+// if(sensvol && (gMC->IsTrackExiting())){
+// copy = fTrackReferences->GetEntriesFast();
+// TClonesArray &lTR = *fTrackReferences;
+// // Fill TrackReference structure with this new TrackReference.
+// new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+// } // if Outer ITS mother Volume
+
+
+// Int_t copy1,copy2;
+// Int_t vol[5];
+// TClonesArray &lhits = *fHits;
+// //
+// // Track status
+// vol[3] = 0;
+// vol[4] = 0;
+// if(gMC->IsTrackInside()) vol[3] += 1;
+// if(gMC->IsTrackEntering()) vol[3] += 2;
+// if(gMC->IsTrackExiting()) vol[3] += 4;
+// if(gMC->IsTrackOut()) vol[3] += 8;
+// if(gMC->IsTrackDisappeared()) vol[3] += 16;
+// if(gMC->IsTrackStop()) vol[3] += 32;
+// if(gMC->IsTrackAlive()) vol[3] += 64;
+// //
+// // Fill hit structure.
+// if(!(gMC->TrackCharge())) return;
+// //
+// // Only entering charged tracks
+// if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
+// vol[0] = 1;
+// id = gMC->CurrentVolOffID(2,copy);
+// //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
+// vol[1] = copy;
+// gMC->CurrentVolOffID(3,copy1);
+// //ladder copy in the module = 1<->2 (I10A < I12A)
+// gMC->CurrentVolOffID(4,copy2);
+// //module copy in the layer = 1<->10 (I12A < IT12)
+// vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
+// } else if(id == fIdSens[1]){
+// vol[0] = 2;
+// id = gMC->CurrentVolOffID(2,copy);
+// //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
+// vol[1] = copy;
+// gMC->CurrentVolOffID(3,copy1);
+// //ladder copy in the module = 1<->4 (I20A < I12A)
+// gMC->CurrentVolOffID(4,copy2);
+// //module copy in the layer = 1<->10 (I12A < IT12)
+// vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
+// } else if(id == fIdSens[2]){
+// vol[0] = 3;
+// id = gMC->CurrentVolOffID(1,copy);
+// //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004)
+// vol[1] = copy;
+// id = gMC->CurrentVolOffID(2,copy);
+// //ladder copy in the layer = 1<->14 (I004 < IT34)
+// vol[2] = copy;
+// } else if(id == fIdSens[3]){
+// vol[0] = 4;
+// id = gMC->CurrentVolOffID(1,copy);
+// //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005)
+// vol[1] = copy;
+// id = gMC->CurrentVolOffID(2,copy);
+// //ladder copy in the layer = 1<->22 (I005 < IT34))
+// vol[2] = copy;
+// }else if(id == fIdSens[4]){
+// vol[0] = 5;
+// id = gMC->CurrentVolOffID(1,copy);
+// //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565)
+// vol[1] = copy;
+// id = gMC->CurrentVolOffID(2,copy);
+// //ladder copy in the layer = 1<->34 (I565 < IT56)
+// vol[2] = copy;
+// }else if(id == fIdSens[5]){
+// vol[0] = 6;
+// id = gMC->CurrentVolOffID(1,copy);
+// //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569)
+// vol[1] = copy;
+// id = gMC->CurrentVolOffID(2,copy);
+// //ladder copy in the layer = 1<->38 (I569 < IT56)
+// vol[2] = copy;
+// } else {
+// return; // not an ITS volume?
+// } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
+// //
+// gMC->TrackPosition(position);
+// gMC->TrackMomentum(momentum);
+// vol[4] = stat0;
+// if(gMC->IsTrackEntering()){
+// position0 = position;
+// stat0 = vol[3];
+// return;
+// } // end if IsEntering
+// // Fill hit structure with this new hit.
+
+// new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
+// gMC->Edep(),gMC->TrackTime(),position,
+// position0,momentum);
+
+// position0 = position;
+// stat0 = vol[3];
+
+// 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.
+ //
+ // Called for every step in the ITS, then calles the AliITShit class
+ // creator with the information to be recoreded about that hit.
+ //
+ Int_t copy, id;
+ TLorentzVector position, momentum;
+ static TLorentzVector position0;
+ static Int_t stat0=0;
+
+ if(!(this->IsActive())){
+ return;
+ } // end if !Active volume.
+
+ if(!(gMC->TrackCharge())) return;
+
+ id=gMC->CurrentVolID(copy);
+
+ Bool_t sensvol = kFALSE;
+ for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE;
+ if(sensvol && (gMC->IsTrackExiting())){
+ AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kITS);
+ } // if Outer ITS mother Volume
+
+
+ Int_t copy1,copy2;
+ Int_t vol[5];
+ TClonesArray &lhits = *fHits;
+ //
+ // Track status
+ vol[3] = 0;
+ vol[4] = 0;
+ if(gMC->IsTrackInside()) vol[3] += 1;
+ if(gMC->IsTrackEntering()) vol[3] += 2;
+ if(gMC->IsTrackExiting()) vol[3] += 4;
+ if(gMC->IsTrackOut()) vol[3] += 8;
+ if(gMC->IsTrackDisappeared()) vol[3] += 16;
+ if(gMC->IsTrackStop()) vol[3] += 32;
+ if(gMC->IsTrackAlive()) vol[3] += 64;
+ //
+ // Fill hit structure.
+ if(!(gMC->TrackCharge())) return;
+
+ // Only entering charged tracks
+ if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
+ vol[0] = 1;
+ id = gMC->CurrentVolOffID(2,copy);
+ //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
+ vol[1] = copy;
+ gMC->CurrentVolOffID(3,copy1);
+ //ladder copy in the module = 1<->2 (I10A < I12A)
+ gMC->CurrentVolOffID(4,copy2);
+ //module copy in the layer = 1<->10 (I12A < IT12)
+ vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
+
+ } else if(id == fIdSens[1]){
+ vol[0] = 2;
+ id = gMC->CurrentVolOffID(2,copy);
+ //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
+ vol[1] = copy;
+ gMC->CurrentVolOffID(3,copy1);
+ //ladder copy in the module = 1<->4 (I20A < I12A)
+ gMC->CurrentVolOffID(4,copy2);
+ //module copy in the layer = 1<->10 (I12A < IT12)
+ vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
+
+ } else if(id == fIdSens[2]){
+ vol[0] = 3;
+ id = gMC->CurrentVolOffID(1,copy);
+ //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004)
+ vol[1] = copy;
+ id = gMC->CurrentVolOffID(2,copy);
+ //ladder copy in the layer = 1<->14 (I004 < IT34)
+ vol[2] = copy;
+
+ } else if(id == fIdSens[3]){
+ vol[0] = 4;
+ id = gMC->CurrentVolOffID(1,copy);
+ //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005)
+ vol[1] = copy;
+ id = gMC->CurrentVolOffID(2,copy);
+ //ladder copy in the layer = 1<->22 (I005 < IT34))
+ vol[2] = copy;
+
+ }else if(id == fIdSens[4]){
+ vol[0] = 5;
+ id = gMC->CurrentVolOffID(1,copy);
+ //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565)
+ vol[1] = copy;
+ id = gMC->CurrentVolOffID(2,copy);
+ //ladder copy in the layer = 1<->34 (I565 < IT56)
+ vol[2] = copy;
+
+ }else if(id == fIdSens[5]){
+ vol[0] = 6;
+ id = gMC->CurrentVolOffID(1,copy);
+ //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569)
+ vol[1] = copy;
+ id = gMC->CurrentVolOffID(2,copy);
+ //ladder copy in the layer = 1<->38 (I569 < IT56)
+ vol[2] = copy;
+ } else {
+ return; // not an ITS volume?
+ } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
+ //
+ gMC->TrackPosition(position);
+ gMC->TrackMomentum(momentum);
+ vol[4] = stat0;
+ if(gMC->IsTrackEntering()){
+ position0 = position;
+ stat0 = vol[3];
+ return;
+ } // end if IsEntering
+ // Fill hit structure with this new hit.
+
+ new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
+ gMC->Edep(),gMC->TrackTime(),position,
+ position0,momentum);
+
+ position0 = position;
+ stat0 = vol[3];
+
+ return;
}
-
+