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.10 2002/06/10 17:30:24 nilsen
19 A new CreateFastRecPoints has been made and the old one made compatible.
21 Revision 1.9 2001/10/01 19:36:03 nilsen
22 fixed a compilation warning about unused variable.
24 Revision 1.8 2001/07/27 08:06:49 hristov
25 Use global gRandom generator (M.Ivanov)
27 Revision 1.7 2001/05/11 09:15:21 barbera
28 Corrected to make fast point creation working with PPR geometry
30 Revision 1.6 2000/10/29 18:30:14 barbera
31 Z resolution of pixel changed according with the default lenght of 425 microns
33 Revision 1.1.2.6 2000/10/29 18:29:51 barbera
34 Z resolution of pixel changed according with the default lenght of 425 microns
36 Revision 1.1.2.5 2000/10/02 16:03:20 barbera
37 Forward declarations added
39 Revision 1.4 2000/09/22 12:43:59 nilsen
40 Default track number set to -3 and not 0.
46 #include "AliITShit.h"
47 #include "AliITSRecPoint.h"
48 #include "AliITSmodule.h"
49 #include "AliITSgeom.h"
51 #include "AliITSsimulationFastPoints.h"
54 ClassImp(AliITSsimulationFastPoints)
56 AliITSsimulationFastPoints::AliITSsimulationFastPoints()
59 fSigmaRPhi[0] = fSigmaRPhi[1] = 12e-4;
60 fSigmaRPhi[2] = fSigmaRPhi[3] = 38e-4;
61 fSigmaRPhi[4] = fSigmaRPhi[5] = 20e-4;
62 fSigmaZ[0] = fSigmaZ[1] = 120e-4; // resolution for 425 micron pixels
63 fSigmaZ[2] = fSigmaZ[3] = 28e-4;
64 fSigmaZ[4] = fSigmaZ[5] = 830e-4;
65 fSigmaDe[0] = fSigmaDe[1] = 0.72e-6;
66 fSigmaDe[2] = fSigmaDe[3] = 0.90e-6;
67 fSigmaDe[4] = fSigmaDe[5] = 5e-6;
68 fThrDe[0] = fThrDe[1] = 7.2e-6;
69 fThrDe[2] = fThrDe[3] = 2.70e-6;
70 fThrDe[4] = fThrDe[5] = 10e-6;
73 //-------------------------------------------------------------
74 void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module){
75 // Fast points simulator
76 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
78 CreateFastRecPoints((AliITSmodule *)(aliITS->GetModule(module)),
81 //-------------------------------------------------------------
82 void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod,
85 // Fast points simulator
86 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
87 AliITSgeom *gm = aliITS->GetITSgeom();
89 const Float_t kdEdXtoQ = 2.778e+8;
91 Int_t ihit,flag,numofhits;
94 Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.;
95 Float_t deltaXl,deltaZl,deltaDe;
97 Int_t hitlay, hitlad, hitdet, hitstatus;
98 Float_t hitpx, hitpy, hitpz, hitdestep;
100 Int_t hitstatus1, hittrack1;
101 Float_t hitx1, hity1, hitz1;
105 numofhits = mod->GetNhits();
106 //printf("numofhits %d \n",numofhits);
107 for(ihit=0;ihit<numofhits;ihit++){
108 AliITShit *hit=mod->GetHit(ihit);
109 hit->GetPositionG(hitx1,hity1,hitz1);
110 hitstatus1 = hit->GetTrackStatus();
111 hitdestep1 = hit->GetIonization();
112 hittrack1 = hit->GetTrack();
114 mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag);
116 hitdestep = hit->GetIonization();
119 hit->GetDetectorID(hitlay,hitlad,hitdet);
120 hit->GetMomentumG(hitpx,hitpy,hitpz);
121 hitstatus = hitstatus1;
122 // Transform to the module local frame
126 gm->GtoL(hitlay,hitlad,hitdet,globals,locals);
127 // Retrieve sigma values for position and energy, and energy
129 sigmarphi = SigmaRPhi(hitlay);
130 sigmaz = SigmaZ(hitlay);
131 sigmade = SigmaDe(hitlay);
132 thrde = ThrDe(hitlay);
133 deltaXl = random->Gaus(0,sigmarphi);
134 deltaZl = random->Gaus(0,sigmaz);
135 deltaDe = random->Gaus(0,sigmade);
137 // Apply energy threshold and trasform back to global reference
140 if ( (hitdestep+deltaDe) > thrde ){
141 locals[0] += deltaXl;
142 locals[2] += deltaZl;
144 rp.fTracks[0]=hit->GetTrack();
145 // rp.fTracks[0]=mod->GetHitTrackIndex(ihit);
150 rp.SetdEdX(hitdestep+deltaDe);
151 rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e
152 rp.SetSigmaX2(sigmarphi*sigmarphi);
153 rp.SetSigmaZ2(sigmaz*sigmaz);
154 aliITS->AddRecPoint(rp);
155 } // end if ( (hitdestep+deltaDe)
156 } // end if (hitdestep > 0)
157 } // end if (flag!=1)
160 //_______________________________________________________________________
161 void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])
163 // set sigmas in rphi
166 for (i=0; i<6; i++) {
167 fSigmaRPhi[i]=srphi[i];
170 //_______________________________________________________________________
171 void AliITSsimulationFastPoints::SetSigmaZ(Double_t sz[6])
176 for (i=0; i<6; i++) {
180 //_______________________________________________________________________
181 void AliITSsimulationFastPoints::SetSigmaDe(Double_t sde[6])
183 // set sigmas in energy
186 for (i=0; i<6; i++) {
190 //_______________________________________________________________________
191 void AliITSsimulationFastPoints::SetThrDe(Double_t thrde[6])
193 // set energy thersholds
196 for (i=0; i<6; i++) {