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