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.8 2001/07/27 08:06:49 hristov
19 Use global gRandom generator (M.Ivanov)
21 Revision 1.7 2001/05/11 09:15:21 barbera
22 Corrected to make fast point creation working with PPR geometry
24 Revision 1.6 2000/10/29 18:30:14 barbera
25 Z resolution of pixel changed according with the default lenght of 425 microns
27 Revision 1.1.2.6 2000/10/29 18:29:51 barbera
28 Z resolution of pixel changed according with the default lenght of 425 microns
30 Revision 1.1.2.5 2000/10/02 16:03:20 barbera
31 Forward declarations added
33 Revision 1.4 2000/09/22 12:43:59 nilsen
34 Default track number set to -3 and not 0.
40 #include "AliITShit.h"
41 #include "AliITSRecPoint.h"
42 #include "AliITSmodule.h"
43 #include "AliITSgeom.h"
45 #include "AliITSsimulationFastPoints.h"
48 ClassImp(AliITSsimulationFastPoints)
50 AliITSsimulationFastPoints::AliITSsimulationFastPoints()
53 fSigmaRPhi[0] = fSigmaRPhi[1] = 12e-4;
54 fSigmaRPhi[2] = fSigmaRPhi[3] = 38e-4;
55 fSigmaRPhi[4] = fSigmaRPhi[5] = 20e-4;
56 fSigmaZ[0] = fSigmaZ[1] = 120e-4; // resolution for 425 micron pixels
57 fSigmaZ[2] = fSigmaZ[3] = 28e-4;
58 fSigmaZ[4] = fSigmaZ[5] = 830e-4;
59 fSigmaDe[0] = fSigmaDe[1] = 0.72e-6;
60 fSigmaDe[2] = fSigmaDe[3] = 0.90e-6;
61 fSigmaDe[4] = fSigmaDe[5] = 5e-6;
62 fThrDe[0] = fThrDe[1] = 7.2e-6;
63 fThrDe[2] = fThrDe[3] = 2.70e-6;
64 fThrDe[4] = fThrDe[5] = 10e-6;
67 //-------------------------------------------------------------
68 void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod, Int_t module, TRandom *random){
69 // Fast points simulator
71 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
72 AliITSgeom *gm = aliITS->GetITSgeom();
74 const Float_t kdEdXtoQ = 2.778e+8;
76 Int_t ihit,flag,numofhits;
77 Float_t xg,yg,zg,xl,yl,zl;
79 //Double_t p, theta, pt, ps;
82 //Float_t xg1,yg1,zg1;
83 Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.;
84 Float_t deltaXl,deltaZl,deltaDe;
86 Int_t hitlay, hitlad, hitdet, hitstatus, hittrack;
87 Float_t hitx, hity, hitz, hitpx, hitpy, hitpz, hitdestep;
90 Int_t hitstatus1, hittrack1;
91 Float_t hitx1, hity1, hitz1;
95 //Float_t dx,dy,dz,ds;
98 numofhits = mod->GetNhits();
99 //printf("numofhits %d \n",numofhits);
101 for(ihit=0;ihit<numofhits;ihit++){
102 AliITShit *hit=mod->GetHit(ihit);
103 hit->GetPositionG(hitx1,hity1,hitz1);
104 hitstatus1 = hit->GetTrackStatus();
105 hitdestep1 = hit->GetIonization();
107 hittrack1 = hit->GetTrack();
109 mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag);
114 hit->GetDetectorID(hitlay,hitlad,hitdet);
115 hit->GetMomentumG(hitpx,hitpy,hitpz);
116 hitdestep = hit->GetIonization();
117 hitstatus = hitstatus1;
118 hittrack = hit->GetTrack();
124 // Transform to the module local frame
128 gm->GtoL(hitlay,hitlad,hitdet,globals,locals);
136 // Calculate transverse momentum and pseudorapidity
137 // to allow pt and eta dependence in sigma values
138 // of the spatial resolution
139 p = TMath::Sqrt((px*px)+(py*py)+(pz*pz));
140 theta = TMath::ACos(pz/p);
141 pt = p * TMath::Sin(theta);
142 ps = -TMath::Log(TMath::Tan(theta/2));
145 // Retrieve sigma values for position and energy, and energy
148 sigmarphi = SigmaRPhi(hitlay);
149 sigmaz = SigmaZ(hitlay);
150 sigmade = SigmaDe(hitlay);
151 thrde = ThrDe(hitlay);
152 // Randomize position and deposited energy
153 // Int_t k=3*(Int_t)((hitlay-1)/2);
155 // deltaXl = (float)(random[k].Gaus(0,sigmarphi));
156 // deltaZl = (float)(random[k+1].Gaus(0,sigmaz));
157 // deltaDe = (float)(random[k+2].Gaus(0,sigmade));
158 deltaXl = random->Gaus(0,sigmarphi);
159 deltaZl = random->Gaus(0,sigmaz);
160 deltaDe = random->Gaus(0,sigmade);
161 // Apply energy threshold and trasform back to global reference
164 if ( (hitdestep+deltaDe) > thrde ){
165 locals[0] = xl + deltaXl;
167 locals[2] = zl + deltaZl;
169 rp.fTracks[0]=hittrack;
174 rp.SetdEdX(hitdestep+deltaDe);
175 rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e
176 rp.SetSigmaX2(sigmarphi*sigmarphi);
177 rp.SetSigmaZ2(sigmaz*sigmaz);
178 aliITS->AddRecPoint(rp);
180 gm->LtoG(hitlay,hitlad,hitdet,locals,globals);
184 dx = TMath::Abs(xg1-hitx);
185 dy = TMath::Abs(yg1-hity);
186 dz = TMath::Abs(zg1-hitz);
187 ds = TMath::Abs(deltaDe);
189 } // if ( (hitdestep+deltaDe)
191 } // if (hitdestep > 0)
197 //_______________________________________________________________________
198 void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])
200 // set sigmas in rphi
203 for (i=0; i<6; i++) {
204 fSigmaRPhi[i]=srphi[i];
207 //_______________________________________________________________________
208 void AliITSsimulationFastPoints::SetSigmaZ(Double_t sz[6])
213 for (i=0; i<6; i++) {
217 //_______________________________________________________________________
218 void AliITSsimulationFastPoints::SetSigmaDe(Double_t sde[6])
220 // set sigmas in energy
223 for (i=0; i<6; i++) {
227 //_______________________________________________________________________
228 void AliITSsimulationFastPoints::SetThrDe(Double_t thrde[6])
230 // set energy thersholds
233 for (i=0; i<6; i++) {