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():
36 // default constructor
38 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const char *dataType):
43 Info("AliITSsimulationFastPointsV0","Standard constructor %s",dataType);
44 fSx = new AliITSstatistics(2);
45 fSz = new AliITSstatistics(2);
47 //______________________________________________________________________
48 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const AliITSsimulationFastPointsV0 & rec):AliITSsimulation(rec),
55 //______________________________________________________________________
56 AliITSsimulationFastPointsV0& AliITSsimulationFastPointsV0::operator=(const AliITSsimulationFastPointsV0& /*source*/){
57 // Assignment operator
58 Error("operator=","Assignment operator not allowed");
62 //----------------------------------------------------------
63 AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0()
71 //-------------------------------------------------------------
72 void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm, TClonesArray* recp) {
73 // Fast points simulator for all of the ITS.
75 Int_t nhit,h,trk,ifirst;
76 Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx.
80 if(rndm!=0) module=0; // fix unsued parameter warnings.
81 fSx->Reset(); // Start out with things clearly zeroed
82 fSz->Reset(); // Start out with things clearly zeroed
83 e = 0.; // Start out with things clearly zeroed
85 nhit = mod->GetNhits();
89 hit->GetPositionL(x,y,z,t);
90 if(ifirst) {x1=x;y1=y;z1=z;}
91 e += hit->GetIonization();
92 trk = hit->GetTrack();
93 fSx->AddValue((Double_t)x,weight);
94 fSz->AddValue((Double_t)z,weight);
96 if(hit->StatusExiting()|| // leaving volume
97 hit->StatusDisappeared()|| // interacted/decayed...
98 hit->StatusStop() // dropped below E cuts.
99 ){ // exiting track, write out RecPoint.
100 // if(fSz->GetRMS()>1.E-1) {
101 // TParticle *part = hit->GetParticle();
102 // printf("idpart %d energy %f \n",part->GetPdgCode(),part->Energy());
103 // printf("diffx=%e diffy=%e diffz=%e\n",x-x1,y-y1,z-z1);
105 switch (mod->GetLayer()){
106 case 1: case 2: // SPDs
107 AddSPD(e,mod,trk,recp);
109 case 3: case 4: // SDDs
110 AddSDD(e,mod,trk,recp);
112 case 5: case 6: // SSDs
113 AddSSD(e,mod,trk,recp);
124 //_______________________________________________________________________
125 void AliITSsimulationFastPointsV0::AddSPD(Float_t &e,
126 AliITSmodule* mod,Int_t trackNumber,TClonesArray* recp){
128 TClonesArray &pt=*recp;
129 const Float_t kmicronTocm = 1.0e-4;
130 // const Float_t kdEdXtoQ = ;
131 const Float_t kRMSx = 12.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
132 const Float_t kRMSz = 70.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
133 Float_t a1,a2; // general float.
135 AliITSgeom* gm = mod->GetITS()->GetITSgeom();
137 AliITSRecPoint rpSPD(gm);
139 rpSPD.SetLabel(trackNumber,0);
140 rpSPD.SetLabel(-3,1);
141 rpSPD.SetLabel(-3,2);
142 rpSPD.SetXZ(mod->GetIndex(),fSx->GetMean(),fSz->GetMean());
145 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
146 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
147 // mod->GetLayer(),trackNumber,e,a1);
148 rpSPD.SetSigmaDetLocX2(a1);
149 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
150 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
151 rpSPD.SetSigmaZ2(a2);
152 rpSPD.SetDetectorIndex(mod->GetIndex());
153 rpSPD.SetLayer(mod->GetLayer());
154 //(mod->GetITS())->AddRecPoint(rpSPD);
155 new (pt[fNrecp]) AliITSRecPoint(rpSPD);
158 //_______________________________________________________________________
159 void AliITSsimulationFastPointsV0::AddSDD(Float_t &e,
160 AliITSmodule* mod,Int_t trackNumber,TClonesArray* recp){
162 TClonesArray &pt=*recp;
163 const Float_t kmicronTocm = 1.0e-4;
164 const Float_t kdEdXtoQ = 2.778e+8;
165 const Float_t kRMSx = 38.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
166 const Float_t kRMSz = 28.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
167 Float_t a1,a2; // general float.
168 AliITSgeom* gm = mod->GetITS()->GetITSgeom();
170 AliITSRecPoint rpSDD(gm);
172 rpSDD.SetLabel(trackNumber,0);
173 rpSDD.SetLabel(-3,1);
174 rpSDD.SetLabel(-3,2);
175 rpSDD.SetXZ(mod->GetIndex(),fSx->GetMean(),fSz->GetMean());
177 rpSDD.SetQ(kdEdXtoQ*e);
178 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
179 // if(a1>1.E5) printf("addSDD: layer=%d track #%d dedx=%e sigmaX2= %e ",
180 // mod->GetLayer(),trackNumber,e,a1);
181 rpSDD.SetSigmaDetLocX2(a1);
182 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
183 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
184 rpSDD.SetSigmaZ2(a2);
185 rpSDD.SetDetectorIndex(mod->GetIndex());
186 rpSDD.SetLayer(mod->GetLayer());
187 new (pt[fNrecp]) AliITSRecPoint(rpSDD);
191 //_______________________________________________________________________
192 void AliITSsimulationFastPointsV0::AddSSD(Float_t &e,
193 AliITSmodule* mod,Int_t trackNumber,TClonesArray* recp){
195 TClonesArray &pt=*recp;
196 const Float_t kmicronTocm = 1.0e-4;
197 const Float_t kdEdXtoQ = 2.778e+8;
198 const Float_t kRMSx = 20.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
199 const Float_t kRMSz = 830.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
200 Float_t a1,a2; // general float.
202 AliITSgeom* gm = mod->GetITS()->GetITSgeom();
204 AliITSRecPoint rpSSD(gm);
206 rpSSD.SetLabel(trackNumber,0);
207 rpSSD.SetLabel(-3,1);
208 rpSSD.SetLabel(-3,2);
209 rpSSD.SetXZ(mod->GetIndex(),fSx->GetMean(),fSz->GetMean());
211 rpSSD.SetQ(kdEdXtoQ*e);
212 a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
213 // if(a1>1.E5) printf("addSSD: layer=%d track #%d dedx=%e sigmaX2= %e ",
214 // mod->GetLayer(),trackNumber,e,a1);
215 rpSSD.SetSigmaDetLocX2(a1);
216 a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
217 // if(a1>1.E5) printf(" sigmaZ2= %e RMSx=%e RMSz=%e\n",a2,fSx->GetRMS(),fSz->GetRMS());
218 rpSSD.SetSigmaZ2(a2);
219 rpSSD.SetDetectorIndex(mod->GetIndex());
220 rpSSD.SetLayer(mod->GetLayer());
221 new (pt[fNrecp]) AliITSRecPoint(rpSSD);
226 //_______________________________________________________________________