Belle II Software  release-08-01-10
VXDHoughState.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 #pragma once
9 
10 #include <tracking/spacePointCreation/SpacePoint.h>
11 #include <tracking/trackFindingCDC/ca/AutomatonCell.h>
12 #include <vxd/dataobjects/VxdID.h>
13 
14 namespace Belle2 {
19  class SpacePoint;
20  namespace vxdHoughTracking {
21 
23 
24  class VXDHoughState {
25  public:
27  VXDHoughState() = default;
31  VXDHoughState(const VXDHoughState&) = delete;
37  ~VXDHoughState() = default;
38 
40  explicit VXDHoughState(const SpacePoint* hit, const B2Vector3D& BeamSpotPosition) : m_hit(hit)
41  {
42  m_dataCache.sensorID = hit->getVxdID();
43  m_dataCache.layer = hit->getVxdID().getLayerNumber();
44  m_dataCache.ladder = hit->getVxdID().getLadderNumber();
45  const VXD::SensorInfoBase& sensorInfo = VXD::GeoCache::getInstance().getSensorInfo(hit->getVxdID());
46  m_dataCache.x = hit->X();
47  m_dataCache.y = hit->Y();
48  m_dataCache.z = hit->Z();
49  const double conformalTransform = 2. / ((hit->X() - BeamSpotPosition.X()) * (hit->X() - BeamSpotPosition.X()) +
50  (hit->Y() - BeamSpotPosition.Y()) * (hit->Y() - BeamSpotPosition.Y()));
51  m_dataCache.xConformal = hit->X() * conformalTransform;
52  m_dataCache.yConformal = hit->Y() * conformalTransform;
53  m_dataCache.localNormalizedu = hit->getNormalizedLocalU();
54  m_dataCache.localNormalizedv = hit->getNormalizedLocalV();
55  m_dataCache.sensorCenterPhi = sensorInfo.pointToGlobal(ROOT::Math::XYZVector(0., 0., 0.), true).Phi();
56  m_dataCache.phi = hit->getPosition().Phi();
57  m_dataCache.theta = hit->getPosition().Theta();
58  m_dataCache.uTime = hit->TimeU();
59  m_dataCache.vTime = hit->TimeV();
60  }
61 
63  const SpacePoint* getHit() const { return m_hit; }
64 
67 
68 
70  struct DataCache {
72  float x = std::numeric_limits<float>::quiet_NaN();
74  float y = std::numeric_limits<float>::quiet_NaN();
76  float z = std::numeric_limits<float>::quiet_NaN();
78  float xConformal = std::numeric_limits<float>::quiet_NaN();
80  float yConformal = std::numeric_limits<float>::quiet_NaN();
82  float localNormalizedu = std::numeric_limits<float>::quiet_NaN();
84  float localNormalizedv = std::numeric_limits<float>::quiet_NaN();
86  float sensorCenterPhi = std::numeric_limits<float>::quiet_NaN();
88  float phi = std::numeric_limits<float>::quiet_NaN();
90  float theta = std::numeric_limits<float>::quiet_NaN();
92  float uTime = std::numeric_limits<float>::quiet_NaN();
94  float vTime = std::numeric_limits<float>::quiet_NaN();
96  unsigned short layer = std::numeric_limits<unsigned short>::quiet_NaN();
98  unsigned short ladder = std::numeric_limits<unsigned short>::quiet_NaN();
101  };
103  const DataCache getDataCache() const { return m_dataCache; }
104 
105  protected:
108 
109  private:
111  const SpacePoint* m_hit = nullptr;
114  };
115 
116  }
118 }
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Definition: SpacePoint.h:42
Cell used by the cellular automata.
Definition: AutomatonCell.h:29
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.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Simple container for hit information to be used during intercept finding.
Definition: VXDHoughState.h:24
const SpacePoint * m_hit
Pointer to hit.
VXDHoughState & operator=(VXDHoughState &&)=default
Move assignment constructor.
VXDHoughState(VXDHoughState &&)=default
Move constructor needed for STL containers.
TrackFindingCDC::AutomatonCell m_automatonCell
Memory for the automaton cell.
VXDHoughState(const VXDHoughState &)=delete
No copy constructor.
VXDHoughState(const SpacePoint *hit, const B2Vector3D &BeamSpotPosition)
Initialize the state as non-root with a related hit (and with a seed)
Definition: VXDHoughState.h:40
VXDHoughState & operator=(const VXDHoughState &)=delete
No copy constructor.
TrackFindingCDC::AutomatonCell & getAutomatonCell()
Getter for the automaton cell.
Definition: VXDHoughState.h:66
const SpacePoint * getHit() const
Return the SP this state is related to. May be nullptr.
Definition: VXDHoughState.h:63
VXDHoughState()=default
Default constructor.
DataCache m_dataCache
Cache the most important data of this state for better runtime performance.
const DataCache getDataCache() const
Get the cached data of this state.
Abstract base class for different kinds of events.
Cache containing the most important information of this state which will often be needed.
Definition: VXDHoughState.h:70
float sensorCenterPhi
Phi value of SpacePoint.
Definition: VXDHoughState.h:86
float yConformal
conformal transformed y coordinate of this hit
Definition: VXDHoughState.h:80
float localNormalizedu
Local normalized uCoordinate of this state, only set if based on SpacePoint.
Definition: VXDHoughState.h:82
unsigned short layer
Geometrical Layer this state is based on.
Definition: VXDHoughState.h:96
float xConformal
conformal transformed x coordinate of this hit
Definition: VXDHoughState.h:78
float uTime
Time of the u-side cluster.
Definition: VXDHoughState.h:92
unsigned short ladder
Ladder this state is based on (only use for SpacePoint based states)
Definition: VXDHoughState.h:98
float vTime
Time of the v-side cluster.
Definition: VXDHoughState.h:94
float localNormalizedv
Local normalized vCoordinate of this state, only set if based on SpacePoint.
Definition: VXDHoughState.h:84