1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
18 Revision 1.12 1999/10/05 08:05:09 fca
19 Minor corrections for uninitialised variables.
21 Revision 1.11 1999/09/29 09:24:20 fca
22 Introduction of the Copyright and cvs Log
26 ///////////////////////////////////////////////////////////////////////////////
28 // Inner Traking System version 5 //
29 // This class contains the base procedures for the Inner Tracking System //
31 // Authors: R. Barbera, B. S. Nilsen.
33 // Created September 17 1999.
35 ///////////////////////////////////////////////////////////////////////////////
43 #include "AliITShit.h"
46 #include "AliITSgeom.h"
50 //_____________________________________________________________________________
51 AliITSv5::AliITSv5() {
53 // Standard constructor for the ITS
56 fId5Name = new char*[fId5N];
64 //_____________________________________________________________________________
65 AliITSv5::~AliITSv5() {
67 // Standard destructor for the ITS
69 for (Int_t i=0;i<fId5N;++i) delete [] fId5Name[i];
73 //_____________________________________________________________________________
74 AliITSv5::AliITSv5(const char *name, const char *title) : AliITS(name, title){
76 // Standard constructor for the ITS
79 fId5Name = new char*[fId5N];
87 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5.tme";
88 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5.euc";
92 //_____________________________________________________________________________
93 void AliITSv5::CreateMaterials(){
95 // Read materials for the ITS
99 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
100 // FILE *file = fopen(fEuclidMaterial.Data(),"r");
101 FILE *file = fopen(filtmp,"r");
104 // gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
105 gAlice->ReadEuclidMedia(filtmp,this);
107 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",
108 // fEuclidMaterial.Data());
114 //_____________________________________________________________________________
115 void AliITSv5::CreateGeometry(){
116 //////////////////////////////////////////////////////////////////////
117 // This is the geometry used for the ITS Pre-TDR and comes from an
118 // Euclid to Geant conversion. The only difference
119 // is in the details of the ITS supports. The detectors elements,
120 // detector numbering, and local and global reference frames are shown in
121 // the following figures.
124 <img src="picts/ITS/its1+2_convention_front_5.gif">
127 <font size=+2 color=red>
128 <p>This shows the front view of the SPDs.
131 <img src="picts/ITS/its1+2_convention_side_5.gif">
134 <font size=+2 color=red>
135 <p>This shows the perspective view of the SPDs.
137 <img src="picts/ITS/its1+2_tree.gif">
140 <font size=+2 color=red>
141 <p>This shows the geometry Tree for the SPDs.
146 <img src="picts/ITS/its3+4_convention_front_5.gif">
149 <font size=+2 color=red>
150 <p>This shows the front view of the SDDs.
153 <img src="picts/ITS/its3+4_convention_side_5.gif">
156 <font size=+2 color=red>
157 <p>This shows the perspective view of the SDDs.
159 <img src="picts/ITS/its3+4_tree.gif">
162 <font size=+2 color=red>
163 <p>This shows the geometry Tree for the SDDs.
168 <img src="picts/ITS/its5+6_convention_front_5.gif">
171 <font size=+2 color=red>
172 <p>This shows the front view of the SSDs.
175 <img src="picts/ITS/its5+6_convention_side_5.gif">
178 <font size=+2 color=red>
179 <p>This shows the perspective view of the SSDs.
182 <img src="picts/ITS/its5+6_tree.gif">
185 <font size=+2 color=red>
186 <p>This shows the geometry Tree for the SSDs.
191 <img src="picts/ITS/its_layer1-6_2.gif">
194 <font size=+2 color=red>
195 <p>This shows the front view of the whole ITS..
199 <img src="picts/ITS/its_layer1-6_1.gif">
202 <font size=+2 color=red>
203 <p>This shows the perspective view of the whole ITS..
207 <img src="picts/ITS/its1-6_tree.gif">
210 <font size=+2 color=red>
211 <p>This shows the geometry Tree for the whole ITS.
218 // Here are shown the details of the ITS support cones and services.
219 // First is a GEANT tree showing the organization of all of the volumes
220 // that make up the ITS supports and services.
223 <img src="picts/ITS/supports_tree.gif">
226 // What follows are a number of figures showing what these support
227 // structures look like.
231 <img src="picts/ITS/supports_3.gif">
234 <font size=+2 color=red>
235 <p>This shows the geometry of the supports for the Drift and Strip layers only.
239 <img src="picts/ITS/supports_2.gif">
242 <font size=+2 color=red>
243 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
247 <img src="picts/ITS/supports_1.gif">
250 <font size=+2 color=red>
251 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
255 <img src="picts/ITS/suppssd.gif">
258 <font size=+2 color=red>
259 <p>This shows the geometry for the Strip layers supports.
263 <img src="picts/ITS/suppsdd.gif">
266 <font size=+2 color=red>
267 <p>This shows the geometry for the Drift layers supports.
272 ////////////////////////////////////////////////////////////////////////
273 // Read geometry for the ITS
280 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
281 FILE *file = fopen(filtmp,"r");
285 printf("Ready to read Euclid geometry file\n");
286 gAlice->ReadEuclid(fEuclidGeometry.Data(),this,topvol);
287 printf("Read in euclid geometries\n");
289 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
290 fEuclidGeometry.Data());
294 //---Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
297 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
299 //---Outputs the geometry tree in the EUCLID/CAD format
302 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
303 } // end if (fEuclidOut)
305 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
306 size = strlen(filtmp);
308 filtmp[size-3] = 'd'; // change from .euc to .det
309 filtmp[size-2] = 'e';
310 filtmp[size-1] = 't';
311 file = fopen(filtmp,"r");
312 if(file){ // if file exists use it to fill AliITSgeom structure.
314 printf("ready to read .det file %s\n",filtmp);
315 fITSgeom = new AliITSgeom(filtmp);
318 // fill AliITSgeom structure from geant structure just filled above
322 printf("finished with euclid geometrys\n");
325 //_____________________________________________________________________________
326 void AliITSv5::Init(){
328 // Initialise the ITS after it has been created
333 fIdName = new char*[fId5N];
334 fIdSens = new Int_t[fId5N];
335 for(i=0;i<fId5N;i++) {
336 l = strlen(fId5Name[i]);
337 fIdName[i] = new char[l+1];
338 for(j=0;j<l;j++) fIdName[i][j] = fId5Name[i][j];
339 fIdName[i][l] = '\0'; // Null terminate this string.
345 //_____________________________________________________________________________
346 void AliITSv5::StepManager(){
348 // Called for every step in the ITS
354 TLorentzVector position, momentum;
355 TClonesArray &lhits = *fHits;
359 if(gMC->IsTrackInside()) vol[3] += 1;
360 if(gMC->IsTrackEntering()) vol[3] += 2;
361 if(gMC->IsTrackExiting()) vol[3] += 4;
362 if(gMC->IsTrackOut()) vol[3] += 8;
363 if(gMC->IsTrackDisappeared()) vol[3] += 16;
364 if(gMC->IsTrackStop()) vol[3] += 32;
365 if(gMC->IsTrackAlive()) vol[3] += 64;
367 // Fill hit structure.
368 if(!(gMC->TrackCharge())) return;
370 // Only entering charged tracks
371 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
373 id = gMC->CurrentVolOffID(0,copy);
374 //detector copy in the ladder = 1<->4 (ITS1)
376 gMC->CurrentVolOffID(1,copy1);
377 //ladder copy in the module = 1<->2 (I186)
378 gMC->CurrentVolOffID(2,copy2);
379 //module copy in the layer = 1<->10 (I132)
380 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
381 } else if(id == fIdSens[1]){
383 id = gMC->CurrentVolOffID(0,copy);
384 //detector copy in the ladder = 1<->4 (ITS2)
386 gMC->CurrentVolOffID(1,copy1);
387 //ladder copy in the module = 1<->4 (I131)
388 gMC->CurrentVolOffID(2,copy2);
389 //module copy in the layer = 1<->10 (I132)
390 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
391 } else if(id == fIdSens[2]){
393 id = gMC->CurrentVolOffID(1,copy);
394 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
396 id = gMC->CurrentVolOffID(2,copy);
397 //ladder copy in the layer = 1<->12 (I316)
399 } else if(id == fIdSens[3]){
401 id = gMC->CurrentVolOffID(1,copy);
402 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
404 id = gMC->CurrentVolOffID(2,copy);
405 //ladder copy in the layer = 1<->22 (I417)
407 }else if(id == fIdSens[4]){
409 id = gMC->CurrentVolOffID(1,copy);
410 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
412 id = gMC->CurrentVolOffID(2,copy);
413 //ladder copy in the layer = 1<->34 (I565)
415 }else if(id == fIdSens[5]){
417 id = gMC->CurrentVolOffID(1,copy);
418 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
420 id = gMC->CurrentVolOffID(2,copy);
421 //ladder copy in the layer = 1<->38 (I569)
424 return; // not an ITS volume?
425 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
427 gMC->TrackPosition(position);
428 gMC->TrackMomentum(momentum);
436 hits[7]=gMC->TrackTime();
437 // Fill hit structure with this new hit.
438 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
441 //____________________________________________________________________________
442 void AliITSv5::Streamer(TBuffer &R__b)
444 // Stream an object of class AliITSv5.
446 if (R__b.IsReading()) {
447 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
448 AliITS::Streamer(R__b);
449 // This information does not need to be read. It is "hard wired"
450 // into this class via its creators.
452 //R__b.ReadArray(fId5Name);
454 R__b.WriteVersion(AliITSv5::IsA());
455 AliITS::Streamer(R__b);
456 // This information does not need to be saved. It is "hard wired"
457 // into this class via its creators.
459 //R__b.WriteArray(fId5Name, __COUNTER__);