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 Revision 1.6 2002/03/18 17:59:13 kowal2
19 Chnges in the pad geometry - 3 pad lengths introduced.
21 Revision 1.5 2001/01/26 19:57:22 hristov
22 Major upgrade of AliRoot code
24 Revision 1.4 2000/11/02 07:33:15 kowal2
25 Improvements of the code.
27 Revision 1.3 2000/06/30 12:07:50 kowal2
28 Updated from the TPC-PreRelease branch
30 Revision 1.2.4.1 2000/06/14 16:48:24 kowal2
31 Parameter setting improved. Removed compiler warnings
33 Revision 1.2 2000/04/17 09:37:33 kowal2
34 removed obsolete AliTPCDigitsDisplay.C
36 Revision 1.1.4.2 2000/04/10 11:36:13 kowal2
38 New Detector parameters handling class
42 ///////////////////////////////////////////////////////////////////////
43 // Manager and of geomety classes for set: TPC //
45 // !sectors are numbered from 0 //
46 // !pad rows are numbered from 0 //
48 // 27.7. - AliTPCPaaramSr object for TPC
49 // TPC with straight pad rows
50 // Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
52 ///////////////////////////////////////////////////////////////////////
55 #include <Riostream.h>
58 #include <AliTPCParamCR.h>
59 #include "AliTPCPRF2D.h"
60 #include "AliTPCRF1D.h"
64 ClassImp(AliTPCParamCR)
65 const static Int_t kMaxRows=600;
66 const static Float_t kEdgeSectorSpace = 2.5;
68 AliTPCParamCR::AliTPCParamCR()
71 //constructor set the default parameters
76 fFacSigma = Float_t(2.);
81 AliTPCParamCR::~AliTPCParamCR()
84 //destructor destroy some dynmicaly alocated variables
85 if (fInnerPRF != 0) delete fInnerPRF;
86 if (fOuter1PRF != 0) delete fOuter1PRF;
87 if (fOuter2PRF != 0) delete fOuter2PRF;
88 if (fTimeRF != 0) delete fTimeRF;
91 void AliTPCParamCR::SetDefault()
93 //set default TPC param
95 AliTPCParam::SetDefault();
98 Int_t AliTPCParamCR::CalcResponse(Float_t* xyz, Int_t * index, Int_t dummy)
101 //calculate bin response as function of the input position -x
102 //return number of valid response bin
104 //we suppose that coordinata is expressed in float digits
105 // it's mean coordinate system 8
106 //xyz[0] - float padrow xyz[1] is float pad (center pad is number 0) and xyz[2] is float time bin
107 if ( (fInnerPRF==0)||(fOuter1PRF==0) ||(fOuter2PRF==0)||(fTimeRF==0) ){
108 Error("AliTPCParamCR", "response function were not adjusted");
112 Float_t sfpadrow; // sigma of response function
113 Float_t sfpad; // sigma of
114 Float_t sftime= fFacSigma*fTimeRF->GetSigma()/fZWidth; //3 sigma of time response
115 if (index[1]<fNInnerSector){
116 sfpadrow =fFacSigma*fInnerPRF->GetSigmaY()/fInnerPadPitchLength;
117 sfpad =fFacSigma*fInnerPRF->GetSigmaX()/fInnerPadPitchWidth;
119 if(index[2]<fNRowUp1){
120 sfpadrow =fFacSigma*fOuter1PRF->GetSigmaY()/fOuter1PadPitchLength;
121 sfpad =fFacSigma*fOuter1PRF->GetSigmaX()/fOuterPadPitchWidth;}
122 else{ sfpadrow =fFacSigma*fOuter2PRF->GetSigmaY()/fOuter2PadPitchLength;
123 sfpad =fFacSigma*fOuter2PRF->GetSigmaX()/fOuterPadPitchWidth;}
126 Int_t fpadrow = TMath::Nint(xyz[0]-sfpadrow); //"first" padrow
127 Int_t fpad = TMath::Nint(xyz[1]-sfpad); //first pad
128 Int_t ftime = TMath::Nint(xyz[2]+fTimeRF->GetOffset()-sftime); // first time
129 Int_t lpadrow = TMath::Min(TMath::Nint(xyz[0]+sfpadrow),fpadrow+19); //"last" padrow
130 Int_t lpad = TMath::Min(TMath::Nint(xyz[1]+sfpad),fpad+19); //last pad
131 Int_t ltime = TMath::Min(TMath::Nint(xyz[2]+fTimeRF->GetOffset()+sftime),ftime+19); // last time
133 Float_t padres[20][20]; //I don't expect bigger number of bins
135 //calculate padresponse function
137 for (padrow = fpadrow;padrow<=lpadrow;padrow++)
138 for (Int_t pad = fpad;pad<=lpad;pad++){
139 Float_t dy = (xyz[0]-Float_t(padrow));
140 Float_t dx = (xyz[1]-Float_t(pad));
141 if (index[1]<fNInnerSector)
142 padres[padrow-fpadrow][pad-fpad]=fInnerPRF->GetPRF(dx*fInnerPadPitchWidth,dy*fInnerPadPitchLength);
144 if(index[2]<fNRowUp1){
145 padres[padrow-fpadrow][pad-fpad]=fOuter1PRF->GetPRF(dx*fOuterPadPitchWidth,dy*fOuter1PadPitchLength);}
146 else{ padres[padrow-fpadrow][pad-fpad]=fOuter2PRF->GetPRF(dx*fOuterPadPitchWidth,dy*fOuter2PadPitchLength);}}}
148 //calculate time response function
151 for (time = ftime;time<=ltime;time++) timeres[time-ftime]= fTimeRF->GetRF((xyz[2]-Float_t(time))*fZWidth);
153 //write over threshold values to stack
157 for (padrow = fpadrow;padrow<=lpadrow;padrow++)
158 for (Int_t pad = fpad;pad<=lpad;pad++)
159 for (time = ftime;time<=ltime;time++){
160 cweight = timeres[time-ftime]*padres[padrow-fpadrow][pad-fpad];
161 if (cweight>fResponseThreshold) {
162 fResponseBin[++cindex3]=padrow;
163 fResponseBin[++cindex3]=pad;
164 fResponseBin[++cindex3]=time;
165 fResponseWeight[++cindex]=cweight;
172 void AliTPCParamCR::CRXYZtoXYZ(Float_t *xyz,
173 const Int_t §or, const Int_t & padrow, Int_t option) const
175 //transform relative coordinates to absolute
176 Bool_t rel = ( (option&2)!=0);
177 Int_t index[2]={sector,padrow};
178 if (rel==kTRUE) Transform4to3(xyz,index);//if the position is relative to pad row
179 Transform2to1(xyz,index);
182 void AliTPCParamCR::XYZtoCRXYZ(Float_t *xyz,
183 Int_t §or, Int_t & padrow, Int_t option) const
185 //transform global position to the position relative to the sector padrow
186 //if option=0 X calculate absolute calculate sector
187 //if option=1 X absolute use input sector
188 //if option=2 X relative to pad row calculate sector
189 //if option=3 X relative use input sector
190 //!!!!!!!!! WE start to calculate rows from row = 0
192 Bool_t rel = ( (option&2)!=0);
194 //option 0 and 2 means that we don't have information about sector
195 if ((option&1)==0) Transform0to1(xyz,index); //we calculate sector number
198 Transform1to2(xyz,index);
199 Transform2to3(xyz,index);
200 //if we store relative position calculate position relative to pad row
201 if (rel==kTRUE) Transform3to4(xyz,index);
208 Bool_t AliTPCParamCR::Update()
211 if (AliTPCParam::Update()==kFALSE) return kFALSE;
214 Float_t firstrow = fInnerRadiusLow + 2.225 ;
215 for( i= 0;i<fNRowLow;i++)
217 Float_t x = firstrow + fInnerPadPitchLength*(Float_t)i;
219 // number of pads per row
220 /*Float_t y = (x-0.5*fInnerPadPitchLength)*tan(fInnerAngle/2.)-fInnerWireMount-
221 fInnerPadPitchWidth/2.;*/
222 Float_t y = x*tan(fInnerAngle/2.)-fInnerWireMount;
224 fNPadsLow[i] = 1+2*(Int_t)(y/fInnerPadPitchWidth) ;
227 firstrow = fOuterRadiusLow + 1.6;
228 for(i=0;i<fNRowUp;i++)
231 Float_t x = firstrow + fOuter1PadPitchLength*(Float_t)i;
233 /*Float_t y =(x-0.5*fOuter1PadPitchLength)*tan(fOuterAngle/2.)-fOuterWireMount-
234 fOuterPadPitchWidth/2.;*/
235 Float_t y = x*tan(fInnerAngle/2.)-fInnerWireMount;
236 fNPadsUp[i] = 1+2*(Int_t)(y/fOuterPadPitchWidth) ;
239 fLastWireUp1=fPadRowUp[i] +0.375;
240 firstrow = fPadRowUp[i] + 0.5*(fOuter1PadPitchLength+fOuter2PadPitchLength);
245 Float_t x = firstrow + fOuter2PadPitchLength*(Float_t)(i-64);
246 /*Float_t y =(x-0.5*fOuter2PadPitchLength)*tan(fOuterAngle/2.)-fOuterWireMount-
247 fOuterPadPitchWidth/2.;*/
248 Float_t y = x*tan(fInnerAngle/2.)-fInnerWireMount;
249 fNPadsUp[i] = 1+2*(Int_t)(y/fOuterPadPitchWidth) ;
254 fNtRows = fNInnerSector*fNRowLow+fNOuterSector*fNRowUp;
261 void AliTPCParamCR::Streamer(TBuffer &R__b)
263 // Stream an object of class AliTPC.
265 if (R__b.IsReading()) {
266 AliTPCParamCR::Class()->ReadBuffer(R__b, this);
269 AliTPCParamCR::Class()->WriteBuffer(R__b, this);