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.9.8.1 2002/07/24 09:27:50 alibrary
21 Revision 1.11 2002/07/11 10:24:21 barbera
22 Fixes 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.
24 Revision 1.10 2002/06/10 17:30:24 nilsen
25 A new CreateFastRecPoints has been made and the old one made compatible.
27 Revision 1.9 2001/10/01 19:36:03 nilsen
28 fixed a compilation warning about unused variable.
30 Revision 1.8 2001/07/27 08:06:49 hristov
31 Use global gRandom generator (M.Ivanov)
33 Revision 1.7 2001/05/11 09:15:21 barbera
34 Corrected to make fast point creation working with PPR geometry
36 Revision 1.6 2000/10/29 18:30:14 barbera
37 Z resolution of pixel changed according with the default lenght of 425 microns
39 Revision 1.1.2.6 2000/10/29 18:29:51 barbera
40 Z resolution of pixel changed according with the default lenght of 425 microns
42 Revision 1.1.2.5 2000/10/02 16:03:20 barbera
43 Forward declarations added
45 Revision 1.4 2000/09/22 12:43:59 nilsen
46 Default track number set to -3 and not 0.
52 #include "AliITShit.h"
53 #include "AliITSRecPoint.h"
54 #include "AliITSmodule.h"
55 #include "AliITSgeom.h"
57 #include "AliITSsimulationFastPoints.h"
60 ClassImp(AliITSsimulationFastPoints)
62 AliITSsimulationFastPoints::AliITSsimulationFastPoints()
65 fSigmaRPhi[0] = fSigmaRPhi[1] = 12e-4;
66 fSigmaRPhi[2] = fSigmaRPhi[3] = 38e-4;
67 fSigmaRPhi[4] = fSigmaRPhi[5] = 20e-4;
68 fSigmaZ[0] = fSigmaZ[1] = 120e-4; // resolution for 425 micron pixels
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;
79 //-------------------------------------------------------------
80 void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module){
81 // Fast points simulator
82 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
84 CreateFastRecPoints((AliITSmodule *)(aliITS->GetModule(module)),
87 //-------------------------------------------------------------
88 void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod,
91 // Fast points simulator
92 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
93 AliITSgeom *gm = aliITS->GetITSgeom();
95 const Float_t kdEdXtoQ = 2.778e+8;
97 Int_t ihit,flag,numofhits;
100 Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.;
101 Float_t deltaXl,deltaZl,deltaDe;
103 Int_t hitlay, hitlad, hitdet, hitstatus;
104 Float_t hitpx, hitpy, hitpz, hitdestep;
106 Int_t hitstatus1, hittrack1;
107 Float_t hitx1, hity1, hitz1;
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();
120 mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag);
122 hitdestep = hit->GetIonization();
125 hit->GetDetectorID(hitlay,hitlad,hitdet);
126 hit->GetMomentumG(hitpx,hitpy,hitpz);
127 hitstatus = hitstatus1;
128 // Transform to the module local frame
132 gm->GtoL(hitlay,hitlad,hitdet,globals,locals);
133 // Retrieve sigma values for position and energy, and energy
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);
143 // Apply energy threshold and trasform back to global reference
146 if ( (hitdestep+deltaDe) > thrde ){
147 locals[0] += deltaXl;
148 locals[2] += deltaZl;
150 rp.fTracks[0]=hit->GetTrack();
151 // rp.fTracks[0]=mod->GetHitTrackIndex(ihit);
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)
166 //_______________________________________________________________________
167 void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])
169 // set sigmas in rphi
172 for (i=0; i<6; i++) {
173 fSigmaRPhi[i]=srphi[i];
176 //_______________________________________________________________________
177 void AliITSsimulationFastPoints::SetSigmaZ(Double_t sz[6])
182 for (i=0; i<6; i++) {
186 //_______________________________________________________________________
187 void AliITSsimulationFastPoints::SetSigmaDe(Double_t sde[6])
189 // set sigmas in energy
192 for (i=0; i<6; i++) {
196 //_______________________________________________________________________
197 void AliITSsimulationFastPoints::SetThrDe(Double_t thrde[6])
199 // set energy thersholds
202 for (i=0; i<6; i++) {