]>
Commit | Line | Data |
---|---|---|
d53869b0 | 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 | 18 | Revision 1.1.2.8 2000/10/02 15:52:05 barbera |
19 | Forward declaration added | |
20 | ||
21 | Revision 1.6 2000/07/10 16:07:18 fca | |
22 | Release version of ITS code | |
23 | ||
3bd79107 | 24 | Revision 1.4 2000/06/10 20:34:22 nilsen |
25 | Fixed compilation warning with HP unix. | |
26 | ||
b3acdf28 | 27 | Revision 1.3 2000/06/10 10:42:49 nilsen |
28 | Fixed bug in copy and operator =. | |
29 | ||
d53869b0 | 30 | |
31 | */ | |
32 | ||
33 | #include <TShape.h> | |
92c19c36 | 34 | #include <TBRIK.h> |
d53869b0 | 35 | |
36 | #include "AliITSgeomSPD425.h" | |
37 | ||
38 | ClassImp(AliITSgeomSPD425) | |
39 | ||
40 | AliITSgeomSPD425::AliITSgeomSPD425(){ | |
41 | //////////////////////////////////////////////////////////////////////// | |
42 | // default constructor, for ITS post TDR geometry. | |
43 | //////////////////////////////////////////////////////////////////////// | |
44 | ||
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 | |
48 | // units. | |
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. | |
b3acdf28 | 54 | Int_t i; |
d53869b0 | 55 | |
92c19c36 | 56 | fDx = kdx; // default value. |
57 | fDy = kdy; // default value. | |
58 | fDz = kdz; // default value. | |
d53869b0 | 59 | fNbinx = knbinx; // default number of bins in x. |
60 | fNbinz = knbinz; // default number of bins in z. | |
61 | ||
62 | fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x. | |
b3acdf28 | 63 | for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size. |
d53869b0 | 64 | fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z. |
b3acdf28 | 65 | for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size. |
d53869b0 | 66 | fBinSizeZ[ 31] = kbinz1; |
67 | fBinSizeZ[ 32] = kbinz1; | |
68 | ||
69 | fBinSizeZ[ 64] = kbinz1; | |
70 | fBinSizeZ[ 65] = kbinz1; | |
71 | ||
72 | fBinSizeZ[ 97] = kbinz1; | |
73 | fBinSizeZ[ 98] = kbinz1; | |
74 | ||
75 | fBinSizeZ[130] = kbinz1; | |
76 | fBinSizeZ[131] = kbinz1; | |
77 | ||
78 | fBinSizeZ[163] = kbinz1; | |
79 | fBinSizeZ[164] = kbinz1; | |
80 | ||
81 | // correct detector size for bin size. | |
92c19c36 | 82 | fDx = 0.0; |
83 | for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i]; | |
84 | fDx *= 0.5; | |
85 | fDz = 0.0; | |
86 | for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i]; | |
87 | fDz *= 0.5; | |
d53869b0 | 88 | |
89 | fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET", | |
92c19c36 | 90 | fDx,fDy,fDz); |
d53869b0 | 91 | } |
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 | //////////////////////////////////////////////////////////////////////// | |
b3acdf28 | 98 | Int_t i; |
92c19c36 | 99 | fDx = 0.0; |
100 | fDy = dy; | |
101 | fDz = 0.0; | |
d53869b0 | 102 | fNbinx = nx; // new number of bins in x. |
103 | fNbinz = nz; // new number of bins in z. | |
104 | ||
105 | fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x. | |
b3acdf28 | 106 | for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size. |
d53869b0 | 107 | fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z. |
b3acdf28 | 108 | for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size. |
d53869b0 | 109 | |
110 | // correct detector size for bin size. | |
92c19c36 | 111 | for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i]; |
112 | fDx *= 0.5; | |
113 | for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i]; | |
114 | fDz *= 0.5; | |
d53869b0 | 115 | |
116 | fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET", | |
92c19c36 | 117 | fDx,fDy,fDz); |
d53869b0 | 118 | } |
119 | //______________________________________________________________________ | |
120 | AliITSgeomSPD425::AliITSgeomSPD425(AliITSgeomSPD425 &source){ | |
121 | // copy constructor | |
b3acdf28 | 122 | Int_t i; |
d53869b0 | 123 | if(&source == this) return; |
93a31784 | 124 | this->fShapeSPD = new TBRIK(*(source.fShapeSPD)); |
92c19c36 | 125 | this->fDx = source.fDx; |
126 | this->fDy = source.fDy; | |
127 | this->fDz = source.fDz; | |
d53869b0 | 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]; | |
d53869b0 | 136 | } |
137 | //______________________________________________________________________ | |
138 | AliITSgeomSPD425& AliITSgeomSPD425::operator=(AliITSgeomSPD425 &source){ | |
139 | // = operator | |
b3acdf28 | 140 | Int_t i; |
d53869b0 | 141 | if(&source == this) return *this; |
93a31784 | 142 | this->fShapeSPD = new TBRIK(*(source.fShapeSPD)); |
92c19c36 | 143 | this->fDx = source.fDx; |
144 | this->fDy = source.fDy; | |
145 | this->fDz = source.fDz; | |
d53869b0 | 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]; | |
b3acdf28 | 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]; | |
d53869b0 | 154 | return *this; |
155 | } | |
156 | //______________________________________________________________________ | |
157 | AliITSgeomSPD425::~AliITSgeomSPD425(){ | |
158 | // destructor | |
159 | delete[] fBinSizeX; | |
160 | delete[] fBinSizeZ; | |
161 | delete fShapeSPD; | |
162 | } | |
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 | //////////////////////////////////////////////////////////////////////// | |
b3acdf28 | 169 | Int_t i; |
92c19c36 | 170 | fDx = 0.0; |
171 | fDy = dy; | |
172 | fDz = 0.0; | |
d53869b0 | 173 | fNbinx = nx; // new number of bins in x. |
174 | fNbinz = nz; // new number of bins in z. | |
175 | ||
176 | if(fBinSizeX!=0) delete[] fBinSizeX; | |
177 | fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x. | |
b3acdf28 | 178 | for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size. |
d53869b0 | 179 | if(fBinSizeZ!=0) delete[] fBinSizeZ; |
180 | fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z. | |
b3acdf28 | 181 | for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size. |
d53869b0 | 182 | |
183 | // correct detector size for bin size. | |
92c19c36 | 184 | for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i]; |
185 | fDx *= 0.5; | |
186 | for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i]; | |
187 | fDz *= 0.5; | |
d53869b0 | 188 | |
189 | fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET", | |
92c19c36 | 190 | fDx,fDy,fDz); |
d53869b0 | 191 | } |
92c19c36 | 192 | /* |
d53869b0 | 193 | //---------------------------------------------------------------------- |
194 | void AliITSgeomSPD425::Streamer(TBuffer &R__b){ | |
195 | // Streamer function for the class AliITSgeomSPD425. | |
3bd79107 | 196 | Int_t i; |
d53869b0 | 197 | UInt_t R__s, R__c; |
198 | ||
199 | if(R__b.IsReading()){ | |
200 | Version_t R__v = R__b.ReadVersion(&R__s, &R__c); | |
201 | if(R__v==1){ | |
202 | TObject::Streamer(R__b); | |
203 | fShapeSPD->Streamer(R__b); | |
92c19c36 | 204 | R__b >> fDx; |
205 | R__b >> fDy; | |
206 | R__b >> fDz; | |
d53869b0 | 207 | }else if (R__v==2){ |
208 | AliITSgeomSPD::Streamer(R__b); | |
209 | fShapeSPD->Streamer(R__b); | |
92c19c36 | 210 | R__b >> fDx; |
211 | R__b >> fDy; | |
212 | R__b >> fDz; | |
d53869b0 | 213 | R__b >> fNbinx; |
214 | if(fBinSizeX!=0) delete[] fBinSizeX; | |
215 | fBinSizeX = new Float_t[fNbinx]; | |
3bd79107 | 216 | for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i]; |
d53869b0 | 217 | R__b >> fNbinz; |
218 | if(fBinSizeZ!=0) delete[] fBinSizeZ; | |
219 | fBinSizeZ = new Float_t[fNbinz]; | |
3bd79107 | 220 | for(i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i]; |
d53869b0 | 221 | R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD425::IsA()); |
222 | } // end if R__v==1 | |
223 | } else { // IsWriting. | |
224 | R__c = R__b.WriteVersion(AliITSgeomSPD425::IsA(), kTRUE); | |
225 | AliITSgeomSPD::Streamer(R__b); | |
226 | fShapeSPD->Streamer(R__b); | |
92c19c36 | 227 | R__b << fDx; |
228 | R__b << fDy; | |
229 | R__b << fDz; | |
d53869b0 | 230 | R__b << fNbinx; |
3bd79107 | 231 | for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i]; |
d53869b0 | 232 | R__b << fNbinz; |
3bd79107 | 233 | for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i]; |
d53869b0 | 234 | R__b.SetByteCount(R__c, kTRUE); |
235 | } // end if R__b.IsReading() | |
236 | } | |
237 | //---------------------------------------------------------------------- | |
92c19c36 | 238 | */ |