Belle II Software development
CDCSimHitLookUp.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/trackFindingCDC/numerics/ERightLeft.h>
11
12#include <tracking/trackFindingCDC/utilities/MayBePtr.h>
13
14#include <map>
15#include <vector>
16
17namespace Belle2 {
23 class CDCHit;
24 class CDCSimHit;
25
26 namespace TrackFindingCDC {
27 class CDCMCMap;
28 class CDCRecoHit3D;
29 class CDCRecoHit2D;
30 class CDCRLWireHit;
31 class CDCWireHit;
32 class Vector3D;
33
35
41
42 public:
44 static const CDCSimHitLookUp& getInstance();
45
48
51
53 CDCSimHitLookUp() = default;
54
56 void clear();
57
59 void fill(const CDCMCMap* ptrMCMap);
60
61 private:
63 void fillPrimarySimHits();
64
66 MayBePtr<const CDCSimHit> getClosestPrimarySimHit(const CDCSimHit* ptrSimHit) const;
67
68 public:
70 const CDCSimHit* getClosestPrimarySimHit(const CDCHit* ptrHit) const;
71
74
75 private:
77 void fillRLInfo();
78
79 public:
81 ERightLeft getRLInfo(const CDCHit* ptrHit) const;
82
84 Vector3D getRecoPos3D(const CDCHit* ptrHit) const;
85
87 double getDriftLength(const CDCHit* ptrHit) const;
88
91 Vector3D getClosestPrimaryRecoPos3D(const CDCHit* ptrHit) const;
92
95 double getClosestPrimaryDriftLength(const CDCHit* ptrHit) const;
96
97 public:
99 const CDCWireHit* getWireHit(const CDCHit* ptrHit,
100 const std::vector<CDCWireHit>& wireHits) const;
101
103 CDCRLWireHit getRLWireHit(const CDCHit* ptrHit,
104 const std::vector<CDCWireHit>& wireHits) const;
105
107 CDCRecoHit3D getRecoHit3D(const CDCHit* ptrHit,
108 const std::vector<CDCWireHit>& wireHits) const;
109
112 const std::vector<CDCWireHit>& wireHits) const;
113
115 CDCRecoHit2D getRecoHit2D(const CDCHit* ptrHit,
116 const std::vector<CDCWireHit>& wireHits) const;
117
120 const std::vector<CDCWireHit>& wireHits) const;
121
122 private:
125
127 std::map<const CDCHit*, MayBePtr<const CDCSimHit> > m_primarySimHits;
128
130 std::map<const CDCHit*, ERightLeft> m_rightLeftInfos;
131
132 };
133 }
135}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
Example Detector.
Definition: CDCSimHit.h:21
Class to organize and present the monte carlo hit information.
Definition: CDCMCMap.h:28
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:41
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:47
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:52
Singletone class to gather local information about the hits.
CDCRecoHit3D getRecoHit3D(const CDCHit *ptrHit, const std::vector< CDCWireHit > &wireHits) const
Construct an CDCRecoHit3D from the (potential secondary) CDCSimHit information related to the CDCHit.
void fillRLInfo()
Construct the look up relation for the right left passage information as used in track finding.
static const CDCSimHitLookUp & getInstance()
Getter for the singletone instance.
double getClosestPrimaryDriftLength(const CDCHit *ptrHit) const
Look up the drift length from the primary ionisation to the wire from related simulated hit.
const CDCWireHit * getWireHit(const CDCHit *ptrHit, const std::vector< CDCWireHit > &wireHits) const
Retrieve the wire hit the given CDCHit form the given wire hits.
double getDriftLength(const CDCHit *ptrHit) const
Look up the drift length from the primary ionisation to the wire from related simulated hit.
void fillPrimarySimHits()
Constructs the relation from reassigned secondary to a close by primary hit from the same MCParticle.
CDCRLWireHit getRLWireHit(const CDCHit *ptrHit, const std::vector< CDCWireHit > &wireHits) const
Retrieve the wire hit including right left passage information for the given CDCHit form the given wi...
Vector3D getDirectionOfFlight(const CDCHit *ptrHit)
Calculate the local direction of flight. If the hit is secondary take the direction of flight from a ...
Vector3D getRecoPos3D(const CDCHit *ptrHit) const
Look up the position of the primary ionisation from related simulated hit.
MayBePtr< const CDCSimHit > getClosestPrimarySimHit(const CDCSimHit *ptrSimHit) const
Helper function to find the closest primary hit for the given CDCSimHit from the same MCParticle - nu...
CDCRecoHit3D getClosestPrimaryRecoHit3D(const CDCHit *ptrHit, const std::vector< CDCWireHit > &wireHits) const
Construct an CDCRecoHit3D from the closest primary CDCSimHit information related to the CDCHit.
CDCSimHitLookUp(CDCSimHitLookUp &)=delete
Singleton: Delete copy constructor and assignment operator.
const CDCMCMap * m_ptrMCMap
Reference to the CDCMCMap to be used in this event.
CDCSimHitLookUp & operator=(const CDCSimHitLookUp &)=delete
Operator =.
std::map< const CDCHit *, ERightLeft > m_rightLeftInfos
Memory for the look up relation of the right left passage information as defined in tracking.
CDCRecoHit2D getClosestPrimaryRecoHit2D(const CDCHit *ptrHit, const std::vector< CDCWireHit > &wireHits) const
Construct an CDCRecoHit2D from the closest primary CDCSimHit information related to the CDCHit.
void fill(const CDCMCMap *ptrMCMap)
Gather the information about the right left passage using the CDCMCMap.
void clear()
Clear all information from the last event.
std::map< const CDCHit *, MayBePtr< const CDCSimHit > > m_primarySimHits
Memory for the look up relation of close primary CDCSimHits.
ERightLeft getRLInfo(const CDCHit *ptrHit) const
Look up the Monte Carlo right left passage information for the given hit.
CDCRecoHit2D getRecoHit2D(const CDCHit *ptrHit, const std::vector< CDCWireHit > &wireHits) const
Construct an CDCRecoHit2D from the (potential secondary) CDCSimHit information related to the CDCHit.
Vector3D getClosestPrimaryRecoPos3D(const CDCHit *ptrHit) const
Look up the position of the primary ionisation from the closest primary simulated hit.
CDCSimHitLookUp()=default
Default constructor - for cppcheck.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
A three dimensional vector.
Definition: Vector3D.h:33
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition: Cell.h:34
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25
Abstract base class for different kinds of events.