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.1.2.4 2000/10/02 16:03:20 barbera
19 Forward declarations added
21 Revision 1.3 2000/09/22 12:44:34 nilsen
22 Default track number set to -3 and not 0.
24 Revision 1.2 2000/07/10 16:07:19 fca
25 Release version of ITS code
29 #include <TParticle.h>
33 #include "AliITShit.h"
34 #include "AliITSRecPoint.h"
35 #include "AliITSmodule.h"
36 #include "AliITSgeom.h"
37 #include "AliITSsimulationFastPointsV0.h"
38 #include "AliITSstatistics.h"
40 ClassImp(AliITSsimulationFastPointsV0)
42 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0()
45 fSx = new AliITSstatistics(2);
46 fSz = new AliITSstatistics(2);
49 //----------------------------------------------------------
50 AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0()
58 //-------------------------------------------------------------
59 void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm){
60 // Fast points simulator for all of the ITS.
61 Int_t nhit,h,trk,ifirst;
62 Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx.
66 fSx->Reset(); // Start out with things clearly zeroed
67 fSz->Reset(); // Start out with things clearly zeroed
68 e = 0.; // Start out with things clearly zeroed
70 nhit = mod->GetNhits();
74 hit->GetPositionL(x,y,z,t);
75 if(ifirst) {x1=x;y1=y;z1=z;}
76 e += hit->GetIonization();
77 trk = hit->GetTrack();
78 fSx->AddValue((Double_t)x,weight);
79 fSz->AddValue((Double_t)z,weight);
81 if(hit->StatusExiting()|| // leaving volume
82 hit->StatusDisappeared()|| // interacted/decayed...
83 hit->StatusStop() // dropped below E cuts.
84 ){ // exiting track, write out RecPoint.
85 // if(fSz->GetRMS()>1.E-1) {
86 // TParticle *part = hit->GetParticle();
87 // printf("idpart %d energy %f \n",part->GetPdgCode(),part->Energy());
88 // printf("diffx=%e diffy=%e diffz=%e\n",x-x1,y-y1,z-z1);
90 switch (mod->GetLayer()){
91 case 1: case 2: // SPDs
94 case 3: case 4: // SDDs
97 case 5: case 6: // SSDs
109 //_______________________________________________________________________
110 void AliITSsimulationFastPointsV0::AddSPD(Float_t &e,
111 AliITSmodule *mod,Int_t trackNumber){
112 const Float_t kmicronTocm = 1.0e-4;
113 // const Float_t kdEdXtoQ = ;
114 const Float_t kRMSx = 12.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
115 const Float_t kRMSz = 70.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
116 Float_t a1,a2; // general float.
117 AliITSRecPoint rpSPD;
119 rpSPD.fTracks[0]=trackNumber;
122 rpSPD.SetX(fSx->GetMean());
123 rpSPD.SetZ(fSz->GetMean());
126 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
127 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
128 // mod->GetLayer(),trackNumber,e,a1);
129 rpSPD.SetSigmaX2(a1);
130 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
131 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
132 rpSPD.SetSigmaZ2(a2);
134 (mod->GetITS())->AddRecPoint(rpSPD);
136 //_______________________________________________________________________
137 void AliITSsimulationFastPointsV0::AddSDD(Float_t &e,
138 AliITSmodule *mod,Int_t trackNumber){
140 const Float_t kmicronTocm = 1.0e-4;
141 const Float_t kdEdXtoQ = 2.778e+8;
142 const Float_t kRMSx = 38.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
143 const Float_t kRMSz = 28.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
144 Float_t a1,a2; // general float.
145 AliITSRecPoint rpSDD;
147 rpSDD.fTracks[0]=trackNumber;
150 rpSDD.SetX(fSx->GetMean());
151 rpSDD.SetZ(fSz->GetMean());
153 rpSDD.SetQ(kdEdXtoQ*e);
154 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
155 // if(a1>1.E5) printf("addSDD: layer=%d track #%d dedx=%e sigmaX2= %e ",
156 // mod->GetLayer(),trackNumber,e,a1);
157 rpSDD.SetSigmaX2(a1);
158 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
159 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
160 rpSDD.SetSigmaZ2(a2);
162 (mod->GetITS())->AddRecPoint(rpSDD);
164 //_______________________________________________________________________
165 void AliITSsimulationFastPointsV0::AddSSD(Float_t &e,
166 AliITSmodule *mod,Int_t trackNumber){
168 const Float_t kmicronTocm = 1.0e-4;
169 const Float_t kdEdXtoQ = 2.778e+8;
170 const Float_t kRMSx = 20.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
171 const Float_t kRMSz = 830.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
172 Float_t a1,a2; // general float.
173 AliITSRecPoint rpSSD;
175 rpSSD.fTracks[0]=trackNumber;
178 rpSSD.SetX(fSx->GetMean());
179 rpSSD.SetZ(fSz->GetMean());
181 rpSSD.SetQ(kdEdXtoQ*e);
182 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
183 // if(a1>1.E5) printf("addSSD: layer=%d track #%d dedx=%e sigmaX2= %e ",
184 // mod->GetLayer(),trackNumber,e,a1);
185 rpSSD.SetSigmaX2(a1);
186 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
187 // if(a1>1.E5) printf(" sigmaZ2= %e RMSx=%e RMSz=%e\n",a2,fSx->GetRMS(),fSz->GetRMS());
188 rpSSD.SetSigmaZ2(a2);
190 (mod->GetITS())->AddRecPoint(rpSSD);
192 //_______________________________________________________________________