1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 /// \brief Geometry class for a single ROC
20 #include "AliTPCROC.h"
28 AliTPCROC* AliTPCROC::fgInstance = 0;
33 //_ singleton implementation __________________________________________________
34 AliTPCROC* AliTPCROC::Instance()
36 /// Singleton implementation
37 /// Returns an instance of this class, it is created if neccessary
40 fgInstance = new AliTPCROC();
49 void AliTPCROC::Init(){
50 /// initialize static variables
52 if (AliTPCROC::fNSectorsAll>0) return;
60 // number of pads in padrow
61 fNPads[0] = new UInt_t[fNRows[0]];
62 fNPads[1] = new UInt_t[fNRows[1]];
64 // padrow index in array
66 fRowPosIndex[0] = new UInt_t[fNRows[0]];
67 fRowPosIndex[1] = new UInt_t[fNRows[1]];
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;
78 fNChannels[0] = index;
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;
91 fNChannels[1] = index;
98 void AliTPCROC::SetGeometry()
100 /// set ROC geometry parameters
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
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;
132 //wires default parameters
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;
148 //set sector parameters
150 fInnerRadiusLow = kInnerRadiusLow;
151 fOuterRadiusLow = kOuterRadiusLow;
152 fInnerRadiusUp = kInnerRadiusUp;
153 fOuterRadiusUp = kOuterRadiusUp;
154 fInnerFrameSpace = kInnerFrameSpace;
155 fOuterFrameSpace = kOuterFrameSpace;
156 fInnerWireMount = kInnerWireMount;
157 fOuterWireMount = kOuterWireMount;
159 fInnerAngle = TMath::DegToRad()*kInnerAngle;
160 fOuterAngle = TMath::DegToRad()*kOuterAngle;
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;
181 //set wire parameters
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);
198 Float_t firstrow = fInnerRadiusLow + 1.575;
199 for( i= 0;i<fNRowLow;i++)
201 Float_t x = firstrow + fInnerPadPitchLength*(Float_t)i;
203 fYInner[i+1] = x*TMath::Tan(fInnerAngle/2.)-fInnerWireMount;
204 fNPadsLow[i] = GetNPads(0,i) ; // ROC implement
207 fYInner[0]=(fPadRowLow[0]-fInnerPadPitchLength)*TMath::Tan(fInnerAngle/2.)-fInnerWireMount;
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++)
213 Float_t x = firstrow + fOuter1PadPitchLength*(Float_t)i;
215 fYOuter[i+1]= x*TMath::Tan(fOuterAngle/2.)-fOuterWireMount;
216 fNPadsUp[i] = GetNPads(36,i) ; // ROC implement
218 fLastWireUp1=fPadRowUp[i] +0.625;
219 firstrow = fPadRowUp[i] + 0.5*(fOuter1PadPitchLength+fOuter2PadPitchLength);
224 Float_t x = firstrow + fOuter2PadPitchLength*(Float_t)(i-64);
226 fNPadsUp[i] = GetNPads(36,i) ; // ROC implement
228 fYOuter[i+1] = fPadRowUp[i]*TMath::Tan(fOuterAngle/2.)-fOuterWireMount;
238 //_____________________________________________________________________________
239 AliTPCROC::AliTPCROC()
246 fInnerFrameSpace(0.),
247 fOuterFrameSpace(0.),
253 fNInnerWiresPerPad(0),
257 fRInnerFirstWire(0.),
260 fNOuter1WiresPerPad(0),
261 fNOuter2WiresPerPad(0),
265 fROuterFirstWire(0.),
267 fInnerPadPitchLength(0.),
268 fInnerPadPitchWidth(0.),
271 fOuter1PadPitchLength(0.),
272 fOuter2PadPitchLength(0),
273 fOuterPadPitchWidth(0),
274 fOuter1PadLength(0.),
283 /// Default constructor
285 for (UInt_t i=0;i<2;i++){
293 for (UInt_t i=0;i<100;++i){
304 //_____________________________________________________________________________
305 AliTPCROC::AliTPCROC(const AliTPCROC &roc)
312 fInnerFrameSpace(0.),
313 fOuterFrameSpace(0.),
319 fNInnerWiresPerPad(0),
323 fRInnerFirstWire(0.),
326 fNOuter1WiresPerPad(0),
327 fNOuter2WiresPerPad(0),
331 fROuterFirstWire(0.),
333 fInnerPadPitchLength(0.),
334 fInnerPadPitchWidth(0.),
337 fOuter1PadPitchLength(0.),
338 fOuter2PadPitchLength(0),
339 fOuterPadPitchWidth(0),
340 fOuter1PadLength(0.),
350 /// AliTPCROC copy constructor
352 fNSectorsAll = roc.fNSectorsAll;
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];
360 // number of pads in padrow
361 fNPads[0] = new UInt_t[fNRows[0]];
362 fNPads[1] = new UInt_t[fNRows[1]];
364 // padrow index in array
366 fRowPosIndex[0] = new UInt_t[fNRows[0]];
367 fRowPosIndex[1] = new UInt_t[fNRows[1]];
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];
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];
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];
388 //____________________________________________________________________________
389 AliTPCROC & AliTPCROC::operator =(const AliTPCROC & roc)
391 /// assignment operator - dummy
393 if (this == &roc) return (*this);
395 fZLength = roc.fZLength;
398 //_____________________________________________________________________________
399 AliTPCROC::~AliTPCROC()
401 /// AliTPCROC destructor
405 delete [] fRowPosIndex[0];
406 delete [] fRowPosIndex[1];
414 void AliTPCROC::GetPositionLocal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos){
415 /// get position of center of pad - ideal frame used
419 pos[0] = fPadRowLow[row];
420 pos[1] = fInnerPadPitchWidth*(Int_t(pad)+0.5-Int_t(fNPads[0][row])/2);
422 pos[0] = fPadRowUp[row];
423 pos[1] = fOuterPadPitchWidth*(Int_t(pad)+0.5-Int_t(fNPads[1][row])/2);
425 if ((sector%36)>=18){
432 void AliTPCROC::GetPositionGlobal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos){
433 /// get position of center of pad - ideal frame used
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);