]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCParam.cxx
Changes due to a new class AliComplexCluster. Forward declarations.
[u/mrichter/AliRoot.git] / TPC / AliTPCParam.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.9  2000/06/30 12:07:50  kowal2
19 Updated from the TPC-PreRelease branch
20
21 Revision 1.8.4.4  2000/06/26 07:39:42  kowal2
22 Changes to obey the coding rules
23
24 Revision 1.8.4.3  2000/06/25 08:38:41  kowal2
25 Splitted from AliTPCtracking
26   
27 Revision 1.8.4.2  2000/06/14 16:48:24  kowal2
28 Parameter setting improved. Removed compiler warnings
29
30 Revision 1.8.4.1  2000/06/09 07:12:21  kowal2  
31
32 Updated defaults
33
34 Revision 1.8  2000/04/17 09:37:33  kowal2
35 removed obsolete AliTPCDigitsDisplay.C
36
37 Revision 1.7.8.2  2000/04/10 08:44:51  kowal2
38
39 New transformations added
40 Different pad and pad-rows geometries for different sectors
41
42 Revision 1.7.8.1  2000/04/10 07:56:53  kowal2
43 Not used anymore - removed
44
45 Revision 1.7  1999/10/08 13:10:35  fca
46 Values in SetDefault are in radiants
47
48 Revision 1.6  1999/10/08 06:27:59  fca
49 Defaults updated
50
51 Revision 1.5  1999/10/05 17:18:27  fca
52 Correct GetWire check on even/odd fnWires
53
54 Revision 1.4  1999/09/29 09:24:34  fca
55 Introduction of the Copyright and cvs Log
56
57 */
58
59 ///////////////////////////////////////////////////////////////////////
60 //  Manager and of geomety  classes for set: TPC                     //
61 //                                                                   //
62 //  !sectors are numbered from  0                                     //
63 //  !pad rows are numbered from 0                                     //
64 //  
65 //  12.6.   changed z relative 
66 //  Origin:  Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk // 
67 //                                                                   //  
68 ///////////////////////////////////////////////////////////////////////
69
70 //
71
72 #include <iostream.h>
73 #include <TMath.h>
74 #include <TObject.h>
75 #include <TRandom.h>
76 #include <AliTPCParam.h>
77
78
79
80
81 ClassImp(AliTPCParam)
82
83
84 //___________________________________________
85 AliTPCParam::AliTPCParam()
86 {   
87   //
88   //constructor sets the default parameters
89   //
90
91   fResponseBin = 0;
92   fResponseWeight = 0;
93   fRotAngle = 0;
94   SetTitle("75x40_100x60");
95   SetDefault();  
96 }
97
98 AliTPCParam::~AliTPCParam()
99 {
100   //
101   //destructor deletes some dynamicaly alocated variables
102   //
103
104   if (fResponseBin!=0)    delete [] fResponseBin;
105   if (fResponseWeight!=0) delete [] fResponseWeight;
106   if (fRotAngle      !=0) delete [] fRotAngle;
107
108 }
109
110
111
112
113 Int_t  AliTPCParam::Transform0to1(Float_t *xyz, Int_t * index)  const
114 {
115   //
116   // calculates sector number (index[1], undefined on input)
117   // xyz intact
118   //
119
120   Float_t angle,x1;
121   Int_t sector;
122   Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
123   if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0.;
124   else
125     {
126       angle =TMath::ASin(xyz[1]/r);
127       if   (xyz[0]<0)   angle=TMath::Pi()-angle;
128       if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle;
129     }
130
131   sector=Int_t((angle-fInnerAngleShift)/fInnerAngle);      
132  
133   Float_t cos,sin;
134   AdjustCosSin(sector,cos,sin);
135   x1=xyz[0]*cos + xyz[1]*sin;
136
137   if (x1>fOuterRadiusLow)
138     {
139       sector=Int_t((angle-fOuterAngleShift)/fOuterAngle)+fNInnerSector;      
140       if (xyz[2]<0)     sector+=(fNOuterSector>>1);            
141     }
142     else   
143       if (xyz[2]<0) sector+=(fNInnerSector>>1);    
144   index[1]=sector; // calculated sector number
145   index[0]=1; // indicates system after transformation
146   return sector;
147 }
148
149 Bool_t  AliTPCParam::Transform(Float_t *xyz, Int_t *index, Int_t* oindex)
150 {
151   //transformation from input coodination system to output coordination system
152   switch (index[0]){
153   case 0:
154     break;
155   };
156
157   return kFALSE;
158
159 }
160
161 Int_t AliTPCParam::GetPadRow(Float_t *xyz, Int_t *index) const 
162 {
163   //
164   //calculates pad row of point xyz - transformation to system 8 (digit system)
165   //
166   Int_t system = index[0];
167   if (0==system) {
168     Transform0to1(xyz,index); 
169     system=1;
170   }
171   if (1==system) {
172     Transform1to2(xyz,index); 
173     system=2;
174   }
175     
176   if (fGeometryType==0){ //straight row    
177     if (2==system) {
178       Transform2to3(xyz,index);       
179       system=3;
180     } 
181     if (3==system) {
182       Transform3to4(xyz,index);
183       system=4; 
184     }
185     if (4==system) {
186       Transform4to8(xyz,index);
187       system=8;     
188     }
189     if (8==system) {
190       index[0]=8;
191       return index[2];
192     } 
193   }
194
195   if (fGeometryType==1){ //cylindrical geometry    
196     if (2==system) {
197       Transform2to5(xyz,index);       
198       system=5;
199     } 
200     if (5==system) {
201       Transform2to3(xyz,index);
202       system=6;
203     }
204     if (6==system) {
205       Transform3to4(xyz,index); 
206       system=7;
207     }
208     if (8==system) {
209       index[0]=8;
210       return index[2];
211     }
212   } 
213   index[0]=system;
214   return -1; //if no reasonable system     
215 }
216
217 void  AliTPCParam::SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle,
218                         Float_t outershift)
219 {
220   //
221   // set opening angles  
222   const static  Float_t  kDegtoRad = 0.01745329251994;
223   fInnerAngle = innerangle;       //opening angle of Inner sector
224   fInnerAngleShift = innershift;  //shift of first inner sector center to the 0
225   fOuterAngle = outerangle;       //opening angle of outer sector
226   fOuterAngleShift = outershift;  //shift of first sector center to the 0  
227   fInnerAngle *=kDegtoRad;
228   fInnerAngleShift *=kDegtoRad;
229   fOuterAngle *=kDegtoRad;
230   fOuterAngleShift *=kDegtoRad;
231 }
232
233 Float_t  AliTPCParam::GetInnerAngle() const
234 {
235   //return angle 
236   return fInnerAngle;
237
238 }
239
240 Float_t  AliTPCParam::GetInnerAngleShift() const
241 {  
242   //return angle   
243   return fInnerAngleShift;  
244 }
245 Float_t  AliTPCParam::GetOuterAngle() const
246
247   //return angle 
248   return fOuterAngle;
249
250 Float_t  AliTPCParam::GetOuterAngleShift() const
251
252   //return angle 
253
254      return fOuterAngleShift;
255
256
257
258 Int_t AliTPCParam::GetIndex(Int_t sector, Int_t row)
259 {
260   //
261   //give index of the given sector and pad row 
262   //no control if the sectors and rows  are reasonable !!!
263   //
264   if (sector<fNInnerSector) return sector*fNRowLow+row;
265   return (fNInnerSector*fNRowLow)+(sector-fNInnerSector)*fNRowUp+row;  
266 }
267
268 Bool_t   AliTPCParam::AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const
269 {
270   //
271   //return sector and padrow for given index
272   //if index is reasonable returns true else return false
273   //
274   if ( (index<0) || (index>fNtRows))  return kFALSE;
275   Int_t outindex = fNInnerSector*fNRowLow;
276   if (index<outindex) {
277     sector = index/fNRowLow;
278     row    = index - sector*fNRowLow;
279     return kTRUE;
280   }
281   index-= outindex;
282   sector = index/fNRowUp;
283   row    = index - sector*fNRowUp;
284   sector += fNInnerSector;
285   return kTRUE;         
286
287
288 void AliTPCParam::SetDefault()
289 {
290   //
291   //set default parameters
292   //
293   //const static  Int_t kMaxRows=600; 
294   //
295   //sector default parameters
296   //
297   const static  Float_t kInnerRadiusLow = 82.97;
298   const static  Float_t kOuterRadiusLow = 133.58;
299   const static  Float_t kInnerRadiusUp  = 133.17;
300   const static  Float_t kOuterRadiusUp  = 247.78;
301   const static  Float_t kInnerAngle = 20; // 20 degrees
302   const static  Float_t kInnerAngleShift = 10;
303   const static  Float_t kOuterAngle = 20; //  20 degrees
304   const static  Float_t kOuterAngleShift = 10;
305   const static  Float_t kInnerFrameSpace = 1.5;
306   const static  Float_t kOuterFrameSpace = 1.5;
307   const static  Float_t kInnerWireMount = 1.370825926;
308   const static  Float_t kOuterWireMount = 1.370825926;
309   const static  Float_t kZLength =250.;
310   const static  Int_t   kGeometryType = 0; //straight rows 
311   //
312   //wires default parameters
313   //
314   const static Int_t    kNInnerWiresPerPad = 3;
315   const static Int_t    kInnerDummyWire = 2;
316   const static Float_t  kInnerOffWire = 0.5;
317   const static Int_t    kNOuterWiresPerPad = 4;
318   const static Int_t    kOuterDummyWire = 2;
319   const static Float_t  kOuterOffWire = 0.5;
320   //
321   //pad default parameters
322   // 
323   const static Float_t  kInnerPadPitchLength = 0.75;
324   const static Float_t  kInnerPadPitchWidth = 0.40;
325   const static Float_t  kInnerPadLength = 0.75;
326   const static Float_t  kInnerPadWidth = 0.40;
327   const static Float_t  kOuterPadPitchLength = 1.0;
328   const static Float_t  kOuterPadPitchWidth = 0.6;
329   const static Float_t  kOuterPadLength = 1.0;
330   const static Float_t  kOuterPadWidth = 0.6;
331   const static Bool_t   kBMWPCReadout = kTRUE; //MWPC readout - another possibility GEM 
332   const static Int_t    kNCrossRows = 1; //number of rows to cross-talk
333   
334   //
335   //gas default parameters
336   //
337   const static  Float_t  kDiffT = 2.2e-2; 
338   const static  Float_t  kDiffL = 2.2e-2;
339   const static  Float_t  kGasGain = 2.e4;
340   const static  Float_t  kDriftV  =2.83e6;
341   const static  Float_t  kOmegaTau = 0.145;
342   const static  Float_t  kAttCoef = 250.;
343   const static  Float_t  kOxyCont = 5.e-6;
344   //
345   //electronic default parameters
346   //
347   const static  Float_t  kPadCoupling=0.5;
348   const static  Int_t    kZeroSup=2;
349   const static  Float_t  kNoise = 1000;                            
350   const static  Float_t  kChipGain = 12;
351   const static  Float_t  kChipNorm = 0.4;
352   const static  Float_t  kTSample = 2.e-7; 
353   const static  Float_t  kTFWHM   = 1.9e-7;  //fwhm of charge distribution
354   const static  Int_t    kMaxTBin =445;  
355   const static  Int_t    kADCSat  =1024;  
356   const static  Float_t  kADCDynRange =2000.;  
357   //
358   //
359   //
360   const static  Float_t kBField =0.2; 
361   const static  Float_t kNPrimLoss =10.9;
362   const static  Float_t kNTotalLoss =39.9;
363   // 
364   //response constants
365   //
366   const static Int_t     kNResponseMax=100;
367   const static Float_t   kResponseThreshold=0.01;     
368   fbStatus = kFALSE;
369   //
370   //set sector parameters
371   //
372   SetInnerRadiusLow(kInnerRadiusLow);
373   SetOuterRadiusLow(kOuterRadiusLow);
374   SetInnerRadiusUp(kInnerRadiusUp);
375   SetOuterRadiusUp(kOuterRadiusUp);
376   SetInnerFrameSpace(kInnerFrameSpace);
377   SetOuterFrameSpace(kOuterFrameSpace);
378   SetInnerWireMount(kInnerWireMount);
379   SetOuterWireMount(kOuterWireMount);
380   SetSectorAngles(kInnerAngle,kInnerAngleShift,kOuterAngle,kOuterAngleShift);
381   SetZLength(kZLength);
382   SetGeometryType(kGeometryType);
383   //
384   //set wire parameters
385   //
386   SetInnerNWires(kNInnerWiresPerPad);
387   SetInnerDummyWire(kInnerDummyWire);
388   SetInnerOffWire(kInnerOffWire);
389   SetOuterNWires(kNOuterWiresPerPad);
390   SetOuterDummyWire(kOuterDummyWire);
391   SetOuterOffWire(kOuterOffWire);
392   //
393   //set pad parameter
394   //
395   SetInnerPadPitchLength(kInnerPadPitchLength);
396   SetInnerPadPitchWidth(kInnerPadPitchWidth);
397   SetInnerPadLength(kInnerPadLength);
398   SetInnerPadWidth(kInnerPadWidth);
399   SetOuterPadPitchLength(kOuterPadPitchLength);
400   SetOuterPadPitchWidth(kOuterPadPitchWidth);
401   SetOuterPadLength(kOuterPadLength);
402   SetOuterPadWidth(kOuterPadWidth); 
403   SetMWPCReadout(kBMWPCReadout);
404   SetNCrossRows(kNCrossRows);
405   //
406   //set gas paremeters
407   //
408   SetDiffT(kDiffT);
409   SetDiffL(kDiffL);
410   SetGasGain(kGasGain);
411   SetDriftV(kDriftV);
412   SetOmegaTau(kOmegaTau);
413   SetAttCoef(kAttCoef);
414   SetOxyCont(kOxyCont);
415   //
416   //set electronivc parameters  
417   //
418   SetPadCoupling(kPadCoupling);
419   SetZeroSup(kZeroSup);
420   SetNoise(kNoise);
421   SetChipGain(kChipGain);
422   SetChipNorm(kChipNorm);   
423   SetTSample(kTSample);
424   SetTFWHM(kTFWHM);
425   SetMaxTBin(kMaxTBin);
426   SetADCSat(kADCSat);
427   SetADCDynRange(kADCDynRange);
428   //set magnetic field
429   SetBField(kBField);
430   SetNPrimLoss(kNPrimLoss);
431   SetNTotalLoss(kNTotalLoss);
432   //
433   //set response  parameters  
434   //
435   SetNResponseMax(kNResponseMax); 
436   SetResponseThreshold(kResponseThreshold);
437 }
438
439           
440 Bool_t AliTPCParam::Update()
441 {
442   //
443   // update some calculated parameter which must be updated after changing "base"
444   // parameters 
445   // for example we can change size of pads and according this recalculate number
446   // of pad rows, number of of pads in given row ....
447   //
448   const Float_t kQel = 1.602e-19; // elementary charge
449   fbStatus = kFALSE;
450
451   Int_t i,j;  //loop variables because HP 
452   //-----------------Sector section------------------------------------------
453   //calclulate number of sectors
454   fNInnerSector = Int_t(4*TMath::Pi()/fInnerAngle+0.2); 
455        // number of inner sectors - factor 0.2 to don't be influnced by inprecision
456   if (fNInnerSector%2) return kFALSE;
457   fNOuterSector = Int_t(4*TMath::Pi()/fOuterAngle+0.2); 
458   if (fNOuterSector%2) return kFALSE;
459   fNSector  = fNInnerSector+fNOuterSector;
460
461   if (fRotAngle!=0) delete [] fRotAngle;
462   fRotAngle = new Float_t[4*fNSector];
463   //calculate sin and cosine of rotations angle     
464   //sectors angles numbering from 0
465
466   j=fNInnerSector*2;
467   Float_t angle = fInnerAngleShift; 
468   for (i=0; j<fNInnerSector*4; i+=4, j+=4 , angle +=fInnerAngle){
469     fRotAngle[i]=TMath::Cos(angle);
470     fRotAngle[i+1]=TMath::Sin(angle);
471     fRotAngle[j] =  fRotAngle[i];
472     fRotAngle[j+1] =  fRotAngle[i+1];
473     fRotAngle[i+2] =angle;
474     fRotAngle[j+2] =angle;    
475   }
476   angle = fOuterAngleShift; 
477   j=(fNInnerSector+fNOuterSector/2)*4;
478   for (i=fNInnerSector*4; j<fNSector*4; i+=4,j+=4, angle +=fOuterAngle){
479     fRotAngle[i]=TMath::Cos(angle);
480     fRotAngle[i+1]=TMath::Sin(angle);
481     fRotAngle[j] =  fRotAngle[i];
482     fRotAngle[j+1] =  fRotAngle[i+1];
483     fRotAngle[i+2] =angle;
484     fRotAngle[j+2] =angle;    
485   }
486   fZWidth = fTSample*fDriftV;  
487   fTotalNormFac = fPadCoupling*fChipNorm*kQel*1.e15*fChipGain*fADCSat/fADCDynRange;
488   fNoiseNormFac = kQel*1.e15*fChipGain*fADCSat/fADCDynRange;
489   //wire section 
490   Int_t nwire;
491   Float_t wspace; //available space for wire
492   Float_t dummyspace; //dummyspace for wire
493
494   fInnerWWPitch = Float_t((Double_t)fInnerPadPitchLength/(Double_t)fNInnerWiresPerPad);  
495   wspace =fInnerRadiusUp-fInnerRadiusLow-2*fInnerOffWire;
496   nwire = Int_t(wspace/fInnerWWPitch);
497   wspace = Float_t(nwire)*fInnerWWPitch;
498   dummyspace =(fInnerRadiusUp-fInnerRadiusLow-wspace)/2.; 
499   fRInnerFirstWire = fInnerRadiusLow+dummyspace;
500   fRInnerLastWire = fRInnerFirstWire+fInnerWWPitch*(Float_t)(nwire);
501
502   fOuterWWPitch = Float_t((Double_t)fOuterPadPitchLength/(Double_t)fNOuterWiresPerPad);  
503   wspace =fOuterRadiusUp-fOuterRadiusLow-2*fOuterOffWire;
504   nwire = Int_t(wspace/fOuterWWPitch);
505   wspace = Float_t(nwire)*fOuterWWPitch;
506   dummyspace =(fOuterRadiusUp-fOuterRadiusLow-wspace)/2.; 
507   fROuterFirstWire = fOuterRadiusLow+dummyspace;
508   fROuterLastWire = fROuterFirstWire+fOuterWWPitch*(Float_t)(nwire);
509
510   
511   //
512   //response data
513   //
514   if (fResponseBin==0) delete [] fResponseBin;
515   if (fResponseWeight==0) delete [] fResponseBin;
516   fResponseBin    = new Int_t[3*fNResponseMax];
517   fResponseWeight = new Float_t[fNResponseMax];
518   
519   fbStatus = kTRUE;
520   return kTRUE;
521 }
522
523
524
525 Bool_t AliTPCParam::GetStatus()
526 {
527   //get information about object consistency
528   return fbStatus;
529 }
530
531 Int_t AliTPCParam::GetNRowLow() const
532 {
533   //get the number of pad rows in low sector
534   return fNRowLow;
535 }
536 Int_t AliTPCParam::GetNRowUp() const
537 {
538   //get the number of pad rows in up sector
539   return fNRowUp;
540 }
541 Float_t AliTPCParam::GetPadRowRadiiLow(Int_t irow) const
542 {
543   //get the pad row (irow) radii
544   if ( !(irow<0) && (irow<fNRowLow) ) 
545     return  fPadRowLow[irow];
546   else
547     return 0;
548 }
549
550 Float_t AliTPCParam::GetPadRowRadiiUp(Int_t irow) const
551 {
552   //get the pad row (irow) radii
553  if ( !(irow<0) && (irow<fNRowUp) ) 
554     return  fPadRowUp[irow];
555   else
556     return 0;
557 }
558
559 Int_t AliTPCParam::GetNPadsLow(Int_t irow) const
560 {
561   //get the number of pads in row irow
562   if ( !(irow<0) && (irow<fNRowLow) ) 
563     return  fNPadsLow[irow];
564   else
565     return 0;
566 }
567
568
569 Int_t AliTPCParam::GetNPadsUp(Int_t irow) const
570 {
571   //get the number of pads in row irow
572   if ( !(irow<0) && (irow<fNRowUp) ) 
573     return  fNPadsUp[irow];
574   else
575     return 0;
576 }
577
578
579 void AliTPCParam::Streamer(TBuffer &R__b)
580 {
581    // Stream an object of class AliTPC.
582
583    if (R__b.IsReading()) {
584       Version_t R__v = R__b.ReadVersion(); if (R__v) { }
585       AliDetectorParam::Streamer(R__b);
586       if (R__v < 2) return;
587       //---------------------------------------------------------------------
588       //   ALICE TPC sector geometry
589       //--------------------------------------------------------------------  
590       R__b >> fInnerRadiusLow;   // lower radius of inner sector-IP
591       R__b >> fInnerRadiusUp;    // upper radius of inner  sector-IP
592       R__b >> fOuterRadiusUp;    // upper radius of outer  sector-IP
593       R__b >> fOuterRadiusLow;   // lower radius of outer sector-IP
594       R__b >> fInnerAngle;       //opening angle of Inner sector
595       R__b >> fInnerAngleShift;  //shift of first inner sector center to the 0
596       R__b >> fOuterAngle;       //opening angle of outer sector
597       R__b >> fOuterAngleShift;  //shift of first sector center to the 0  
598       R__b >> fInnerFrameSpace;  //spce for inner frame in the phi direction 
599       R__b >> fOuterFrameSpace;  //spce for outer frame in the phi direction 
600       R__b >> fInnerWireMount;
601       R__b >> fOuterWireMount;
602       //R__b >> fNInnerSector;      //!number of inner sectors - calculated
603       //R__b >> fNOuterSector;      //!number of outer sectors -calculated
604       //R__b >> fNSector;           //! total number of sectors -calculated
605       R__b >> fZLength;           //length of the drift region of the TPC
606       //R__b.ReadFastArray(fRotAngle,fNSector*4);      //  sin and cos of rotation angles for 
607       R__b >> fGeometryType;      //type of geometry -0 straight rows
608                                  //  diferent sectors
609       //---------------------------------------------------------------------
610       //   ALICE TPC wires  geometry
611       //--------------------------------------------------------------------
612       R__b >> fNInnerWiresPerPad;//  Number of wires per pad
613       //R__b >> fInnerWWPitch;     // pitch between wires  in inner sector - calculated
614       R__b >> fInnerDummyWire;   //number of wires without pad readout
615       R__b >> fInnerOffWire;//oofset of first wire to the begining of the sector
616       //R__b >> fRInnerFirstWire;  //position of the first wire  -calculated
617       //R__b >> fRInnerLastWire;   //position of the last wire    -calculated
618       R__b >> fNOuterWiresPerPad;//  Number of wires per pad
619       //R__b >> fOuterWWPitch;     // pitch between wires in outer sector   - calculated
620       R__b >> fOuterDummyWire;   //number of wires without pad readout
621       R__b >> fOuterOffWire;//oofset of first wire to the begining of the sector
622       //R__b >> fROuterFirstWire;  //position of the first wire  -calulated
623       //R__b >> fROuterLastWire;   //position of the last wire    -calculated            
624       //---------------------------------------------------------------------
625       //   ALICE TPC pad parameters
626       //--------------------------------------------------------------------
627       R__b >> fInnerPadPitchLength;    //Inner pad pitch length
628       R__b >> fInnerPadPitchWidth;     //Inner pad pitch width
629       R__b >> fInnerPadLength;         //Inner pad  length
630       R__b >> fInnerPadWidth;          //Inner pad  width
631       R__b >> fOuterPadPitchLength;    //Outer pad pitch length
632       R__b >> fOuterPadPitchWidth;     //Outer pad pitch width
633       R__b >> fOuterPadLength;         //Outer pad  length
634       R__b >> fOuterPadWidth;          //Outer pad  width
635       R__b >> fBMWPCReadout;           //indicate wire readout 
636       R__b >> fNCrossRows;             //number of pad rows to crostalk
637       R__b >> fNRowLow;           //  number of pad rows per low sector 
638       R__b >> fNRowUp;            //  number of pad rows per sector up 
639       //R__b >> fPadRowLow[600]; // Lower sector, pad row radii
640       //R__b >> fPadRowUp[600];  // Upper sector, pad row radii
641       //R__b >> fNPadsLow[600];     // Lower sector, number of pads per row
642       //R__b >> fNPadsUp[600];      //  Upper sector, number of pads per row
643       //---------------------------------------------------------------------
644       //   ALICE TPC Gas Parameters
645       //--------------------------------------------------------------------
646       R__b >> fDiffT;          //tangencial diffusion constant
647       R__b >> fDiffL;          //longutudinal diffusion constant
648       R__b >> fGasGain;        //gas gain constant
649       R__b >> fDriftV;          //drift velocity constant
650       R__b >> fOmegaTau;       //omega tau ExB coeficient
651       R__b >> fAttCoef;        //attachment coefitients
652       R__b >> fOxyCont;        //oxygen content
653       //---------------------------------------------------------------------
654       //   ALICE TPC  Electronics Parameters
655       //--------------------------------------------------------------------
656       R__b >> fPadCoupling;     //coupling factor ration of  anode signal 
657       //and total pads signal  
658       R__b >> fZeroSup;         //zero suppresion constant
659       R__b >> fNoise;         //noise sigma constant
660       R__b >> fChipGain;      //preamp shaper constant
661       R__b >> fChipNorm;      //preamp shaper normalisation       
662       R__b >> fTSample; // sampling time
663       R__b >> fZWidth;  //derived value calculated using TSample and driftw 
664       R__b >> fTSigma;  // width of the Preamp/Shaper function
665       R__b >> fMaxTBin; //maximum time bin number   
666       R__b >> fADCSat;  //saturation value of ADC (10 bits)
667       R__b >> fADCDynRange; // input dynamic range (mV)
668       //--------------------------------------------------------        
669    } else {
670       R__b.WriteVersion(AliTPCParam::IsA());
671       AliDetectorParam::Streamer(R__b);      
672      //---------------------------------------------------------------------
673       //   ALICE TPC sector geometry
674       //--------------------------------------------------------------------  
675       R__b << fInnerRadiusLow;   // lower radius of inner sector-IP
676       R__b << fInnerRadiusUp;    // upper radius of inner  sector-IP
677       R__b << fOuterRadiusUp;    // upper radius of outer  sector-IP
678       R__b << fOuterRadiusLow;   // lower radius of outer sector-IP
679       R__b << fInnerAngle;       //opening angle of Inner sector
680       R__b << fInnerAngleShift;  //shift of first inner sector center to the 0
681       R__b << fOuterAngle;       //opening angle of outer sector
682       R__b << fOuterAngleShift;  //shift of first sector center to the 0  
683       R__b << fInnerFrameSpace;  //spce for inner frame in the phi direction 
684       R__b << fOuterFrameSpace;  //spce for outer frame in the phi direction 
685       R__b << fInnerWireMount;
686       R__b << fOuterWireMount;
687       //R__b << fNInnerSector;      //!number of inner sectors - calculated
688       //R__b << fNOuterSector;      //!number of outer sectors -calculated
689       //R__b << fNSector;           //! total number of sectors -calculated
690       R__b << fZLength;           //length of the drift region of the TPC
691       //R__b.WriteFastArray(fRotAngle,fNSector*4);      //  sin and cos of rotation angles for 
692       R__b << fGeometryType;      //type of geometry -0 straight rows
693       
694                                  //  diferent sectors
695       //---------------------------------------------------------------------
696       //   ALICE TPC wires  geometry
697       //--------------------------------------------------------------------
698       R__b << fNInnerWiresPerPad;//  Number of wires per pad
699       // R__b << fInnerWWPitch;     // pitch between wires  in inner sector - calculated
700       R__b << fInnerDummyWire;   //number of wires without pad readout
701       R__b << fInnerOffWire;//oofset of first wire to the begining of the sector
702       //R__b << fRInnerFirstWire;  //position of the first wire  -calculated
703       //R__b << fRInnerLastWire;   //position of the last wire    -calculated
704       R__b << fNOuterWiresPerPad;//  Number of wires per pad
705       //R__b << fOuterWWPitch;     // pitch between wires in outer sector   - calculated
706       R__b << fOuterDummyWire;   //number of wires without pad readout
707       R__b << fOuterOffWire;//oofset of first wire to the begining of the sector
708       //R__b << fROuterFirstWire;  //position of the first wire  -calulated
709       //R__b << fROuterLastWire;   //position of the last wire    -calculated            
710       //---------------------------------------------------------------------
711       //   ALICE TPC pad parameters
712       //--------------------------------------------------------------------
713       R__b << fInnerPadPitchLength;    //Inner pad pitch length
714       R__b << fInnerPadPitchWidth;     //Inner pad pitch width
715       R__b << fInnerPadLength;         //Inner pad  length
716       R__b << fInnerPadWidth;          //Inner pad  width
717       R__b << fOuterPadPitchLength;    //Outer pad pitch length
718       R__b << fOuterPadPitchWidth;     //Outer pad pitch width
719       R__b << fOuterPadLength;         //Outer pad  length
720       R__b << fOuterPadWidth;          //Outer pad  width
721       R__b << fBMWPCReadout;           //indicate wire readout 
722       R__b << fNCrossRows;             // number of rows to cross talk
723       R__b << fNRowLow;           //  number of pad rows per low sector 
724       R__b << fNRowUp;            //  number of pad rows per sector up 
725       // R__b << fPadRowLow[600]; // Lower sector, pad row radii
726       //R__b << fPadRowUp[600];  // Upper sector, pad row radii
727       //R__b << fNPadsLow[600];     // Lower sector, number of pads per row
728       //R__b << fNPadsUp[600];      //  Upper sector, number of pads per row
729       //---------------------------------------------------------------------
730       //   ALICE TPC Gas Parameters
731       //--------------------------------------------------------------------
732       R__b << fDiffT;          //tangencial diffusion constant
733       R__b << fDiffL;          //longutudinal diffusion constant
734       R__b << fGasGain;        //gas gain constant
735       R__b << fDriftV;          //drift velocity constant
736       R__b << fOmegaTau;       //omega tau ExB coeficient
737       R__b << fAttCoef;        //attachment coefitients
738       R__b << fOxyCont;        //oxygen content
739       //---------------------------------------------------------------------
740       //   ALICE TPC  Electronics Parameters
741       //--------------------------------------------------------------------
742       R__b << fPadCoupling;     //coupling factor ration of  anode signal 
743       //and total pads signal  
744       R__b << fZeroSup;         //zero suppresion constant
745       R__b << fNoise;         //noise sigma constant
746       R__b << fChipGain;      //preamp shaper constant
747       R__b << fChipNorm;      //preamp shaper normalisation     
748       R__b << fTSample; // sampling time
749       R__b << fZWidth;  //derived value calculated using TSample and driftw 
750       R__b << fTSigma;  // width of the Preamp/Shaper function
751       R__b << fMaxTBin; //maximum time bin number   
752       R__b << fADCSat;  //saturation value of ADC (10 bits)
753       R__b << fADCDynRange; // input dynamic range (mV)       
754    }
755 }
756