]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulationFastPoints.cxx
New access to conditions database
[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
88cb7938 16/* $Id$ */
7d62fb64 17//////////////////////////////////////////////////////////
18// implements fast simulation //
19// //
20// //
21//////////////////////////////////////////////////////////
22
b9d0a01d 23
e8189707 24#include <TRandom.h>
b0f5e3fc 25
b0f5e3fc 26#include "AliITS.h"
517784f0 27#include "AliITShit.h"
28#include "AliITSRecPoint.h"
29#include "AliITSmodule.h"
30#include "AliITSgeom.h"
e8189707 31#include "AliRun.h"
b0f5e3fc 32#include "AliITSsimulationFastPoints.h"
e8189707 33
b0f5e3fc 34
35ClassImp(AliITSsimulationFastPoints)
36
37AliITSsimulationFastPoints::AliITSsimulationFastPoints()
38{
39 //constructor
e8189707 40 fSigmaRPhi[0] = fSigmaRPhi[1] = 12e-4;
41 fSigmaRPhi[2] = fSigmaRPhi[3] = 38e-4;
42 fSigmaRPhi[4] = fSigmaRPhi[5] = 20e-4;
21d3c626 43 fSigmaZ[0] = fSigmaZ[1] = 120e-4; // resolution for 425 micron pixels
e8189707 44 fSigmaZ[2] = fSigmaZ[3] = 28e-4;
45 fSigmaZ[4] = fSigmaZ[5] = 830e-4;
46 fSigmaDe[0] = fSigmaDe[1] = 0.72e-6;
47 fSigmaDe[2] = fSigmaDe[3] = 0.90e-6;
48 fSigmaDe[4] = fSigmaDe[5] = 5e-6;
49 fThrDe[0] = fThrDe[1] = 7.2e-6;
50 fThrDe[2] = fThrDe[3] = 2.70e-6;
51 fThrDe[4] = fThrDe[5] = 10e-6;
b0f5e3fc 52}
53
e8189707 54//-------------------------------------------------------------
7d62fb64 55void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module, TClonesArray* recp){
785086f0 56 // Fast points simulator
57 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
b0f5e3fc 58
785086f0 59 CreateFastRecPoints((AliITSmodule *)(aliITS->GetModule(module)),
7d62fb64 60 module,gRandom,recp);
785086f0 61}
62//-------------------------------------------------------------
63void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod,
64 Int_t module,
7d62fb64 65 TRandom *random,
66 TClonesArray* recp) {
67 // Fast points simulator
68
69 TClonesArray &pt=*recp;
70 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
71 AliITSgeom *gm = aliITS->GetITSgeom();
72 const Float_t kdEdXtoQ = 2.778e+8;
73
74 Int_t ihit,flag,numofhits;
75 Float_t locals[3];
76 Float_t globals[3];
77 Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.;
78 Float_t deltaXl,deltaZl,deltaDe;
79
80 Int_t hitlay, hitlad, hitdet, hitstatus;
81 Float_t hitpx, hitpy, hitpz, hitdestep;
82
83 Int_t hitstatus1, hittrack1;
84 Float_t hitx1, hity1, hitz1;
85 Float_t hitdestep1;
86 Float_t xMg,yMg,zMg;
87 Int_t irecp=0;
88 numofhits = mod->GetNhits();
89 //printf("numofhits %d \n",numofhits);
90 for(ihit=0;ihit<numofhits;ihit++){
91 AliITShit *hit=mod->GetHit(ihit);
92 hit->GetPositionG(hitx1,hity1,hitz1);
93 hitstatus1 = hit->GetTrackStatus();
94 hitdestep1 = hit->GetIonization();
95 hittrack1 = hit->GetTrack();
96
97 mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag);
98 if (flag!=1) {
99 hitdestep = hit->GetIonization();
100
101 if (hitdestep > 0) {
102 hit->GetDetectorID(hitlay,hitlad,hitdet);
103 hit->GetMomentumG(hitpx,hitpy,hitpz);
104 hitstatus = hitstatus1;
785086f0 105 // Transform to the module local frame
7d62fb64 106 globals[0] = xMg;
107 globals[1] = yMg;
108 globals[2] = zMg;
109 gm->GtoL(hitlay,hitlad,hitdet,globals,locals);
110 // Retrieve sigma values for position and energy, and energy
111 // threshold
112 sigmarphi = SigmaRPhi(hitlay);
113 sigmaz = SigmaZ(hitlay);
114 sigmade = SigmaDe(hitlay);
115 thrde = ThrDe(hitlay);
116 deltaXl = random->Gaus(0,sigmarphi);
117 deltaZl = random->Gaus(0,sigmaz);
118 deltaDe = random->Gaus(0,sigmade);
119
120 // Apply energy threshold and trasform back to global reference
121 // system
122
123 if ( (hitdestep+deltaDe) > thrde ){
124 locals[0] += deltaXl;
125 locals[2] += deltaZl;
126 AliITSRecPoint rp;
127 rp.fTracks[0]=hit->GetTrack();
128 // rp.fTracks[0]=mod->GetHitTrackIndex(ihit);
129 rp.fTracks[1]=-3;
130 rp.fTracks[2]=-3;
131 rp.SetX(locals[0]);
132 rp.SetZ(locals[2]);
133 rp.SetdEdX(hitdestep+deltaDe);
134 rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e
135 rp.SetSigmaX2(sigmarphi*sigmarphi);
136 rp.SetSigmaZ2(sigmaz*sigmaz);
137 new (pt[irecp]) AliITSRecPoint(rp);
138 irecp++;
139 } // end if ( (hitdestep+deltaDe)
140 } // end if (hitdestep > 0)
141 } // end if (flag!=1)
142 } // end for ihit
b0f5e3fc 143}
e8189707 144//_______________________________________________________________________
145void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])
146{
147 // set sigmas in rphi
b0f5e3fc 148
e8189707 149 Int_t i;
150 for (i=0; i<6; i++) {
151 fSigmaRPhi[i]=srphi[i];
152 }
b0f5e3fc 153}
154//_______________________________________________________________________
e8189707 155void AliITSsimulationFastPoints::SetSigmaZ(Double_t sz[6])
156{
157 // set sigmas in z
158
159 Int_t i;
160 for (i=0; i<6; i++) {
161 fSigmaZ[i]=sz[i];
162 }
b0f5e3fc 163}
164//_______________________________________________________________________
e8189707 165void AliITSsimulationFastPoints::SetSigmaDe(Double_t sde[6])
166{
167 // set sigmas in energy
168
169 Int_t i;
170 for (i=0; i<6; i++) {
171 fSigmaDe[i]=sde[i];
172 }
b0f5e3fc 173}
174//_______________________________________________________________________
e8189707 175void AliITSsimulationFastPoints::SetThrDe(Double_t thrde[6])
176{
177 // set energy thersholds
178
179 Int_t i;
180 for (i=0; i<6; i++) {
181 fThrDe[i]=thrde[i];
182 }
b0f5e3fc 183}
e8189707 184