]>
Commit | Line | Data |
---|---|---|
2e5f0f7b | 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$ | |
2d857021 | 18 | Revision 1.12 2001/09/07 08:38:10 hristov |
19 | Pointers initialised to 0 in the default constructors | |
20 | ||
edf34242 | 21 | Revision 1.11 2001/05/10 12:35:39 jbarbosa |
22 | Update. | |
23 | ||
b577b475 | 24 | Revision 1.10 2001/02/23 17:21:17 jbarbosa |
25 | Re-definition of IntPH() to accomodate for wire sag effect. | |
26 | ||
733b4fa4 | 27 | Revision 1.9 2001/02/13 20:15:34 jbarbosa |
28 | Removed fNsec (number of cathodes - obsolete) related loops and calls. | |
29 | ||
f73582a8 | 30 | Revision 1.8 2000/12/18 17:45:43 jbarbosa |
31 | Cleaned up PadHits object. | |
32 | ||
176a9917 | 33 | Revision 1.7 2000/10/03 21:44:09 morsch |
34 | Use AliSegmentation and AliHit abstract base classes. | |
35 | ||
a2f7eaf6 | 36 | Revision 1.6 2000/10/02 15:44:37 jbarbosa |
37 | Fixed forward declarations. | |
38 | ||
488e98ba | 39 | Revision 1.5 2000/07/13 16:19:45 fca |
40 | Mainly coding conventions + some small bug fixes | |
41 | ||
ef42d733 | 42 | Revision 1.4 2000/06/30 16:48:58 dibari |
43 | New function GenerateTresholds() for pedestal simulation. | |
44 | ||
4faf338d | 45 | Revision 1.3 2000/06/12 15:17:58 jbarbosa |
46 | Cleaned up version. | |
47 | ||
237c933d | 48 | Revision 1.2 2000/05/18 13:45:57 jbarbosa |
49 | Fixed feedback photon origin coordinates | |
50 | ||
64cdfc12 | 51 | Revision 1.1 2000/04/19 12:57:20 morsch |
52 | Newly structured and updated version (JB, AM) | |
53 | ||
2e5f0f7b | 54 | */ |
55 | ||
56 | ||
57 | #include "AliRICHChamber.h" | |
237c933d | 58 | |
2e5f0f7b | 59 | #include <TLorentzVector.h> |
60 | #include <TParticle.h> | |
61 | #include <TRandom.h> | |
488e98ba | 62 | #include <TObjArray.h> |
63 | #include <TRotMatrix.h> | |
64 | #include <AliRICHTresholdMap.h> | |
a2f7eaf6 | 65 | #include <AliSegmentation.h> |
733b4fa4 | 66 | #include <AliRICHSegmentationV0.h> |
488e98ba | 67 | #include <AliRICHGeometry.h> |
68 | #include <AliRICHResponse.h> | |
2e5f0f7b | 69 | |
70 | ClassImp(AliRICHChamber) | |
71 | ||
72 | AliRICHChamber::AliRICHChamber() | |
73 | { | |
237c933d | 74 | |
75 | // | |
76 | // Chamber object constructor | |
77 | ||
2d857021 | 78 | fpRotMatrix = 0; |
2e5f0f7b | 79 | fSegmentation = 0; |
4faf338d | 80 | fResponse = 0; |
81 | fGeometry = 0; | |
edf34242 | 82 | fReconstruction = 0; |
4faf338d | 83 | fTresh = 0; |
84 | frMin = 0.1; | |
85 | frMax = 140; | |
ef42d733 | 86 | for(Int_t i=0; i<50; ++i) fIndexMap[i] = 0; |
2e5f0f7b | 87 | } |
88 | ||
237c933d | 89 | AliRICHChamber::AliRICHChamber(const AliRICHChamber& Chamber) |
90 | { | |
91 | // Copy Constructor | |
92 | } | |
93 | ||
94 | ||
2e5f0f7b | 95 | AliRICHResponse* AliRICHChamber::GetResponseModel() |
96 | { | |
237c933d | 97 | // |
98 | // Get reference to response model | |
2e5f0f7b | 99 | return fResponse; |
100 | } | |
101 | ||
2e5f0f7b | 102 | void AliRICHChamber::ResponseModel(AliRICHResponse* thisResponse) |
103 | { | |
237c933d | 104 | // Configure response model |
2e5f0f7b | 105 | fResponse=thisResponse; |
106 | } | |
107 | ||
a2f7eaf6 | 108 | void AliRICHChamber::Init(Int_t id) |
2e5f0f7b | 109 | { |
237c933d | 110 | // Initialise chambers |
a2f7eaf6 | 111 | fSegmentation->Init(id); |
2e5f0f7b | 112 | } |
113 | ||
114 | void AliRICHChamber::LocaltoGlobal(Float_t pos[3],Float_t Globalpos[3]) | |
115 | { | |
116 | ||
237c933d | 117 | // Local coordinates to global coordinates transformation |
118 | ||
2d857021 | 119 | Double_t *pMatrix; |
120 | pMatrix = fpRotMatrix->GetMatrix(); | |
121 | Globalpos[0]=pos[0]*pMatrix[0]+pos[1]*pMatrix[3]+pos[2]*pMatrix[6]; | |
122 | Globalpos[1]=pos[0]*pMatrix[1]+pos[1]*pMatrix[4]+pos[2]*pMatrix[7]; | |
123 | Globalpos[2]=pos[0]*pMatrix[2]+pos[1]*pMatrix[5]+pos[2]*pMatrix[8]; | |
124 | Globalpos[0]+=fX; | |
125 | Globalpos[1]+=fY; | |
126 | Globalpos[2]+=fZ; | |
2e5f0f7b | 127 | } |
128 | ||
129 | void AliRICHChamber::GlobaltoLocal(Float_t pos[3],Float_t Localpos[3]) | |
130 | { | |
2d857021 | 131 | // |
237c933d | 132 | // Global coordinates to local coordinates transformation |
2d857021 | 133 | // |
134 | TMatrix matrixCopy(3,3); | |
135 | Double_t *pMatrixOrig = fpRotMatrix->GetMatrix(); | |
2e5f0f7b | 136 | for(Int_t i=0;i<3;i++) |
137 | { | |
138 | for(Int_t j=0;j<3;j++) | |
2d857021 | 139 | matrixCopy(j,i)=pMatrixOrig[j+3*i]; |
2e5f0f7b | 140 | } |
2d857021 | 141 | matrixCopy.Invert(); |
142 | Localpos[0] = pos[0] - fX; | |
143 | Localpos[1] = pos[1] - fY; | |
144 | Localpos[2] = pos[2] - fZ; | |
145 | Localpos[0]=Localpos[0]*matrixCopy(0,0)+Localpos[1]*matrixCopy(0,1)+Localpos[2]*matrixCopy(0,2); | |
146 | Localpos[1]=Localpos[0]*matrixCopy(1,0)+Localpos[1]*matrixCopy(1,1)+Localpos[2]*matrixCopy(1,2); | |
147 | Localpos[2]=Localpos[0]*matrixCopy(2,0)+Localpos[1]*matrixCopy(2,1)+Localpos[2]*matrixCopy(2,2); | |
2e5f0f7b | 148 | } |
149 | ||
150 | ||
151 | void AliRICHChamber::DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit, | |
176a9917 | 152 | Int_t& nnew,Float_t newclust[5][500],ResponseType res) |
2e5f0f7b | 153 | { |
154 | // | |
155 | // Generates pad hits (simulated cluster) | |
156 | // using the segmentation and the response model | |
157 | ||
158 | Float_t dx, dy; | |
159 | Float_t local[3]; | |
160 | //Float_t source[3]; | |
161 | Float_t global[3]; | |
162 | // | |
163 | // Width of the integration area | |
164 | // | |
165 | dx=(fResponse->SigmaIntegration())*(fResponse->ChargeSpreadX()); | |
166 | dy=(fResponse->SigmaIntegration())*(fResponse->ChargeSpreadY()); | |
167 | // | |
168 | // Get pulse height from energy loss and generate feedback photons | |
169 | Float_t qtot=0; | |
170 | ||
171 | local[0]=xhit; | |
172 | // z-position of the wires relative to the RICH mother volume | |
173 | // (2 mmm before CsI) old value: 6.076 | |
64cdfc12 | 174 | local[1]=1.276 + fGeometry->GetGapThickness()/2 - .2; |
2e5f0f7b | 175 | //printf("AliRICHChamber feedback origin:%f",local[1]); |
176 | local[2]=yhit; | |
177 | ||
178 | LocaltoGlobal(local,global); | |
179 | ||
237c933d | 180 | Int_t nFp=0; |
2e5f0f7b | 181 | |
733b4fa4 | 182 | |
183 | // To calculate wire sag, the origin of y-position must be the middle of the photcathode | |
184 | AliRICHSegmentationV0* segmentation = (AliRICHSegmentationV0*) GetSegmentationModel(); | |
185 | Float_t newy; | |
186 | if (yhit>0) | |
187 | newy = yhit - segmentation->GetPadPlaneLength()/2; | |
188 | else | |
189 | newy = yhit + segmentation->GetPadPlaneLength()/2; | |
190 | ||
237c933d | 191 | if (res==kMip) { |
733b4fa4 | 192 | qtot = fResponse->IntPH(eloss, newy); |
237c933d | 193 | nFp = fResponse->FeedBackPhotons(global,qtot); |
b577b475 | 194 | //printf("feedbacks:%d\n",nFp); |
237c933d | 195 | } else if (res==kCerenkov) { |
733b4fa4 | 196 | qtot = fResponse->IntPH(newy); |
237c933d | 197 | nFp = fResponse->FeedBackPhotons(global,qtot); |
b577b475 | 198 | //printf("feedbacks:%d\n",nFp); |
2e5f0f7b | 199 | } |
200 | ||
237c933d | 201 | //printf("Feedbacks:%d\n",nFp); |
2e5f0f7b | 202 | |
203 | // | |
204 | // Loop Over Pads | |
205 | ||
206 | Float_t qcheck=0, qp=0; | |
207 | ||
208 | nnew=0; | |
f73582a8 | 209 | for (fSegmentation->FirstPad(xhit, yhit, 0, dx, dy); |
210 | fSegmentation->MorePads(); | |
211 | fSegmentation->NextPad()) | |
212 | { | |
213 | qp= fResponse->IntXY(fSegmentation); | |
214 | qp= TMath::Abs(qp); | |
215 | ||
733b4fa4 | 216 | //printf("Qp:%f Qtot %f\n",qp,qtot); |
f73582a8 | 217 | |
218 | if (qp > 1.e-4) { | |
219 | qcheck+=qp; | |
220 | // | |
221 | // --- store signal information | |
222 | newclust[0][nnew]=qp*qtot; | |
223 | newclust[1][nnew]=fSegmentation->Ix(); | |
224 | newclust[2][nnew]=fSegmentation->Iy(); | |
225 | newclust[3][nnew]=fSegmentation->ISector(); | |
226 | nnew++; | |
227 | //printf("Newcluster:%d\n",i); | |
228 | } | |
229 | } // Pad loop | |
2e5f0f7b | 230 | //if (fSegmentation->ISector()==2) |
231 | //printf("Nnew:%d\n\n\n\n",nnew); | |
232 | } | |
233 | ||
234 | ||
237c933d | 235 | AliRICHChamber& AliRICHChamber::operator=(const AliRICHChamber& rhs) |
236 | { | |
237 | // Assignment operator | |
238 | return *this; | |
239 | ||
240 | } | |
2e5f0f7b | 241 | |
242 | ||
4faf338d | 243 | void AliRICHChamber::GenerateTresholds() |
244 | { | |
245 | ||
246 | // Generates random treshold charges for all pads | |
247 | ||
248 | //printf("Pads : %dx%d\n",fSegmentation->Npx(),fSegmentation->Npy()); | |
249 | ||
250 | Int_t nx = fSegmentation->Npx(); | |
251 | Int_t ny = fSegmentation->Npy(); | |
252 | ||
253 | //Int_t size=nx*ny; | |
254 | ||
255 | //printf("Size:%d\n",size); | |
256 | ||
257 | fTresh = new AliRICHTresholdMap(fSegmentation); | |
258 | ||
259 | //printf("Generating tresholds...\n"); | |
260 | ||
261 | for(Int_t i=-nx/2;i<nx/2;i++) | |
262 | { | |
263 | for(Int_t j=-ny/2;j<ny/2;j++) | |
264 | { | |
265 | Int_t pedestal = (Int_t)(gRandom->Gaus(50, 10)); | |
266 | //Int_t pedestal =0; | |
267 | fTresh->SetHit(i,j,pedestal); | |
268 | //printf("Pad %d %d has pedestal %d.\n",i,j,pedestal); | |
269 | } | |
270 | } | |
271 | ||
272 | } |