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 #include <TParticle.h>
22 #include "AliITShit.h"
23 #include "AliITSRecPoint.h"
24 #include "AliITSmodule.h"
25 #include "AliITSgeom.h"
26 #include "AliITSsimulationFastPointsV0.h"
27 #include "AliITSstatistics.h"
29 ClassImp(AliITSsimulationFastPointsV0)
31 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0()
33 // default constructor
37 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const char *dataType){
39 fSx = new AliITSstatistics(2);
40 fSz = new AliITSstatistics(2);
43 //----------------------------------------------------------
44 AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0()
52 //-------------------------------------------------------------
53 void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm){
54 // Fast points simulator for all of the ITS.
55 Int_t nhit,h,trk,ifirst;
56 Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx.
60 if(rndm!=0) module=0; // fix unsued parameter warnings.
61 fSx->Reset(); // Start out with things clearly zeroed
62 fSz->Reset(); // Start out with things clearly zeroed
63 e = 0.; // Start out with things clearly zeroed
65 nhit = mod->GetNhits();
69 hit->GetPositionL(x,y,z,t);
70 if(ifirst) {x1=x;y1=y;z1=z;}
71 e += hit->GetIonization();
72 trk = hit->GetTrack();
73 fSx->AddValue((Double_t)x,weight);
74 fSz->AddValue((Double_t)z,weight);
76 if(hit->StatusExiting()|| // leaving volume
77 hit->StatusDisappeared()|| // interacted/decayed...
78 hit->StatusStop() // dropped below E cuts.
79 ){ // exiting track, write out RecPoint.
80 // if(fSz->GetRMS()>1.E-1) {
81 // TParticle *part = hit->GetParticle();
82 // printf("idpart %d energy %f \n",part->GetPdgCode(),part->Energy());
83 // printf("diffx=%e diffy=%e diffz=%e\n",x-x1,y-y1,z-z1);
85 switch (mod->GetLayer()){
86 case 1: case 2: // SPDs
89 case 3: case 4: // SDDs
92 case 5: case 6: // SSDs
104 //_______________________________________________________________________
105 void AliITSsimulationFastPointsV0::AddSPD(Float_t &e,
106 AliITSmodule *mod,Int_t trackNumber){
107 const Float_t kmicronTocm = 1.0e-4;
108 // const Float_t kdEdXtoQ = ;
109 const Float_t kRMSx = 12.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
110 const Float_t kRMSz = 70.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
111 Float_t a1,a2; // general float.
112 AliITSRecPoint rpSPD;
114 rpSPD.fTracks[0]=trackNumber;
117 rpSPD.SetX(fSx->GetMean());
118 rpSPD.SetZ(fSz->GetMean());
121 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
122 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
123 // mod->GetLayer(),trackNumber,e,a1);
124 rpSPD.SetSigmaX2(a1);
125 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
126 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
127 rpSPD.SetSigmaZ2(a2);
129 (mod->GetITS())->AddRecPoint(rpSPD);
131 //_______________________________________________________________________
132 void AliITSsimulationFastPointsV0::AddSDD(Float_t &e,
133 AliITSmodule *mod,Int_t trackNumber){
135 const Float_t kmicronTocm = 1.0e-4;
136 const Float_t kdEdXtoQ = 2.778e+8;
137 const Float_t kRMSx = 38.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
138 const Float_t kRMSz = 28.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
139 Float_t a1,a2; // general float.
140 AliITSRecPoint rpSDD;
142 rpSDD.fTracks[0]=trackNumber;
145 rpSDD.SetX(fSx->GetMean());
146 rpSDD.SetZ(fSz->GetMean());
148 rpSDD.SetQ(kdEdXtoQ*e);
149 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
150 // if(a1>1.E5) printf("addSDD: layer=%d track #%d dedx=%e sigmaX2= %e ",
151 // mod->GetLayer(),trackNumber,e,a1);
152 rpSDD.SetSigmaX2(a1);
153 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
154 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
155 rpSDD.SetSigmaZ2(a2);
157 (mod->GetITS())->AddRecPoint(rpSDD);
159 //_______________________________________________________________________
160 void AliITSsimulationFastPointsV0::AddSSD(Float_t &e,
161 AliITSmodule *mod,Int_t trackNumber){
163 const Float_t kmicronTocm = 1.0e-4;
164 const Float_t kdEdXtoQ = 2.778e+8;
165 const Float_t kRMSx = 20.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
166 const Float_t kRMSz = 830.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
167 Float_t a1,a2; // general float.
168 AliITSRecPoint rpSSD;
170 rpSSD.fTracks[0]=trackNumber;
173 rpSSD.SetX(fSx->GetMean());
174 rpSSD.SetZ(fSz->GetMean());
176 rpSSD.SetQ(kdEdXtoQ*e);
177 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
178 // if(a1>1.E5) printf("addSSD: layer=%d track #%d dedx=%e sigmaX2= %e ",
179 // mod->GetLayer(),trackNumber,e,a1);
180 rpSSD.SetSigmaX2(a1);
181 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
182 // if(a1>1.E5) printf(" sigmaZ2= %e RMSx=%e RMSz=%e\n",a2,fSx->GetRMS(),fSz->GetRMS());
183 rpSSD.SetSigmaZ2(a2);
185 (mod->GetITS())->AddRecPoint(rpSSD);
187 //_______________________________________________________________________