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 **************************************************************************/
20 #include <TParticle.h>
25 #include "AliITSsimulationFastPointsV0.h"
26 #include "AliITSstatistics.h"
28 ClassImp(AliITSsimulationFastPointsV0)
30 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0()
33 fSx = new AliITSstatistics(2);
34 fSz = new AliITSstatistics(2);
37 //----------------------------------------------------------
38 AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0()
46 //-------------------------------------------------------------
47 void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm){
48 // Fast points simulator for all of the ITS.
49 Int_t nhit,h,trk,ifirst;
50 Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx.
54 fSx->Reset(); // Start out with things clearly zeroed
55 fSz->Reset(); // Start out with things clearly zeroed
56 e = 0.; // Start out with things clearly zeroed
58 nhit = mod->GetNhits();
62 hit->GetPositionL(x,y,z,t);
63 if(ifirst) {x1=x;y1=y;z1=z;}
64 e += hit->GetIonization();
65 trk = hit->GetTrack();
66 fSx->AddValue((Double_t)x,weight);
67 fSz->AddValue((Double_t)z,weight);
69 if(hit->StatusExiting()|| // leaving volume
70 hit->StatusDisappeared()|| // interacted/decayed...
71 hit->StatusStop() // dropped below E cuts.
72 ){ // exiting track, write out RecPoint.
73 // if(fSz->GetRMS()>1.E-1) {
74 // TParticle *part = hit->GetParticle();
75 // printf("idpart %d energy %f \n",part->GetPdgCode(),part->Energy());
76 // printf("diffx=%e diffy=%e diffz=%e\n",x-x1,y-y1,z-z1);
78 switch (mod->GetLayer()){
79 case 1: case 2: // SPDs
82 case 3: case 4: // SDDs
85 case 5: case 6: // SSDs
97 //_______________________________________________________________________
98 void AliITSsimulationFastPointsV0::AddSPD(Float_t &e,
99 AliITSmodule *mod,Int_t trackNumber){
100 const Float_t kmicronTocm = 1.0e-4;
101 // const Float_t kdEdXtoQ = ;
102 const Float_t kRMSx = 12.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
103 const Float_t kRMSz = 70.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
104 Float_t a1,a2; // general float.
105 AliITSRecPoint rpSPD;
107 rpSPD.fTracks[0]=trackNumber;
110 rpSPD.SetX(fSx->GetMean());
111 rpSPD.SetZ(fSz->GetMean());
114 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
115 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
116 // mod->GetLayer(),trackNumber,e,a1);
117 rpSPD.SetSigmaX2(a1);
118 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
119 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
120 rpSPD.SetSigmaZ2(a2);
121 rpSPD.SetProbability(1.0);
123 (mod->GetITS())->AddRecPoint(rpSPD);
125 //_______________________________________________________________________
126 void AliITSsimulationFastPointsV0::AddSDD(Float_t &e,
127 AliITSmodule *mod,Int_t trackNumber){
129 const Float_t kmicronTocm = 1.0e-4;
130 const Float_t kdEdXtoQ = 2.778e+8;
131 const Float_t kRMSx = 38.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
132 const Float_t kRMSz = 28.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
133 Float_t a1,a2; // general float.
134 AliITSRecPoint rpSDD;
136 rpSDD.fTracks[0]=trackNumber;
139 rpSDD.SetX(fSx->GetMean());
140 rpSDD.SetZ(fSz->GetMean());
142 rpSDD.SetQ(kdEdXtoQ*e);
143 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
144 // if(a1>1.E5) printf("addSDD: layer=%d track #%d dedx=%e sigmaX2= %e ",
145 // mod->GetLayer(),trackNumber,e,a1);
146 rpSDD.SetSigmaX2(a1);
147 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
148 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
149 rpSDD.SetSigmaZ2(a2);
150 rpSDD.SetProbability(1.0);
152 (mod->GetITS())->AddRecPoint(rpSDD);
154 //_______________________________________________________________________
155 void AliITSsimulationFastPointsV0::AddSSD(Float_t &e,
156 AliITSmodule *mod,Int_t trackNumber){
158 const Float_t kmicronTocm = 1.0e-4;
159 const Float_t kdEdXtoQ = 2.778e+8;
160 const Float_t kRMSx = 20.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
161 const Float_t kRMSz = 830.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
162 Float_t a1,a2; // general float.
163 AliITSRecPoint rpSSD;
165 rpSSD.fTracks[0]=trackNumber;
168 rpSSD.SetX(fSx->GetMean());
169 rpSSD.SetZ(fSz->GetMean());
171 rpSSD.SetQ(kdEdXtoQ*e);
172 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
173 // if(a1>1.E5) printf("addSSD: layer=%d track #%d dedx=%e sigmaX2= %e ",
174 // mod->GetLayer(),trackNumber,e,a1);
175 rpSSD.SetSigmaX2(a1);
176 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
177 // if(a1>1.E5) printf(" sigmaZ2= %e RMSx=%e RMSz=%e\n",a2,fSx->GetRMS(),fSz->GetRMS());
178 rpSSD.SetSigmaZ2(a2);
179 rpSSD.SetProbability(1.0);
181 (mod->GetITS())->AddRecPoint(rpSSD);
183 //_______________________________________________________________________