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