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