]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSgeomSPD300.cxx
Automatic streamer used and forward declarations added
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSPD300.cxx
CommitLineData
50037af7 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/*
17$Log$
92c19c36 18Revision 1.1.2.8 2000/10/02 15:52:05 barbera
19Forward declaration added
20
21Revision 1.6 2000/07/10 16:07:18 fca
22Release version of ITS code
23
3bd79107 24Revision 1.4 2000/06/10 20:34:37 nilsen
25Fixed compilation warning with HP unix.
26
b3acdf28 27Revision 1.3 2000/06/10 10:43:04 nilsen
28Fixed bug in copy and operator =.
29
50037af7 30
31*/
32
92c19c36 33#include "TBRIK.h"
50037af7 34#include "AliITSgeomSPD300.h"
35
36ClassImp(AliITSgeomSPD300)
37
38AliITSgeomSPD300::AliITSgeomSPD300(){
39////////////////////////////////////////////////////////////////////////
40// default constructor, for ITS TDR geometry.
41////////////////////////////////////////////////////////////////////////
42const Float_t kdx=0.6400,kdy=0.0075,kdz=4.1890; // cm; Standard pixel detector
43 // size is 2dx wide, 2dz long,
44 // and 2dy thick. Geant 3.12
45 // units.
46const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
47const Int_t knbinx = 256; // number of pixels along x direction.
48const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
49const Int_t knbinz = 279; // number of pixels along z direction.
b3acdf28 50 Int_t i;
50037af7 51
92c19c36 52 fDx = kdx; // default value.
53 fDy = kdy; // default value.
54 fDz = kdz; // default value.
50037af7 55 fNbinx = knbinx; // default number of bins in x.
56 fNbinz = knbinz; // default number of bins in z.
57
58 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
b3acdf28 59 for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
50037af7 60 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
b3acdf28 61 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
50037af7 62
63 // correct detector size for bin size.
92c19c36 64 fDx = 0.0;
65 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
66 fDx *= 0.5;
67 fDz = 0.0;
68 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
69 fDz *= 0.5;
50037af7 70
71 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
92c19c36 72 fDx,fDy,fDz);
50037af7 73}
74//______________________________________________________________________
75AliITSgeomSPD300::AliITSgeomSPD300(Float_t dy,Int_t nx,Float_t *bx,
76 Int_t nz,Float_t *bz){
77////////////////////////////////////////////////////////////////////////
78// default constructor, for a User modified TDR based geometry.
79////////////////////////////////////////////////////////////////////////
b3acdf28 80 Int_t i;
92c19c36 81 fDx = 0.0;
82 fDy = dy;
83 fDz = 0.0;
50037af7 84 fNbinx = nx; // new number of bins in x.
85 fNbinz = nz; // new number of bins in z.
86
87 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
b3acdf28 88 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
50037af7 89 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
b3acdf28 90 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
50037af7 91
92 // correct detector size for bin size.
92c19c36 93 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
94 fDx *= 0.5;
95 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
96 fDz *= 0.5;
50037af7 97
98 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
92c19c36 99 fDx,fDy,fDz);
50037af7 100}
101//______________________________________________________________________
102AliITSgeomSPD300::AliITSgeomSPD300(AliITSgeomSPD300 &source){
103 // copy constructor
b3acdf28 104 Int_t i;
50037af7 105 if(&source == this) return;
93a31784 106 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
92c19c36 107 this->fDx = source.fDx;
108 this->fDy = source.fDy;
109 this->fDz = source.fDz;
50037af7 110 if(this->fBinSizeX) delete[] this->fBinSizeX;
111 if(this->fBinSizeX) delete[] this->fBinSizeZ;
112 this->fNbinx = source.fNbinx;
113 this->fBinSizeX = new Float_t[this->fNbinx];
114 this->fNbinz = source.fNbinz;
115 this->fBinSizeZ = new Float_t[this->fNbinz];
b3acdf28 116 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
117 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
50037af7 118}
119//______________________________________________________________________
120AliITSgeomSPD300& AliITSgeomSPD300::operator=(AliITSgeomSPD300 &source){
121 // = operator
b3acdf28 122 Int_t i;
50037af7 123 if(&source == this) return *this;
93a31784 124 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
92c19c36 125 this->fDx = source.fDx;
126 this->fDy = source.fDy;
127 this->fDz = source.fDz;
50037af7 128 if(this->fBinSizeX) delete[] this->fBinSizeX;
129 if(this->fBinSizeX) delete[] this->fBinSizeZ;
130 this->fNbinx = source.fNbinx;
131 this->fBinSizeX = new Float_t[this->fNbinx];
132 this->fNbinz = source.fNbinz;
133 this->fBinSizeZ = new Float_t[this->fNbinz];
b3acdf28 134 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
135 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
50037af7 136 return *this;
137}
138//______________________________________________________________________
139AliITSgeomSPD300::~AliITSgeomSPD300(){
140 // destructor
141 delete[] fBinSizeX;
142 delete[] fBinSizeZ;
143 delete fShapeSPD;
144}
145//______________________________________________________________________
146void AliITSgeomSPD300::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
147 Int_t nz,Float_t *bz){
148////////////////////////////////////////////////////////////////////////
149// default constructor, for a User modified TDR based geometry.
150////////////////////////////////////////////////////////////////////////
b3acdf28 151 Int_t i;
92c19c36 152 fDx = 0.0;
153 fDy = dy;
154 fDz = 0.0;
50037af7 155 fNbinx = nx; // new number of bins in x.
156 fNbinz = nz; // new number of bins in z.
157
158 if(fBinSizeX!=0) delete[] fBinSizeX;
159 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
b3acdf28 160 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
50037af7 161 if(fBinSizeZ!=0) delete[] fBinSizeZ;
162 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
b3acdf28 163 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
50037af7 164
165 // correct detector size for bin size.
92c19c36 166 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
167 fDx *= 0.5;
168 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
169 fDz *= 0.5;
50037af7 170
171 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
92c19c36 172 fDx,fDy,fDz);
50037af7 173}
92c19c36 174/*
50037af7 175//----------------------------------------------------------------------
176void AliITSgeomSPD300::Streamer(TBuffer &R__b){
177 // Streamer function for the class AliItSgeomSPD300.
178 Int_t i;
179 UInt_t R__s, R__c;
180
181 if(R__b.IsReading()){
182 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
183 if(R__v==1){
184 TObject::Streamer(R__b);
185 fShapeSPD->Streamer(R__b);
92c19c36 186 R__b >> fDx;
187 R__b >> fDy;
188 R__b >> fDz;
50037af7 189 }else if (R__v==2){
190 AliITSgeomSPD::Streamer(R__b);
191 fShapeSPD->Streamer(R__b);
92c19c36 192 R__b >> fDx;
193 R__b >> fDy;
194 R__b >> fDz;
50037af7 195 R__b >> fNbinx;
196 if(fBinSizeX!=0) delete[] fBinSizeX;
197 fBinSizeX = new Float_t[fNbinx];
198 for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
199 R__b >> fNbinz;
200 if(fBinSizeZ!=0) delete[] fBinSizeZ;
201 fBinSizeZ = new Float_t[fNbinz];
202 for(i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
203 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD300::IsA());
204 } // end if R__v==1
205 } else { // IsWriting.
206 R__c = R__b.WriteVersion(AliITSgeomSPD300::IsA(), kTRUE);
207 AliITSgeomSPD::Streamer(R__b);
208 fShapeSPD->Streamer(R__b);
92c19c36 209 R__b << fDx;
210 R__b << fDy;
211 R__b << fDz;
50037af7 212 R__b << fNbinx;
213 for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
214 R__b << fNbinz;
215 for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
216 R__b.SetByteCount(R__c, kTRUE);
217 } // end if R__b.IsReading()
218}
219//----------------------------------------------------------------------
92c19c36 220*/