]>
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 | ||
2e5f0f7b | 16 | #include "AliRICHChamber.h" |
a277aaca | 17 | #include "AliRICHConst.h" //for kR2d |
853634d3 | 18 | #include "AliRICHParam.h" |
2e5f0f7b | 19 | #include <TRandom.h> |
488e98ba | 20 | #include <TRotMatrix.h> |
853634d3 | 21 | #include "AliRICHTresholdMap.h" |
22 | #include "AliSegmentation.h" | |
23 | #include "AliRICHSegmentationV0.h" | |
24 | #include "AliRICHGeometry.h" | |
25 | #include "AliRICHResponse.h" | |
2e5f0f7b | 26 | |
27 | ClassImp(AliRICHChamber) | |
853634d3 | 28 | //______________________________________________________________________________ |
2e5f0f7b | 29 | AliRICHChamber::AliRICHChamber() |
853634d3 | 30 | {//default ctor |
31 | fpParam=0; | |
32 | fpRotMatrix=0; | |
33 | ||
2e5f0f7b | 34 | fSegmentation = 0; |
4faf338d | 35 | fResponse = 0; |
36 | fGeometry = 0; | |
edf34242 | 37 | fReconstruction = 0; |
4faf338d | 38 | fTresh = 0; |
ef42d733 | 39 | for(Int_t i=0; i<50; ++i) fIndexMap[i] = 0; |
2e5f0f7b | 40 | } |
853634d3 | 41 | //______________________________________________________________________________ |
42 | AliRICHChamber::AliRICHChamber(Int_t iModuleN,AliRICHParam *pParam) | |
43 | {//named ctor. Defines all geometry parameters for the given module. | |
3ea9cb08 | 44 | // 6 7 |----> X |
45 | // 3 4 5 | | |
46 | // 1 2 V Z | |
47 | SetCenter(0,pParam->Offset()-pParam->GapThickness()/2,0);//put to up position | |
853634d3 | 48 | switch(iModuleN){ |
853634d3 | 49 | case 1: |
0ffe413c | 50 | RotateX(-pParam->AngleYZ()); |
3ea9cb08 | 51 | RotateZ(-pParam->AngleXY()); |
853634d3 | 52 | fName="RICHc1";fTitle="RICH chamber 1"; |
53 | break; | |
54 | case 2: | |
3ea9cb08 | 55 | RotateZ(-pParam->AngleXY()); |
853634d3 | 56 | fName="RICHc2";fTitle="RICH chamber 2"; |
57 | break; | |
58 | case 3: | |
3ea9cb08 | 59 | RotateX(-pParam->AngleYZ()); |
853634d3 | 60 | fName="RICHc3";fTitle="RICH chamber 3"; |
61 | break; | |
3ea9cb08 | 62 | case 4: |
63 | fName="RICHc4";fTitle="RICH chamber 4"; //no turns | |
853634d3 | 64 | break; |
65 | case 5: | |
3ea9cb08 | 66 | RotateX(pParam->AngleYZ()); |
853634d3 | 67 | fName="RICHc5";fTitle="RICH chamber 5"; |
68 | break; | |
69 | case 6: | |
3ea9cb08 | 70 | RotateZ(pParam->AngleXY()); |
853634d3 | 71 | fName="RICHc6";fTitle="RICH chamber 6"; |
72 | break; | |
3ea9cb08 | 73 | case 7: |
74 | RotateX(pParam->AngleYZ()); | |
75 | RotateZ(pParam->AngleXY()); | |
76 | fName="RICHc7";fTitle="RICH chamber 7"; | |
77 | break; | |
853634d3 | 78 | default: |
79 | Fatal("named ctor","Wrong chamber number %i, check muster class ctor",iModuleN); | |
80 | }//switch(iModuleN) | |
81 | RotateZ(pParam->AngleRot());//apply common rotation | |
a277aaca | 82 | fpRotMatrix=new TRotMatrix("rot"+fName,"rot"+fName, Rot().ThetaX()*kR2d, Rot().PhiX()*kR2d, |
83 | Rot().ThetaY()*kR2d, Rot().PhiY()*kR2d, | |
84 | Rot().ThetaZ()*kR2d, Rot().PhiZ()*kR2d); | |
853634d3 | 85 | fpParam=pParam; |
c60862bf | 86 | fX=fCenterV3.X();fY=fCenterV3.Y();fZ=fCenterV3.Z(); |
853634d3 | 87 | } |
88 | //______________________________________________________________________________ | |
2e5f0f7b | 89 | |
0ffe413c | 90 | void AliRICHChamber::LocaltoGlobal(Float_t local[3],Float_t global[3]) |
853634d3 | 91 | {//Local coordinates to global coordinates transformation |
237c933d | 92 | |
2d857021 | 93 | Double_t *pMatrix; |
94 | pMatrix = fpRotMatrix->GetMatrix(); | |
0ffe413c | 95 | global[0]=local[0]*pMatrix[0]+local[1]*pMatrix[3]+local[2]*pMatrix[6]; |
96 | global[1]=local[0]*pMatrix[1]+local[1]*pMatrix[4]+local[2]*pMatrix[7]; | |
97 | global[2]=local[0]*pMatrix[2]+local[1]*pMatrix[5]+local[2]*pMatrix[8]; | |
98 | global[0]+=fX; | |
99 | global[1]+=fY; | |
100 | global[2]+=fZ; | |
2e5f0f7b | 101 | } |
102 | ||
0ffe413c | 103 | void AliRICHChamber::GlobaltoLocal(Float_t global[3],Float_t local[3]) |
853634d3 | 104 | {// Global coordinates to local coordinates transformation |
2d857021 | 105 | TMatrix matrixCopy(3,3); |
106 | Double_t *pMatrixOrig = fpRotMatrix->GetMatrix(); | |
2e5f0f7b | 107 | for(Int_t i=0;i<3;i++) |
108 | { | |
109 | for(Int_t j=0;j<3;j++) | |
2d857021 | 110 | matrixCopy(j,i)=pMatrixOrig[j+3*i]; |
2e5f0f7b | 111 | } |
2d857021 | 112 | matrixCopy.Invert(); |
0ffe413c | 113 | local[0] = global[0] - fX; |
114 | local[1] = global[1] - fY; | |
115 | local[2] = global[2] - fZ; | |
116 | local[0]=local[0]*matrixCopy(0,0)+local[1]*matrixCopy(0,1)+local[2]*matrixCopy(0,2); | |
117 | local[1]=local[0]*matrixCopy(1,0)+local[1]*matrixCopy(1,1)+local[2]*matrixCopy(1,2); | |
118 | local[2]=local[0]*matrixCopy(2,0)+local[1]*matrixCopy(2,1)+local[2]*matrixCopy(2,2); | |
2e5f0f7b | 119 | } |
120 | ||
2e5f0f7b | 121 | void AliRICHChamber::DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit, |
3ea9cb08 | 122 | Int_t& iNpads,Float_t cluster[5][500],ResponseType res) |
123 | {//Generates pad hits (simulated cluster) using the segmentation and the response model | |
0ffe413c | 124 | |
125 | Float_t local[3],global[3]; | |
3ea9cb08 | 126 | // Width of the integration area |
127 | Float_t dx=(fResponse->SigmaIntegration())*(fResponse->ChargeSpreadX()); | |
128 | Float_t dy=(fResponse->SigmaIntegration())*(fResponse->ChargeSpreadY()); | |
129 | // Get pulse height from energy loss and generate feedback photons | |
130 | Float_t qtot=0; | |
131 | local[0]=xhit; | |
132 | //z-position of the wires relative to the RICH mother volume (2 mm before CsI) old value: 6.076 ??????? | |
133 | local[1]=1.276 + fGeometry->GetGapThickness()/2 - .2; | |
134 | local[2]=yhit; | |
2e5f0f7b | 135 | |
3ea9cb08 | 136 | LocaltoGlobal(local,global); |
2e5f0f7b | 137 | |
0ffe413c | 138 | |
139 | ||
3ea9cb08 | 140 | //To calculate wire sag, the origin of y-position must be the middle of the photcathode |
141 | AliRICHSegmentationV0* segmentation = (AliRICHSegmentationV0*) GetSegmentationModel(); | |
142 | Float_t newy; | |
143 | if (yhit>0) | |
144 | newy = yhit - segmentation->GetPadPlaneLength()/2; | |
145 | else | |
146 | newy = yhit + segmentation->GetPadPlaneLength()/2; | |
0ffe413c | 147 | |
3ea9cb08 | 148 | if(res==kMip){ |
149 | qtot = fResponse->IntPH(eloss, newy); | |
0ffe413c | 150 | fResponse->FeedBackPhotons(global,qtot); |
151 | }else if(res==kPhoton){ | |
3ea9cb08 | 152 | qtot = fResponse->IntPH(newy); |
0ffe413c | 153 | fResponse->FeedBackPhotons(global,qtot); |
3ea9cb08 | 154 | } |
2e5f0f7b | 155 | |
2e5f0f7b | 156 | // Loop Over Pads |
0ffe413c | 157 | |
3ea9cb08 | 158 | Float_t qcheck=0, qp=0; |
0ffe413c | 159 | |
3ea9cb08 | 160 | iNpads=0; |
0ffe413c | 161 | for(fSegmentation->FirstPad(xhit, yhit, 0, dx, dy); |
162 | fSegmentation->MorePads(); | |
3ea9cb08 | 163 | fSegmentation->NextPad()) { |
164 | qp= fResponse->IntXY(fSegmentation); | |
165 | qp= TMath::Abs(qp); | |
166 | if(qp >1.e-4){ | |
167 | qcheck+=qp; | |
168 | cluster[0][iNpads]=qp*qtot;// --- store signal information | |
169 | cluster[1][iNpads]=fSegmentation->Ix(); | |
170 | cluster[2][iNpads]=fSegmentation->Iy(); | |
171 | cluster[3][iNpads]=fSegmentation->ISector(); | |
0ffe413c | 172 | iNpads++; |
3ea9cb08 | 173 | } |
174 | }//pad loop | |
853634d3 | 175 | }//void AliRICHChamber::DisIntegration(... |
0ffe413c | 176 | //__________________________________________________________________________________________________ |
4faf338d | 177 | void AliRICHChamber::GenerateTresholds() |
0ffe413c | 178 | {//Generates random treshold charges for all pads |
4faf338d | 179 | Int_t nx = fSegmentation->Npx(); |
180 | Int_t ny = fSegmentation->Npy(); | |
181 | ||
4faf338d | 182 | fTresh = new AliRICHTresholdMap(fSegmentation); |
853634d3 | 183 | for(Int_t i=-nx/2;i<nx/2;i++){ |
184 | for(Int_t j=-ny/2;j<ny/2;j++){ | |
185 | Int_t pedestal = (Int_t)(gRandom->Gaus(50, 10)); | |
186 | fTresh->SetHit(i,j,pedestal); | |
4faf338d | 187 | } |
853634d3 | 188 | } |
189 | }//void AliRICHChamber::GenerateTresholds() | |
0ffe413c | 190 | //__________________________________________________________________________________________________ |
cc23c5c6 | 191 | void AliRICHChamber::Print(Option_t *) const |
853634d3 | 192 | { |
0ffe413c | 193 | printf("%s r=%8.3f theta=%5.1f phi=%5.1f x=%8.3f y=%8.3f z=%8.3f %6.2f,%6.2f %6.2f,%6.2f %6.2f,%6.2f\n",fName.Data(), |
194 | Rho(), ThetaD(),PhiD(), X(), Y(), Z(), | |
3ea9cb08 | 195 | ThetaXd(),PhiXd(),ThetaYd(),PhiYd(),ThetaZd(),PhiZd()); |
853634d3 | 196 | }//void AliRICHChamber::Print(Option_t *option)const |
0ffe413c | 197 | //__________________________________________________________________________________________________ |
c60862bf | 198 | void AliRICHChamber::SetChamberTransform(Float_t x,Float_t y,Float_t z,TRotMatrix *pRotMatrix) |
199 | { | |
200 | SetCenter(x,y,z); | |
201 | fpRotMatrix=pRotMatrix; | |
202 | } |