StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiPixelDetectorBuilder.h
1 #ifndef StiPixelDetectorBuilder_H
2 #define StiPixelDetectorBuilder_H
3 #include "Sti/StiDetectorBuilder.h"
4 #include "StDetectorDbMaker/StiHitErrorCalculator.h"
6 {
7 public:
8  StiPixelDetectorBuilder(bool active);
9  virtual ~StiPixelDetectorBuilder();
10  virtual void buildDetectors(StMaker&source);
11  double phiForSector(unsigned int iSector) const;
12 
13 
14  void useVMCGeometry();
15  void AverageVolume(TGeoPhysicalNode *nodeP);
16 
18  double phiForPixelSector(unsigned int iSector) const;
19  double radiusForPixelSector(unsigned int iSector) const;
20  double psiForPixelSector(unsigned int iSector) const;
21 
22  protected:
23  StiMaterial * _fcMaterial;
24  StiMaterial *_siMat;
25  StiMaterial *_hybridMat;
26 };
27 
28 inline double StiPixelDetectorBuilder::phiForSector(unsigned int sector) const
29 {
30  int nSectors = 12;
31  int offset = nSectors/4;
32  double deltaPhi = 2.*M_PI/nSectors;
33  double dPhi = (offset - static_cast<int>(sector+1))*deltaPhi;
34  return nice(dPhi);
35 }
36 
37 inline double StiPixelDetectorBuilder::phiForPixelSector(unsigned int sector) const
38 {
39  if(sector>=24)
40  {
41  cout << "phiForPixelSector(" << sector << "): invalid sector" << endl;
42  throw runtime_error("StiPixelDetectorBuilder::phiForPixelSector - ERROR - Invalid Sector");
43  }
44  double phi = -1000.;
45  switch (sector)
46  {
47  case 0:
48  phi = 0.;
49  break;
50  case 3:
51  phi = 60.;
52  break;
53  case 6:
54  phi = 120.;
55  break;
56  case 9:
57  phi = 180.;
58  break;
59  case 12:
60  phi = 240.;
61  break;
62  case 15:
63  phi = 300.;
64  break;
65  case 1:
66  phi = 0. + 20.27;
67  break;
68  case 4:
69  phi = 60. + 20.27;
70  break;
71  case 7:
72  phi = 120. + 20.27;
73  break;
74  case 10:
75  phi = 180. + 20.27;
76  break;
77  case 13:
78  phi = 240. + 20.27;
79  break;
80  case 16:
81  phi = 300. + 20.27;
82  break;
83  case 2:
84  phi = 0. + 42.62;
85  break;
86  case 5:
87  phi = 60. + 42.62;
88  break;
89  case 8:
90  phi = 120. + 42.62;
91  break;
92  case 11:
93  phi = 180. + 42.62;
94  break;
95  case 14:
96  phi = 240. + 42.62;
97  break;
98  case 17:
99  phi = 300. + 42.62;
100  break;
101  case 18:
102  phi = 0. + 79.51;
103  break;
104  case 19:
105  phi = 60. + 79.51;
106  break;
107  case 20:
108  phi = 120. + 79.51;
109  break;
110  case 21:
111  phi = 180. + 79.51;
112  break;
113  case 22:
114  phi = 240. + 79.51;
115  break;
116  case 23:
117  phi = 300. + 79.51;
118  break;
119  }
120 
121  return (phi/180.*M_PI);
122 } // phiForPixelSector
123 
124 inline double StiPixelDetectorBuilder::radiusForPixelSector(unsigned int sector) const
125 {
126  if(sector<0 || sector>=24)
127  {
128  cout << "radiusForPixelSector(" << sector << "): invalid sector" << endl;
129  throw runtime_error("StiPixelDetectorBuilder::radiusForPixelSector - ERROR - Invalid Sector");
130  }
131 
132  double radius = -1000.;
133  switch (sector)
134  {
135  case 0:
136  case 3:
137  case 6:
138  case 9:
139  case 12:
140  case 15:
141  radius = 5.294;
142  break;
143  case 1:
144  case 4:
145  case 7:
146  case 10:
147  case 13:
148  case 16:
149  radius = 4.862;
150  break;
151  case 2:
152  case 5:
153  case 8:
154  case 11:
155  case 14:
156  case 17:
157  radius = 4.391;
158  break;
159  break;
160  case 18:
161  case 19:
162  case 20:
163  case 21:
164  case 22:
165  case 23:
166  radius = 1.595;
167  break;
168  }
169 
170  return radius;
171 } // radiusForPixelSector
172 
173 inline double StiPixelDetectorBuilder::psiForPixelSector(unsigned int sector) const
174 {
175  if(sector<0 || sector>=24)
176  {
177  cout << "psiForPixelSector(" << sector << "): invalid sector" << endl;
178  throw runtime_error("StiPixelDetectorBuilder::psiForPixelSector - ERROR - Invalid Sector");
179  }
180 
181  double psi = -1000.;
182  switch (sector)
183  {
184  case 0:
185  case 3:
186  case 6:
187  case 9:
188  case 12:
189  case 15:
190  psi = 0.72;
191  break;
192  case 1:
193  case 4:
194  case 7:
195  case 10:
196  case 13:
197  case 16:
198  psi = 1.69;
199  break;
200  case 2:
201  case 5:
202  case 8:
203  case 11:
204  case 14:
205  case 17:
206  psi = 2.96;
207  break;
208  break;
209  case 18:
210  case 19:
211  case 20:
212  case 21:
213  case 22:
214  case 23:
215  psi = 19.85;
216  break;
217  }
218 
219  return (psi/180.*M_PI);
220  //return 0.;
221 } // psiForPixelSector
222 
223 #endif
virtual void buildDetectors(StMaker &source)
Build all detector components of the Pixel detector.
double phiForPixelSector(unsigned int iSector) const
returns the azimuthal angle [-pi, pi) for tpc sector [1-24]