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 **************************************************************************/
23 #include "AliITSgeomSPD425.h"
25 ClassImp(AliITSgeomSPD425)
27 AliITSgeomSPD425::AliITSgeomSPD425(){
28 ////////////////////////////////////////////////////////////////////////
29 // default constructor, for ITS post TDR geometry.
30 ////////////////////////////////////////////////////////////////////////
32 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.23625;// 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.0425; // cm; Standard pixel size in z direction.
39 const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction.
40 const Int_t knbinz = 197; // 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(Int_t 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(Int_t i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
52 fBinSizeZ[ 31] = kbinz1;
53 fBinSizeZ[ 32] = kbinz1;
55 fBinSizeZ[ 64] = kbinz1;
56 fBinSizeZ[ 65] = kbinz1;
58 fBinSizeZ[ 97] = kbinz1;
59 fBinSizeZ[ 98] = kbinz1;
61 fBinSizeZ[130] = kbinz1;
62 fBinSizeZ[131] = kbinz1;
64 fBinSizeZ[163] = kbinz1;
65 fBinSizeZ[164] = kbinz1;
67 // correct detector size for bin size.
69 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
72 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
75 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
78 //______________________________________________________________________
79 AliITSgeomSPD425::AliITSgeomSPD425(Float_t dy,Int_t nx,Float_t *bx,
80 Int_t nz,Float_t *bz){
81 ////////////////////////////////////////////////////////////////////////
82 // default constructor, for a User modified TDR based geometry.
83 ////////////////////////////////////////////////////////////////////////
87 fNbinx = nx; // new number of bins in x.
88 fNbinz = nz; // new number of bins in z.
90 fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
91 for(Int_t i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
92 fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
93 for(Int_t i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
95 // correct detector size for bin size.
96 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
98 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
101 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
104 //______________________________________________________________________
105 AliITSgeomSPD425::AliITSgeomSPD425(AliITSgeomSPD425 &source){
107 if(&source == this) return;
108 this->fShapeSPD = source.fShapeSPD;
109 this->fdx = source.fdx;
110 this->fdy = source.fdy;
111 this->fdz = source.fdz;
112 if(this->fBinSizeX) delete[] this->fBinSizeX;
113 if(this->fBinSizeX) delete[] this->fBinSizeZ;
114 this->fNbinx = source.fNbinx;
115 this->fBinSizeX = new Float_t[this->fNbinx];
116 this->fNbinz = source.fNbinz;
117 this->fBinSizeZ = new Float_t[this->fNbinz];
118 for(Int_t i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
119 for(Int_t i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
121 //______________________________________________________________________
122 AliITSgeomSPD425& AliITSgeomSPD425::operator=(AliITSgeomSPD425 &source){
124 if(&source == this) return *this;
125 this->fShapeSPD = source.fShapeSPD;
126 this->fdx = source.fdx;
127 this->fdy = source.fdy;
128 this->fdz = source.fdz;
129 if(this->fBinSizeX) delete[] this->fBinSizeX;
130 if(this->fBinSizeX) delete[] this->fBinSizeZ;
131 this->fNbinx = source.fNbinx;
132 this->fBinSizeX = new Float_t[this->fNbinx];
133 this->fNbinz = source.fNbinz;
134 this->fBinSizeZ = new Float_t[this->fNbinz];
135 for(Int_t i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
136 for(Int_t i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
139 //______________________________________________________________________
140 AliITSgeomSPD425::~AliITSgeomSPD425(){
146 //______________________________________________________________________
147 void AliITSgeomSPD425::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
148 Int_t nz,Float_t *bz){
149 ////////////////////////////////////////////////////////////////////////
150 // default constructor, for a User modified TDR based geometry.
151 ////////////////////////////////////////////////////////////////////////
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(Int_t 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(Int_t i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
165 // correct detector size for bin size.
166 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
168 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
171 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
174 //----------------------------------------------------------------------
175 void AliITSgeomSPD425::Streamer(TBuffer &R__b){
176 // Streamer function for the class AliITSgeomSPD425.
179 if(R__b.IsReading()){
180 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
182 TObject::Streamer(R__b);
183 fShapeSPD->Streamer(R__b);
188 AliITSgeomSPD::Streamer(R__b);
189 fShapeSPD->Streamer(R__b);
194 if(fBinSizeX!=0) delete[] fBinSizeX;
195 fBinSizeX = new Float_t[fNbinx];
196 for(Int_t i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
198 if(fBinSizeZ!=0) delete[] fBinSizeZ;
199 fBinSizeZ = new Float_t[fNbinz];
200 for(Int_t i=0;i<fNbinz;i++) R__b >> fBinSizeZ[i];
201 R__b.CheckByteCount(R__s, R__c, AliITSgeomSPD425::IsA());
203 } else { // IsWriting.
204 R__c = R__b.WriteVersion(AliITSgeomSPD425::IsA(), kTRUE);
205 AliITSgeomSPD::Streamer(R__b);
206 fShapeSPD->Streamer(R__b);
211 for(Int_t i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
213 for(Int_t i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
214 R__b.SetByteCount(R__c, kTRUE);
215 } // end if R__b.IsReading()
217 //----------------------------------------------------------------------