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