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:37 nilsen
25 Fixed compilation warning with HP unix.
27 Revision 1.3 2000/06/10 10:43:04 nilsen
28 Fixed bug in copy and operator =.
34 #include "AliITSgeomSPD300.h"
36 ClassImp(AliITSgeomSPD300)
38 AliITSgeomSPD300::AliITSgeomSPD300(){
39 ////////////////////////////////////////////////////////////////////////
40 // default constructor, for ITS TDR geometry.
41 ////////////////////////////////////////////////////////////////////////
42 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.1890; // cm; Standard pixel detector
43 // size is 2dx wide, 2dz long,
44 // and 2dy thick. Geant 3.12
46 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
47 const Int_t knbinx = 256; // number of pixels along x direction.
48 const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
49 const Int_t knbinz = 279; // number of pixels along z direction.
52 fDx = kdx; // default value.
53 fDy = kdy; // default value.
54 fDz = kdz; // default value.
55 fNbinx = knbinx; // default number of bins in x.
56 fNbinz = knbinz; // default number of bins in z.
58 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
59 for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
60 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
61 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
63 // correct detector size for bin size.
65 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
68 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
71 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
74 //______________________________________________________________________
75 AliITSgeomSPD300::AliITSgeomSPD300(Float_t dy,Int_t nx,Float_t *bx,
76 Int_t nz,Float_t *bz){
77 ////////////////////////////////////////////////////////////////////////
78 // default constructor, for a User modified TDR based geometry.
79 ////////////////////////////////////////////////////////////////////////
84 fNbinx = nx; // new number of bins in x.
85 fNbinz = nz; // new number of bins in z.
87 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
88 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
89 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
90 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
92 // correct detector size for bin size.
93 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
95 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
98 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
101 //______________________________________________________________________
102 AliITSgeomSPD300::AliITSgeomSPD300(AliITSgeomSPD300 &source){
105 if(&source == this) return;
106 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
107 this->fDx = source.fDx;
108 this->fDy = source.fDy;
109 this->fDz = source.fDz;
110 if(this->fBinSizeX) delete[] this->fBinSizeX;
111 if(this->fBinSizeX) delete[] this->fBinSizeZ;
112 this->fNbinx = source.fNbinx;
113 this->fBinSizeX = new Float_t[this->fNbinx];
114 this->fNbinz = source.fNbinz;
115 this->fBinSizeZ = new Float_t[this->fNbinz];
116 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
117 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
119 //______________________________________________________________________
120 AliITSgeomSPD300& AliITSgeomSPD300::operator=(AliITSgeomSPD300 &source){
123 if(&source == this) return *this;
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];
138 //______________________________________________________________________
139 AliITSgeomSPD300::~AliITSgeomSPD300(){
145 //______________________________________________________________________
146 void AliITSgeomSPD300::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
147 Int_t nz,Float_t *bz){
148 ////////////////////////////////////////////////////////////////////////
149 // default constructor, for a User modified TDR based geometry.
150 ////////////////////////////////////////////////////////////////////////
155 fNbinx = nx; // new number of bins in x.
156 fNbinz = nz; // new number of bins in z.
158 if(fBinSizeX!=0) delete[] fBinSizeX;
159 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
160 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
161 if(fBinSizeZ!=0) delete[] fBinSizeZ;
162 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
163 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
165 // correct detector size for bin size.
166 for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
168 for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
171 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
175 //----------------------------------------------------------------------
176 void AliITSgeomSPD300::Streamer(TBuffer &R__b){
177 // Streamer function for the class AliItSgeomSPD300.
181 if(R__b.IsReading()){
182 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
184 TObject::Streamer(R__b);
185 fShapeSPD->Streamer(R__b);
190 AliITSgeomSPD::Streamer(R__b);
191 fShapeSPD->Streamer(R__b);
196 if(fBinSizeX!=0) delete[] fBinSizeX;
197 fBinSizeX = new Float_t[fNbinx];
198 for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
200 if(fBinSizeZ!=0) delete[] fBinSizeZ;
201 fBinSizeZ = new Float_t[fNbinz];
202 for(i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
203 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD300::IsA());
205 } else { // IsWriting.
206 R__c = R__b.WriteVersion(AliITSgeomSPD300::IsA(), kTRUE);
207 AliITSgeomSPD::Streamer(R__b);
208 fShapeSPD->Streamer(R__b);
213 for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
215 for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
216 R__b.SetByteCount(R__c, kTRUE);
217 } // end if R__b.IsReading()
219 //----------------------------------------------------------------------