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 **************************************************************************/
18 Revision 1.1.2.6 2000/06/12 18:10:18 barbera
19 fixed posible compilation errors on HP unix
21 Revision 1.1.2.5 2000/06/11 20:30:56 barbera
24 Revision 1.4 2000/06/10 20:34:22 nilsen
25 Fixed compilation warning with HP unix.
27 Revision 1.3 2000/06/10 10:42:49 nilsen
28 Fixed bug in copy and operator =.
35 #include "AliITSgeomSPD425.h"
37 ClassImp(AliITSgeomSPD425)
39 AliITSgeomSPD425::AliITSgeomSPD425(){
40 ////////////////////////////////////////////////////////////////////////
41 // default constructor, for ITS post TDR geometry.
42 ////////////////////////////////////////////////////////////////////////
44 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.23625;// cm; Standard pixel detector
45 // size is 2dx wide, 2dz long,
46 // and 2dy thick. Geant 3.12
48 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
49 const Int_t knbinx = 256; // number of pixels along x direction.
50 const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction.
51 const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction.
52 const Int_t knbinz = 197; // number of pixels along z direction.
55 fdx = kdx; // default value.
56 fdy = kdy; // default value.
57 fdz = kdz; // default value.
58 fNbinx = knbinx; // default number of bins in x.
59 fNbinz = knbinz; // default number of bins in z.
61 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
62 for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
63 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
64 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
65 fBinSizeZ[ 31] = kbinz1;
66 fBinSizeZ[ 32] = kbinz1;
68 fBinSizeZ[ 64] = kbinz1;
69 fBinSizeZ[ 65] = kbinz1;
71 fBinSizeZ[ 97] = kbinz1;
72 fBinSizeZ[ 98] = kbinz1;
74 fBinSizeZ[130] = kbinz1;
75 fBinSizeZ[131] = kbinz1;
77 fBinSizeZ[163] = kbinz1;
78 fBinSizeZ[164] = kbinz1;
80 // correct detector size for bin size.
82 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
85 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
88 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
91 //______________________________________________________________________
92 AliITSgeomSPD425::AliITSgeomSPD425(Float_t dy,Int_t nx,Float_t *bx,
93 Int_t nz,Float_t *bz){
94 ////////////////////////////////////////////////////////////////////////
95 // default constructor, for a User modified TDR based geometry.
96 ////////////////////////////////////////////////////////////////////////
101 fNbinx = nx; // new number of bins in x.
102 fNbinz = nz; // new number of bins in z.
104 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
105 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
106 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
107 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
109 // correct detector size for bin size.
110 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
112 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
115 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
118 //______________________________________________________________________
119 AliITSgeomSPD425::AliITSgeomSPD425(AliITSgeomSPD425 &source){
122 if(&source == this) return;
123 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
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];
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];
136 //______________________________________________________________________
137 AliITSgeomSPD425& AliITSgeomSPD425::operator=(AliITSgeomSPD425 &source){
140 if(&source == this) return *this;
141 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
142 this->fdx = source.fdx;
143 this->fdy = source.fdy;
144 this->fdz = source.fdz;
145 if(this->fBinSizeX) delete[] this->fBinSizeX;
146 if(this->fBinSizeX) delete[] this->fBinSizeZ;
147 this->fNbinx = source.fNbinx;
148 this->fBinSizeX = new Float_t[this->fNbinx];
149 this->fNbinz = source.fNbinz;
150 this->fBinSizeZ = new Float_t[this->fNbinz];
151 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
152 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
155 //______________________________________________________________________
156 AliITSgeomSPD425::~AliITSgeomSPD425(){
162 //______________________________________________________________________
163 void AliITSgeomSPD425::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
164 Int_t nz,Float_t *bz){
165 ////////////////////////////////////////////////////////////////////////
166 // default constructor, for a User modified TDR based geometry.
167 ////////////////////////////////////////////////////////////////////////
172 fNbinx = nx; // new number of bins in x.
173 fNbinz = nz; // new number of bins in z.
175 if(fBinSizeX!=0) delete[] fBinSizeX;
176 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
177 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
178 if(fBinSizeZ!=0) delete[] fBinSizeZ;
179 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
180 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
182 // correct detector size for bin size.
183 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
185 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
188 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
191 //----------------------------------------------------------------------
192 void AliITSgeomSPD425::Streamer(TBuffer &R__b){
193 // Streamer function for the class AliITSgeomSPD425.
197 if(R__b.IsReading()){
198 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
200 TObject::Streamer(R__b);
201 fShapeSPD->Streamer(R__b);
206 AliITSgeomSPD::Streamer(R__b);
207 fShapeSPD->Streamer(R__b);
212 if(fBinSizeX!=0) delete[] fBinSizeX;
213 fBinSizeX = new Float_t[fNbinx];
214 for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
216 if(fBinSizeZ!=0) delete[] fBinSizeZ;
217 fBinSizeZ = new Float_t[fNbinz];
218 for(i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
219 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD425::IsA());
221 } else { // IsWriting.
222 R__c = R__b.WriteVersion(AliITSgeomSPD425::IsA(), kTRUE);
223 AliITSgeomSPD::Streamer(R__b);
224 fShapeSPD->Streamer(R__b);
229 for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
231 for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
232 R__b.SetByteCount(R__c, kTRUE);
233 } // end if R__b.IsReading()
235 //----------------------------------------------------------------------