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 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // Inner Traking System version 5 //
23 // This class contains the base procedures for the Inner Tracking System //
25 // Authors: R. Barbera, B. S. Nilsen.
27 // Created September 17 1999.
29 ///////////////////////////////////////////////////////////////////////////////
37 #include "AliITShit.h"
40 #include "AliITSgeom.h"
44 //_____________________________________________________________________________
45 AliITSv5::AliITSv5() : AliITS(){
47 // Standard constructor for the ITS
50 fId5Name = new char*[fId5N];
58 //_____________________________________________________________________________
59 AliITSv5::AliITSv5(const char *name, const char *title) : AliITS(name, title){
61 // Standard constructor for the ITS
64 fId5Name = new char*[fId5N];
72 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5.tme";
73 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5.euc";
77 //_____________________________________________________________________________
78 void AliITSv5::CreateMaterials(){
80 // Read materials for the ITS
84 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
85 // FILE *file = fopen(fEuclidMaterial.Data(),"r");
86 FILE *file = fopen(filtmp,"r");
89 // gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
90 gAlice->ReadEuclidMedia(filtmp,this);
92 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",
93 // fEuclidMaterial.Data());
99 //_____________________________________________________________________________
100 void AliITSv5::CreateGeometry(){
101 //////////////////////////////////////////////////////////////////////
102 // This is the geometry used for the ITS Pre-TDR and comes from an
103 // Euclid to Geant conversion. The only difference
104 // is in the details of the ITS supports. The detectors elements,
105 // detector numbering, and local and global reference frames are shown in
106 // the following figures.
109 <img src="picts/ITS/its1+2_convention_front_5.gif">
112 <font size=+2 color=red>
113 <p>This shows the front view of the SPDs.
116 <img src="picts/ITS/its1+2_convention_side_5.gif">
119 <font size=+2 color=red>
120 <p>This shows the perspective view of the SPDs.
122 <img src="picts/ITS/its1+2_tree.gif">
125 <font size=+2 color=red>
126 <p>This shows the geometry Tree for the SPDs.
131 <img src="picts/ITS/its3+4_convention_front_5.gif">
134 <font size=+2 color=red>
135 <p>This shows the front view of the SDDs.
138 <img src="picts/ITS/its3+4_convention_side_5.gif">
141 <font size=+2 color=red>
142 <p>This shows the perspective view of the SDDs.
144 <img src="picts/ITS/its3+4_tree.gif">
147 <font size=+2 color=red>
148 <p>This shows the geometry Tree for the SDDs.
153 <img src="picts/ITS/its5+6_convention_front_5.gif">
156 <font size=+2 color=red>
157 <p>This shows the front view of the SSDs.
160 <img src="picts/ITS/its5+6_convention_side_5.gif">
163 <font size=+2 color=red>
164 <p>This shows the perspective view of the SSDs.
167 <img src="picts/ITS/its5+6_tree.gif">
170 <font size=+2 color=red>
171 <p>This shows the geometry Tree for the SSDs.
176 <img src="picts/ITS/its_layer1-6_2.gif">
179 <font size=+2 color=red>
180 <p>This shows the front view of the whole ITS..
184 <img src="picts/ITS/its_layer1-6_1.gif">
187 <font size=+2 color=red>
188 <p>This shows the perspective view of the whole ITS..
192 <img src="picts/ITS/its1-6_tree.gif">
195 <font size=+2 color=red>
196 <p>This shows the geometry Tree for the whole ITS.
203 // Here are shown the details of the ITS support cones and services.
204 // First is a GEANT tree showing the organization of all of the volumes
205 // that make up the ITS supports and services.
208 <img src="picts/ITS/supports_tree.gif">
211 // What follows are a number of figures showing what these support
212 // structures look like.
216 <img src="picts/ITS/supports_3.gif">
219 <font size=+2 color=red>
220 <p>This shows the geometry of the supports for the Drift and Strip layers only.
224 <img src="picts/ITS/supports_2.gif">
227 <font size=+2 color=red>
228 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
232 <img src="picts/ITS/supports_1.gif">
235 <font size=+2 color=red>
236 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
240 <img src="picts/ITS/suppssd.gif">
243 <font size=+2 color=red>
244 <p>This shows the geometry for the Strip layers supports.
248 <img src="picts/ITS/suppsdd.gif">
251 <font size=+2 color=red>
252 <p>This shows the geometry for the Drift layers supports.
257 ////////////////////////////////////////////////////////////////////////
258 // Read geometry for the ITS
265 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
266 FILE *file = fopen(filtmp,"r");
270 printf("Ready to read Euclid geometry file\n");
271 gAlice->ReadEuclid(fEuclidGeometry.Data(),this,topvol);
272 printf("Read in euclid geometries\n");
274 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
275 fEuclidGeometry.Data());
279 //---Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
282 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
284 //---Outputs the geometry tree in the EUCLID/CAD format
287 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
288 } // end if (fEuclidOut)
290 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
291 size = strlen(filtmp);
293 filtmp[size-3] = 'd'; // change from .euc to .det
294 filtmp[size-2] = 'e';
295 filtmp[size-1] = 't';
296 file = fopen(filtmp,"r");
297 if(file){ // if file exists use it to fill AliITSgeom structure.
299 printf("ready to read .det file %s\n",filtmp);
300 fITSgeom = new AliITSgeom(filtmp);
303 // fill AliITSgeom structure from geant structure just filled above
307 printf("finished with euclid geometrys\n");
310 //_____________________________________________________________________________
311 void AliITSv5::Init(){
313 // Initialise the ITS after it has been created
318 fIdName = new char*[fId5N];
319 fIdSens = new Int_t[fId5N];
320 for(i=0;i<fId5N;i++) {
321 l = strlen(fId5Name[i]);
322 fIdName[i] = new char[l+1];
323 for(j=0;j<l;j++) fIdName[i][j] = fId5Name[i][j];
324 fIdName[i][l] = '\0'; // Null terminate this string.
330 //_____________________________________________________________________________
331 void AliITSv5::StepManager(){
333 // Called for every step in the ITS
339 TLorentzVector position, momentum;
340 TClonesArray &lhits = *fHits;
344 if(gMC->IsTrackInside()) vol[3] += 1;
345 if(gMC->IsTrackEntering()) vol[3] += 2;
346 if(gMC->IsTrackExiting()) vol[3] += 4;
347 if(gMC->IsTrackOut()) vol[3] += 8;
348 if(gMC->IsTrackDisappeared()) vol[3] += 16;
349 if(gMC->IsTrackStop()) vol[3] += 32;
350 if(gMC->IsTrackAlive()) vol[3] += 64;
352 // Fill hit structure.
353 if(!(gMC->TrackCharge())) return;
355 // Only entering charged tracks
356 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
358 id = gMC->CurrentVolOffID(0,copy);
359 //detector copy in the ladder = 1<->4 (ITS1)
361 gMC->CurrentVolOffID(1,copy1);
362 //ladder copy in the module = 1<->2 (I186)
363 gMC->CurrentVolOffID(2,copy2);
364 //module copy in the layer = 1<->10 (I132)
365 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
366 } else if(id == fIdSens[1]){
368 id = gMC->CurrentVolOffID(0,copy);
369 //detector copy in the ladder = 1<->4 (ITS2)
371 gMC->CurrentVolOffID(1,copy1);
372 //ladder copy in the module = 1<->4 (I131)
373 gMC->CurrentVolOffID(2,copy2);
374 //module copy in the layer = 1<->10 (I132)
375 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
376 } else if(id == fIdSens[2]){
378 id = gMC->CurrentVolOffID(1,copy);
379 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
381 id = gMC->CurrentVolOffID(2,copy);
382 //ladder copy in the layer = 1<->12 (I316)
384 } else if(id == fIdSens[3]){
386 id = gMC->CurrentVolOffID(1,copy);
387 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
389 id = gMC->CurrentVolOffID(2,copy);
390 //ladder copy in the layer = 1<->22 (I417)
392 }else if(id == fIdSens[4]){
394 id = gMC->CurrentVolOffID(1,copy);
395 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
397 id = gMC->CurrentVolOffID(2,copy);
398 //ladder copy in the layer = 1<->34 (I565)
400 }else if(id == fIdSens[5]){
402 id = gMC->CurrentVolOffID(1,copy);
403 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
405 id = gMC->CurrentVolOffID(2,copy);
406 //ladder copy in the layer = 1<->38 (I569)
409 return; // not an ITS volume?
410 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
412 gMC->TrackPosition(position);
413 gMC->TrackMomentum(momentum);
421 hits[7]=gMC->TrackTime();
422 // Fill hit structure with this new hit.
423 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
426 //____________________________________________________________________________
427 void AliITSv5::Streamer(TBuffer &R__b)
429 // Stream an object of class AliITSv5.
431 if (R__b.IsReading()) {
432 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
433 AliITS::Streamer(R__b);
434 // This information does not need to be read. It is "hard wired"
435 // into this class via its creators.
437 //R__b.ReadArray(fId5Name);
439 R__b.WriteVersion(AliITSv5::IsA());
440 AliITS::Streamer(R__b);
441 // This information does not need to be saved. It is "hard wired"
442 // into this class via its creators.
444 //R__b.WriteArray(fId5Name, __COUNTER__);