]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSgeomSPD.h
99d432bcd646cc477c58c4af90699fb634ccb592
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSPD.h
1 #ifndef ALIITSGEOMSPD_H
2 #define ALIITSGEOMSPD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 #include <TObject.h>
9 #include <TBRIK.h>
10
11 class ostream;
12 class istream;
13
14 class TShape;
15
16 class AliITSgeomSPD : public TObject {
17
18  public:
19     AliITSgeomSPD();
20     AliITSgeomSPD(Float_t dy,Int_t nx,Float_t *bx,Int_t nz,Float_t *bz);
21     AliITSgeomSPD(AliITSgeomSPD &source);
22     AliITSgeomSPD& operator=(AliITSgeomSPD &source);
23     virtual ~AliITSgeomSPD();
24     virtual void ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
25                            Int_t nz,Float_t *bz);
26     virtual TShape *GetShape() const {return fShapeSPD;}
27     virtual Float_t GetDx() { // Get TBRIK Dx
28         if(fShapeSPD!=0) return fShapeSPD->GetDx();
29         else return 0.0;}
30     virtual Float_t GetDy() {// Get TBRIK Dy
31         if(fShapeSPD!=0) return fShapeSPD->GetDy();
32         else return 0.0;}
33     virtual Float_t GetDz() {// Get TBRIK Dz
34         if(fShapeSPD!=0) return fShapeSPD->GetDz();
35         else return 0.0;}
36     virtual Int_t GetNbinxX(){return fNbinx-1;} // returns the number of bins x
37     virtual Int_t GetNbinxZ(){return fNbinz-1;} // returns the number of bins z
38     virtual Float_t GetBinSizeX(Int_t i)
39         {if(i<fNbinx-1&&i>=0) return fLowBinEdgeX[i+1]-fLowBinEdgeX[i];
40         else return 0.0;}; // give size of bin i in x.
41     virtual Float_t GetBinSizeZ(Int_t i)
42         {if(i<fNbinx-1&&i>=0) return fLowBinEdgeZ[i+1]-fLowBinEdgeZ[i];
43         else return 0.0;}; // give size of bin i in z.
44     virtual Float_t GetBinLowEdgeX(Int_t i)
45         {if(i<fNbinx-1&&i>=0) return fLowBinEdgeX[i];
46         else return 0.0;}; // give size of bin i in x.
47     virtual Float_t GetBinLowEdgeZ(Int_t i)
48         {if(i<fNbinz-1&&i>=0) return fLowBinEdgeZ[i];
49         else return 0.0;}; // give size of bin i in z.
50     virtual void InitLowBinEdgeX(){// allocate memory for fLowBinEdgeX.
51         if(fLowBinEdgeX!=0) delete[] fLowBinEdgeX;
52         if(fNbinx>0) fLowBinEdgeX = new Float_t[fNbinx];else fLowBinEdgeX = 0;}
53     virtual void InitLowBinEdgeZ(){// allocate memory for fLowBinEdgeZ.
54         if(fLowBinEdgeZ!=0) delete[] fLowBinEdgeZ;
55         if(fNbinz>0) fLowBinEdgeZ = new Float_t[fNbinz];else fLowBinEdgeZ = 0;}
56     virtual void SetShape(const char *name,const char *title,const char *mat,
57                           Float_t dx,Float_t dy,Float_t dz)
58         {fShapeSPD = new TBRIK(name,title,mat,dx,dy,dz);};
59     virtual void SetNbinX(Int_t i){fNbinx = i+1;} // Set nubmer of pixels in x
60     virtual void SetNbinZ(Int_t i){fNbinz = i+1;} // Set nubmer of pixels in z
61     virtual void SetLowBinEdgeX(Int_t i,Float_t s){//puts value in fLowbinEdgeX
62         if(i>=0&&i<fNbinx) fLowBinEdgeX[i] = s;}
63     virtual void SetLowBinEdgeZ(Int_t i,Float_t s){//puts value in fLowbinEdgeZ
64         if(i>=0&&i<fNbinz) fLowBinEdgeZ[i] = s;};
65     virtual void LToDet(Float_t xl,Float_t zl,Int_t &row,Int_t &col);
66     virtual void DetToL(Int_t row,Int_t col,Float_t &xl,Float_t &zl);
67     virtual void Print(ostream *os); // output streamer to standard out.
68     virtual void Read(istream *is); // input streamer from standard in.
69
70  protected:
71     TBRIK  *fShapeSPD; // SPD active area shape
72     Int_t fNbinx;  // the number of elements in fLowBinEdgeX (#bins-1)
73     Int_t fNbinz;  // the number of elements in fLowBinEdgeZ (#bins-1)
74     Float_t *fLowBinEdgeX; //[fNbinx] Array of X lower bin edges for the pixels
75     Float_t *fLowBinEdgeZ; //[fNbinz] Array of Z lower bin edges for the pixels
76
77     ClassDef(AliITSgeomSPD,1) // ITS SPD detector geometry class..
78
79 };
80 // Input and output function for standard C++ input/output.
81 ostream &operator<<(ostream &os,AliITSgeomSPD &source);
82 istream &operator>>(istream &os,AliITSgeomSPD &source);
83 #endif
84 //======================================================================
85
86 #ifndef ALIITSGEOMSPD300_H
87 #define ALIITSGEOMSPD300_H
88 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
89  * See cxx source for full Copyright notice                               */
90
91 /* $Id$ */
92
93 //#include "AliITSgeomSPD.h"
94
95 class ostream;
96 class istream;
97
98 class AliITSgeomSPD300 : public AliITSgeomSPD {
99
100  public:
101     AliITSgeomSPD300();
102
103     // This clas now has version 0 so that it will not be written to a root
104     // file. This is good since there are no longer any data members to this
105     // class. It is only designed to make it easer to define this standard
106     // SPD detector geometry.
107     ClassDef(AliITSgeomSPD300,0) // ITS SPD detector geometry class for 300X50 micron pixel size.
108
109 };
110 // Input and output function for standard C++ input/output.
111 ostream &operator<<(ostream &os,AliITSgeomSPD300 &source);
112 istream &operator>>(istream &os,AliITSgeomSPD300 &source);
113 #endif
114 //======================================================================
115
116 #ifndef ALIITSGEOMSPD425SHORT_H
117 #define ALIITSGEOMSPD425SHORT_H
118 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
119  * See cxx source for full Copyright notice                               */
120
121 /* $Id$ */
122
123 //#include "AliITSgeomSPD.h"
124
125
126 // temporary - this will migrate into the segmentation class
127
128 class ostream;
129 class istream;
130
131 class AliITSgeomSPD425Short : public AliITSgeomSPD {
132
133  public:
134     AliITSgeomSPD425Short();
135
136     // This clas now has version 0 so that it will not be written to a root
137     // file. This is good since there are no longer any data members to this
138     // class. It is only designed to make it easer to define this standard
139     // SPD detector geometry.
140     ClassDef(AliITSgeomSPD425Short,0) // ITS SPD detector geometry class for 425X50 micron pixel size Short version.
141
142 };
143 // Input and output function for standard C++ input/output.
144 ostream &operator<<(ostream &os,AliITSgeomSPD425Short &source);
145 istream &operator>>(istream &os,AliITSgeomSPD425Short &source);
146 #endif
147 //======================================================================
148
149 #ifndef ALIITSGEOMSPD425LONG_H
150 #define ALIITSGEOMSPD425LONG_H
151 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
152  * See cxx source for full Copyright notice                               */
153
154 /* $Id$ */
155
156 //#include "AliITSgeomSPD.h"
157
158
159 // temporary - this will migrate into the segmentation class
160
161 class ostream;
162 class istream;
163
164 class AliITSgeomSPD425Long : public AliITSgeomSPD {
165
166  public:
167     AliITSgeomSPD425Long();
168
169     // This clas now has version 0 so that it will not be written to a root
170     // file. This is good since there are no longer any data members to this
171     // class. It is only designed to make it easer to define this standard
172     // SPD detector geometry.
173     ClassDef(AliITSgeomSPD425Long,0) // ITS SPD detector geometry class for 425X50 micron pixel size.
174
175 };
176 // Input and output function for standard C++ input/output.
177 ostream &operator<<(ostream &os,AliITSgeomSPD425Long &source);
178 istream &operator>>(istream &os,AliITSgeomSPD425Long &source);
179 #endif