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 **************************************************************************/
21 #include "AliITSgeomSPD300.h"
23 ClassImp(AliITSgeomSPD300)
25 AliITSgeomSPD300::AliITSgeomSPD300(){
26 ////////////////////////////////////////////////////////////////////////
27 // default constructor, for ITS TDR geometry.
28 ////////////////////////////////////////////////////////////////////////
29 const 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
33 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
34 const Int_t knbinx = 256; // number of pixels along x direction.
35 const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
36 const Int_t knbinz = 279; // number of pixels along z direction.
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.
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.
49 // correct detector size for bin size.
51 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
54 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
57 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
60 //______________________________________________________________________
61 AliITSgeomSPD300::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 ////////////////////////////////////////////////////////////////////////
69 fNbinx = nx; // new number of bins in x.
70 fNbinz = nz; // new number of bins in z.
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.
77 // correct detector size for bin size.
78 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
80 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
83 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
86 //______________________________________________________________________
87 AliITSgeomSPD300::AliITSgeomSPD300(AliITSgeomSPD300 &source){
89 if(&source == this) return;
90 this->fShapeSPD = new TBRIK(*(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];
103 //______________________________________________________________________
104 AliITSgeomSPD300& AliITSgeomSPD300::operator=(AliITSgeomSPD300 &source){
106 if(&source == this) return *this;
107 this->fShapeSPD = new TBRIK(*(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];
121 //______________________________________________________________________
122 AliITSgeomSPD300::~AliITSgeomSPD300(){
128 //______________________________________________________________________
129 void 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 ////////////////////////////////////////////////////////////////////////
137 fNbinx = nx; // new number of bins in x.
138 fNbinz = nz; // new number of bins in z.
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.
147 // correct detector size for bin size.
148 for(Int_t i=0;i<fNbinx;i++) fdx +=fBinSizeX[i];
150 for(Int_t i=0;i<fNbinz;i++) fdz +=fBinSizeZ[i];
153 fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
156 //----------------------------------------------------------------------
157 void AliITSgeomSPD300::Streamer(TBuffer &R__b){
158 // Streamer function for the class AliItSgeomSPD300.
162 if(R__b.IsReading()){
163 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
165 TObject::Streamer(R__b);
166 fShapeSPD->Streamer(R__b);
171 AliITSgeomSPD::Streamer(R__b);
172 fShapeSPD->Streamer(R__b);
177 if(fBinSizeX!=0) delete[] fBinSizeX;
178 fBinSizeX = new Float_t[fNbinx];
179 for(i=0;i<fNbinx;i++) R__b >> fBinSizeX[i];
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());
186 } else { // IsWriting.
187 R__c = R__b.WriteVersion(AliITSgeomSPD300::IsA(), kTRUE);
188 AliITSgeomSPD::Streamer(R__b);
189 fShapeSPD->Streamer(R__b);
194 for(i=0;i<fNbinx;i++) R__b << fBinSizeX[i];
196 for(i=0;i<fNbinz;i++) R__b << fBinSizeZ[i];
197 R__b.SetByteCount(R__c, kTRUE);
198 } // end if R__b.IsReading()
200 //----------------------------------------------------------------------