]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSgeomSPD300.cxx
New SPD geometry class for 300 micron pixels
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSPD300.cxx
CommitLineData
50037af7 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$
18
19*/
20
21#include "AliITSgeomSPD300.h"
22
23ClassImp(AliITSgeomSPD300)
24
25AliITSgeomSPD300::AliITSgeomSPD300(){
26////////////////////////////////////////////////////////////////////////
27// default constructor, for ITS TDR geometry.
28////////////////////////////////////////////////////////////////////////
29const Float_t kdx=0.6400,kdy=0.0075,kdz=4.1890; // cm; Standard pixel detector
30 // size is 2dx wide, 2dz long,
31 // and 2dy thick. Geant 3.12
32 // units.
33const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
34const Int_t knbinx = 256; // number of pixels along x direction.
35const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
36const Int_t knbinz = 279; // number of pixels along z direction.
37
38 fdx = kdx; // default value.
39 fdy = kdy; // default value.
40 fdz = kdz; // default value.
41 fNbinx = knbinx; // default number of bins in x.
42 fNbinz = knbinz; // default number of bins in z.
43
44 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
45 for(Int_t i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
46 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
47 for(Int_t i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
48
49 // correct detector size for bin size.
50 fdx = 0.0;
51 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
52 fdx *= 0.5;
53 fdz = 0.0;
54 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
55 fdz *= 0.5;
56
57 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
58 fdx,fdy,fdz);
59}
60//______________________________________________________________________
61AliITSgeomSPD300::AliITSgeomSPD300(Float_t dy,Int_t nx,Float_t *bx,
62 Int_t nz,Float_t *bz){
63////////////////////////////////////////////////////////////////////////
64// default constructor, for a User modified TDR based geometry.
65////////////////////////////////////////////////////////////////////////
66 fdx = 0.0;
67 fdy = dy;
68 fdz = 0.0;
69 fNbinx = nx; // new number of bins in x.
70 fNbinz = nz; // new number of bins in z.
71
72 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
73 for(Int_t i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
74 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
75 for(Int_t i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
76
77 // correct detector size for bin size.
78 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
79 fdx *= 0.5;
80 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
81 fdz *= 0.5;
82
83 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
84 fdx,fdy,fdz);
85}
86//______________________________________________________________________
87AliITSgeomSPD300::AliITSgeomSPD300(AliITSgeomSPD300 &source){
88 // copy constructor
89 if(&source == this) return;
90 this->fShapeSPD = source.fShapeSPD;
91 this->fdx = source.fdx;
92 this->fdy = source.fdy;
93 this->fdz = source.fdz;
94 if(this->fBinSizeX) delete[] this->fBinSizeX;
95 if(this->fBinSizeX) delete[] this->fBinSizeZ;
96 this->fNbinx = source.fNbinx;
97 this->fBinSizeX = new Float_t[this->fNbinx];
98 this->fNbinz = source.fNbinz;
99 this->fBinSizeZ = new Float_t[this->fNbinz];
100 for(Int_t i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
101 for(Int_t i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
102}
103//______________________________________________________________________
104AliITSgeomSPD300& AliITSgeomSPD300::operator=(AliITSgeomSPD300 &source){
105 // = operator
106 if(&source == this) return *this;
107 this->fShapeSPD = source.fShapeSPD;
108 this->fdx = source.fdx;
109 this->fdy = source.fdy;
110 this->fdz = source.fdz;
111 if(this->fBinSizeX) delete[] this->fBinSizeX;
112 if(this->fBinSizeX) delete[] this->fBinSizeZ;
113 this->fNbinx = source.fNbinx;
114 this->fBinSizeX = new Float_t[this->fNbinx];
115 this->fNbinz = source.fNbinz;
116 this->fBinSizeZ = new Float_t[this->fNbinz];
117 for(Int_t i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
118 for(Int_t i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
119 return *this;
120}
121//______________________________________________________________________
122AliITSgeomSPD300::~AliITSgeomSPD300(){
123 // destructor
124 delete[] fBinSizeX;
125 delete[] fBinSizeZ;
126 delete fShapeSPD;
127}
128//______________________________________________________________________
129void AliITSgeomSPD300::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
130 Int_t nz,Float_t *bz){
131////////////////////////////////////////////////////////////////////////
132// default constructor, for a User modified TDR based geometry.
133////////////////////////////////////////////////////////////////////////
134 fdx = 0.0;
135 fdy = dy;
136 fdz = 0.0;
137 fNbinx = nx; // new number of bins in x.
138 fNbinz = nz; // new number of bins in z.
139
140 if(fBinSizeX!=0) delete[] fBinSizeX;
141 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
142 for(Int_t i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
143 if(fBinSizeZ!=0) delete[] fBinSizeZ;
144 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
145 for(Int_t i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
146
147 // correct detector size for bin size.
148 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
149 fdx *= 0.5;
150 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
151 fdz *= 0.5;
152
153 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
154 fdx,fdy,fdz);
155}
156//----------------------------------------------------------------------
157void AliITSgeomSPD300::Streamer(TBuffer &R__b){
158 // Streamer function for the class AliItSgeomSPD300.
159 Int_t i;
160 UInt_t R__s, R__c;
161
162 if(R__b.IsReading()){
163 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
164 if(R__v==1){
165 TObject::Streamer(R__b);
166 fShapeSPD->Streamer(R__b);
167 R__b >> fdx;
168 R__b >> fdy;
169 R__b >> fdz;
170 }else if (R__v==2){
171 AliITSgeomSPD::Streamer(R__b);
172 fShapeSPD->Streamer(R__b);
173 R__b >> fdx;
174 R__b >> fdy;
175 R__b >> fdz;
176 R__b >> fNbinx;
177 if(fBinSizeX!=0) delete[] fBinSizeX;
178 fBinSizeX = new Float_t[fNbinx];
179 for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
180 R__b >> fNbinz;
181 if(fBinSizeZ!=0) delete[] fBinSizeZ;
182 fBinSizeZ = new Float_t[fNbinz];
183 for(i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
184 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD300::IsA());
185 } // end if R__v==1
186 } else { // IsWriting.
187 R__c = R__b.WriteVersion(AliITSgeomSPD300::IsA(), kTRUE);
188 AliITSgeomSPD::Streamer(R__b);
189 fShapeSPD->Streamer(R__b);
190 R__b << fdx;
191 R__b << fdy;
192 R__b << fdz;
193 R__b << fNbinx;
194 for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
195 R__b << fNbinz;
196 for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
197 R__b.SetByteCount(R__c, kTRUE);
198 } // end if R__b.IsReading()
199}
200//----------------------------------------------------------------------