]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulationFastPointsV0.cxx
Preprocessor with new DA
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationFastPointsV0.cxx
CommitLineData
e8189707 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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. *
7d62fb64 14 ***********************************************************************/
e8189707 15
803d1ab0 16/* $Id$ */
7d62fb64 17/////////////////////////////////////////////////////////
18// fast simulation V0 //
19// //
20// //
21/////////////////////////////////////////////////////////
e8189707 22
e8189707 23#include "AliITS.h"
517784f0 24#include "AliITShit.h"
25#include "AliITSRecPoint.h"
26#include "AliITSmodule.h"
e8189707 27#include "AliITSsimulationFastPointsV0.h"
28#include "AliITSstatistics.h"
29
30ClassImp(AliITSsimulationFastPointsV0)
31
7537d03c 32AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0():
33fNrecp(0),
34fSx(0),
35fSz(0){
9de0700b 36 // default constructor
9de0700b 37}
7537d03c 38AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const char *dataType):
39fNrecp(0),
40fSx(0),
41fSz(0){
e8189707 42 //constructor
d0df5576 43 Info("AliITSsimulationFastPointsV0","Standard constructor %s",dataType);
e8189707 44 fSx = new AliITSstatistics(2);
45 fSz = new AliITSstatistics(2);
46}
7d62fb64 47//______________________________________________________________________
7537d03c 48AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const AliITSsimulationFastPointsV0 & rec):AliITSsimulation(rec),
49fNrecp(rec.fNrecp),
50fSx(rec.fSx),
51fSz(rec.fSz){
7d62fb64 52 // Copy constructor.
53
7d62fb64 54}
55//______________________________________________________________________
7537d03c 56AliITSsimulationFastPointsV0& AliITSsimulationFastPointsV0::operator=(const AliITSsimulationFastPointsV0& /*source*/){
57 // Assignment operator
58 Error("operator=","Assignment operator not allowed");
59 return *this;
7d62fb64 60}
e8189707 61
62//----------------------------------------------------------
63AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0()
64{
65 //destructor
9de0700b 66 if(fSx) delete fSx;
67 if(fSz) delete fSz;
e8189707 68
69}
70
71//-------------------------------------------------------------
7d62fb64 72void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm, TClonesArray* recp) {
e8189707 73 // Fast points simulator for all of the ITS.
7d62fb64 74
e8189707 75 Int_t nhit,h,trk,ifirst;
76 Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx.
77 Float_t x1,y1,z1;
78 AliITShit *hit;
79
ac74f489 80 if(rndm!=0) module=0; // fix unsued parameter warnings.
e8189707 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
84 Double_t weight=1.;
85 nhit = mod->GetNhits();
86 ifirst = 1;
87 for(h=0;h<nhit;h++){
88 hit = mod->GetHit(h);
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);
95 ifirst = 0;
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);
104 // }
105 switch (mod->GetLayer()){
106 case 1: case 2: // SPDs
7d62fb64 107 AddSPD(e,mod,trk,recp);
e8189707 108 break;
109 case 3: case 4: // SDDs
7d62fb64 110 AddSDD(e,mod,trk,recp);
e8189707 111 break;
112 case 5: case 6: // SSDs
7d62fb64 113 AddSSD(e,mod,trk,recp);
e8189707 114 break;
115 } // end switch
116 fSx->Reset();
117 fSz->Reset();
118 e = 0.;
119 ifirst = 1;
120 continue;
121 }// end if
122 } // end for h
123}
124//_______________________________________________________________________
125void AliITSsimulationFastPointsV0::AddSPD(Float_t &e,
00a7cc50 126 AliITSmodule* mod,Int_t trackNumber,TClonesArray* recp){
d2f55a22 127 //
7d62fb64 128 TClonesArray &pt=*recp;
e8189707 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
00a7cc50 133
75fb37cc 134 Int_t lab[4] = {trackNumber,-3,-3,mod->GetIndex()};
135 Float_t a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
e8189707 136 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
137 // mod->GetLayer(),trackNumber,e,a1);
75fb37cc 138 Float_t a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
e8189707 139 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
75fb37cc 140 Float_t hit[5] = {fSx->GetMean(),fSz->GetMean(),a1,a2,1.0};
141 Int_t info[3] = {0,0,mod->GetLayer()};
142
143 AliITSRecPoint rpSPD(lab,hit,info,kTRUE);
144 rpSPD.SetdEdX(e);
145
7d62fb64 146 new (pt[fNrecp]) AliITSRecPoint(rpSPD);
147 fNrecp++;
e8189707 148}
149//_______________________________________________________________________
150void AliITSsimulationFastPointsV0::AddSDD(Float_t &e,
00a7cc50 151 AliITSmodule* mod,Int_t trackNumber,TClonesArray* recp){
d2f55a22 152 //
7d62fb64 153 TClonesArray &pt=*recp;
e8189707 154 const Float_t kmicronTocm = 1.0e-4;
155 const Float_t kdEdXtoQ = 2.778e+8;
156 const Float_t kRMSx = 38.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
157 const Float_t kRMSz = 28.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
e8189707 158
75fb37cc 159 Int_t lab[4] = {trackNumber,-3,-3,mod->GetIndex()};
160 Float_t a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
161 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
e8189707 162 // mod->GetLayer(),trackNumber,e,a1);
75fb37cc 163 Float_t a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
e8189707 164 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
75fb37cc 165 Float_t hit[5] = {fSx->GetMean(),fSz->GetMean(),a1,a2,kdEdXtoQ*e};
166 Int_t info[3] = {0,0,mod->GetLayer()};
167
168 AliITSRecPoint rpSDD(lab,hit,info,kTRUE);
169 rpSDD.SetdEdX(e);
170
7d62fb64 171 new (pt[fNrecp]) AliITSRecPoint(rpSDD);
172 fNrecp++;
173
e8189707 174}
175//_______________________________________________________________________
176void AliITSsimulationFastPointsV0::AddSSD(Float_t &e,
00a7cc50 177 AliITSmodule* mod,Int_t trackNumber,TClonesArray* recp){
d2f55a22 178 //
7d62fb64 179 TClonesArray &pt=*recp;
e8189707 180 const Float_t kmicronTocm = 1.0e-4;
181 const Float_t kdEdXtoQ = 2.778e+8;
182 const Float_t kRMSx = 20.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
183 const Float_t kRMSz = 830.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
e8189707 184
75fb37cc 185 Int_t lab[4] = {trackNumber,-3,-3,mod->GetIndex()};
186 Float_t a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
187 // if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
188 // mod->GetLayer(),trackNumber,e,a1);
189 Float_t a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
190 // if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
191 Float_t hit[5] = {fSx->GetMean(),fSz->GetMean(),a1,a2,kdEdXtoQ*e};
192 Int_t info[3] = {0,0,mod->GetLayer()};
00a7cc50 193
75fb37cc 194 AliITSRecPoint rpSSD(lab,hit,info,kTRUE);
e8189707 195 rpSSD.SetdEdX(e);
75fb37cc 196
7d62fb64 197 new (pt[fNrecp]) AliITSRecPoint(rpSSD);
198 fNrecp++;
199
200
e8189707 201}
202//_______________________________________________________________________
203