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:43:04 nilsen
19 Fixed bug in copy and operator =.
24 #include "AliITSgeomSPD300.h"
26 ClassImp(AliITSgeomSPD300)
28 AliITSgeomSPD300::AliITSgeomSPD300(){
29 ////////////////////////////////////////////////////////////////////////
30 // default constructor, for ITS TDR geometry.
31 ////////////////////////////////////////////////////////////////////////
32 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.1890; // cm; Standard pixel detector
33 // size is 2dx wide, 2dz long,
34 // and 2dy thick. Geant 3.12
36 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
37 const Int_t knbinx = 256; // number of pixels along x direction.
38 const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
39 const Int_t knbinz = 279; // number of pixels along z direction.
42 fdx = kdx; // default value.
43 fdy = kdy; // default value.
44 fdz = kdz; // default value.
45 fNbinx = knbinx; // default number of bins in x.
46 fNbinz = knbinz; // default number of bins in z.
48 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
49 for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
50 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
51 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
53 // correct detector size for bin size.
55 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
58 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
61 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
64 //______________________________________________________________________
65 AliITSgeomSPD300::AliITSgeomSPD300(Float_t dy,Int_t nx,Float_t *bx,
66 Int_t nz,Float_t *bz){
67 ////////////////////////////////////////////////////////////////////////
68 // default constructor, for a User modified TDR based geometry.
69 ////////////////////////////////////////////////////////////////////////
74 fNbinx = nx; // new number of bins in x.
75 fNbinz = nz; // new number of bins in z.
77 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
78 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
79 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
80 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
82 // correct detector size for bin size.
83 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
85 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
88 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
91 //______________________________________________________________________
92 AliITSgeomSPD300::AliITSgeomSPD300(AliITSgeomSPD300 &source){
95 if(&source == this) return;
96 this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
97 this->fdx = source.fdx;
98 this->fdy = source.fdy;
99 this->fdz = source.fdz;
100 if(this->fBinSizeX) delete[] this->fBinSizeX;
101 if(this->fBinSizeX) delete[] this->fBinSizeZ;
102 this->fNbinx = source.fNbinx;
103 this->fBinSizeX = new Float_t[this->fNbinx];
104 this->fNbinz = source.fNbinz;
105 this->fBinSizeZ = new Float_t[this->fNbinz];
106 for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
107 for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
109 //______________________________________________________________________
110 AliITSgeomSPD300& AliITSgeomSPD300::operator=(AliITSgeomSPD300 &source){
113 if(&source == this) return *this;
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];
128 //______________________________________________________________________
129 AliITSgeomSPD300::~AliITSgeomSPD300(){
135 //______________________________________________________________________
136 void AliITSgeomSPD300::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
137 Int_t nz,Float_t *bz){
138 ////////////////////////////////////////////////////////////////////////
139 // default constructor, for a User modified TDR based geometry.
140 ////////////////////////////////////////////////////////////////////////
145 fNbinx = nx; // new number of bins in x.
146 fNbinz = nz; // new number of bins in z.
148 if(fBinSizeX!=0) delete[] fBinSizeX;
149 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
150 for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
151 if(fBinSizeZ!=0) delete[] fBinSizeZ;
152 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
153 for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
155 // correct detector size for bin size.
156 for(i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
158 for(i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
161 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
164 //----------------------------------------------------------------------
165 void AliITSgeomSPD300::Streamer(TBuffer &R__b){
166 // Streamer function for the class AliItSgeomSPD300.
170 if(R__b.IsReading()){
171 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
173 TObject::Streamer(R__b);
174 fShapeSPD->Streamer(R__b);
179 AliITSgeomSPD::Streamer(R__b);
180 fShapeSPD->Streamer(R__b);
185 if(fBinSizeX!=0) delete[] fBinSizeX;
186 fBinSizeX = new Float_t[fNbinx];
187 for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
189 if(fBinSizeZ!=0) delete[] fBinSizeZ;
190 fBinSizeZ = new Float_t[fNbinz];
191 for(i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
192 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD300::IsA());
194 } else { // IsWriting.
195 R__c = R__b.WriteVersion(AliITSgeomSPD300::IsA(), kTRUE);
196 AliITSgeomSPD::Streamer(R__b);
197 fShapeSPD->Streamer(R__b);
202 for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
204 for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
205 R__b.SetByteCount(R__c, kTRUE);
206 } // end if R__b.IsReading()
208 //----------------------------------------------------------------------