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.4 2000/10/02 16:34:28 barbera
19 Forward declarations added
21 Revision 1.1.2.4 2000/10/02 16:03:20 barbera
22 Forward declarations added
24 Revision 1.3 2000/09/22 12:44:34 nilsen
25 Default track number set to -3 and not 0.
27 Revision 1.2 2000/07/10 16:07:19 fca
28 Release version of ITS code
32 #include <TParticle.h>
36 #include "AliITShit.h"
37 #include "AliITSRecPoint.h"
38 #include "AliITSmodule.h"
39 #include "AliITSgeom.h"
40 #include "AliITSsimulationFastPointsV0.h"
41 #include "AliITSstatistics.h"
43 ClassImp(AliITSsimulationFastPointsV0)
45 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0()
47 // default constructor
51 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const char *dataType){
53 fSx = new AliITSstatistics(2);
54 fSz = new AliITSstatistics(2);
57 //----------------------------------------------------------
58 AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0()
66 //-------------------------------------------------------------
67 void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm){
68 // Fast points simulator for all of the ITS.
69 Int_t nhit,h,trk,ifirst;
70 Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx.
74 fSx->Reset(); // Start out with things clearly zeroed
75 fSz->Reset(); // Start out with things clearly zeroed
76 e = 0.; // Start out with things clearly zeroed
78 nhit = mod->GetNhits();
82 hit->GetPositionL(x,y,z,t);
83 if(ifirst) {x1=x;y1=y;z1=z;}
84 e += hit->GetIonization();
85 trk = hit->GetTrack();
86 fSx->AddValue((Double_t)x,weight);
87 fSz->AddValue((Double_t)z,weight);
89 if(hit->StatusExiting()|| // leaving volume
90 hit->StatusDisappeared()|| // interacted/decayed...
91 hit->StatusStop() // dropped below E cuts.
92 ){ // exiting track, write out RecPoint.
93 // if(fSz->GetRMS()>1.E-1) {
94 // TParticle *part = hit->GetParticle();
95 // printf("idpart %d energy %f \n",part->GetPdgCode(),part->Energy());
96 // printf("diffx=%e diffy=%e diffz=%e\n",x-x1,y-y1,z-z1);
98 switch (mod->GetLayer()){
99 case 1: case 2: // SPDs
102 case 3: case 4: // SDDs
105 case 5: case 6: // SSDs
117 //_______________________________________________________________________
118 void AliITSsimulationFastPointsV0::AddSPD(Float_t &e,
119 AliITSmodule *mod,Int_t trackNumber){
120 const Float_t kmicronTocm = 1.0e-4;
121 // const Float_t kdEdXtoQ = ;
122 const Float_t kRMSx = 12.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
123 const Float_t kRMSz = 70.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
124 Float_t a1,a2; // general float.
125 AliITSRecPoint rpSPD;
127 rpSPD.fTracks[0]=trackNumber;
130 rpSPD.SetX(fSx->GetMean());
131 rpSPD.SetZ(fSz->GetMean());
134 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
135 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
136 // mod->GetLayer(),trackNumber,e,a1);
137 rpSPD.SetSigmaX2(a1);
138 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
139 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
140 rpSPD.SetSigmaZ2(a2);
142 (mod->GetITS())->AddRecPoint(rpSPD);
144 //_______________________________________________________________________
145 void AliITSsimulationFastPointsV0::AddSDD(Float_t &e,
146 AliITSmodule *mod,Int_t trackNumber){
148 const Float_t kmicronTocm = 1.0e-4;
149 const Float_t kdEdXtoQ = 2.778e+8;
150 const Float_t kRMSx = 38.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
151 const Float_t kRMSz = 28.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
152 Float_t a1,a2; // general float.
153 AliITSRecPoint rpSDD;
155 rpSDD.fTracks[0]=trackNumber;
158 rpSDD.SetX(fSx->GetMean());
159 rpSDD.SetZ(fSz->GetMean());
161 rpSDD.SetQ(kdEdXtoQ*e);
162 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
163 // if(a1>1.E5) printf("addSDD: layer=%d track #%d dedx=%e sigmaX2= %e ",
164 // mod->GetLayer(),trackNumber,e,a1);
165 rpSDD.SetSigmaX2(a1);
166 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
167 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
168 rpSDD.SetSigmaZ2(a2);
170 (mod->GetITS())->AddRecPoint(rpSDD);
172 //_______________________________________________________________________
173 void AliITSsimulationFastPointsV0::AddSSD(Float_t &e,
174 AliITSmodule *mod,Int_t trackNumber){
176 const Float_t kmicronTocm = 1.0e-4;
177 const Float_t kdEdXtoQ = 2.778e+8;
178 const Float_t kRMSx = 20.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
179 const Float_t kRMSz = 830.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
180 Float_t a1,a2; // general float.
181 AliITSRecPoint rpSSD;
183 rpSSD.fTracks[0]=trackNumber;
186 rpSSD.SetX(fSx->GetMean());
187 rpSSD.SetZ(fSz->GetMean());
189 rpSSD.SetQ(kdEdXtoQ*e);
190 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
191 // if(a1>1.E5) printf("addSSD: layer=%d track #%d dedx=%e sigmaX2= %e ",
192 // mod->GetLayer(),trackNumber,e,a1);
193 rpSSD.SetSigmaX2(a1);
194 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
195 // if(a1>1.E5) printf(" sigmaZ2= %e RMSx=%e RMSz=%e\n",a2,fSx->GetRMS(),fSz->GetRMS());
196 rpSSD.SetSigmaZ2(a2);
198 (mod->GetITS())->AddRecPoint(rpSSD);
200 //_______________________________________________________________________