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.8 2000/10/02 15:52:05 barbera
19 Forward declaration added
21 Revision 1.6 2000/07/10 16:07:18 fca
22 Release version of ITS code
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 =.
36 #include "AliITSgeomSPD425.h"
38 ClassImp(AliITSgeomSPD425)
40 AliITSgeomSPD425::AliITSgeomSPD425(){
41 ////////////////////////////////////////////////////////////////////////
42 // default constructor, for ITS post TDR geometry.
43 ////////////////////////////////////////////////////////////////////////
45 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.23625;// cm; Standard pixel detector
46 // size is 2dx wide, 2dz long,
47 // and 2dy thick. Geant 3.12
49 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
50 const Int_t knbinx = 256; // number of pixels along x direction.
51 const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction.
52 const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction.
53 const Int_t knbinz = 197; // number of pixels along z direction.
56 fDx = kdx; // default value.
57 fDy = kdy; // default value.
58 fDz = kdz; // default value.
59 fNbinx = knbinx; // default number of bins in x.
60 fNbinz = knbinz; // default number of bins in z.
62 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
63 for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
64 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
65 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
66 fBinSizeZ[ 31] = kbinz1;
67 fBinSizeZ[ 32] = kbinz1;
69 fBinSizeZ[ 64] = kbinz1;
70 fBinSizeZ[ 65] = kbinz1;
72 fBinSizeZ[ 97] = kbinz1;
73 fBinSizeZ[ 98] = kbinz1;
75 fBinSizeZ[130] = kbinz1;
76 fBinSizeZ[131] = kbinz1;
78 fBinSizeZ[163] = kbinz1;
79 fBinSizeZ[164] = kbinz1;
81 // correct detector size for bin size.
83 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
86 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
89 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
92 //______________________________________________________________________
93 AliITSgeomSPD425::AliITSgeomSPD425(Float_t dy,Int_t nx,Float_t *bx,
94 Int_t nz,Float_t *bz){
95 ////////////////////////////////////////////////////////////////////////
96 // default constructor, for a User modified TDR based geometry.
97 ////////////////////////////////////////////////////////////////////////
102 fNbinx = nx; // new number of bins in x.
103 fNbinz = nz; // new number of bins in z.
105 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
106 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
107 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
108 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
110 // correct detector size for bin size.
111 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
113 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
116 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
119 //______________________________________________________________________
120 AliITSgeomSPD425::AliITSgeomSPD425(AliITSgeomSPD425 &source){
123 if(&source == this) return;
124 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
125 this->fDx = source.fDx;
126 this->fDy = source.fDy;
127 this->fDz = source.fDz;
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];
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];
137 //______________________________________________________________________
138 AliITSgeomSPD425& AliITSgeomSPD425::operator=(AliITSgeomSPD425 &source){
141 if(&source == this) return *this;
142 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
143 this->fDx = source.fDx;
144 this->fDy = source.fDy;
145 this->fDz = source.fDz;
146 if(this->fBinSizeX) delete[] this->fBinSizeX;
147 if(this->fBinSizeX) delete[] this->fBinSizeZ;
148 this->fNbinx = source.fNbinx;
149 this->fBinSizeX = new Float_t[this->fNbinx];
150 this->fNbinz = source.fNbinz;
151 this->fBinSizeZ = new Float_t[this->fNbinz];
152 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
153 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
156 //______________________________________________________________________
157 AliITSgeomSPD425::~AliITSgeomSPD425(){
163 //______________________________________________________________________
164 void AliITSgeomSPD425::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
165 Int_t nz,Float_t *bz){
166 ////////////////////////////////////////////////////////////////////////
167 // default constructor, for a User modified TDR based geometry.
168 ////////////////////////////////////////////////////////////////////////
173 fNbinx = nx; // new number of bins in x.
174 fNbinz = nz; // new number of bins in z.
176 if(fBinSizeX!=0) delete[] fBinSizeX;
177 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
178 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
179 if(fBinSizeZ!=0) delete[] fBinSizeZ;
180 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
181 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
183 // correct detector size for bin size.
184 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
186 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
189 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
193 //----------------------------------------------------------------------
194 void AliITSgeomSPD425::Streamer(TBuffer &R__b){
195 // Streamer function for the class AliITSgeomSPD425.
199 if(R__b.IsReading()){
200 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
202 TObject::Streamer(R__b);
203 fShapeSPD->Streamer(R__b);
208 AliITSgeomSPD::Streamer(R__b);
209 fShapeSPD->Streamer(R__b);
214 if(fBinSizeX!=0) delete[] fBinSizeX;
215 fBinSizeX = new Float_t[fNbinx];
216 for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
218 if(fBinSizeZ!=0) delete[] fBinSizeZ;
219 fBinSizeZ = new Float_t[fNbinz];
220 for(i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
221 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD425::IsA());
223 } else { // IsWriting.
224 R__c = R__b.WriteVersion(AliITSgeomSPD425::IsA(), kTRUE);
225 AliITSgeomSPD::Streamer(R__b);
226 fShapeSPD->Streamer(R__b);
231 for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
233 for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
234 R__b.SetByteCount(R__c, kTRUE);
235 } // end if R__b.IsReading()
237 //----------------------------------------------------------------------