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.3 2000/06/10 10:42:49 nilsen
19 Fixed bug in copy and operator =.
26 #include "AliITSgeomSPD425.h"
28 ClassImp(AliITSgeomSPD425)
30 AliITSgeomSPD425::AliITSgeomSPD425(){
31 ////////////////////////////////////////////////////////////////////////
32 // default constructor, for ITS post TDR geometry.
33 ////////////////////////////////////////////////////////////////////////
35 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.23625;// cm; Standard pixel detector
36 // size is 2dx wide, 2dz long,
37 // and 2dy thick. Geant 3.12
39 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
40 const Int_t knbinx = 256; // number of pixels along x direction.
41 const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction.
42 const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction.
43 const Int_t knbinz = 197; // number of pixels along z direction.
46 fdx = kdx; // default value.
47 fdy = kdy; // default value.
48 fdz = kdz; // default value.
49 fNbinx = knbinx; // default number of bins in x.
50 fNbinz = knbinz; // default number of bins in z.
52 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
53 for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
54 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
55 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
56 fBinSizeZ[ 31] = kbinz1;
57 fBinSizeZ[ 32] = kbinz1;
59 fBinSizeZ[ 64] = kbinz1;
60 fBinSizeZ[ 65] = kbinz1;
62 fBinSizeZ[ 97] = kbinz1;
63 fBinSizeZ[ 98] = kbinz1;
65 fBinSizeZ[130] = kbinz1;
66 fBinSizeZ[131] = kbinz1;
68 fBinSizeZ[163] = kbinz1;
69 fBinSizeZ[164] = kbinz1;
71 // correct detector size for bin size.
73 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
76 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
79 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
82 //______________________________________________________________________
83 AliITSgeomSPD425::AliITSgeomSPD425(Float_t dy,Int_t nx,Float_t *bx,
84 Int_t nz,Float_t *bz){
85 ////////////////////////////////////////////////////////////////////////
86 // default constructor, for a User modified TDR based geometry.
87 ////////////////////////////////////////////////////////////////////////
92 fNbinx = nx; // new number of bins in x.
93 fNbinz = nz; // new number of bins in z.
95 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
96 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
97 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
98 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
100 // correct detector size for bin size.
101 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
103 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
106 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
109 //______________________________________________________________________
110 AliITSgeomSPD425::AliITSgeomSPD425(AliITSgeomSPD425 &source){
113 if(&source == this) return;
114 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
115 this->fdx = source.fdx;
116 this->fdy = source.fdy;
117 this->fdz = source.fdz;
118 if(this->fBinSizeX) delete[] this->fBinSizeX;
119 if(this->fBinSizeX) delete[] this->fBinSizeZ;
120 this->fNbinx = source.fNbinx;
121 this->fBinSizeX = new Float_t[this->fNbinx];
122 this->fNbinz = source.fNbinz;
123 this->fBinSizeZ = new Float_t[this->fNbinz];
124 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
125 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
127 //______________________________________________________________________
128 AliITSgeomSPD425& AliITSgeomSPD425::operator=(AliITSgeomSPD425 &source){
131 if(&source == this) return *this;
132 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
133 this->fdx = source.fdx;
134 this->fdy = source.fdy;
135 this->fdz = source.fdz;
136 if(this->fBinSizeX) delete[] this->fBinSizeX;
137 if(this->fBinSizeX) delete[] this->fBinSizeZ;
138 this->fNbinx = source.fNbinx;
139 this->fBinSizeX = new Float_t[this->fNbinx];
140 this->fNbinz = source.fNbinz;
141 this->fBinSizeZ = new Float_t[this->fNbinz];
142 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
143 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
146 //______________________________________________________________________
147 AliITSgeomSPD425::~AliITSgeomSPD425(){
153 //______________________________________________________________________
154 void AliITSgeomSPD425::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
155 Int_t nz,Float_t *bz){
156 ////////////////////////////////////////////////////////////////////////
157 // default constructor, for a User modified TDR based geometry.
158 ////////////////////////////////////////////////////////////////////////
163 fNbinx = nx; // new number of bins in x.
164 fNbinz = nz; // new number of bins in z.
166 if(fBinSizeX!=0) delete[] fBinSizeX;
167 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
168 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
169 if(fBinSizeZ!=0) delete[] fBinSizeZ;
170 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
171 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
173 // correct detector size for bin size.
174 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
176 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
179 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
182 //----------------------------------------------------------------------
183 void AliITSgeomSPD425::Streamer(TBuffer &R__b){
184 // Streamer function for the class AliITSgeomSPD425.
187 if(R__b.IsReading()){
188 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
190 TObject::Streamer(R__b);
191 fShapeSPD->Streamer(R__b);
196 AliITSgeomSPD::Streamer(R__b);
197 fShapeSPD->Streamer(R__b);
202 if(fBinSizeX!=0) delete[] fBinSizeX;
203 fBinSizeX = new Float_t[fNbinx];
204 for(Int_t i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
206 if(fBinSizeZ!=0) delete[] fBinSizeZ;
207 fBinSizeZ = new Float_t[fNbinz];
208 for(Int_t i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
209 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD425::IsA());
211 } else { // IsWriting.
212 R__c = R__b.WriteVersion(AliITSgeomSPD425::IsA(), kTRUE);
213 AliITSgeomSPD::Streamer(R__b);
214 fShapeSPD->Streamer(R__b);
219 for(Int_t i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
221 for(Int_t i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
222 R__b.SetByteCount(R__c, kTRUE);
223 } // end if R__b.IsReading()
225 //----------------------------------------------------------------------