1 ///////////////////////////////////////////////////////////////////////////////
3 // Inner Traking System version 5 //
4 // This class contains the base procedures for the Inner Tracking System //
6 // Authors: R. Barbera, B. S. Nilsen.
8 // Created September 17 1999.
10 ///////////////////////////////////////////////////////////////////////////////
18 #include "AliITShit.h"
21 #include "AliITSgeom.h"
25 //_____________________________________________________________________________
26 AliITSv5::AliITSv5() : AliITS(){
28 // Standard constructor for the ITS
31 fId5Name = new char*[fId5N];
39 //_____________________________________________________________________________
40 AliITSv5::AliITSv5(const char *name, const char *title) : AliITS(name, title){
42 // Standard constructor for the ITS
45 fId5Name = new char*[fId5N];
53 fEuclidMaterial = "$ALICE_ROOT/Euclid/ITSgeometry_5.tme";
54 fEuclidGeometry = "$ALICE_ROOT/Euclid/ITSgeometry_5.euc";
58 //_____________________________________________________________________________
59 void AliITSv5::CreateMaterials(){
61 // Read materials for the ITS
65 filtmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
66 // FILE *file = fopen(fEuclidMaterial.Data(),"r");
67 FILE *file = fopen(filtmp,"r");
70 // gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
71 gAlice->ReadEuclidMedia(filtmp,this);
73 Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",
74 // fEuclidMaterial.Data());
80 //_____________________________________________________________________________
81 void AliITSv5::CreateGeometry(){
82 //////////////////////////////////////////////////////////////////////
83 // This is the geometry used for the ITS Pre-TDR and comes from an
84 // Euclid to Geant conversion. The only difference
85 // is in the details of the ITS supports. The detectors elements,
86 // detector numbering, and local and global reference frames are shown in
87 // the following figures.
90 <img src="picts/ITS/its1+2_convention_front_5.gif">
93 <font size=+2 color=red>
94 <p>This shows the front view of the SPDs.
97 <img src="picts/ITS/its1+2_convention_side_5.gif">
100 <font size=+2 color=red>
101 <p>This shows the perspective view of the SPDs.
103 <img src="picts/ITS/its1+2_tree.gif">
106 <font size=+2 color=red>
107 <p>This shows the geometry Tree for the SPDs.
112 <img src="picts/ITS/its3+4_convention_front_5.gif">
115 <font size=+2 color=red>
116 <p>This shows the front view of the SDDs.
119 <img src="picts/ITS/its3+4_convention_side_5.gif">
122 <font size=+2 color=red>
123 <p>This shows the perspective view of the SDDs.
125 <img src="picts/ITS/its3+4_tree.gif">
128 <font size=+2 color=red>
129 <p>This shows the geometry Tree for the SDDs.
134 <img src="picts/ITS/its5+6_convention_front_5.gif">
137 <font size=+2 color=red>
138 <p>This shows the front view of the SSDs.
141 <img src="picts/ITS/its5+6_convention_side_5.gif">
144 <font size=+2 color=red>
145 <p>This shows the perspective view of the SSDs.
148 <img src="picts/ITS/its5+6_tree.gif">
151 <font size=+2 color=red>
152 <p>This shows the geometry Tree for the SSDs.
157 <img src="picts/ITS/its_layer1-6_2.gif">
160 <font size=+2 color=red>
161 <p>This shows the front view of the whole ITS..
165 <img src="picts/ITS/its_layer1-6_1.gif">
168 <font size=+2 color=red>
169 <p>This shows the perspective view of the whole ITS..
173 <img src="picts/ITS/its1-6_tree.gif">
176 <font size=+2 color=red>
177 <p>This shows the geometry Tree for the whole ITS.
184 // Here are shown the details of the ITS support cones and services.
185 // First is a GEANT tree showing the organization of all of the volumes
186 // that make up the ITS supports and services.
189 <img src="picts/ITS/supports_tree.gif">
192 // What follows are a number of figures showing what these support
193 // structures look like.
197 <img src="picts/ITS/supports_3.gif">
200 <font size=+2 color=red>
201 <p>This shows the geometry of the supports for the Drift and Strip layers only.
205 <img src="picts/ITS/supports_2.gif">
208 <font size=+2 color=red>
209 <p>This shows the geometry of the supports for the Drift and Strip layers in front cut out.
213 <img src="picts/ITS/supports_1.gif">
216 <font size=+2 color=red>
217 <p>This shows the geometry of the supports for the Drift and Strip layers in a back cut out..
221 <img src="picts/ITS/suppssd.gif">
224 <font size=+2 color=red>
225 <p>This shows the geometry for the Strip layers supports.
229 <img src="picts/ITS/suppsdd.gif">
232 <font size=+2 color=red>
233 <p>This shows the geometry for the Drift layers supports.
238 ////////////////////////////////////////////////////////////////////////
239 // Read geometry for the ITS
246 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
247 FILE *file = fopen(filtmp,"r");
251 printf("Ready to read Euclid geometry file\n");
252 gAlice->ReadEuclid(fEuclidGeometry.Data(),this,topvol);
253 printf("Read in euclid geometries\n");
255 Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
256 fEuclidGeometry.Data());
260 //---Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
263 gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
265 //---Outputs the geometry tree in the EUCLID/CAD format
268 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
269 } // end if (fEuclidOut)
271 filtmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
272 size = strlen(filtmp);
274 filtmp[size-3] = 'd'; // change from .euc to .det
275 filtmp[size-2] = 'e';
276 filtmp[size-1] = 't';
277 file = fopen(filtmp,"r");
278 if(file){ // if file exists use it to fill AliITSgeom structure.
280 printf("ready to read .det file %s\n",filtmp);
281 fITSgeom = new AliITSgeom(filtmp);
284 // fill AliITSgeom structure from geant structure just filled above
288 printf("finished with euclid geometrys\n");
291 //_____________________________________________________________________________
292 void AliITSv5::Init(){
294 // Initialise the ITS after it has been created
299 fIdName = new char*[fId5N];
300 fIdSens = new Int_t[fId5N];
301 for(i=0;i<fId5N;i++) {
302 l = strlen(fId5Name[i]);
303 fIdName[i] = new char[l+1];
304 for(j=0;j<l;j++) fIdName[i][j] = fId5Name[i][j];
305 fIdName[i][l] = '\0'; // Null terminate this string.
311 //_____________________________________________________________________________
312 void AliITSv5::StepManager(){
314 // Called for every step in the ITS
320 TLorentzVector position, momentum;
321 TClonesArray &lhits = *fHits;
325 if(gMC->IsTrackInside()) vol[3] += 1;
326 if(gMC->IsTrackEntering()) vol[3] += 2;
327 if(gMC->IsTrackExiting()) vol[3] += 4;
328 if(gMC->IsTrackOut()) vol[3] += 8;
329 if(gMC->IsTrackDisappeared()) vol[3] += 16;
330 if(gMC->IsTrackStop()) vol[3] += 32;
331 if(gMC->IsTrackAlive()) vol[3] += 64;
333 // Fill hit structure.
334 if(!(gMC->TrackCharge())) return;
336 // Only entering charged tracks
337 if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) {
339 id = gMC->CurrentVolOffID(0,copy);
340 //detector copy in the ladder = 1<->4 (ITS1)
342 gMC->CurrentVolOffID(1,copy1);
343 //ladder copy in the module = 1<->2 (I186)
344 gMC->CurrentVolOffID(2,copy2);
345 //module copy in the layer = 1<->10 (I132)
346 vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2
347 } else if(id == fIdSens[1]){
349 id = gMC->CurrentVolOffID(0,copy);
350 //detector copy in the ladder = 1<->4 (ITS2)
352 gMC->CurrentVolOffID(1,copy1);
353 //ladder copy in the module = 1<->4 (I131)
354 gMC->CurrentVolOffID(2,copy2);
355 //module copy in the layer = 1<->10 (I132)
356 vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4
357 } else if(id == fIdSens[2]){
359 id = gMC->CurrentVolOffID(1,copy);
360 //detector copy in the ladder = 1<->5 (ITS3 is inside I314)
362 id = gMC->CurrentVolOffID(2,copy);
363 //ladder copy in the layer = 1<->12 (I316)
365 } else if(id == fIdSens[3]){
367 id = gMC->CurrentVolOffID(1,copy);
368 //detector copy in the ladder = 1<->8 (ITS4 is inside I414)
370 id = gMC->CurrentVolOffID(2,copy);
371 //ladder copy in the layer = 1<->22 (I417)
373 }else if(id == fIdSens[4]){
375 id = gMC->CurrentVolOffID(1,copy);
376 //detector copy in the ladder = 1<->23 (ITS5 is inside I562)
378 id = gMC->CurrentVolOffID(2,copy);
379 //ladder copy in the layer = 1<->34 (I565)
381 }else if(id == fIdSens[5]){
383 id = gMC->CurrentVolOffID(1,copy);
384 //detector copy in the ladder = 1<->26 (ITS6 is inside I566)
386 id = gMC->CurrentVolOffID(2,copy);
387 //ladder copy in the layer = 1<->38 (I569)
390 return; // not an ITS volume?
391 } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i])
393 gMC->TrackPosition(position);
394 gMC->TrackMomentum(momentum);
402 hits[7]=gMC->TrackTime();
403 // Fill hit structure with this new hit.
404 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
407 //____________________________________________________________________________
408 void AliITSv5::Streamer(TBuffer &R__b)
410 // Stream an object of class AliITSv5.
412 if (R__b.IsReading()) {
413 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
414 AliITS::Streamer(R__b);
415 // This information does not need to be read. It is "hard wired"
416 // into this class via its creators.
418 //R__b.ReadArray(fId5Name);
420 R__b.WriteVersion(AliITSv5::IsA());
421 AliITS::Streamer(R__b);
422 // This information does not need to be saved. It is "hard wired"
423 // into this class via its creators.
425 //R__b.WriteArray(fId5Name, __COUNTER__);