]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulationFastPoints.cxx
Additional protection in case of very high momentum (Yu.Belikov)
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationFastPoints.cxx
CommitLineData
b0f5e3fc 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$
b9d0a01d 18Revision 1.9.8.1 2002/07/24 09:27:50 alibrary
19Updating on VirtualMC
20
21Revision 1.11 2002/07/11 10:24:21 barbera
22Fixes to make tracking V2 working with the HEAD and with fast points. Waiting for a fix in slow reconstruction of SPD, fast points are temporarily made the default for tracking V2.
23
4465d468 24Revision 1.10 2002/06/10 17:30:24 nilsen
25A new CreateFastRecPoints has been made and the old one made compatible.
26
785086f0 27Revision 1.9 2001/10/01 19:36:03 nilsen
28fixed a compilation warning about unused variable.
29
84f9ba63 30Revision 1.8 2001/07/27 08:06:49 hristov
31Use global gRandom generator (M.Ivanov)
32
4c57765b 33Revision 1.7 2001/05/11 09:15:21 barbera
34Corrected to make fast point creation working with PPR geometry
35
34980f24 36Revision 1.6 2000/10/29 18:30:14 barbera
37Z resolution of pixel changed according with the default lenght of 425 microns
38
21d3c626 39Revision 1.1.2.6 2000/10/29 18:29:51 barbera
40Z resolution of pixel changed according with the default lenght of 425 microns
41
1ca7869b 42Revision 1.1.2.5 2000/10/02 16:03:20 barbera
43Forward declarations added
44
45Revision 1.4 2000/09/22 12:43:59 nilsen
46Default track number set to -3 and not 0.
47
b0f5e3fc 48*/
e8189707 49#include <TRandom.h>
b0f5e3fc 50
b0f5e3fc 51#include "AliITS.h"
517784f0 52#include "AliITShit.h"
53#include "AliITSRecPoint.h"
54#include "AliITSmodule.h"
55#include "AliITSgeom.h"
e8189707 56#include "AliRun.h"
b0f5e3fc 57#include "AliITSsimulationFastPoints.h"
e8189707 58
b0f5e3fc 59
60ClassImp(AliITSsimulationFastPoints)
61
62AliITSsimulationFastPoints::AliITSsimulationFastPoints()
63{
64 //constructor
e8189707 65 fSigmaRPhi[0] = fSigmaRPhi[1] = 12e-4;
66 fSigmaRPhi[2] = fSigmaRPhi[3] = 38e-4;
67 fSigmaRPhi[4] = fSigmaRPhi[5] = 20e-4;
21d3c626 68 fSigmaZ[0] = fSigmaZ[1] = 120e-4; // resolution for 425 micron pixels
e8189707 69 fSigmaZ[2] = fSigmaZ[3] = 28e-4;
70 fSigmaZ[4] = fSigmaZ[5] = 830e-4;
71 fSigmaDe[0] = fSigmaDe[1] = 0.72e-6;
72 fSigmaDe[2] = fSigmaDe[3] = 0.90e-6;
73 fSigmaDe[4] = fSigmaDe[5] = 5e-6;
74 fThrDe[0] = fThrDe[1] = 7.2e-6;
75 fThrDe[2] = fThrDe[3] = 2.70e-6;
76 fThrDe[4] = fThrDe[5] = 10e-6;
b0f5e3fc 77}
78
e8189707 79//-------------------------------------------------------------
785086f0 80void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module){
81 // Fast points simulator
82 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
b0f5e3fc 83
785086f0 84 CreateFastRecPoints((AliITSmodule *)(aliITS->GetModule(module)),
85 module,gRandom);
86}
87//-------------------------------------------------------------
88void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod,
89 Int_t module,
90 TRandom *random){
91 // Fast points simulator
92 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
93 AliITSgeom *gm = aliITS->GetITSgeom();
94
95 const Float_t kdEdXtoQ = 2.778e+8;
96
97 Int_t ihit,flag,numofhits;
98 Float_t locals[3];
99 Float_t globals[3];
100 Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.;
101 Float_t deltaXl,deltaZl,deltaDe;
102
103 Int_t hitlay, hitlad, hitdet, hitstatus;
104 Float_t hitpx, hitpy, hitpz, hitdestep;
105
106 Int_t hitstatus1, hittrack1;
107 Float_t hitx1, hity1, hitz1;
108 Float_t hitdestep1;
109 Float_t xMg,yMg,zMg;
110
111 numofhits = mod->GetNhits();
112 //printf("numofhits %d \n",numofhits);
113 for(ihit=0;ihit<numofhits;ihit++){
114 AliITShit *hit=mod->GetHit(ihit);
115 hit->GetPositionG(hitx1,hity1,hitz1);
116 hitstatus1 = hit->GetTrackStatus();
117 hitdestep1 = hit->GetIonization();
118 hittrack1 = hit->GetTrack();
119
120 mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag);
121 if (flag!=1) {
122 hitdestep = hit->GetIonization();
123
124 if (hitdestep > 0) {
125 hit->GetDetectorID(hitlay,hitlad,hitdet);
126 hit->GetMomentumG(hitpx,hitpy,hitpz);
127 hitstatus = hitstatus1;
128 // Transform to the module local frame
129 globals[0] = xMg;
130 globals[1] = yMg;
131 globals[2] = zMg;
132 gm->GtoL(hitlay,hitlad,hitdet,globals,locals);
133 // Retrieve sigma values for position and energy, and energy
134 // threshold
135 sigmarphi = SigmaRPhi(hitlay);
136 sigmaz = SigmaZ(hitlay);
137 sigmade = SigmaDe(hitlay);
138 thrde = ThrDe(hitlay);
139 deltaXl = random->Gaus(0,sigmarphi);
140 deltaZl = random->Gaus(0,sigmaz);
141 deltaDe = random->Gaus(0,sigmade);
142
143 // Apply energy threshold and trasform back to global reference
144 // system
145
146 if ( (hitdestep+deltaDe) > thrde ){
147 locals[0] += deltaXl;
148 locals[2] += deltaZl;
149 AliITSRecPoint rp;
4465d468 150 rp.fTracks[0]=hit->GetTrack();
151 // rp.fTracks[0]=mod->GetHitTrackIndex(ihit);
785086f0 152 rp.fTracks[1]=-3;
153 rp.fTracks[2]=-3;
154 rp.SetX(locals[0]);
155 rp.SetZ(locals[2]);
156 rp.SetdEdX(hitdestep+deltaDe);
157 rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e
158 rp.SetSigmaX2(sigmarphi*sigmarphi);
159 rp.SetSigmaZ2(sigmaz*sigmaz);
160 aliITS->AddRecPoint(rp);
161 } // end if ( (hitdestep+deltaDe)
162 } // end if (hitdestep > 0)
163 } // end if (flag!=1)
164 } // end for ihit
b0f5e3fc 165}
e8189707 166//_______________________________________________________________________
167void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])
168{
169 // set sigmas in rphi
b0f5e3fc 170
e8189707 171 Int_t i;
172 for (i=0; i<6; i++) {
173 fSigmaRPhi[i]=srphi[i];
174 }
b0f5e3fc 175}
176//_______________________________________________________________________
e8189707 177void AliITSsimulationFastPoints::SetSigmaZ(Double_t sz[6])
178{
179 // set sigmas in z
180
181 Int_t i;
182 for (i=0; i<6; i++) {
183 fSigmaZ[i]=sz[i];
184 }
b0f5e3fc 185}
186//_______________________________________________________________________
e8189707 187void AliITSsimulationFastPoints::SetSigmaDe(Double_t sde[6])
188{
189 // set sigmas in energy
190
191 Int_t i;
192 for (i=0; i<6; i++) {
193 fSigmaDe[i]=sde[i];
194 }
b0f5e3fc 195}
196//_______________________________________________________________________
e8189707 197void AliITSsimulationFastPoints::SetThrDe(Double_t thrde[6])
198{
199 // set energy thersholds
200
201 Int_t i;
202 for (i=0; i<6; i++) {
203 fThrDe[i]=thrde[i];
204 }
b0f5e3fc 205}
e8189707 206