SdReconstruction/SdHorizontalReconstruction/Utilities.h
Go to the documentation of this file.
1 #ifndef _SdHorizontalReconstruction_Utilities_h_
2 #define _SdHorizontalReconstruction_Utilities_h_
3 
4 #include <utl/CoordinateSystemPtr.h>
5 #include <utl/Point.h>
6 #include <utl/Vector.h>
7 
8 namespace SdHorizontalReconstructionNS {
9 
10  inline
12  GetShowerCoordinateSystem(const double theta, const double phi,
13  const utl::CoordinateSystemPtr& coreCS)
14  {
16  theta,
18  phi,
19  coreCS));
20  }
21 
22  inline
23  void
24  GetRhoAndDelta(double& rho, double& delta,
25  const utl::Point& pos, const utl::Point& core, const utl::Point& origin)
26  {
27  using namespace utl;
28  const Vector coreToPos = pos - core;
29  const Vector coreToOrigin = origin - core;
30  delta = coreToPos*coreToOrigin/coreToOrigin.GetMag();
31  rho = std::sqrt(coreToPos.GetMag2() - delta*delta);
32  }
33 
34  inline
35  double
36  GetRho(const utl::Point& pos, const utl::Point& core, const utl::Point& origin)
37  {
38  double rho, delta;
39  GetRhoAndDelta(rho, delta, pos, core, origin);
40  return rho;
41  }
42 
43 } // NS SdHorizontalReconstructionNS
44 
45 #endif
Point object.
Definition: Point.h:32
utl::CoordinateSystemPtr GetShowerCoordinateSystem(const double theta, const double phi, const utl::CoordinateSystemPtr &coreCS)
double GetRho(const utl::Point &pos, const utl::Point &core, const utl::Point &origin)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
static Policy::type RotationY(const double angle, const CoordinateSystemPtr &theCS)
Construct from rotation about Y axis.
static Policy::type RotationZ(const double angle, const CoordinateSystemPtr &theCS)
Construct from rotation about Z axis.
Vector object.
Definition: Vector.h:30
void GetRhoAndDelta(double &rho, double &delta, const utl::Point &pos, const utl::Point &core, const utl::Point &origin)

, generated on Tue Sep 26 2023.