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 2001/10/01 19:36:03 nilsen
19 fixed a compilation warning about unused variable.
21 Revision 1.8 2001/07/27 08:06:49 hristov
22 Use global gRandom generator (M.Ivanov)
24 Revision 1.7 2001/05/11 09:15:21 barbera
25 Corrected to make fast point creation working with PPR geometry
27 Revision 1.6 2000/10/29 18:30:14 barbera
28 Z resolution of pixel changed according with the default lenght of 425 microns
30 Revision 1.1.2.6 2000/10/29 18:29:51 barbera
31 Z resolution of pixel changed according with the default lenght of 425 microns
33 Revision 1.1.2.5 2000/10/02 16:03:20 barbera
34 Forward declarations added
36 Revision 1.4 2000/09/22 12:43:59 nilsen
37 Default track number set to -3 and not 0.
43 #include "AliITShit.h"
44 #include "AliITSRecPoint.h"
45 #include "AliITSmodule.h"
46 #include "AliITSgeom.h"
48 #include "AliITSsimulationFastPoints.h"
51 ClassImp(AliITSsimulationFastPoints)
53 AliITSsimulationFastPoints::AliITSsimulationFastPoints()
56 fSigmaRPhi[0] = fSigmaRPhi[1] = 12e-4;
57 fSigmaRPhi[2] = fSigmaRPhi[3] = 38e-4;
58 fSigmaRPhi[4] = fSigmaRPhi[5] = 20e-4;
59 fSigmaZ[0] = fSigmaZ[1] = 120e-4; // resolution for 425 micron pixels
60 fSigmaZ[2] = fSigmaZ[3] = 28e-4;
61 fSigmaZ[4] = fSigmaZ[5] = 830e-4;
62 fSigmaDe[0] = fSigmaDe[1] = 0.72e-6;
63 fSigmaDe[2] = fSigmaDe[3] = 0.90e-6;
64 fSigmaDe[4] = fSigmaDe[5] = 5e-6;
65 fThrDe[0] = fThrDe[1] = 7.2e-6;
66 fThrDe[2] = fThrDe[3] = 2.70e-6;
67 fThrDe[4] = fThrDe[5] = 10e-6;
70 //-------------------------------------------------------------
71 void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module){
72 // Fast points simulator
73 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
75 CreateFastRecPoints((AliITSmodule *)(aliITS->GetModule(module)),
78 //-------------------------------------------------------------
79 void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod,
82 // Fast points simulator
83 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
84 AliITSgeom *gm = aliITS->GetITSgeom();
86 const Float_t kdEdXtoQ = 2.778e+8;
88 Int_t ihit,flag,numofhits;
91 Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.;
92 Float_t deltaXl,deltaZl,deltaDe;
94 Int_t hitlay, hitlad, hitdet, hitstatus;
95 Float_t hitpx, hitpy, hitpz, hitdestep;
97 Int_t hitstatus1, hittrack1;
98 Float_t hitx1, hity1, hitz1;
102 numofhits = mod->GetNhits();
103 //printf("numofhits %d \n",numofhits);
104 for(ihit=0;ihit<numofhits;ihit++){
105 AliITShit *hit=mod->GetHit(ihit);
106 hit->GetPositionG(hitx1,hity1,hitz1);
107 hitstatus1 = hit->GetTrackStatus();
108 hitdestep1 = hit->GetIonization();
109 hittrack1 = hit->GetTrack();
111 mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag);
113 hitdestep = hit->GetIonization();
116 hit->GetDetectorID(hitlay,hitlad,hitdet);
117 hit->GetMomentumG(hitpx,hitpy,hitpz);
118 hitstatus = hitstatus1;
119 // Transform to the module local frame
123 gm->GtoL(hitlay,hitlad,hitdet,globals,locals);
124 // Retrieve sigma values for position and energy, and energy
126 sigmarphi = SigmaRPhi(hitlay);
127 sigmaz = SigmaZ(hitlay);
128 sigmade = SigmaDe(hitlay);
129 thrde = ThrDe(hitlay);
130 deltaXl = random->Gaus(0,sigmarphi);
131 deltaZl = random->Gaus(0,sigmaz);
132 deltaDe = random->Gaus(0,sigmade);
134 // Apply energy threshold and trasform back to global reference
137 if ( (hitdestep+deltaDe) > thrde ){
138 locals[0] += deltaXl;
139 locals[2] += deltaZl;
141 // rp.fTracks[0]=hit->GetTrack();
142 rp.fTracks[0]=mod->GetHitTrackIndex(ihit);
147 rp.SetdEdX(hitdestep+deltaDe);
148 rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e
149 rp.SetSigmaX2(sigmarphi*sigmarphi);
150 rp.SetSigmaZ2(sigmaz*sigmaz);
151 aliITS->AddRecPoint(rp);
152 } // end if ( (hitdestep+deltaDe)
153 } // end if (hitdestep > 0)
154 } // end if (flag!=1)
157 //_______________________________________________________________________
158 void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])
160 // set sigmas in rphi
163 for (i=0; i<6; i++) {
164 fSigmaRPhi[i]=srphi[i];
167 //_______________________________________________________________________
168 void AliITSsimulationFastPoints::SetSigmaZ(Double_t sz[6])
173 for (i=0; i<6; i++) {
177 //_______________________________________________________________________
178 void AliITSsimulationFastPoints::SetSigmaDe(Double_t sde[6])
180 // set sigmas in energy
183 for (i=0; i<6; i++) {
187 //_______________________________________________________________________
188 void AliITSsimulationFastPoints::SetThrDe(Double_t thrde[6])
190 // set energy thersholds
193 for (i=0; i<6; i++) {