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 // **************************************************************************
16 #include "AliRICHChamber.h"
17 #include "AliRICHParam.h"
18 #include "AliSegmentation.h"
19 #include "AliRICHSegmentationV0.h"
20 #include "AliRICHGeometry.h"
21 #include "AliRICHResponse.h"
22 #include <TRotMatrix.h>
24 ClassImp(AliRICHChamber)
25 //______________________________________________________________________________
26 AliRICHChamber::AliRICHChamber()
36 //______________________________________________________________________________
37 AliRICHChamber::AliRICHChamber(Int_t iModuleN,AliRICHParam *pParam)
39 //main ctor. Defines all geometry parameters for the given module.
40 SetToZenith();//put to up position
43 RotateX(-pParam->AngleYZ());
44 RotateZ(-pParam->AngleXY());
45 fName="RICHc1";fTitle="RICH chamber 1";
48 RotateZ(-pParam->AngleXY());
49 fName="RICHc2";fTitle="RICH chamber 2";
52 RotateX(-pParam->AngleYZ());
53 fName="RICHc3";fTitle="RICH chamber 3";
56 fName="RICHc4";fTitle="RICH chamber 4"; //no turns
59 RotateX(pParam->AngleYZ());
60 fName="RICHc5";fTitle="RICH chamber 5";
63 RotateZ(pParam->AngleXY());
64 fName="RICHc6";fTitle="RICH chamber 6";
67 RotateX(pParam->AngleYZ());
68 RotateZ(pParam->AngleXY());
69 fName="RICHc7";fTitle="RICH chamber 7";
72 Fatal("named ctor","Wrong chamber number %i, check CreateChamber ctor",iModuleN);
74 RotateZ(pParam->AngleRot());//apply common rotation
75 fpRotMatrix=new TRotMatrix("rot"+fName,"rot"+fName, Rot().ThetaX()*TMath::RadToDeg(), Rot().PhiX()*TMath::RadToDeg(),
76 Rot().ThetaY()*TMath::RadToDeg(), Rot().PhiY()*TMath::RadToDeg(),
77 Rot().ThetaZ()*TMath::RadToDeg(), Rot().PhiZ()*TMath::RadToDeg());
79 fX=fCenterV3.X();fY=fCenterV3.Y();fZ=fCenterV3.Z();
81 fSegmentation = 0; fResponse = 0; fGeometry = 0;
83 //______________________________________________________________________________
85 void AliRICHChamber::LocaltoGlobal(Float_t local[3],Float_t global[3])
87 //Local coordinates to global coordinates transformation
90 pMatrix = fpRotMatrix->GetMatrix();
91 global[0]=local[0]*pMatrix[0]+local[1]*pMatrix[3]+local[2]*pMatrix[6];
92 global[1]=local[0]*pMatrix[1]+local[1]*pMatrix[4]+local[2]*pMatrix[7];
93 global[2]=local[0]*pMatrix[2]+local[1]*pMatrix[5]+local[2]*pMatrix[8];
99 void AliRICHChamber::GlobaltoLocal(Float_t global[3],Float_t local[3])
101 // Global coordinates to local coordinates transformation
102 TMatrix matrixCopy(3,3);
103 Double_t *pMatrixOrig = fpRotMatrix->GetMatrix();
104 for(Int_t i=0;i<3;i++)
106 for(Int_t j=0;j<3;j++)
107 matrixCopy(j,i)=pMatrixOrig[j+3*i];
110 local[0] = global[0] - fX;
111 local[1] = global[1] - fY;
112 local[2] = global[2] - fZ;
113 local[0]=local[0]*matrixCopy(0,0)+local[1]*matrixCopy(0,1)+local[2]*matrixCopy(0,2);
114 local[1]=local[0]*matrixCopy(1,0)+local[1]*matrixCopy(1,1)+local[2]*matrixCopy(1,2);
115 local[2]=local[0]*matrixCopy(2,0)+local[1]*matrixCopy(2,1)+local[2]*matrixCopy(2,2);
118 void AliRICHChamber::DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit,
119 Int_t& iNpads,Float_t cluster[5][500],ResponseType res)
121 //Generates pad hits (simulated cluster) using the segmentation and the response model
123 Float_t local[3],global[3];
124 // Width of the integration area
125 Float_t dx=(fResponse->SigmaIntegration())*(fResponse->ChargeSpreadX());
126 Float_t dy=(fResponse->SigmaIntegration())*(fResponse->ChargeSpreadY());
127 // Get pulse height from energy loss and generate feedback photons
130 //z-position of the wires relative to the RICH mother volume (2 mm before CsI) old value: 6.076 ???????
131 local[1]=1.276 + fGeometry->GetGapThickness()/2 - .2;
134 LocaltoGlobal(local,global);
138 //To calculate wire sag, the origin of y-position must be the middle of the photcathode
139 AliRICHSegmentationV0* segmentation = (AliRICHSegmentationV0*) GetSegmentationModel();
142 newy = yhit - segmentation->GetPadPlaneLength()/2;
144 newy = yhit + segmentation->GetPadPlaneLength()/2;
147 qtot = fResponse->IntPH(eloss, newy);
148 fResponse->FeedBackPhotons(global,qtot);
149 }else if(res==kPhoton){
150 qtot = fResponse->IntPH(newy);
151 fResponse->FeedBackPhotons(global,qtot);
156 Float_t qcheck=0, qp=0;
159 for(fSegmentation->FirstPad(xhit, yhit, 0, dx, dy); fSegmentation->MorePads(); fSegmentation->NextPad()) {
160 qp= fResponse->IntXY(fSegmentation);
164 cluster[0][iNpads]=qp*qtot;// --- store signal information
165 cluster[1][iNpads]=fSegmentation->Ix();
166 cluster[2][iNpads]=fSegmentation->Iy();
167 cluster[3][iNpads]=fSegmentation->ISector();
171 }//DisIntegration(...
172 //__________________________________________________________________________________________________
173 void AliRICHChamber::Print(Option_t *) const
175 //debug printout method
176 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(),
177 Rho(), ThetaD(),PhiD(), X(), Y(), Z(),
178 ThetaXd(),PhiXd(),ThetaYd(),PhiYd(),ThetaZd(),PhiZd());
180 //__________________________________________________________________________________________________