Introduction of the Copyright and cvs Log
[u/mrichter/AliRoot.git] / ITS / AliITS.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/*
17$Log$
18*/
19
fe4da5cc 20///////////////////////////////////////////////////////////////////////////////
58005f18 21//
22// An overview of the basic philosophy of the ITS code development
23// and analysis is show in the figure below.
fe4da5cc 24//Begin_Html
25/*
a92b2b7d 26<img src="picts/ITS/ITS_Analysis_schema.gif">
fe4da5cc 27</pre>
28<br clear=left>
29<font size=+2 color=red>
58005f18 30<p>Roberto Barbera is in charge of the ITS Offline code (1999).
fe4da5cc 31<a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
32</font>
33<pre>
34*/
35//End_Html
58005f18 36//
37// AliITS. Inner Traking System base class.
38// This class contains the base procedures for the Inner Tracking System
39//
40//Begin_Html
41/*
a92b2b7d 42<img src="picts/ITS/AliITS_Class_Diagram.gif">
58005f18 43</pre>
44<br clear=left>
45<font size=+2 color=red>
46<p>This show the class diagram of the different elements that are part of
47the AliITS class.
48</font>
49<pre>
50*/
51//End_Html
52//
53// Version: 0
54// Written by Rene Brun, Federico Carminati, and Roberto Barbera
55//
56// Version: 1
57// Modified and documented by Bjorn S. Nilsen
58// July 11 1999
59//
60// AliITS is the general base class for the ITS. Also see AliDetector for
61// futher information.
62//
fe4da5cc 63///////////////////////////////////////////////////////////////////////////////
64
65#include <TMath.h>
66#include <TRandom.h>
67#include <TVector.h>
68#include <TGeometry.h>
69#include <TNode.h>
70#include <TTUBE.h>
bb8ac1e0 71
58005f18 72#include "AliITSmodule.h"
73#include "AliDetector.h"
fe4da5cc 74#include "AliITS.h"
58005f18 75#include "TClonesArray.h"
76#include "TObjArray.h"
77#include "AliITShit.h"
78#include "AliITSdigit.h"
fe4da5cc 79#include "AliRun.h"
80
fe4da5cc 81ClassImp(AliITS)
82
83//_____________________________________________________________________________
58005f18 84AliITS::AliITS() : AliDetector(){
fe4da5cc 85 //
86 // Default initialiser for ITS
58005f18 87 // The default constructor of the AliITS class. In addition to
88 // creating the AliITS class it zeros the variables fIshunt (a member
89 // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
90 // fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
91 // is also called.
fe4da5cc 92 //
58005f18 93 fITSpoints = 0;
94 fIshunt = 0;
95 fEuclidOut = 0;
96 fIdN = 0;
97 fIdName = 0;
98 fIdSens = 0;
99
fe4da5cc 100}
fe4da5cc 101//_____________________________________________________________________________
58005f18 102AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){
fe4da5cc 103 //
104 // Default initialiser for ITS
58005f18 105 // The constructor of the AliITS class. In addition to creating the
106 // AliITS class, it allocates memory for the TClonesArrays fHits and
107 // fDigits, and for the TObjArray fITSpoints. It also zeros the variables
108 // fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
109 // the pointers fIdSens and fIdName. To help in displaying hits via the ROOT
110 // macro display.C AliITS also sets the marker color to red. The variables
111 // passes with this constructor, const char *name and *title, are used by
112 // the constructor of AliDetector class. See AliDetector class for a
113 // description of these parameters and its constructor functions.
fe4da5cc 114 //
58005f18 115
116 fHits = new TClonesArray("AliITShit", 1560);
117 fDigits = new TClonesArray("AliITSdigit",1000);
118 fITSpoints = new TObjArray();
119// fITSmodules = new AliITSmodules();
120
121 fIshunt = 0;
122 fEuclidOut = 0;
123 fIdN = 0;
124 fIdName = 0;
125 fIdSens = 0;
126
fe4da5cc 127 SetMarkerColor(kRed);
58005f18 128
fe4da5cc 129}
130
131//_____________________________________________________________________________
58005f18 132AliITS::~AliITS(){
fe4da5cc 133 //
134 // Default distructor for ITS
58005f18 135 // The default destructor of the AliITS class. In addition to deleting
136 // the AliITS class it deletes the memory pointed to by the fHits, fDigits,
137 // fIdSens, fIdName, and fITSpoints.
fe4da5cc 138 //
139 delete fHits;
140 delete fDigits;
58005f18 141 if(fIdName!=0) delete[] fIdName;
142 if(fIdSens!=0) delete[] fIdSens;
143 delete fITSmodules;
144 if(fITSpoints!=0) delete fITSpoints;
fe4da5cc 145}
146
147//_____________________________________________________________________________
58005f18 148void AliITS::AddDigit(Int_t *tracks, Int_t *digits){
fe4da5cc 149 //
150 // Add an ITS Digit
58005f18 151 // The function to add information to the AliITSdigits class. See the
152 // AliITSdigits class for a full description. This function allocates the
153 // necessary new space for the digits information and passes the pointers
154 // *track and *digits to the AliITSdigits constructor function.
fe4da5cc 155 //
156 TClonesArray &ldigits = *fDigits;
157 new(ldigits[fNdigits++]) AliITSdigit(tracks,digits);
158}
159
58005f18 160Int_t AliITS::AddDigit(AliITSdigit* d) {
161
162 fDigits->Add(d);
163 fNdigits = fDigits->GetEntriesFast();
164 return fNdigits;
165}
166
fe4da5cc 167//_____________________________________________________________________________
58005f18 168void AliITS::AddHit(Int_t track, Int_t *vol, Float_t *hits){
fe4da5cc 169 //
170 // Add an ITS hit
58005f18 171 // The function to add information to the AliITShit class. See the
172 // AliITShit class for a full description. This function allocates the
173 // necessary new space for the hit information and passes the variable
174 // track, and the pointers *vol and *hits to the AliITShit constructor
175 // function.
fe4da5cc 176 //
177 TClonesArray &lhits = *fHits;
178 new(lhits[fNhits++]) AliITShit(fIshunt,track,vol,hits);
179}
fe4da5cc 180//_____________________________________________________________________________
58005f18 181void AliITS::BuildGeometry(){
fe4da5cc 182 //
183 // Build ITS TNODE geometry for event display
58005f18 184 // This function builds a simple ITS geometry used by the ROOT macro
185 // display.C. In general the geometry as coded is wrong.
fe4da5cc 186 //
187 TNode *Node, *Top;
188 const int kColorITS=kYellow;
189 //
190 Top=gAlice->GetGeometry()->GetNode("alice");
191
192 new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+0.05475,12.25);
193 Top->cd();
194 Node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
195 Node->SetLineColor(kColorITS);
196 fNodes->Add(Node);
197
198 new TTUBE("S_layer2","Layer2 of ITS","void",7.6,7.6+0.05475,16.3);
199 Top->cd();
200 Node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
201 Node->SetLineColor(kColorITS);
202 fNodes->Add(Node);
203
204 new TTUBE("S_layer3","Layer3 of ITS","void",14,14+0.05288,21.1);
205 Top->cd();
206 Node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
207 Node->SetLineColor(kColorITS);
208 fNodes->Add(Node);
209
210 new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
211 Top->cd();
212 Node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
213 Node->SetLineColor(kColorITS);
214 fNodes->Add(Node);
215
216 new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
217 Top->cd();
218 Node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
219 Node->SetLineColor(kColorITS);
220 fNodes->Add(Node);
221
222 new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
223 Top->cd();
224 Node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
225 Node->SetLineColor(kColorITS);
226 fNodes->Add(Node);
227}
fe4da5cc 228//_____________________________________________________________________________
58005f18 229void AliITS::CreateMaterials(){
fe4da5cc 230 //
231 // Create ITS materials
58005f18 232 // This function defines the default materials used in the Geant
233 // Monte Carlo simulations. In general it is automatically replaced by
234 // the CreatMaterials routine defined in AliITSv?. Should the function
235 // CreateMaterials not exist for the geometry version you are using this
236 // one is used. See the definition found in AliITSv5 or the other routine
237 // for a complete definition.
fe4da5cc 238 //
58005f18 239 // Water H2O
fe4da5cc 240 Float_t awat[2] = { 1.00794,15.9994 };
241 Float_t zwat[2] = { 1.,8. };
242 Float_t wwat[2] = { 2.,1. };
243 Float_t denswat = 1.;
58005f18 244 // Freon
fe4da5cc 245 Float_t afre[2] = { 12.011,18.9984032 };
246 Float_t zfre[2] = { 6.,9. };
247 Float_t wfre[2] = { 5.,12. };
248 Float_t densfre = 1.5;
58005f18 249 // Ceramics
fe4da5cc 250 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
251 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
252 Float_t zcer[5] = { 13.,8.,14.,25., 24. };
253 Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
254 Float_t denscer = 3.6;
58005f18 255 //
fe4da5cc 256 // 60% SiO2 , 40% G10FR4
58005f18 257 // PC board
fe4da5cc 258 Float_t apcb[3] = { 28.0855,15.9994,17.749 };
259 Float_t zpcb[3] = { 14.,8.,8.875 };
260 Float_t wpcb[3] = { .28,.32,.4 };
261 Float_t denspcb = 1.8;
58005f18 262 // POLYETHYL
fe4da5cc 263 Float_t apoly[2] = { 12.01,1. };
264 Float_t zpoly[2] = { 6.,1. };
265 Float_t wpoly[2] = { .33,.67 };
58005f18 266 // SERVICES
fe4da5cc 267 Float_t zserv[4] = { 1.,6.,26.,29. };
268 Float_t aserv[4] = { 1.,12.,55.8,63.5 };
269 Float_t wserv[4] = { .014,.086,.42,.48 };
270
58005f18 271 Int_t ISXFLD = gAlice->Field()->Integ();
fe4da5cc 272 Float_t SXMGMX = gAlice->Field()->Max();
273
274
275 // --- Define the various materials for GEANT ---
276
58005f18 277 // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
fe4da5cc 278
279 AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
280 AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
281 AliMaterial(2, "SPD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
282 AliMaterial(3, "SPD C$", 12.011, 6., 2.265,18.8, 999);
283 // v. dens
284 AliMaterial(4, "SPD Air$", 14.61, 7.3, .001205, 30423., 999);
285 AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
286 AliMaterial(6, "SPD Al$", 26.981539, 13., 2.6989, 8.9, 999);
287 AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
288 AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
289 // **
58005f18 290 AliMedium(0, "SPD Si$", 0, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
291 AliMedium(1, "SPD Si chip$", 1, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
292 AliMedium(2, "SPD Si bus$", 2, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
293 AliMedium(3, "SPD C$", 3, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
294 AliMedium(4, "SPD Air$", 4, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
295 AliMedium(5, "SPD Vacuum$", 5, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
296 AliMedium(6, "SPD Al$", 6, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
297 AliMedium(7, "SPD Water $", 7, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
298 AliMedium(8, "SPD Freon$", 8, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
fe4da5cc 299
58005f18 300 // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
fe4da5cc 301
302 AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
303 AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
304 AliMaterial(27, "SDD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
305 AliMaterial(28, "SDD C$", 12.011, 6., 2.265,18.8, 999);
306 // v. dens
307 AliMaterial(29, "SDD Air$", 14.61, 7.3, .001205, 30423., 999);
308 AliMaterial(30, "SDD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
309 AliMaterial(31, "SDD Al$", 26.981539, 13., 2.6989, 8.9, 999);
310 // After a call with ratios by number (negative number of elements),
311 // the ratio array is changed to the ratio by weight, so all successive
312 // calls with the same array must specify the number of elements as
313 // positive
314 AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
315 // After a call with ratios by number (negative number of elements),
316 // the ratio array is changed to the ratio by weight, so all successive
317 // calls with the same array must specify the number of elements as
318 // positive
319 AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
320 AliMixture( 34, "SDD PCB$", apcb, zpcb, denspcb, 3, wpcb);
321 AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
322 AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
323 AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
324 // **
325 // check A and Z
58005f18 326 AliMedium(25, "SDD Si$", 25, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
327 AliMedium(26, "SDD Si chip$", 26, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
328 AliMedium(27, "SDD Si bus$", 27, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
329 AliMedium(28, "SDD C$", 28, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
330 AliMedium(29, "SDD Air$", 29, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
331 AliMedium(30, "SDD Vacuum$", 30, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
332 AliMedium(31, "SDD Al$", 31, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
333 AliMedium(32, "SDD Water $", 32, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
334 AliMedium(33, "SDD Freon$", 33, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
335 AliMedium(34, "SDD PCB$", 34, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
336 AliMedium(35, "SDD Copper$", 35, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
337 AliMedium(36, "SDD Ceramics$",36, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
338 AliMedium(37, "SDD Kapton$", 37, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
fe4da5cc 339
58005f18 340 // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
fe4da5cc 341
342 AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
343 AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
344 AliMaterial(52, "SSD Si bus$", 28.0855, 14., 2.33, 9.36, 999.);
345 AliMaterial(53, "SSD C$", 12.011, 6., 2.265,18.8, 999.);
346 // v. dens
347 AliMaterial(54, "SSD Air$", 14.61, 7.3, .001205, 30423., 999);
348 AliMaterial(55, "SSD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
349 AliMaterial(56, "SSD Al$", 26.981539, 13., 2.6989, 8.9, 999);
350 // After a call with ratios by number (negative number of elements),
351 // the ratio array is changed to the ratio by weight, so all successive
352 // calls with the same array must specify the number of elements as
353 // positive
354 AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
355 // After a call with ratios by number (negative number of elements),
356 // the ratio array is changed to the ratio by weight, so all successive
357 // calls with the same array must specify the number of elements as
358 // positive
359 AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
360 AliMixture(59, "SSD PCB$", apcb, zpcb, denspcb, 3, wpcb);
361 AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
362 // After a call with ratios by number (negative number of elements),
363 // the ratio array is changed to the ratio by weight, so all successive
364 // calls with the same array must specify the number of elements as
365 // positive
366 AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
367 AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
368 // check A and Z
369 AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
370 // **
58005f18 371 AliMedium(50, "SSD Si$", 50, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
372 AliMedium(51, "SSD Si chip$", 51, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
373 AliMedium(52, "SSD Si bus$", 52, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
374 AliMedium(53, "SSD C$", 53, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
375 AliMedium(54, "SSD Air$", 54, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
376 AliMedium(55, "SSD Vacuum$", 55, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
377 AliMedium(56, "SSD Al$", 56, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
378 AliMedium(57, "SSD Water $", 57, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
379 AliMedium(58, "SSD Freon$", 58, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
380 AliMedium(59, "SSD PCB$", 59, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
381 AliMedium(60, "SSD Copper$", 60, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
382 AliMedium(61, "SSD Ceramics$",61, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
383 AliMedium(62, "SSD Kapton$", 62, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
384 AliMedium(63, "SSD G10FR4$", 63, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
fe4da5cc 385
386 // 275-299 --> General (end-caps, frames, cooling, cables, etc.)
387
388 AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
389 // verify density
390 AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
391 AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
392 AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
393 AliMixture( 79, "GEN SERVICES$", aserv, zserv, 4.68, 4, wserv);
394 AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
395 // After a call with ratios by number (negative number of elements),
396 // the ratio array is changed to the ratio by weight, so all successive
397 // calls with the same array must specify the number of elements as
398 // positive
399 AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
400 // **
58005f18 401 AliMedium(75,"GEN C$", 75, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
402 AliMedium(76,"GEN Air$", 76, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
403 AliMedium(77,"GEN Vacuum$", 77, 0,ISXFLD,SXMGMX, 10., .10, .1, .100,10.00);
404 AliMedium(78,"GEN POLYETHYL$",78, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
405 AliMedium(79,"GEN SERVICES$", 79, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
406 AliMedium(80,"GEN Copper$", 80, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
407 AliMedium(81,"GEN Water $", 81, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
fe4da5cc 408}
409
410//_____________________________________________________________________________
58005f18 411Int_t AliITS::DistancetoPrimitive(Int_t , Int_t ){
fe4da5cc 412 //
413 // Distance from mouse to ITS on the screen. Dummy routine
58005f18 414 // A dummy routine used by the ROOT macro display.C to allow for the
415 // use of the mouse (pointing device) in the macro. In general this should
416 // never be called. If it is it returns the number 9999 for any value of
417 // x and y.
fe4da5cc 418 //
419 return 9999;
420}
421
422//_____________________________________________________________________________
58005f18 423void AliITS::Init(){
fe4da5cc 424 //
425 // Initialise ITS after it has been built
58005f18 426 // This routine initializes the AliITS class. It is intended to be called
427 // from the Init function in AliITSv?. Besides displaying a banner
428 // indicating that it has been called it initializes the array fIdSens.
429 // Therefore it should be called after a call to CreateGeometry.
fe4da5cc 430 //
431 Int_t i;
fe4da5cc 432 //
433 printf("\n");
434 for(i=0;i<35;i++) printf("*");
435 printf(" ITS_INIT ");
436 for(i=0;i<35;i++) printf("*");
437 printf("\n");
438 //
439 //
58005f18 440 for(i=0;i<fIdN;i++) fIdSens[i] = gMC->VolId(fIdName[i]);
fe4da5cc 441 //
442 for(i=0;i<80;i++) printf("*");
443 printf("\n");
444}
445
446//_____________________________________________________________________________
58005f18 447void AliITS::MakeBranch(Option_t* option){
fe4da5cc 448 //
449 // Create Tree branches for the ITS.
58005f18 450 // Creates the TTree branch where the class AliITS is kept.
fe4da5cc 451 //
452 Int_t buffersize = 4000;
453 char branchname[10];
454 sprintf(branchname,"%s",GetName());
455
456 AliDetector::MakeBranch(option);
457
458 char *D = strstr(option,"D");
459
460 if (fDigits && gAlice->TreeD() && D) {
461 gAlice->TreeD()->Branch(branchname,&fDigits, buffersize);
462 printf("Making Branch %s for digits\n",branchname);
58005f18 463 } // end if
fe4da5cc 464}
465
58005f18 466//____________________________________________________________________________
467void AliITS::Streamer(TBuffer &R__b){
468 // Stream an object of class AliITS.
469 Int_t i,j,l;
470
471 if (R__b.IsReading()) {
472 Version_t R__v = R__b.ReadVersion();
473 if (R__v == 1) {
474 AliDetector::Streamer(R__b);
475 R__b >> fITSgeom;
476// R__b >> fITSmodules; //We do not write out modules so don't read them
477 R__b >> fITSpoints;
478 R__b >> fEuclidOut;
479 R__b >> fIdN;
480 if(fIdSens!=0) delete[] fIdSens;
481 if(fIdName!=0) delete[] fIdName;
482 fIdSens = new Int_t[fIdN];
483 fIdName = new char*[fIdN];
484 for(i=0;i<fIdN;i++) R__b >> fIdSens[i];
485 for(i=0;i<fIdN;i++){
486 R__b >> l;
487 fIdName[i] = new char[l+1]; // add room for null character.
488 for(j=0;j<l;j++) R__b >> fIdName[i][j];
489 fIdName[i][l] = '\0'; // Null terminate this string.
490 } // end for i
491 R__b >> fMajorVersion;
492 R__b >> fMinorVersion;
493 } // end if (R__v)
494 } else {
495 R__b.WriteVersion(AliITS::IsA());
496 AliDetector::Streamer(R__b);
497 R__b << fITSgeom;
498// R__b << fITSmodules; //We don't want to write out the modules class.
499 R__b << fITSpoints;
500 R__b << fEuclidOut;
501 R__b << fIdN;
502 for(i=0;i<fIdN;i++) R__b <<fIdSens[i];
503 for(i=0;i<fIdN;i++){
504 l = strlen(fIdName[i]);
505 R__b << l;
506 for(j=0;j<l;j++) R__b << fIdName[i][j];
507 } // end for i
508 R__b << fMajorVersion;
509 R__b << fMinorVersion;
510 }
fe4da5cc 511}