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.1.2.5 2000/10/02 16:03:20 barbera
19 Forward declarations added
21 Revision 1.4 2000/09/22 12:43:59 nilsen
22 Default track number set to -3 and not 0.
28 #include "AliITShit.h"
29 #include "AliITSRecPoint.h"
30 #include "AliITSmodule.h"
31 #include "AliITSgeom.h"
33 #include "AliITSsimulationFastPoints.h"
36 ClassImp(AliITSsimulationFastPoints)
38 AliITSsimulationFastPoints::AliITSsimulationFastPoints()
41 fSigmaRPhi[0] = fSigmaRPhi[1] = 12e-4;
42 fSigmaRPhi[2] = fSigmaRPhi[3] = 38e-4;
43 fSigmaRPhi[4] = fSigmaRPhi[5] = 20e-4;
44 fSigmaZ[0] = fSigmaZ[1] = 70e-4;
45 fSigmaZ[2] = fSigmaZ[3] = 28e-4;
46 fSigmaZ[4] = fSigmaZ[5] = 830e-4;
47 fSigmaDe[0] = fSigmaDe[1] = 0.72e-6;
48 fSigmaDe[2] = fSigmaDe[3] = 0.90e-6;
49 fSigmaDe[4] = fSigmaDe[5] = 5e-6;
50 fThrDe[0] = fThrDe[1] = 7.2e-6;
51 fThrDe[2] = fThrDe[3] = 2.70e-6;
52 fThrDe[4] = fThrDe[5] = 10e-6;
55 //-------------------------------------------------------------
56 void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod, Int_t module, TRandom *random){
57 // Fast points simulator
59 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
60 AliITSgeom *gm = aliITS->GetITSgeom();
62 const Float_t kdEdXtoQ = 2.778e+8;
64 Int_t ihit,flag,numofhits;
65 Float_t xg,yg,zg,xl,yl,zl;
67 //Double_t p, theta, pt, ps;
70 //Float_t xg1,yg1,zg1;
71 Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.;
72 Float_t deltaXl,deltaZl,deltaDe;
74 Int_t hitlay, hitlad, hitdet, hitstatus, hittrack;
75 Float_t hitx, hity, hitz, hitpx, hitpy, hitpz, hitdestep;
78 Int_t hitstatus1, hittrack1;
79 Float_t hitx1, hity1, hitz1;
83 //Float_t dx,dy,dz,ds;
86 numofhits = mod->GetNhits();
87 printf("numofhits %d \n",numofhits);
89 for(ihit=0;ihit<numofhits;ihit++){
90 AliITShit *hit=mod->GetHit(ihit);
91 hit->GetPositionG(hitx1,hity1,hitz1);
92 hitstatus1 = hit->GetTrackStatus();
93 hitdestep1 = hit->GetIonization();
95 hittrack1 = hit->GetTrack();
97 mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag);
102 hit->GetDetectorID(hitlay,hitlad,hitdet);
103 hit->GetMomentumG(hitpx,hitpy,hitpz);
104 hitdestep = hit->GetIonization();
105 hitstatus = hitstatus1;
106 hittrack = hit->GetTrack();
112 // Transform to the module local frame
116 gm->GtoL(hitlay,hitlad,hitdet,globals,locals);
124 // Calculate transverse momentum and pseudorapidity
125 // to allow pt and eta dependence in sigma values
126 // of the spatial resolution
127 p = TMath::Sqrt((px*px)+(py*py)+(pz*pz));
128 theta = TMath::ACos(pz/p);
129 pt = p * TMath::Sin(theta);
130 ps = -TMath::Log(TMath::Tan(theta/2));
133 // Retrieve sigma values for position and energy, and energy
136 sigmarphi = SigmaRPhi(hitlay);
137 sigmaz = SigmaZ(hitlay);
138 sigmade = SigmaDe(hitlay);
139 thrde = ThrDe(hitlay);
140 // Randomize position and deposited energy
141 Int_t k=3*(Int_t)((hitlay-1)/2);
143 deltaXl = (float)(random[k].Gaus(0,sigmarphi));
144 deltaZl = (float)(random[k+1].Gaus(0,sigmaz));
145 deltaDe = (float)(random[k+2].Gaus(0,sigmade));
146 // Apply energy threshold and trasform back to global reference
149 if ( (hitdestep+deltaDe) > thrde ){
150 locals[0] = xl + deltaXl;
152 locals[2] = zl + deltaZl;
154 rp.fTracks[0]=hittrack;
159 rp.SetdEdX(hitdestep+deltaDe);
160 rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e
161 rp.SetSigmaX2(sigmarphi*sigmarphi);
162 rp.SetSigmaZ2(sigmaz*sigmaz);
163 aliITS->AddRecPoint(rp);
165 gm->LtoG(hitlay,hitlad,hitdet,locals,globals);
169 dx = TMath::Abs(xg1-hitx);
170 dy = TMath::Abs(yg1-hity);
171 dz = TMath::Abs(zg1-hitz);
172 ds = TMath::Abs(deltaDe);
174 } // if ( (hitdestep+deltaDe)
176 } // if (hitdestep > 0)
182 //_______________________________________________________________________
183 void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])
185 // set sigmas in rphi
188 for (i=0; i<6; i++) {
189 fSigmaRPhi[i]=srphi[i];
192 //_______________________________________________________________________
193 void AliITSsimulationFastPoints::SetSigmaZ(Double_t sz[6])
198 for (i=0; i<6; i++) {
202 //_______________________________________________________________________
203 void AliITSsimulationFastPoints::SetSigmaDe(Double_t sde[6])
205 // set sigmas in energy
208 for (i=0; i<6; i++) {
212 //_______________________________________________________________________
213 void AliITSsimulationFastPoints::SetThrDe(Double_t thrde[6])
215 // set energy thersholds
218 for (i=0; i<6; i++) {