AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTPCROC.cxx
Go to the documentation of this file.
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 
19 
20 #include "AliTPCROC.h"
21 #include "TMath.h"
22 
26 
27 
28 AliTPCROC* AliTPCROC::fgInstance = 0;
29 
30 
31 
32 
33 //_ singleton implementation __________________________________________________
34 AliTPCROC* AliTPCROC::Instance()
35 {
38 
39  if (fgInstance == 0){
40  fgInstance = new AliTPCROC();
41  fgInstance->Init();
42  }
43  return fgInstance;
44 }
45 
46 
47 
48 
51 
52  if (AliTPCROC::fNSectorsAll>0) return;
53  fNSectorsAll =72;
54  fNSectors[0] =36;
55  fNSectors[1] =36;
56  //
57  fNRows[0]= 63;
58  fNRows[1]= 96;
59  //
60  // number of pads in padrow
61  fNPads[0] = new UInt_t[fNRows[0]];
62  fNPads[1] = new UInt_t[fNRows[1]];
63  //
64  // padrow index in array
65  //
66  fRowPosIndex[0] = new UInt_t[fNRows[0]];
67  fRowPosIndex[1] = new UInt_t[fNRows[1]];
68  //
69  // inner sectors
70  //
71  UInt_t index =0;
72  for (UInt_t irow=0; irow<fNRows[0];irow++){
73  UInt_t npads = (irow==0) ? 68 : 2 *Int_t(Double_t(irow)/3. +33.67);
74  fNPads[0][irow] = npads;
75  fRowPosIndex[0][irow] = index;
76  index+=npads;
77  }
78  fNChannels[0] = index;
79  //
80  index =0;
81  Double_t k1 = 10.*TMath::Tan(10*TMath::DegToRad())/6.;
82  Double_t k2 = 15.*TMath::Tan(10*TMath::DegToRad())/6.;
83  for (UInt_t irow=0; irow<fNRows[1];irow++){
84  UInt_t npads = (irow<64) ?
85  2*Int_t(k1*Double_t(irow)+37.75):
86  2*Int_t(k2*Double_t(irow-64)+56.66);
87  fNPads[1][irow] = npads;
88  fRowPosIndex[1][irow] = index;
89  index+=npads;
90  }
91  fNChannels[1] = index;
92  SetGeometry();
93 }
94 
95 
96 
97 
99 {
101 
102  const Float_t kInnerRadiusLow = 83.65;
103  const Float_t kInnerRadiusUp = 133.3;
104  const Float_t kOuterRadiusLow = 133.5;
105  const Float_t kOuterRadiusUp = 247.7;
106  const Float_t kInnerFrameSpace = 1.5;
107  const Float_t kOuterFrameSpace = 1.5;
108  const Float_t kInnerWireMount = 1.2;
109  const Float_t kOuterWireMount = 1.4;
110  const Float_t kZLength =250.;
111  const UInt_t kNRowLow = 63;
112  const UInt_t kNRowUp1 = 64;
113  const UInt_t kNRowUp2 = 32;
114  const UInt_t kNRowUp = 96;
115  const Float_t kInnerAngle = 20; // 20 degrees
116  const Float_t kOuterAngle = 20; // 20 degrees
117  //
118  // pad parameters
119  //
120  const Float_t kInnerPadPitchLength = 0.75;
121  const Float_t kInnerPadPitchWidth = 0.40;
122  const Float_t kInnerPadLength = 0.75;
123  const Float_t kInnerPadWidth = 0.40;
124  const Float_t kOuter1PadPitchLength = 1.0;
125  const Float_t kOuterPadPitchWidth = 0.6;
126  const Float_t kOuter1PadLength = 1.0;
127  const Float_t kOuterPadWidth = 0.6;
128  const Float_t kOuter2PadPitchLength = 1.5;
129  const Float_t kOuter2PadLength = 1.5;
130 
131  //
132  //wires default parameters
133  //
134 // const UInt_t kNInnerWiresPerPad = 3;
135 // const UInt_t kInnerDummyWire = 2;
136 // const Float_t kInnerWWPitch = 0.25;
137 // const Float_t kRInnerFirstWire = 84.475;
138 // const Float_t kRInnerLastWire = 132.475;
139 // const Float_t kInnerOffWire = 0.5;
140 // const UInt_t kNOuter1WiresPerPad = 4;
141 // const UInt_t kNOuter2WiresPerPad = 6;
142 // const Float_t kOuterWWPitch = 0.25;
143 // const Float_t kROuterFirstWire = 134.225;
144 // const Float_t kROuterLastWire = 246.975;
145 // const UInt_t kOuterDummyWire = 2;
146 // const Float_t kOuterOffWire = 0.5;
147  //
148  //set sector parameters
149  //
150  fInnerRadiusLow = kInnerRadiusLow;
151  fOuterRadiusLow = kOuterRadiusLow;
152  fInnerRadiusUp = kInnerRadiusUp;
153  fOuterRadiusUp = kOuterRadiusUp;
154  fInnerFrameSpace = kInnerFrameSpace;
155  fOuterFrameSpace = kOuterFrameSpace;
156  fInnerWireMount = kInnerWireMount;
157  fOuterWireMount = kOuterWireMount;
158  fZLength = kZLength;
159  fInnerAngle = TMath::DegToRad()*kInnerAngle;
160  fOuterAngle = TMath::DegToRad()*kOuterAngle;
161 
162  fNRowLow = kNRowLow;
163  fNRowUp1 = kNRowUp1;
164  fNRowUp2 = kNRowUp2;
165  fNRowUp = kNRowUp;
166  //
167  //set pad parameter
168  //
169  fInnerPadPitchLength = kInnerPadPitchLength;
170  fInnerPadPitchWidth = kInnerPadPitchWidth;
171  fInnerPadLength = kInnerPadLength;
172  fInnerPadWidth = kInnerPadWidth;
173  fOuter1PadPitchLength = kOuter1PadPitchLength;
174  fOuter2PadPitchLength = kOuter2PadPitchLength;
175  fOuterPadPitchWidth = kOuterPadPitchWidth;
176  fOuter1PadLength = kOuter1PadLength;
177  fOuter2PadLength = kOuter2PadLength;
178  fOuterPadWidth = kOuterPadWidth;
179 
180  //
181  //set wire parameters
182  //
183  // SetInnerNWires(kNInnerWiresPerPad);
184  // SetInnerDummyWire(kInnerDummyWire);
185  // SetInnerOffWire(kInnerOffWire);
186  // SetOuter1NWires(kNOuter1WiresPerPad);
187  // SetOuter2NWire(kNOuter2WiresPerPad);
188  // SetOuterDummyWire(kOuterDummyWire);
189  // SetOuterOffWire(kOuterOffWire);
190  // SetInnerWWPitch(kInnerWWPitch);
191  // SetRInnerFirstWire(kRInnerFirstWire);
192  // SetRInnerLastWire(kRInnerLastWire);
193  // SetOuterWWPitch(kOuterWWPitch);
194  // SetROuterFirstWire(kROuterFirstWire);
195  // SetROuterLastWire(kROuterLastWire);
196 
197  UInt_t i=0;
198  Float_t firstrow = fInnerRadiusLow + 1.575;
199  for( i= 0;i<fNRowLow;i++)
200  {
201  Float_t x = firstrow + fInnerPadPitchLength*(Float_t)i;
202  fPadRowLow[i]=x;
203  fYInner[i+1] = x*TMath::Tan(fInnerAngle/2.)-fInnerWireMount;
204  fNPadsLow[i] = GetNPads(0,i) ; // ROC implement
205  }
206  // cross talk rows
208  fYInner[fNRowLow+1]=(fPadRowLow[fNRowLow-1]+fInnerPadPitchLength)*TMath::Tan(fInnerAngle/2.)-fInnerWireMount;
209  firstrow = fOuterRadiusLow + 1.6;
210  for(i=0;i<fNRowUp;i++)
211  {
212  if(i<fNRowUp1){
213  Float_t x = firstrow + fOuter1PadPitchLength*(Float_t)i;
214  fPadRowUp[i]=x;
215  fYOuter[i+1]= x*TMath::Tan(fOuterAngle/2.)-fOuterWireMount;
216  fNPadsUp[i] = GetNPads(36,i) ; // ROC implement
217  if(i==fNRowUp1-1) {
218  fLastWireUp1=fPadRowUp[i] +0.625;
219  firstrow = fPadRowUp[i] + 0.5*(fOuter1PadPitchLength+fOuter2PadPitchLength);
220  }
221  }
222  else
223  {
224  Float_t x = firstrow + fOuter2PadPitchLength*(Float_t)(i-64);
225  fPadRowUp[i]=x;
226  fNPadsUp[i] = GetNPads(36,i) ; // ROC implement
227  }
228  fYOuter[i+1] = fPadRowUp[i]*TMath::Tan(fOuterAngle/2.)-fOuterWireMount;
229  }
230 
231 
232 
233 }
234 
235 
236 
237 
238 //_____________________________________________________________________________
240  :TObject(),
241  fNSectorsAll(0),
242  fInnerRadiusLow(0.),
243  fInnerRadiusUp(0.),
244  fOuterRadiusUp(0.),
245  fOuterRadiusLow(0.),
246  fInnerFrameSpace(0.),
247  fOuterFrameSpace(0.),
248  fInnerWireMount(0.),
249  fOuterWireMount(0.),
250  fZLength(0.),
251  fInnerAngle(0.),
252  fOuterAngle(0.),
253  fNInnerWiresPerPad(0),
254  fInnerWWPitch(0.),
255  fInnerDummyWire(0),
256  fInnerOffWire(0.),
257  fRInnerFirstWire(0.),
258  fRInnerLastWire(0.),
259  fLastWireUp1(0.),
260  fNOuter1WiresPerPad(0),
261  fNOuter2WiresPerPad(0),
262  fOuterWWPitch(0.),
263  fOuterDummyWire(0),
264  fOuterOffWire(0),
265  fROuterFirstWire(0.),
266  fROuterLastWire(0),
267  fInnerPadPitchLength(0.),
268  fInnerPadPitchWidth(0.),
269  fInnerPadLength(0.),
270  fInnerPadWidth(0.),
271  fOuter1PadPitchLength(0.),
272  fOuter2PadPitchLength(0),
273  fOuterPadPitchWidth(0),
274  fOuter1PadLength(0.),
275  fOuter2PadLength(0),
276  fOuterPadWidth(0),
277  fNRowLow(0),
278  fNRowUp1(0),
279  fNRowUp2(0),
280  fNRowUp(0),
281  fNtRows(0)
282 {
284 
285  for (UInt_t i=0;i<2;i++){
286  fNSectors[i] = 0;
287  fNRows[i] = 0;
288  fNChannels[i] = 0;
289  fNPads[i] = 0;
290  fRowPosIndex[i]= 0;
291  }
292 
293  for (UInt_t i=0;i<100;++i){
294  fPadRowLow[i]=0.;
295  fPadRowUp[i]=0.;
296  fNPadsLow[i]=0;
297  fNPadsUp[i]=0;
298  fYInner[i]=0.;
299  fYOuter[i]=0.;
300  }
301 }
302 
303 
304 //_____________________________________________________________________________
306  :TObject(roc),
307  fNSectorsAll(0),
308  fInnerRadiusLow(0.),
309  fInnerRadiusUp(0.),
310  fOuterRadiusUp(0.),
311  fOuterRadiusLow(0.),
312  fInnerFrameSpace(0.),
313  fOuterFrameSpace(0.),
314  fInnerWireMount(0.),
315  fOuterWireMount(0.),
316  fZLength(0.),
317  fInnerAngle(0.),
318  fOuterAngle(0.),
319  fNInnerWiresPerPad(0),
320  fInnerWWPitch(0.),
321  fInnerDummyWire(0),
322  fInnerOffWire(0.),
323  fRInnerFirstWire(0.),
324  fRInnerLastWire(0.),
325  fLastWireUp1(0.),
326  fNOuter1WiresPerPad(0),
327  fNOuter2WiresPerPad(0),
328  fOuterWWPitch(0.),
329  fOuterDummyWire(0),
330  fOuterOffWire(0),
331  fROuterFirstWire(0.),
332  fROuterLastWire(0),
333  fInnerPadPitchLength(0.),
334  fInnerPadPitchWidth(0.),
335  fInnerPadLength(0.),
336  fInnerPadWidth(0.),
337  fOuter1PadPitchLength(0.),
338  fOuter2PadPitchLength(0),
339  fOuterPadPitchWidth(0),
340  fOuter1PadLength(0.),
341  fOuter2PadLength(0),
342  fOuterPadWidth(0),
343  fNRowLow(0),
344  fNRowUp1(0),
345  fNRowUp2(0),
346  fNRowUp(0),
347  fNtRows(0)
348 
349 {
351 
353  fNSectors[0] = roc.fNSectors[0];
354  fNSectors[1] = roc.fNSectors[1];
355  fNRows[0] = roc.fNRows[0];
356  fNRows[1] = roc.fNRows[1];
357  fNChannels[0]= roc.fNChannels[0];
358  fNChannels[1]= roc.fNChannels[1];
359  //
360  // number of pads in padrow
361  fNPads[0] = new UInt_t[fNRows[0]];
362  fNPads[1] = new UInt_t[fNRows[1]];
363  //
364  // padrow index in array
365  //
366  fRowPosIndex[0] = new UInt_t[fNRows[0]];
367  fRowPosIndex[1] = new UInt_t[fNRows[1]];
368  //
369  for (UInt_t irow =0; irow<fNRows[0];irow++){
370  fNPads[0][irow] = roc.fNPads[0][irow];
371  fRowPosIndex[0][irow] = roc.fRowPosIndex[0][irow];
372  }
373  for (UInt_t irow =0; irow<fNRows[1];irow++){
374  fNPads[1][irow] = roc.fNPads[1][irow];
375  fRowPosIndex[1][irow] = roc.fRowPosIndex[1][irow];
376  }
377 
378  for (UInt_t i=0;i<100;++i){
379  fPadRowLow[i]=roc.fPadRowLow[i];
380  fPadRowUp[i]=roc.fPadRowUp[i];
381  fNPadsLow[i]=roc.fNPadsLow[i];
382  fNPadsUp[i]=roc.fNPadsUp[i];
383  fYInner[i]=roc.fYInner[i];
384  fYOuter[i]=roc.fYOuter[i];
385  }
386 
387 }
388 //____________________________________________________________________________
390 {
392 
393  if (this == &roc) return (*this);
394 
395  fZLength = roc.fZLength;
396  return (*this);
397 }
398 //_____________________________________________________________________________
400 {
402 
403  delete [] fNPads[0];
404  delete [] fNPads[1];
405  delete [] fRowPosIndex[0];
406  delete [] fRowPosIndex[1];
407  fgInstance = 0x0;
408 
409 }
410 
411 
412 
413 
414 void AliTPCROC::GetPositionLocal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos){
416 
417  pos[2]=fZLength;
418  if (sector<36){
419  pos[0] = fPadRowLow[row];
420  pos[1] = fInnerPadPitchWidth*(Int_t(pad)+0.5-Int_t(fNPads[0][row])/2);
421  }else{
422  pos[0] = fPadRowUp[row];
423  pos[1] = fOuterPadPitchWidth*(Int_t(pad)+0.5-Int_t(fNPads[1][row])/2);
424  }
425  if ((sector%36)>=18){
426  pos[2] *= -1.;
427  pos[1] *= -1.;
428  }
429 }
430 
431 
432 void AliTPCROC::GetPositionGlobal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos){
434 
435  GetPositionLocal(sector,row,pad,pos);
436  Double_t alpha = TMath::DegToRad()*(10.+20.*(sector%18));
437  Float_t gx = pos[0]*TMath::Cos(alpha)-pos[1]*TMath::Sin(alpha);
438  Float_t gy = pos[1]*TMath::Cos(alpha)+pos[0]*TMath::Sin(alpha);
439  pos[0] = gx;
440  pos[1] = gy;
441 }
void SetGeometry()
Definition: AliTPCROC.cxx:98
Float_t fOuter2PadPitchLength
Outer pad pitch length.
Definition: AliTPCROC.h:112
UInt_t fNRowUp
number of pad rows per sector up -calculated
Definition: AliTPCROC.h:121
UInt_t GetNPads(UInt_t sector, UInt_t row) const
Definition: AliTPCROC.h:29
UInt_t fNRowUp1
number of short pad rows per sector up -set
Definition: AliTPCROC.h:119
Float_t fInnerAngle
angular coverage
Definition: AliTPCROC.h:84
UInt_t fNSectors[2]
number of sectors - inner outer
Definition: AliTPCROC.h:65
static AliTPCROC * fgInstance
Definition: AliTPCROC.h:130
Float_t fOuterPadPitchWidth
Outer pad pitch width.
Definition: AliTPCROC.h:113
Float_t fOuterAngle
angular coverage
Definition: AliTPCROC.h:85
Float_t fInnerWireMount
space for wire mount, inner sector
Definition: AliTPCROC.h:81
Float_t fOuter2PadLength
Outer pad length.
Definition: AliTPCROC.h:115
UInt_t fNSectorsAll
number of sectors
Definition: AliTPCROC.h:64
UInt_t fNChannels[2]
total number of pads - inner sector - outer sector
Definition: AliTPCROC.h:67
void GetPositionLocal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos)
Definition: AliTPCROC.cxx:414
UInt_t * fRowPosIndex[2]
index array - inner - outer
Definition: AliTPCROC.h:69
UInt_t fNPadsLow[100]
Lower sector, number of pads per row -calculated.
Definition: AliTPCROC.h:125
Float_t fPadRowLow[100]
Lower sector, pad row radii -calculated.
Definition: AliTPCROC.h:123
Float_t fZLength
length of the drift region of the TPC
Definition: AliTPCROC.h:83
Float_t fInnerPadWidth
Inner pad width.
Definition: AliTPCROC.h:110
Float_t fYOuter[100]
Outer sector, wire-length.
Definition: AliTPCROC.h:128
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Float_t fInnerRadiusUp
upper radius of inner sector-IP
Definition: AliTPCROC.h:76
virtual ~AliTPCROC()
Definition: AliTPCROC.cxx:399
Float_t fOuterWireMount
space for wire mount, outer sector
Definition: AliTPCROC.h:82
Float_t fOuterPadWidth
Outer pad width.
Definition: AliTPCROC.h:116
Float_t fOuterRadiusLow
lower radius of outer sector-IP
Definition: AliTPCROC.h:78
void GetPositionGlobal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos)
Definition: AliTPCROC.cxx:432
void Init()
Definition: AliTPCROC.cxx:49
Geometry class for a single ROC.
Definition: AliTPCROC.h:14
Float_t fInnerPadLength
Inner pad length.
Definition: AliTPCROC.h:109
Float_t fOuterFrameSpace
space for outer frame in the phi direction
Definition: AliTPCROC.h:80
Float_t fInnerRadiusLow
lower radius of inner sector-IP
Definition: AliTPCROC.h:75
Float_t fLastWireUp1
position of the last wire in outer1 sector
Definition: AliTPCROC.h:96
Float_t fPadRowUp[100]
Upper sector, pad row radii -calculated.
Definition: AliTPCROC.h:124
AliTPCROC & operator=(const AliTPCROC &roc)
Definition: AliTPCROC.cxx:389
Float_t fInnerFrameSpace
space for inner frame in the phi direction
Definition: AliTPCROC.h:79
Float_t fYInner[100]
Inner sector, wire-length.
Definition: AliTPCROC.h:127
UInt_t fNRows[2]
number of row - inner outer
Definition: AliTPCROC.h:66
UInt_t fNPadsUp[100]
Upper sector, number of pads per row -calculated.
Definition: AliTPCROC.h:126
UInt_t fNRowUp2
number of long pad rows per sector up -set
Definition: AliTPCROC.h:120
Float_t fOuterRadiusUp
upper radius of outer sector-IP
Definition: AliTPCROC.h:77
Float_t fInnerPadPitchWidth
Inner pad pitch width.
Definition: AliTPCROC.h:108
Float_t fOuter1PadPitchLength
Outer pad pitch length.
Definition: AliTPCROC.h:111
UInt_t * fNPads[2]
number of pads in row - inner - outer
Definition: AliTPCROC.h:68
UInt_t fNRowLow
number of pad rows per low sector -set
Definition: AliTPCROC.h:118
Float_t fInnerPadPitchLength
Inner pad pitch length.
Definition: AliTPCROC.h:107
Float_t fOuter1PadLength
Outer pad length.
Definition: AliTPCROC.h:114