Belle II Software development
CDCMCHitCollectionLookUp.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/mclookup/CDCMCHitLookUp.h>
11
12#include <tracking/trackingUtilities/numerics/EForwardBackward.h>
13#include <tracking/trackingUtilities/numerics/Index.h>
14
15#include <map>
16
17namespace Belle2 {
22 class MCParticle;
23 class CDCHit;
24
25 namespace TrackingUtilities {
26 class CDCTrajectory3D;
27 }
28
29 namespace TrackFindingCDC {
30
33
35 MCTrackIdPurityPair(ITrackType mcTrackId, float purity, int correctRLVote)
36 : m_mcTrackId(mcTrackId)
37 , m_purity(purity)
38 , m_correctRLVote(correctRLVote)
39 {
40 }
41
43 ITrackType getMCTrackId() const
44 {
45 return m_mcTrackId;
46 }
47
49 float getPurity() const
50 {
51 return m_purity;
52 }
53
55 int getCorrectRLVote() const
56 {
57 return m_correctRLVote;
58 }
59
60 private:
62 ITrackType m_mcTrackId;
63
65 float m_purity;
66
69 };
70
72 template <typename ACDCHitCollection>
74
75 public:
77 void clear();
78
81
82 private:
84 std::map<ITrackType, size_t> getHitCountByMCTrackId(const ACDCHitCollection& hits) const;
85
86 public:
88 MCTrackIdPurityPair getHighestPurity(const ACDCHitCollection& hits) const;
89
91
95 ITrackType getMCTrackId(const ACDCHitCollection* ptrHits) const;
96
98 int getCorrectRLVote(const ACDCHitCollection* ptrHits) const;
99
101 double getRLPurity(const ACDCHitCollection* ptrHits) const;
102
104 const MCParticle* getMCParticle(const ACDCHitCollection* ptrHits) const;
105
106
108 const CDCHit* getFirstHit(const ACDCHitCollection* ptrHits) const;
109
111 const CDCHit* getLastHit(const ACDCHitCollection* ptrHits) const;
112
113
114
116 TrackingUtilities::Index getFirstInTrackId(const ACDCHitCollection* ptrHits) const
118
120 TrackingUtilities::Index getLastInTrackId(const ACDCHitCollection* ptrHits) const
122
123
124
126 TrackingUtilities::Index getFirstInTrackSegmentId(const ACDCHitCollection* ptrHits) const
128
130 TrackingUtilities::Index getLastInTrackSegmentId(const ACDCHitCollection* ptrHits) const
132
133
134
136 TrackingUtilities::Index getFirstNPassedSuperLayers(const ACDCHitCollection* ptrHits) const
138
140 TrackingUtilities::Index getLastNPassedSuperLayers(const ACDCHitCollection* ptrHits) const
142
144 TrackingUtilities::Index getFirstNLoops(const ACDCHitCollection* ptrHits) const
146
148 TrackingUtilities::Index getLastNLoops(const ACDCHitCollection* ptrHits) const
149 { return CDCMCHitLookUp::getInstance().getNLoops(getLastHit(ptrHits)); }
150
158 TrackingUtilities::EForwardBackward isForwardOrBackwardToMCTrack(const ACDCHitCollection* ptrHits) const;
159
171 TrackingUtilities::EForwardBackward areAlignedInMCTrack(const ACDCHitCollection* ptrFromHits,
172 const ACDCHitCollection* ptrToHits) const;
173
179 TrackingUtilities::EForwardBackward areAlignedInMCTrackWithRLCheck(const ACDCHitCollection* ptrFromHits,
180 const ACDCHitCollection* ptrToHits) const;
181
183 TrackingUtilities::CDCTrajectory3D getTrajectory3D(const ACDCHitCollection* ptrHits) const;
184
185 private:
188
190 float m_minimalRLPurity = 0.5;
191 };
192 }
194}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition CDCHit.h:40
A Class to store the Monte Carlo particle information.
Definition MCParticle.h:32
TrackingUtilities::Index getFirstInTrackId(const ACDCHitCollection *ptrHits) const
Getter for in track id for the first hit in the collection of hits which has the Monte Carlo track id...
ITrackType getMCTrackId(const ACDCHitCollection *ptrHits) const
Getter for the Monte Carlo track id matched to this collection of hits.
CDCMCHitCollectionLookUp()
Dummy constructor to silence the intel-compiler warnings (NOTE: using "=default" will make the intel ...
TrackingUtilities::Index getFirstNLoops(const ACDCHitCollection *ptrHits) const
Getter for number of loops till the first hit the collection of hits which has the Monte Carlo track ...
TrackingUtilities::Index getFirstInTrackSegmentId(const ACDCHitCollection *ptrHits) const
Getter for in track collection of hits id for the first hit in the collection of hits which has the M...
TrackingUtilities::EForwardBackward areAlignedInMCTrack(const ACDCHitCollection *ptrFromHits, const ACDCHitCollection *ptrToHits) const
Returns if the second collection of hits follows the first collection of hits in their common Monte C...
float m_minimalMatchPurity
Threshold for the purity that must be exceeded to be considered as a match.
std::map< ITrackType, size_t > getHitCountByMCTrackId(const ACDCHitCollection &hits) const
Fill a map with the number of hits for each track id contained in the given hit range.
TrackingUtilities::EForwardBackward isForwardOrBackwardToMCTrack(const ACDCHitCollection *ptrHits) const
Returns the orientation of the collection of hits relative to its matched track.
MCTrackIdPurityPair getHighestPurity(const ACDCHitCollection &hits) const
Get the track id with the highest corresponding purity.
const CDCHit * getLastHit(const ACDCHitCollection *ptrHits) const
Getter for the last hit in the collection of hits which has the Monte Carlo track id matched to this ...
const MCParticle * getMCParticle(const ACDCHitCollection *ptrHits) const
Getter for the mc particle matched to this collection of hits.
TrackingUtilities::Index getLastNLoops(const ACDCHitCollection *ptrHits) const
Getter for number of loops till the last hit the collection of hits which has the Monte Carlo track i...
TrackingUtilities::Index getLastNPassedSuperLayers(const ACDCHitCollection *ptrHits) const
Getter for number of passed superlayer till the last hit the collection of hits which has the Monte C...
int getCorrectRLVote(const ACDCHitCollection *ptrHits) const
Getter for the difference of correct versus incorrect right left passage information.
TrackingUtilities::Index getLastInTrackSegmentId(const ACDCHitCollection *ptrHits) const
Getter for in track collection of hits id for the last hit in the collection of hits which has the Mo...
void clear()
Clears all Monte Carlo information left from the last event.
const CDCHit * getFirstHit(const ACDCHitCollection *ptrHits) const
Getter for the first hit in the collection of hits which has the Monte Carlo track id matched to this...
double getRLPurity(const ACDCHitCollection *ptrHits) const
Getter for the right left passge purity which respects the forward backward reconstruction.
TrackingUtilities::Index getFirstNPassedSuperLayers(const ACDCHitCollection *ptrHits) const
Getter for number of passed superlayer till the first hit the collection of hits which has the Monte ...
TrackingUtilities::EForwardBackward areAlignedInMCTrackWithRLCheck(const ACDCHitCollection *ptrFromHits, const ACDCHitCollection *ptrToHits) const
Returns if the second collection of hits follows the first collection of hits in their common Monte C...
TrackingUtilities::CDCTrajectory3D getTrajectory3D(const ACDCHitCollection *ptrHits) const
Returns the trajectory of the collection of hits.
TrackingUtilities::Index getLastInTrackId(const ACDCHitCollection *ptrHits) const
Getter for in track id for the last hit in the collection of hits which has the Monte Carlo track id ...
float m_minimalRLPurity
Threshold for the correct fraction of right left passage information to be considered a match.
TrackingUtilities::Index getNPassedSuperLayers(const CDCHit *ptrHit) const
Returns the number of superlayers the track traversed until this hit.
TrackingUtilities::Index getInTrackSegmentId(const CDCHit *ptrHit) const
Returns the id of the segment in the track.
TrackingUtilities::Index getNLoops(const CDCHit *ptrHit) const
Returns the number of loops the track traversed until this hit.
TrackingUtilities::Index getInTrackId(const CDCHit *ptrHit) const
Returns the position of the wire hit in the track along the travel direction.
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
Particle full three dimensional trajectory.
Abstract base class for different kinds of events.
Structure representing a matched Monte Carlo track id with the corresponding purity.
int getCorrectRLVote() const
Getter for the rl vote.
float getPurity() const
Getter for the purity.
MCTrackIdPurityPair(ITrackType mcTrackId, float purity, int correctRLVote)
Constructor taking the Monte Carlo track id and the purity to be stored.
ITrackType getMCTrackId() const
Getter for the Monte Carlo track Id.
int m_correctRLVote
Number of correct rl information in the track.