Belle II Software  release-05-02-19
TOPutil.h
1 //*****************************************************************************
2 //-----------------------------------------------------------------------------
3 // Fast simulation and reconstruction package for TOP counter (F77 core)
4 // M. Staric, March-2009
5 //-----------------------------------------------------------------------------
6 //
7 // TOPutil.h
8 // C++ interface to F77 functions: data conversion utility (for debugging etc.)
9 // units: cm, ns
10 // mostly opsolete now !
11 //-----------------------------------------------------------------------------
12 //*****************************************************************************
13 
14 #ifndef _TOPutil_h
15 #define _TOPutil_h
16 
17 #include <top/reconstruction/TOPf77fun.h>
18 
19 namespace Belle2 {
24  namespace TOP {
25 
36  inline void PointToLocal(int moduleID, double X, double Y, double Z,
37  double& x, double& y, double& z)
38  {
39  moduleID--;
40  float r[3] = {(float) X, (float) Y, (float) Z};
41  float dir[3] = {0, 0, 0};
42  to_local_(r, dir, &moduleID);
43  x = r[0]; y = r[1]; z = r[2];
44  }
45 
57  inline void PointToGlobal(int moduleID, double X, double Y, double Z,
58  double& x, double& y, double& z)
59  {
60  moduleID--;
61  float r[3] = {(float) X, (float) Y, (float) Z};
62  float dir[3] = {0, 0, 0};
63  to_global_(r, dir, &moduleID);
64  x = r[0]; y = r[1]; z = r[2];
65  }
66 
77  inline void MomentumToLocal(int moduleID, double Px, double Py, double Pz,
78  double& px, double& py, double& pz)
79  {
80  moduleID--;
81  float r[3] = {0, 0, 0};
82  float dir[3] = {(float) Px, (float) Py, (float) Pz};
83  to_local_(r, dir, &moduleID);
84  px = dir[0]; py = dir[1]; pz = dir[2];
85  }
86 
97  inline void MomentumToGlobal(int moduleID, double Px, double Py, double Pz,
98  double& px, double& py, double& pz)
99  {
100  moduleID--;
101  float r[3] = {0, 0, 0};
102  float dir[3] = {(float) Px, (float) Py, (float) Pz};
103  to_global_(r, dir, &moduleID);
104  px = dir[0]; py = dir[1]; pz = dir[2];
105  }
106 
115  inline bool InsideQbar(double X, double Y, double Z, int moduleID)
116  {
117  moduleID--;
118  float x = (float) X; float y = (float) Y; float z = (float) Z;
119  return inside_qbar_(&x, &y, &z, &moduleID) != 0;
120  }
121 
130  inline bool InsideExpansionVolume(double X, double Y, double Z, int moduleID)
131  {
132  moduleID--;
133  float x = (float) X; float y = (float) Y; float z = (float) Z;
134  return inside_extvol_(&x, &y, &z, &moduleID) != 0;
135  }
136 
142  inline double PhaseIndex(double E)
143  {
144  float e = (float) E;
145  return phase_index_(&e);
146  }
147 
152  inline double PhaseIndex()
153  {
154  float refind, gruind;
155  get_top_par_(&refind, &gruind);
156  return refind;
157  }
158 
164  inline double GroupIndex(double E)
165  {
166  float e = (float) E;
167  return group_index_(&e);
168  }
169 
174  inline double GroupIndex()
175  {
176  float refind, gruind;
177  get_top_par_(&refind, &gruind);
178  return gruind;
179  }
180 
186  inline double AtenuLength(double E)
187  {
188  float e = (float) E;
189  return abspt_leng_(&e);
190  }
191 
197  inline double MirrorRefl(double E)
198  {
199  float e = (float) E;
200  return mirror_refl_(&e);
201  }
202 
208  inline double QEffi(double E)
209  {
210  float e = (float) E;
211  return qe_pmt_(&e);
212  }
213 
219  inline void QErange(double& Emin, double& Emax)
220  {
221  float emin, emax;
222  qe_range_(&emin, &emax);
223  Emin = emin; Emax = emax;
224  }
225 
230  inline double QEmax()
231  {
232  return qe_max_();
233  }
234 
239  inline double Nzero()
240  {
241  return qe_nzero_();
242  }
243 
251  inline double CerAngle(double P, double Mass, double RefrIndex)
252  {
253  float p = (float) P; float mass = (float) Mass;
254  float refind = (float) RefrIndex;
255  return cher_angle_(&p, &mass, &refind);
256  }
257 
258 
259  } // top namespace
261 } // Belle2 namespace
262 
263 
264 #endif
265 
prepareAsicCrosstalkSimDB.e
e
aux.
Definition: prepareAsicCrosstalkSimDB.py:53
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19