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 ***********************************************************************/
17 /////////////////////////////////////////////////////////
18 // fast simulation V0 //
21 /////////////////////////////////////////////////////////
24 #include "AliITShit.h"
25 #include "AliITSRecPoint.h"
26 #include "AliITSmodule.h"
27 #include "AliITSsimulationFastPointsV0.h"
28 #include "AliITSstatistics.h"
30 ClassImp(AliITSsimulationFastPointsV0)
32 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0()
34 // default constructor
38 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const char *dataType){
40 Info("AliITSsimulationFastPointsV0","Standard constructor %s",dataType);
41 fSx = new AliITSstatistics(2);
42 fSz = new AliITSstatistics(2);
44 //______________________________________________________________________
45 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const AliITSsimulationFastPointsV0 &/*rec*/):AliITSsimulation(/*rec*/){
48 Error("Copy constructor","Copy constructor not allowed");
51 //______________________________________________________________________
52 AliITSsimulationFastPointsV0& AliITSsimulationFastPointsV0::operator=(const AliITSsimulationFastPointsV0& /*source*/){
53 // Assignment operator. This is a function which is not allowed to be
55 Error("operator=","Assignment operator not allowed\n");
59 //----------------------------------------------------------
60 AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0()
68 //-------------------------------------------------------------
69 void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm, TClonesArray* recp) {
70 // Fast points simulator for all of the ITS.
72 Int_t nhit,h,trk,ifirst;
73 Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx.
77 if(rndm!=0) module=0; // fix unsued parameter warnings.
78 fSx->Reset(); // Start out with things clearly zeroed
79 fSz->Reset(); // Start out with things clearly zeroed
80 e = 0.; // Start out with things clearly zeroed
82 nhit = mod->GetNhits();
86 hit->GetPositionL(x,y,z,t);
87 if(ifirst) {x1=x;y1=y;z1=z;}
88 e += hit->GetIonization();
89 trk = hit->GetTrack();
90 fSx->AddValue((Double_t)x,weight);
91 fSz->AddValue((Double_t)z,weight);
93 if(hit->StatusExiting()|| // leaving volume
94 hit->StatusDisappeared()|| // interacted/decayed...
95 hit->StatusStop() // dropped below E cuts.
96 ){ // exiting track, write out RecPoint.
97 // if(fSz->GetRMS()>1.E-1) {
98 // TParticle *part = hit->GetParticle();
99 // printf("idpart %d energy %f \n",part->GetPdgCode(),part->Energy());
100 // printf("diffx=%e diffy=%e diffz=%e\n",x-x1,y-y1,z-z1);
102 switch (mod->GetLayer()){
103 case 1: case 2: // SPDs
104 AddSPD(e,mod,trk,recp);
106 case 3: case 4: // SDDs
107 AddSDD(e,mod,trk,recp);
109 case 5: case 6: // SSDs
110 AddSSD(e,mod,trk,recp);
121 //_______________________________________________________________________
122 void AliITSsimulationFastPointsV0::AddSPD(Float_t &e,
123 AliITSmodule* /*mod*/,Int_t trackNumber,TClonesArray* recp){
125 TClonesArray &pt=*recp;
126 const Float_t kmicronTocm = 1.0e-4;
127 // const Float_t kdEdXtoQ = ;
128 const Float_t kRMSx = 12.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
129 const Float_t kRMSz = 70.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
130 Float_t a1,a2; // general float.
131 AliITSRecPoint rpSPD;
133 rpSPD.fTracks[0]=trackNumber;
136 rpSPD.SetX(fSx->GetMean());
137 rpSPD.SetZ(fSz->GetMean());
140 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
141 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
142 // mod->GetLayer(),trackNumber,e,a1);
143 rpSPD.SetSigmaX2(a1);
144 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
145 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
146 rpSPD.SetSigmaZ2(a2);
148 //(mod->GetITS())->AddRecPoint(rpSPD);
149 new (pt[fNrecp]) AliITSRecPoint(rpSPD);
152 //_______________________________________________________________________
153 void AliITSsimulationFastPointsV0::AddSDD(Float_t &e,
154 AliITSmodule* /*mod*/,Int_t trackNumber,TClonesArray* recp){
156 TClonesArray &pt=*recp;
157 const Float_t kmicronTocm = 1.0e-4;
158 const Float_t kdEdXtoQ = 2.778e+8;
159 const Float_t kRMSx = 38.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
160 const Float_t kRMSz = 28.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
161 Float_t a1,a2; // general float.
162 AliITSRecPoint rpSDD;
164 rpSDD.fTracks[0]=trackNumber;
167 rpSDD.SetX(fSx->GetMean());
168 rpSDD.SetZ(fSz->GetMean());
170 rpSDD.SetQ(kdEdXtoQ*e);
171 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
172 // if(a1>1.E5) printf("addSDD: layer=%d track #%d dedx=%e sigmaX2= %e ",
173 // mod->GetLayer(),trackNumber,e,a1);
174 rpSDD.SetSigmaX2(a1);
175 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
176 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
177 rpSDD.SetSigmaZ2(a2);
179 new (pt[fNrecp]) AliITSRecPoint(rpSDD);
183 //_______________________________________________________________________
184 void AliITSsimulationFastPointsV0::AddSSD(Float_t &e,
185 AliITSmodule* /*mod*/,Int_t trackNumber,TClonesArray* recp){
187 TClonesArray &pt=*recp;
188 const Float_t kmicronTocm = 1.0e-4;
189 const Float_t kdEdXtoQ = 2.778e+8;
190 const Float_t kRMSx = 20.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
191 const Float_t kRMSz = 830.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
192 Float_t a1,a2; // general float.
193 AliITSRecPoint rpSSD;
195 rpSSD.fTracks[0]=trackNumber;
198 rpSSD.SetX(fSx->GetMean());
199 rpSSD.SetZ(fSz->GetMean());
201 rpSSD.SetQ(kdEdXtoQ*e);
202 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
203 // if(a1>1.E5) printf("addSSD: layer=%d track #%d dedx=%e sigmaX2= %e ",
204 // mod->GetLayer(),trackNumber,e,a1);
205 rpSSD.SetSigmaX2(a1);
206 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
207 // if(a1>1.E5) printf(" sigmaZ2= %e RMSx=%e RMSz=%e\n",a2,fSx->GetRMS(),fSz->GetRMS());
208 rpSSD.SetSigmaZ2(a2);
210 new (pt[fNrecp]) AliITSRecPoint(rpSSD);
215 //_______________________________________________________________________