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 **************************************************************************/
21 #include "AliITShit.h"
22 #include "AliITSRecPoint.h"
23 #include "AliITSmodule.h"
24 #include "AliITSgeom.h"
26 #include "AliITSsimulationFastPoints.h"
29 ClassImp(AliITSsimulationFastPoints)
31 AliITSsimulationFastPoints::AliITSsimulationFastPoints()
34 fSigmaRPhi[0] = fSigmaRPhi[1] = 12e-4;
35 fSigmaRPhi[2] = fSigmaRPhi[3] = 38e-4;
36 fSigmaRPhi[4] = fSigmaRPhi[5] = 20e-4;
37 fSigmaZ[0] = fSigmaZ[1] = 120e-4; // resolution for 425 micron pixels
38 fSigmaZ[2] = fSigmaZ[3] = 28e-4;
39 fSigmaZ[4] = fSigmaZ[5] = 830e-4;
40 fSigmaDe[0] = fSigmaDe[1] = 0.72e-6;
41 fSigmaDe[2] = fSigmaDe[3] = 0.90e-6;
42 fSigmaDe[4] = fSigmaDe[5] = 5e-6;
43 fThrDe[0] = fThrDe[1] = 7.2e-6;
44 fThrDe[2] = fThrDe[3] = 2.70e-6;
45 fThrDe[4] = fThrDe[5] = 10e-6;
48 //-------------------------------------------------------------
49 void AliITSsimulationFastPoints::CreateFastRecPoints(Int_t module){
50 // Fast points simulator
51 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
53 CreateFastRecPoints((AliITSmodule *)(aliITS->GetModule(module)),
56 //-------------------------------------------------------------
57 void AliITSsimulationFastPoints::CreateFastRecPoints(AliITSmodule *mod,
60 // Fast points simulator
61 AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
62 AliITSgeom *gm = aliITS->GetITSgeom();
64 const Float_t kdEdXtoQ = 2.778e+8;
66 Int_t ihit,flag,numofhits;
69 Double_t sigmarphi=0., sigmaz=0., sigmade=0., thrde=0.;
70 Float_t deltaXl,deltaZl,deltaDe;
72 Int_t hitlay, hitlad, hitdet, hitstatus;
73 Float_t hitpx, hitpy, hitpz, hitdestep;
75 Int_t hitstatus1, hittrack1;
76 Float_t hitx1, hity1, hitz1;
80 numofhits = mod->GetNhits();
81 //printf("numofhits %d \n",numofhits);
82 for(ihit=0;ihit<numofhits;ihit++){
83 AliITShit *hit=mod->GetHit(ihit);
84 hit->GetPositionG(hitx1,hity1,hitz1);
85 hitstatus1 = hit->GetTrackStatus();
86 hitdestep1 = hit->GetIonization();
87 hittrack1 = hit->GetTrack();
89 mod->MedianHit(module,hitx1,hity1,hitz1,hitstatus1,xMg,yMg,zMg,flag);
91 hitdestep = hit->GetIonization();
94 hit->GetDetectorID(hitlay,hitlad,hitdet);
95 hit->GetMomentumG(hitpx,hitpy,hitpz);
96 hitstatus = hitstatus1;
97 // Transform to the module local frame
101 gm->GtoL(hitlay,hitlad,hitdet,globals,locals);
102 // Retrieve sigma values for position and energy, and energy
104 sigmarphi = SigmaRPhi(hitlay);
105 sigmaz = SigmaZ(hitlay);
106 sigmade = SigmaDe(hitlay);
107 thrde = ThrDe(hitlay);
108 deltaXl = random->Gaus(0,sigmarphi);
109 deltaZl = random->Gaus(0,sigmaz);
110 deltaDe = random->Gaus(0,sigmade);
112 // Apply energy threshold and trasform back to global reference
115 if ( (hitdestep+deltaDe) > thrde ){
116 locals[0] += deltaXl;
117 locals[2] += deltaZl;
119 rp.fTracks[0]=hit->GetTrack();
120 // rp.fTracks[0]=mod->GetHitTrackIndex(ihit);
125 rp.SetdEdX(hitdestep+deltaDe);
126 rp.SetQ(kdEdXtoQ*(hitdestep+deltaDe)); // number of e
127 rp.SetSigmaX2(sigmarphi*sigmarphi);
128 rp.SetSigmaZ2(sigmaz*sigmaz);
129 aliITS->AddRecPoint(rp);
130 } // end if ( (hitdestep+deltaDe)
131 } // end if (hitdestep > 0)
132 } // end if (flag!=1)
135 //_______________________________________________________________________
136 void AliITSsimulationFastPoints::SetSigmaRPhi(Double_t srphi[6])
138 // set sigmas in rphi
141 for (i=0; i<6; i++) {
142 fSigmaRPhi[i]=srphi[i];
145 //_______________________________________________________________________
146 void AliITSsimulationFastPoints::SetSigmaZ(Double_t sz[6])
151 for (i=0; i<6; i++) {
155 //_______________________________________________________________________
156 void AliITSsimulationFastPoints::SetSigmaDe(Double_t sde[6])
158 // set sigmas in energy
161 for (i=0; i<6; i++) {
165 //_______________________________________________________________________
166 void AliITSsimulationFastPoints::SetThrDe(Double_t thrde[6])
168 // set energy thersholds
171 for (i=0; i<6; i++) {