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.4 2000/06/10 20:34:37 nilsen
19 Fixed compilation warning with HP unix.
21 Revision 1.3 2000/06/10 10:43:04 nilsen
22 Fixed bug in copy and operator =.
27 #include "AliITSgeomSPD300.h"
29 ClassImp(AliITSgeomSPD300)
31 AliITSgeomSPD300::AliITSgeomSPD300(){
32 ////////////////////////////////////////////////////////////////////////
33 // default constructor, for ITS TDR geometry.
34 ////////////////////////////////////////////////////////////////////////
35 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.1890; // 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.0300; // cm; Standard pixel size in z direction.
42 const Int_t knbinz = 279; // number of pixels along z direction.
45 fdx = kdx; // default value.
46 fdy = kdy; // default value.
47 fdz = kdz; // default value.
48 fNbinx = knbinx; // default number of bins in x.
49 fNbinz = knbinz; // default number of bins in z.
51 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
52 for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
53 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
54 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
56 // correct detector size for bin size.
58 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
61 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
64 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
67 //______________________________________________________________________
68 AliITSgeomSPD300::AliITSgeomSPD300(Float_t dy,Int_t nx,Float_t *bx,
69 Int_t nz,Float_t *bz){
70 ////////////////////////////////////////////////////////////////////////
71 // default constructor, for a User modified TDR based geometry.
72 ////////////////////////////////////////////////////////////////////////
77 fNbinx = nx; // new number of bins in x.
78 fNbinz = nz; // new number of bins in z.
80 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
81 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
82 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
83 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
85 // correct detector size for bin size.
86 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
88 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
91 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
94 //______________________________________________________________________
95 AliITSgeomSPD300::AliITSgeomSPD300(AliITSgeomSPD300 &source){
98 if(&source == this) return;
99 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
100 this->fdx = source.fdx;
101 this->fdy = source.fdy;
102 this->fdz = source.fdz;
103 if(this->fBinSizeX) delete[] this->fBinSizeX;
104 if(this->fBinSizeX) delete[] this->fBinSizeZ;
105 this->fNbinx = source.fNbinx;
106 this->fBinSizeX = new Float_t[this->fNbinx];
107 this->fNbinz = source.fNbinz;
108 this->fBinSizeZ = new Float_t[this->fNbinz];
109 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
110 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
112 //______________________________________________________________________
113 AliITSgeomSPD300& AliITSgeomSPD300::operator=(AliITSgeomSPD300 &source){
116 if(&source == this) return *this;
117 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
118 this->fdx = source.fdx;
119 this->fdy = source.fdy;
120 this->fdz = source.fdz;
121 if(this->fBinSizeX) delete[] this->fBinSizeX;
122 if(this->fBinSizeX) delete[] this->fBinSizeZ;
123 this->fNbinx = source.fNbinx;
124 this->fBinSizeX = new Float_t[this->fNbinx];
125 this->fNbinz = source.fNbinz;
126 this->fBinSizeZ = new Float_t[this->fNbinz];
127 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
128 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
131 //______________________________________________________________________
132 AliITSgeomSPD300::~AliITSgeomSPD300(){
138 //______________________________________________________________________
139 void AliITSgeomSPD300::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
140 Int_t nz,Float_t *bz){
141 ////////////////////////////////////////////////////////////////////////
142 // default constructor, for a User modified TDR based geometry.
143 ////////////////////////////////////////////////////////////////////////
148 fNbinx = nx; // new number of bins in x.
149 fNbinz = nz; // new number of bins in z.
151 if(fBinSizeX!=0) delete[] fBinSizeX;
152 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
153 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
154 if(fBinSizeZ!=0) delete[] fBinSizeZ;
155 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
156 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
158 // correct detector size for bin size.
159 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
161 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
164 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
167 //----------------------------------------------------------------------
168 void AliITSgeomSPD300::Streamer(TBuffer &R__b){
169 // Streamer function for the class AliItSgeomSPD300.
173 if(R__b.IsReading()){
174 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
176 TObject::Streamer(R__b);
177 fShapeSPD->Streamer(R__b);
182 AliITSgeomSPD::Streamer(R__b);
183 fShapeSPD->Streamer(R__b);
188 if(fBinSizeX!=0) delete[] fBinSizeX;
189 fBinSizeX = new Float_t[fNbinx];
190 for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
192 if(fBinSizeZ!=0) delete[] fBinSizeZ;
193 fBinSizeZ = new Float_t[fNbinz];
194 for(i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
195 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD300::IsA());
197 } else { // IsWriting.
198 R__c = R__b.WriteVersion(AliITSgeomSPD300::IsA(), kTRUE);
199 AliITSgeomSPD::Streamer(R__b);
200 fShapeSPD->Streamer(R__b);
205 for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
207 for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
208 R__b.SetByteCount(R__c, kTRUE);
209 } // end if R__b.IsReading()
211 //----------------------------------------------------------------------