]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSgeomSPD300.cxx
Streamers removed (R.Brun)
[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.7  2000/10/02 16:32:35  barbera
19 Forward declaration added
20
21 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
22 Forward declaration added
23
24 Revision 1.6  2000/07/10 16:07:18  fca
25 Release version of ITS code
26
27 Revision 1.4  2000/06/10 20:34:37  nilsen
28 Fixed compilation warning with HP unix.
29
30 Revision 1.3  2000/06/10 10:43:04  nilsen
31 Fixed bug in copy and operator =.
32
33
34 */
35
36 #include "TBRIK.h"
37 #include "AliITSgeomSPD300.h"
38
39 ClassImp(AliITSgeomSPD300)
40
41 AliITSgeomSPD300::AliITSgeomSPD300(){
42 ////////////////////////////////////////////////////////////////////////
43 //    default constructor, for ITS TDR geometry.
44 ////////////////////////////////////////////////////////////////////////
45 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.1890; // cm; Standard pixel detector
46                                                 // size is 2dx wide, 2dz long,
47                                                 // and 2dy thick. Geant 3.12
48                                                 // units.
49 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
50 const Int_t   knbinx = 256;    // number of pixels along x direction.
51 const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
52 const Int_t   knbinz = 279;    // number of pixels along z direction.
53     Int_t i;
54
55     fDx = kdx;  // default value.
56     fDy = kdy;  // default value.
57     fDz = kdz;  // default value.
58     fNbinx = knbinx; // default number of bins in x.
59     fNbinz = knbinz; // default number of bins in z.
60
61     fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
62     for(i=0;i<fNbinx;i++) fBinSizeX[i] = kbinx0; // default x bin size.
63     fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
64     for(i=0;i<fNbinz;i++) fBinSizeZ[i] = kbinz0; // default z bin size.
65
66     // correct detector size for bin size.
67     fDx = 0.0;
68     for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
69     fDx *= 0.5;
70     fDz = 0.0;
71     for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
72     fDz *= 0.5;
73
74     fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
75                           fDx,fDy,fDz);
76 }
77 //______________________________________________________________________
78 AliITSgeomSPD300::AliITSgeomSPD300(Float_t dy,Int_t nx,Float_t *bx,
79                                                 Int_t nz,Float_t *bz){
80 ////////////////////////////////////////////////////////////////////////
81 //    default constructor, for a User modified TDR based geometry.
82 ////////////////////////////////////////////////////////////////////////
83     Int_t i;
84     fDx = 0.0;
85     fDy =  dy;
86     fDz = 0.0;
87     fNbinx = nx; // new number of bins in x.
88     fNbinz = nz; // new number of bins in z.
89
90     fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
91     for(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(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
94
95     // correct detector size for bin size.
96     for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
97     fDx *= 0.5;
98     for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
99     fDz *= 0.5;
100
101     fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
102                           fDx,fDy,fDz);
103 }
104 //______________________________________________________________________
105 AliITSgeomSPD300::AliITSgeomSPD300(AliITSgeomSPD300 &source){
106   // copy constructor
107     Int_t i;
108     if(&source == this) return;
109     this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
110     this->fDx = source.fDx;
111     this->fDy = source.fDy;
112     this->fDz = source.fDz;
113     if(this->fBinSizeX) delete[] this->fBinSizeX; 
114     if(this->fBinSizeX) delete[] this->fBinSizeZ;
115     this->fNbinx = source.fNbinx;
116     this->fBinSizeX = new Float_t[this->fNbinx];
117     this->fNbinz = source.fNbinz;
118     this->fBinSizeZ = new Float_t[this->fNbinz];
119     for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
120     for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
121 }
122 //______________________________________________________________________
123 AliITSgeomSPD300& AliITSgeomSPD300::operator=(AliITSgeomSPD300 &source){
124   // = operator
125     Int_t i;
126     if(&source == this) return *this;
127     this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
128     this->fDx = source.fDx;
129     this->fDy = source.fDy;
130     this->fDz = source.fDz;
131     if(this->fBinSizeX) delete[] this->fBinSizeX; 
132     if(this->fBinSizeX) delete[] this->fBinSizeZ;
133     this->fNbinx = source.fNbinx;
134     this->fBinSizeX = new Float_t[this->fNbinx];
135     this->fNbinz = source.fNbinz;
136     this->fBinSizeZ = new Float_t[this->fNbinz];
137     for(i=0;i<fNbinx;i++) this->fBinSizeX[i] = source.fBinSizeX[i];
138     for(i=0;i<fNbinz;i++) this->fBinSizeZ[i] = source.fBinSizeZ[i];
139     return *this;
140 }
141 //______________________________________________________________________
142 AliITSgeomSPD300::~AliITSgeomSPD300(){
143   // destructor
144     delete[] fBinSizeX;
145     delete[] fBinSizeZ;
146     delete   fShapeSPD;
147 }
148 //______________________________________________________________________
149 void AliITSgeomSPD300::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
150                                         Int_t nz,Float_t *bz){
151 ////////////////////////////////////////////////////////////////////////
152 //    default constructor, for a User modified TDR based geometry.
153 ////////////////////////////////////////////////////////////////////////
154     Int_t i;
155     fDx = 0.0;
156     fDy =  dy;
157     fDz = 0.0;
158     fNbinx = nx; // new number of bins in x.
159     fNbinz = nz; // new number of bins in z.
160
161     if(fBinSizeX!=0) delete[] fBinSizeX;
162     fBinSizeX = new Float_t[fNbinx]; // array of bin sizes along x.
163     for(i=0;i<fNbinx;i++) fBinSizeX[i] = bx[i]; // new x bin size.
164     if(fBinSizeZ!=0) delete[] fBinSizeZ;
165     fBinSizeZ = new Float_t[fNbinz]; // array of bin sizes along z.
166     for(i=0;i<fNbinz;i++) fBinSizeZ[i] = bz[i]; // new z bin size.
167
168     // correct detector size for bin size.
169     for(i=0;i<fNbinx;i++) fDx +=fBinSizeX[i];
170     fDx *= 0.5;
171     for(i=0;i<fNbinz;i++) fDz +=fBinSizeZ[i];
172     fDz *= 0.5;
173
174     fShapeSPD = new TBRIK("ActiveSPD","Active volume of SPD","SPD SI DET",
175                           fDx,fDy,fDz);
176 }