]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSsimulationFastPointsV0.cxx
Removing useless const to avoid warnings on alphacxx6
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationFastPointsV0.cxx
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.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 #include "AliITS.h"
19 #include "AliITShit.h"
20 #include "AliITSRecPoint.h"
21 #include "AliITSmodule.h"
22 #include "AliITSsimulationFastPointsV0.h"
23 #include "AliITSstatistics.h"
24
25 ClassImp(AliITSsimulationFastPointsV0)
26
27 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0()
28 {
29   // default constructor
30   fSx = 0;
31   fSz = 0;
32 }
33 AliITSsimulationFastPointsV0::AliITSsimulationFastPointsV0(const char *dataType){
34   //constructor
35   Info("AliITSsimulationFastPointsV0","Standard constructor %s",dataType);
36   fSx = new AliITSstatistics(2);
37   fSz = new AliITSstatistics(2);
38 }
39
40 //----------------------------------------------------------
41 AliITSsimulationFastPointsV0::~AliITSsimulationFastPointsV0()
42 {
43   //destructor
44   if(fSx) delete fSx;
45   if(fSz) delete fSz;
46
47 }
48
49 //-------------------------------------------------------------
50 void AliITSsimulationFastPointsV0::CreateFastRecPoints(AliITSmodule *mod,Int_t module,TRandom *rndm) {
51   // Fast points simulator for all of the ITS.
52   Int_t   nhit,h,trk,ifirst;
53   Float_t x,y,z,t,e;// local coordinate (cm) and time of flight, and dedx.
54   Float_t x1,y1,z1;
55   AliITShit *hit;
56
57   if(rndm!=0) module=0; // fix unsued parameter warnings.
58   fSx->Reset(); // Start out with things clearly zeroed
59   fSz->Reset(); // Start out with things clearly zeroed
60   e = 0.; // Start out with things clearly zeroed
61   Double_t weight=1.;
62   nhit = mod->GetNhits();
63   ifirst = 1;
64   for(h=0;h<nhit;h++){
65     hit = mod->GetHit(h);
66     hit->GetPositionL(x,y,z,t);
67     if(ifirst) {x1=x;y1=y;z1=z;}
68     e += hit->GetIonization();
69     trk = hit->GetTrack();
70     fSx->AddValue((Double_t)x,weight);
71     fSz->AddValue((Double_t)z,weight);
72     ifirst = 0;
73     if(hit->StatusExiting()||  // leaving volume
74        hit->StatusDisappeared()|| // interacted/decayed...
75        hit->StatusStop() // dropped below E cuts.
76        ){ // exiting track, write out RecPoint.
77       //      if(fSz->GetRMS()>1.E-1) {
78       //        TParticle *part = hit->GetParticle();
79       //        printf("idpart %d energy %f \n",part->GetPdgCode(),part->Energy());
80       //        printf("diffx=%e diffy=%e diffz=%e\n",x-x1,y-y1,z-z1);
81       //      }
82       switch (mod->GetLayer()){
83       case 1: case 2:  // SPDs
84         AddSPD(e,mod,trk);
85         break;
86       case 3: case 4:  // SDDs
87         AddSDD(e,mod,trk);
88         break;
89       case 5: case 6:  // SSDs
90         AddSSD(e,mod,trk);
91         break;
92       } // end switch
93       fSx->Reset();
94       fSz->Reset();
95       e = 0.;
96       ifirst = 1;
97       continue;
98     }// end if
99   } // end for h
100 }
101 //_______________________________________________________________________
102 void AliITSsimulationFastPointsV0::AddSPD(Float_t &e,
103                                          AliITSmodule *mod,Int_t trackNumber){
104   //
105
106   const Float_t kmicronTocm = 1.0e-4;
107   //  const Float_t kdEdXtoQ = ;
108   const Float_t kRMSx = 12.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
109   const Float_t kRMSz = 70.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
110   Float_t a1,a2; // general float.
111   AliITSRecPoint rpSPD;
112
113   rpSPD.fTracks[0]=trackNumber;
114   rpSPD.fTracks[1]=-3;
115   rpSPD.fTracks[2]=-3;
116   rpSPD.SetX(fSx->GetMean());
117   rpSPD.SetZ(fSz->GetMean());
118   rpSPD.SetdEdX(e);
119   rpSPD.SetQ(1.0);
120   a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
121   //  if(a1>1.E5) printf("addSPD: layer=%d track #%d dedx=%e sigmaX2= %e ",
122   //                mod->GetLayer(),trackNumber,e,a1);
123   rpSPD.SetSigmaX2(a1);
124   a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
125   //  if(a1>1.E5) printf(" sigmaZ2= %e\n",a2);
126   rpSPD.SetSigmaZ2(a2);
127
128   (mod->GetITS())->AddRecPoint(rpSPD);
129 }
130 //_______________________________________________________________________
131 void AliITSsimulationFastPointsV0::AddSDD(Float_t &e,
132                                          AliITSmodule *mod,Int_t trackNumber){
133   //
134
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;
141
142   rpSDD.fTracks[0]=trackNumber;
143   rpSDD.fTracks[1]=-3;
144   rpSDD.fTracks[2]=-3;
145   rpSDD.SetX(fSx->GetMean());
146   rpSDD.SetZ(fSz->GetMean());
147   rpSDD.SetdEdX(e);
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);
156
157   (mod->GetITS())->AddRecPoint(rpSDD);
158 }
159 //_______________________________________________________________________
160 void AliITSsimulationFastPointsV0::AddSSD(Float_t &e,
161                                          AliITSmodule *mod,Int_t trackNumber){
162   // 
163
164   const Float_t kmicronTocm = 1.0e-4;
165   const Float_t kdEdXtoQ = 2.778e+8;
166   const Float_t kRMSx = 20.0*kmicronTocm;  // microns->cm ITS TDR Table 1.3
167   const Float_t kRMSz = 830.0*kmicronTocm; // microns->cm ITS TDR Table 1.3
168   Float_t a1,a2; // general float.
169   AliITSRecPoint rpSSD;
170
171   rpSSD.fTracks[0]=trackNumber;
172   rpSSD.fTracks[1]=-3;
173   rpSSD.fTracks[2]=-3;
174   rpSSD.SetX(fSx->GetMean());
175   rpSSD.SetZ(fSz->GetMean());
176   rpSSD.SetdEdX(e);
177   rpSSD.SetQ(kdEdXtoQ*e);
178   a1 = fSx->GetRMS(); a1 *= a1; a1 += kRMSx*kRMSx;
179   //  if(a1>1.E5) printf("addSSD: layer=%d track #%d dedx=%e sigmaX2= %e ",
180   //                mod->GetLayer(),trackNumber,e,a1);
181   rpSSD.SetSigmaX2(a1);
182   a2 = fSz->GetRMS(); a2 *= a2; a2 += kRMSz*kRMSz;
183   //  if(a1>1.E5) printf(" sigmaZ2= %e RMSx=%e RMSz=%e\n",a2,fSx->GetRMS(),fSz->GetRMS());
184   rpSSD.SetSigmaZ2(a2);
185
186   (mod->GetITS())->AddRecPoint(rpSSD);
187 }
188 //_______________________________________________________________________
189