1 /**************************************************************************
2 * Copyright(c) 2007-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 //************************************************************************
19 // Inner Traking System geometry v11
21 // Based on ROOT geometrical modeler
23 // B. Nilsen, L. Gaudichet
24 //************************************************************************
27 #include <TClonesArray.h>
28 #include <TLorentzVector.h>
31 #include "AliITSDetTypeSim.h"
32 #include <TVirtualMC.h>
34 #include "AliITSgeom.h"
35 #include "AliITSgeomSDD.h"
36 #include "AliITSgeomSPD.h"
37 #include "AliITSgeomSSD.h"
38 #include "AliITShit.h"
40 #include "AliITSCalibrationSDD.h"
42 #include "AliITSsegmentationSDD.h"
43 #include "AliITSsegmentationSPD.h"
44 #include "AliITSsegmentationSSD.h"
47 #include "AliTrackReference.h"
50 #include <TGeoManager.h>
51 #include <TGeoVolume.h>
53 #include "AliITSv11.h"
54 #include "AliITSv11GeometrySPD.h"
55 #include "AliITSv11GeometrySDD.h"
56 #include "AliITSv11GeometrySSD.h"
57 #include "AliITSv11GeometrySupport.h"
65 //______________________________________________________________________
66 AliITSv11::AliITSv11() :
71 fMajorVersion(IsVersion()),
82 // Standard default constructor for the ITS version 11.
88 for(i=0;i<60;i++) fRead[i] = '\0';
89 for(i=0;i<60;i++) fWrite[i] = '\0';
90 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
91 strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60);
95 //______________________________________________________________________
96 AliITSv11::AliITSv11(const char *name, const char *title):
101 fMajorVersion(IsVersion()),
112 // Standard constructor for the ITS version 11.
114 fSDDgeom = new AliITSv11GeometrySDD(0);
118 fIdName = new TString[fIdN];
119 fIdName[0] = name; // removes warning message
122 fIdName[2] = fSDDgeom->GetSenstiveVolumeName3();
123 fIdName[3] = fSDDgeom->GetSenstiveVolumeName4();
126 fIdSens = new Int_t[fIdN];
127 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
128 // not needed, fByThick set to kTRUE in in the member initialization lis
131 fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.euc";
132 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det",60);
133 strncpy(fRead,fEuclidGeomDet,60);
134 strncpy(fWrite,fEuclidGeomDet,60);
135 strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60);
137 //______________________________________________________________________
138 AliITSv11::AliITSv11(Int_t debugITS,Int_t debugSPD,Int_t debugSDD,
139 Int_t debugSSD,Int_t debugSUP) :
140 AliITS("ITS","ITS geometry v11"),
144 fMajorVersion(IsVersion()),
155 // Standard default constructor for the ITS version 11.
158 // fSPDgeom = new AliITSv11GeometrySPD(debugSPD);
159 fSDDgeom = new AliITSv11GeometrySDD(debugSDD);
160 fSDDgeom->SetDebug(debugSDD);
161 // fSupgeom = new AliITSv11GeometrySupport(debugSUP);
165 fIdName = new TString[fIdN];
166 fIdName[0] = fSPDgeom->GetSenstiveVolumeName1();
167 fIdName[1] = fSPDgeom->GetSenstiveVolumeName2();
168 fIdName[2] = fSDDgeom->GetSenstiveVolumeName3();
169 fIdName[3] = fSDDgeom->GetSenstiveVolumeName4();
170 fIdName[4] = fSSDgeom->GetSenstiveVolumeName5();
171 fIdName[5] = fSSDgeom->GetSenstiveVolumeName6();
172 fIdSens = new Int_t[fIdN];
173 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
174 fEuclidOut = kFALSE; // Don't write Euclide file
176 fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.euc";
177 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det",60);
178 strncpy(fRead,fEuclidGeomDet,60);
179 strncpy(fWrite,fEuclidGeomDet,60);
180 strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60);
182 debugITS = (debugSPD && debugSSD && debugSUP && debugSDD); //remove temp. warnings
184 //______________________________________________________________________
185 AliITSv11::~AliITSv11() {
188 //______________________________________________________________________
189 void AliITSv11::BuildGeometry(){
192 //______________________________________________________________________
193 void AliITSv11::CreateGeometry(){
195 // Create ROOT geometry
197 // These constant character strings are set by cvs during commit
198 // do not change them unless you know what you are doing!
199 const Char_t *cvsDate="$Date$";
200 const Char_t *cvsRevision="$Revision$";
202 TGeoManager *geoManager = gGeoManager;
203 TGeoVolume *vALIC = geoManager->GetTopVolume();
205 TGeoPcon *sITS = new TGeoPcon("ITS Top Volume",0.0,360.0,2);
207 // DefineSection(section number, Z, Rmin, Rmax).
208 const Double_t kcm = 1.0;
209 sITS->DefineSection(0,-300.0*kcm,0.01*kcm,50.0*kcm);
210 sITS->DefineSection(1,+300.0*kcm,0.01*kcm,50.0*kcm);
212 TGeoMedium *air = gGeoManager->GetMedium("ITS_AIR$");
213 TGeoVolume *vITS = new TGeoVolume("ITSV",sITS,air);
214 vITS->SetVisibility(kFALSE);
215 const Int_t length=100;
216 Char_t vstrng[length];
217 if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(),
218 fMinorVersion,cvsDate,cvsRevision))
219 vITS->SetTitle(vstrng);
220 //printf("Title set to %s\n",vstrng);
221 vALIC->AddNode(vITS,1,0);
223 // fSPDgeom->CenteralSPD(vITS);
225 fSDDgeom->Layer3(vITS);
226 fSDDgeom->Layer4(vITS);
228 // fSupgeom->SPDCone(vITS);
229 // fSupgeom->SPDThermalSheald(vITS);
230 // fSupgeom->SDDCone(vITS);
231 // fSupgeom->SSDCone(vITS);
232 // fSupgeom->ServicesCableSupport(vITS);
235 //______________________________________________________________________
236 void AliITSv11::CreateMaterials(){
237 // Create Standard ITS Materials
247 fSPDgeom->AliITSv11Geometry::CreateDefaultMaterials();
248 // Detector specific material definistions
249 fSPDgeom->CreateMaterials();
250 fSDDgeom->CreateMaterials();
251 fSSDgeom->CreateMaterials();
252 fSupgeom->CreateMaterials();
255 //______________________________________________________________________
256 void AliITSv11::InitAliITSgeom(){
258 // Fill fITSgeom with the 3 sub-detector geometries
261 if (gGeoManager) gGeoManager->Export("geometry.root");
263 const Int_t knlayers = 6;
264 const Int_t kndeep = 3;
265 const AliITSDetector kidet[knlayers]={kSPD,kSPD,kSDD,kSDD,kSSD,kSSD};
266 const TString knames[knlayers] = {
267 "AliITSv11:spd missing", // lay=1
268 "AliITSv11:spd missing", // lay=2
269 "/ALIC_1/ITSV_1/ITSsddLayer3_1/ITSsddLadd_%d/ITSsddSensor_%d/ITSsddWafer_%d", // lay=3
270 "/ALIC_1/ITSV_1/ITSsddLayer4_1/ITSsddLadd_%d/ITSsddSensor_%d/ITSsddWafer_%d", // lay=4
271 "AliITSv11:ssd missing", // lay=5
272 "AliITSv11:ssd missing" // lay=6
275 const Int_t kitsGeomTreeCopys[knlayers][kndeep]= {{10, 2, 4},// lay=1
281 Int_t nlad[knlayers],ndet[knlayers];
282 Int_t mod,lay,lad=0,det=0,i,j,k,cp0,cp1,cp2;
283 TString path,shapeName;
285 Double_t trans[3]={3*0.0},rot[10]={9*0.0,1.0};
288 Bool_t shapeDefined[3]={kFALSE,kFALSE,kFALSE};
290 AliDebug(1,"Reading Geometry transformation directly from Modler.");
292 for(i=0;i<knlayers;i++){
294 for(j=0;j<kndeep;j++) if(kitsGeomTreeCopys[i][j]!=0)
295 k *= TMath::Abs(kitsGeomTreeCopys[i][j]);
300 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
301 ndet[0]= 4;ndet[1]= 4;ndet[2]= 6;ndet[3]= 8;ndet[4]=22;ndet[5]=25;
302 AliITSgeom* geom = new AliITSgeom(0,6,nlad,ndet,mod);
305 for(lay=1;lay<=knlayers;lay++){
307 for(cp0=0; cp0<kitsGeomTreeCopys[lay-1][0]; cp0++){
308 for(cp1=0; cp1<kitsGeomTreeCopys[lay-1][1]; cp1++){
309 for(cp2=1; cp2<=kitsGeomTreeCopys[lay-1][2]; cp2++){
311 path.Form(knames[lay-1].Data(),
322 case 3: case 4: case 5: case 6:{
327 //AliInfo(Form("path=%s lay=%d lad=%d det=%d",
328 // path.Data(),lay,lad,det));
329 gMC->GetTransformation(path.Data(),materix);
330 gMC->GetShape(path.Data(),shapeName,shapePar);
331 shapeParF.Set(shapePar.GetSize());
332 for(i=0;i<shapePar.GetSize();i++) shapeParF[i]=shapePar[i];
333 geom->CreateMatrix(mod,lay,lad,det,kidet[lay-1],trans,rot);
334 geom->SetTrans(mod,materix.GetTranslation());
335 geom->SetRotMatrix(mod,materix.GetRotationMatrix());
336 geom->GetGeomMatrix(mod)->SetPath(path.Data());
339 if(!shapeDefined[kSPD]){
340 geom->ReSetShape(kSPD,new AliITSgeomSPD425Short(
341 shapeParF.GetSize(),shapeParF.GetArray()));
342 shapeDefined[kSPD] = kTRUE;
345 if(!shapeDefined[kSDD]){
346 geom->ReSetShape(kSDD,new AliITSgeomSDD256(
347 shapeParF.GetSize(),shapeParF.GetArray()));
348 shapeDefined[kSDD] = kTRUE;
351 if(!shapeDefined[kSSD]){
352 geom->ReSetShape(kSSD,new AliITSgeomSSD75and275(
353 shapeParF.GetSize(),shapeParF.GetArray()));
354 shapeDefined[kSSD] = kTRUE;
365 // fSDDgeom->ExportSensorGeometry(GetITSgeom(), +3, 0); //SDD
368 //______________________________________________________________________
369 void AliITSv11::Init(){
371 // Initialise the ITS after it has been created.
374 //AliInfo(Form("Minor version %d",fMinorVersion));
376 UpdateInternalGeometry();
378 if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
382 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
383 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
384 if(GetITSgeom()!=0) SetITSgeom(0x0);
385 AliITSgeom* geom = new AliITSgeom();
387 if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
388 else this->InitAliITSgeom();
389 if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
394 // //______________________________________________________________________
395 // void AliITSv11::SetDefaults(){
397 // // Set response ans segmentation models for SPD, SDD and SSD
399 // const Float_t kconv = 1.0e+04; // convert cm to microns
400 // AliInfo("Called");
402 // if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
403 // fDetTypeSim->SetITSgeom(GetITSgeom());
405 // AliITSgeomSPD *s0;
406 // AliITSgeomSDD *s1;
407 // AliITSgeomSSD *s2;
409 // Float_t bx[256],bz[280];
411 // fDetTypeSim->ResetCalibrationArray();
412 // fDetTypeSim->ResetSegmentation();
413 // fDetTypeSim->SetDefaults();
416 // s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info. Do it this way for now.
417 // AliITSsegmentationSPD* seg0 = (AliITSsegmentationSPD*)fDetTypeSim->GetSegmentationModel(0);
418 // seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
419 // s0->GetDz()*2.*kconv, // for now.
420 // s0->GetDy()*2.*kconv); // x,z,y full width in microns.
421 // seg0->SetNPads(256,160);// Number of Bins in x and z
422 // for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
423 // for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
424 // for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
425 // bz[ 31] = bz[ 32] = 625.0; // first chip boundry
426 // bz[ 63] = bz[ 64] = 625.0; // first chip boundry
427 // bz[ 95] = bz[ 96] = 625.0; // first chip boundry
428 // bz[127] = bz[128] = 625.0; // first chip boundry
429 // bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
430 // seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
431 // SetSegmentationModel(kSPD,seg0);
432 // // set digit and raw cluster classes to be used
433 // const char *kData0=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()))->DataType();
434 // if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
435 // else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
440 // s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now.
441 // AliITSsegmentationSDD* seg1 = (AliITSsegmentationSDD*)fDetTypeSim->GetSegmentationModel(1);
442 // seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
443 // s1->GetDz()*2.*kconv, // for now.
444 // s1->GetDy()*2.*kconv); // x,z,y full width in microns.
445 // seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
446 // SetSegmentationModel(kSDD,seg1);
447 // const char *kData1=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()))->DataType();
448 // AliITSCalibrationSDD* rsp = (AliITSCalibrationSDD*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD());
449 // const char *kopt=rsp->GetZeroSuppOption();
450 // if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
451 // fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
452 // } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
456 // s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
457 // AliITSsegmentationSSD* seg2 = (AliITSsegmentationSSD*)fDetTypeSim->GetSegmentationModel(2);
458 // seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
459 // s2->GetDz()*2.*kconv, // for now.
460 // s2->GetDy()*2.*kconv); // x,z,y full width in microns.
461 // seg2->SetPadSize(95.,0.); // strip x pitch in microns
462 // seg2->SetNPads(768,0); // number of strips on each side.
463 // seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
464 // seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
465 // seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
466 // SetSegmentationModel(kSSD,seg2);
467 // const char *kData2=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType();
468 // if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
469 // else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
471 // Warning("SetDefaults",
472 // "Only the four basic detector types are initialised!");
480 //______________________________________________________________________
481 void AliITSv11::SetDefaults(){
483 // Set response and segmentation models for SPD, SDD and SSD
485 const Float_t kconv = 1.0e+04; // convert cm to microns
488 // if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
489 // fDetTypeSim->SetITSgeom(GetITSgeom());
491 Warning("SetDefaults","Error fDetTypeSim not defined");
499 Float_t bx[256],bz[280];
501 fDetTypeSim->ResetCalibrationArray();
502 fDetTypeSim->ResetSegmentation();
503 fDetTypeSim->SetDefaults();
506 s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info. Do it this way for now.
507 AliITSsegmentationSPD* seg0 = (AliITSsegmentationSPD*)fDetTypeSim->GetSegmentationModel(0);
508 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
509 s0->GetDz()*2.*kconv, // for now.
510 s0->GetDy()*2.*kconv); // x,z,y full width in microns.
511 seg0->SetNPads(256,160);// Number of Bins in x and z
512 for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
513 for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
514 for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
515 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
516 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
517 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
518 bz[127] = bz[128] = 625.0; // first chip boundry
519 bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
520 seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
521 SetSegmentationModel(kSPD,seg0);
522 // set digit and raw cluster classes to be used
523 const char *kData0=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()))->DataType();
524 if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
525 else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
530 s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now.
531 AliITSsegmentationSDD* seg1 = (AliITSsegmentationSDD*)fDetTypeSim->GetSegmentationModel(1);
532 seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
533 s1->GetDz()*2.*kconv, // for now.
534 s1->GetDy()*2.*kconv); // x,z,y full width in microns.
535 seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
536 SetSegmentationModel(kSDD,seg1);
537 const char *kData1=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()))->DataType();
538 AliITSCalibrationSDD* rsp = (AliITSCalibrationSDD*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD());
539 const char *kopt=rsp->GetZeroSuppOption();
540 if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
541 fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
542 } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
546 s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
547 AliITSsegmentationSSD* seg2 = (AliITSsegmentationSSD*)fDetTypeSim->GetSegmentationModel(2);
548 seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
549 s2->GetDz()*2.*kconv, // for now.
550 s2->GetDy()*2.*kconv); // x,z,y full width in microns.
551 seg2->SetPadSize(95.,0.); // strip x pitch in microns
552 seg2->SetNPads(768,0); // number of strips on each side.
553 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
554 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
555 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
556 SetSegmentationModel(kSSD,seg2);
557 const char *kData2=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType();
558 if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
559 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
561 Warning("SetDefaults",
562 "Only the four basic detector types are initialised!");
573 //______________________________________________________________________
574 void AliITSv11::DrawModule() const{
578 // //______________________________________________________________________
579 // void AliITSv11::StepManager(){
581 // // Called for every step in the ITS, then calles the AliITShit class
582 // // creator with the information to be recoreded about that hit.
585 // TLorentzVector position, momentum;
586 // static TLorentzVector position0;
587 // static Int_t stat0=0;
589 // if(!(this->IsActive())){
591 // } // end if !Active volume.
593 // if(!(gMC->TrackCharge())) return;
595 // id=gMC->CurrentVolID(copy);
597 // Bool_t sensvol = kFALSE;
598 // for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE;
599 // if(sensvol && (gMC->IsTrackExiting())){
600 // copy = fTrackReferences->GetEntriesFast();
601 // TClonesArray &lTR = *fTrackReferences;
602 // // Fill TrackReference structure with this new TrackReference.
603 // new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
604 // } // if Outer ITS mother Volume
607 // Int_t copy1,copy2;
609 // TClonesArray &lhits = *fHits;
614 // if(gMC->IsTrackInside()) vol[3] += 1;
615 // if(gMC->IsTrackEntering()) vol[3] += 2;
616 // if(gMC->IsTrackExiting()) vol[3] += 4;
617 // if(gMC->IsTrackOut()) vol[3] += 8;
618 // if(gMC->IsTrackDisappeared()) vol[3] += 16;
619 // if(gMC->IsTrackStop()) vol[3] += 32;
620 // if(gMC->IsTrackAlive()) vol[3] += 64;
622 // // Fill hit structure.
623 // if(!(gMC->TrackCharge())) return;
625 // // Only entering charged tracks
626 // if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
628 // id = gMC->CurrentVolOffID(2,copy);
629 // //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
631 // gMC->CurrentVolOffID(3,copy1);
632 // //ladder copy in the module = 1<->2 (I10A < I12A)
633 // gMC->CurrentVolOffID(4,copy2);
634 // //module copy in the layer = 1<->10 (I12A < IT12)
635 // vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
636 // } else if(id == fIdSens[1]){
638 // id = gMC->CurrentVolOffID(2,copy);
639 // //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
641 // gMC->CurrentVolOffID(3,copy1);
642 // //ladder copy in the module = 1<->4 (I20A < I12A)
643 // gMC->CurrentVolOffID(4,copy2);
644 // //module copy in the layer = 1<->10 (I12A < IT12)
645 // vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
646 // } else if(id == fIdSens[2]){
648 // id = gMC->CurrentVolOffID(1,copy);
649 // //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004)
651 // id = gMC->CurrentVolOffID(2,copy);
652 // //ladder copy in the layer = 1<->14 (I004 < IT34)
654 // } else if(id == fIdSens[3]){
656 // id = gMC->CurrentVolOffID(1,copy);
657 // //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005)
659 // id = gMC->CurrentVolOffID(2,copy);
660 // //ladder copy in the layer = 1<->22 (I005 < IT34))
662 // }else if(id == fIdSens[4]){
664 // id = gMC->CurrentVolOffID(1,copy);
665 // //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565)
667 // id = gMC->CurrentVolOffID(2,copy);
668 // //ladder copy in the layer = 1<->34 (I565 < IT56)
670 // }else if(id == fIdSens[5]){
672 // id = gMC->CurrentVolOffID(1,copy);
673 // //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569)
675 // id = gMC->CurrentVolOffID(2,copy);
676 // //ladder copy in the layer = 1<->38 (I569 < IT56)
679 // return; // not an ITS volume?
680 // } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
682 // gMC->TrackPosition(position);
683 // gMC->TrackMomentum(momentum);
685 // if(gMC->IsTrackEntering()){
686 // position0 = position;
689 // } // end if IsEntering
690 // // Fill hit structure with this new hit.
692 // new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
693 // gMC->Edep(),gMC->TrackTime(),position,
694 // position0,momentum);
696 // position0 = position;
703 //______________________________________________________________________
704 void AliITSv11::StepManager(){
706 // Called for every step in the ITS, then calles the AliITShit class
707 // creator with the information to be recoreded about that hit.
710 TLorentzVector position, momentum;
711 static TLorentzVector position0;
712 static Int_t stat0=0;
714 if(!(this->IsActive())){
716 } // end if !Active volume.
718 if(!(gMC->TrackCharge())) return;
720 id=gMC->CurrentVolID(copy);
722 Bool_t sensvol = kFALSE;
723 for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE;
724 if(sensvol && (gMC->IsTrackExiting())){
725 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kITS);
726 } // if Outer ITS mother Volume
731 TClonesArray &lhits = *fHits;
736 if(gMC->IsTrackInside()) vol[3] += 1;
737 if(gMC->IsTrackEntering()) vol[3] += 2;
738 if(gMC->IsTrackExiting()) vol[3] += 4;
739 if(gMC->IsTrackOut()) vol[3] += 8;
740 if(gMC->IsTrackDisappeared()) vol[3] += 16;
741 if(gMC->IsTrackStop()) vol[3] += 32;
742 if(gMC->IsTrackAlive()) vol[3] += 64;
744 // Fill hit structure.
745 if(!(gMC->TrackCharge())) return;
747 // Only entering charged tracks
748 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
750 id = gMC->CurrentVolOffID(2,copy);
751 //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
753 gMC->CurrentVolOffID(3,copy1);
754 //ladder copy in the module = 1<->2 (I10A < I12A)
755 gMC->CurrentVolOffID(4,copy2);
756 //module copy in the layer = 1<->10 (I12A < IT12)
757 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
759 } else if(id == fIdSens[1]){
761 id = gMC->CurrentVolOffID(2,copy);
762 //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
764 gMC->CurrentVolOffID(3,copy1);
765 //ladder copy in the module = 1<->4 (I20A < I12A)
766 gMC->CurrentVolOffID(4,copy2);
767 //module copy in the layer = 1<->10 (I12A < IT12)
768 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
770 } else if(id == fIdSens[2]){
772 id = gMC->CurrentVolOffID(1,copy);
773 //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004)
775 id = gMC->CurrentVolOffID(2,copy);
776 //ladder copy in the layer = 1<->14 (I004 < IT34)
779 } else if(id == fIdSens[3]){
781 id = gMC->CurrentVolOffID(1,copy);
782 //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005)
784 id = gMC->CurrentVolOffID(2,copy);
785 //ladder copy in the layer = 1<->22 (I005 < IT34))
788 }else if(id == fIdSens[4]){
790 id = gMC->CurrentVolOffID(1,copy);
791 //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565)
793 id = gMC->CurrentVolOffID(2,copy);
794 //ladder copy in the layer = 1<->34 (I565 < IT56)
797 }else if(id == fIdSens[5]){
799 id = gMC->CurrentVolOffID(1,copy);
800 //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569)
802 id = gMC->CurrentVolOffID(2,copy);
803 //ladder copy in the layer = 1<->38 (I569 < IT56)
806 return; // not an ITS volume?
807 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
809 gMC->TrackPosition(position);
810 gMC->TrackMomentum(momentum);
812 if(gMC->IsTrackEntering()){
813 position0 = position;
816 } // end if IsEntering
817 // Fill hit structure with this new hit.
819 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
820 gMC->Edep(),gMC->TrackTime(),position,
823 position0 = position;