Belle II Software development
SensorPlane.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#ifndef VXD_SENSORPLANE_H
10#define VXD_SENSORPLANE_H
11
12#include <vxd/dataobjects/VxdID.h>
13#include <vxd/geometry/SensorInfoBase.h>
14#include <framework/logging/Logger.h>
15//ROOT CINT has problems with the boost classes used by the GeoCache but it
16//does not need to see them anyway
17#ifndef __CINT__
18#include <vxd/geometry/GeoCache.h>
19#endif
20
21#include <genfit/AbsFinitePlane.h>
22#include <cmath>
23
24namespace Belle2 {
29 namespace VXD {
34 class SensorPlane: public genfit::AbsFinitePlane {
35 public:
42 SensorPlane(VxdID sensorID = 0, double uTolerance = 0, double vTolerance = 0):
43 m_sensorID(sensorID), m_uTolerance(uTolerance), m_vTolerance(vTolerance), m_cosPhi(1.), m_sinPhi(0.), m_sensorInfo(0) {}
44
49 void setRotation(double phi)
50 {
51 m_cosPhi = cos(phi);
52 m_sinPhi = sin(phi);
53 }
55 virtual ~SensorPlane() {}
56
62 bool isInActive(double u, double v) const override
63 {
64#ifndef __CINT__
65 //If running in ROOT CINT we do not know about GeoCache so we cannot get
66 //the SensorInfo
67 if (!m_sensorInfo) {
69 }
70#endif
71 //No sensorInfo set so we have to bail
72 if (!m_sensorInfo) {
73 B2FATAL("Could not find sensorInfo for VXD Sensor " << VxdID(m_sensorID));
74 }
75 double uRot = m_cosPhi * u - m_sinPhi * v;
76 double vRot = m_sinPhi * u + m_cosPhi * v;
77 return m_sensorInfo->inside(uRot, vRot, m_uTolerance, m_vTolerance);
78 }
79
81 void Print(const Option_t* option = "") const override;
82
87 virtual genfit::AbsFinitePlane* clone() const override
88 {
89 return new SensorPlane(*this);
90 }
91
92 private:
94 unsigned short m_sensorID;
100 double m_cosPhi;
102 double m_sinPhi;
105
106 ClassDefOverride(SensorPlane, 2)
107 };
108 } // vxd namespace
110} // Belle2 namespace
111
112#endif /* VXD_SENSORPLANE_H */
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
Base class to provide Sensor Information for PXD and SVD.
bool inside(double u, double v, double uTolerance=DBL_EPSILON, double vTolerance=DBL_EPSILON) const
Check wether a given point is inside the active area.
A Finite plane of one VXD Sensor.
Definition: SensorPlane.h:34
double m_uTolerance
Tolerance to add to the sensor dimensions in u direction.
Definition: SensorPlane.h:96
void setRotation(double phi)
Set plane rotation angle.
Definition: SensorPlane.h:49
unsigned short m_sensorID
Sensor ID of the sensor plane.
Definition: SensorPlane.h:94
bool isInActive(double u, double v) const override
Return whether the given coordinates are inside the finite region.
Definition: SensorPlane.h:62
double m_sinPhi
Sine term of plane rotation, used to align SVD trapezoidal sensors.
Definition: SensorPlane.h:102
virtual genfit::AbsFinitePlane * clone() const override
Deep copy of the object.
Definition: SensorPlane.h:87
double m_cosPhi
Cosine term of plane rotation, used to align SVD trapezoidal sensors.
Definition: SensorPlane.h:100
double m_vTolerance
Tolerance to add to the sensor dimensions in v direction.
Definition: SensorPlane.h:98
virtual ~SensorPlane()
Destructor.
Definition: SensorPlane.h:55
SensorPlane(VxdID sensorID=0, double uTolerance=0, double vTolerance=0)
Constructs the plane for a given VXD Sensor.
Definition: SensorPlane.h:42
void Print(const Option_t *option="") const override
Prints object data.
Definition: SensorPlane.cc:15
const SensorInfoBase * m_sensorInfo
Pointer to the SensorInfo which contains the geometry information for the given sensor plane.
Definition: SensorPlane.h:104
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.