Belle II Software development
CDCSimHitLookUp Class Reference

Singletone class to gather local information about the hits. More...

#include <CDCSimHitLookUp.h>

Public Member Functions

 CDCSimHitLookUp (CDCSimHitLookUp &)=delete
 Singleton: Delete copy constructor and assignment operator.
 
CDCSimHitLookUpoperator= (const CDCSimHitLookUp &)=delete
 Operator =.
 
 CDCSimHitLookUp ()=default
 Default constructor - for cppcheck.
 
void clear ()
 Clear all information from the last event.
 
void fill (const CDCMCMap *ptrMCMap)
 Gather the information about the right left passage using the CDCMCMap.
 
const CDCSimHitgetClosestPrimarySimHit (const CDCHit *ptrHit) const
 Look up and return the closest primary simulated hit for the given CDCHit - if no suitable hit can be found return the secondary.
 
TrackingUtilities::Vector3D getDirectionOfFlight (const CDCHit *ptrHit)
 Calculate the local direction of flight. If the hit is secondary take the direction of flight from a close by primary - null vector if it cannot be assumed this way.
 
TrackingUtilities::ERightLeft getRLInfo (const CDCHit *ptrHit) const
 Look up the Monte Carlo right left passage information for the given hit.
 
TrackingUtilities::Vector3D getRecoPos3D (const CDCHit *ptrHit) const
 Look up the position of the primary ionisation from related simulated hit.
 
double getDriftLength (const CDCHit *ptrHit) const
 Look up the drift length from the primary ionisation to the wire from related simulated hit.
 
TrackingUtilities::Vector3D getClosestPrimaryRecoPos3D (const CDCHit *ptrHit) const
 Look up the position of the primary ionisation from the closest primary simulated hit.
 
double getClosestPrimaryDriftLength (const CDCHit *ptrHit) const
 Look up the drift length from the primary ionisation to the wire from related simulated hit.
 
const TrackingUtilities::CDCWireHitgetWireHit (const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
 Retrieve the wire hit the given CDCHit form the given wire hits.
 
TrackingUtilities::CDCRLWireHit getRLWireHit (const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
 Retrieve the wire hit including right left passage information for the given CDCHit form the given wire hits.
 
TrackingUtilities::CDCRecoHit3D getRecoHit3D (const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
 Construct an CDCRecoHit3D from the (potential secondary) CDCSimHit information related to the CDCHit.
 
TrackingUtilities::CDCRecoHit3D getClosestPrimaryRecoHit3D (const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
 Construct an CDCRecoHit3D from the closest primary CDCSimHit information related to the CDCHit.
 
TrackingUtilities::CDCRecoHit2D getRecoHit2D (const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
 Construct an TrackingUtilities::CDCRecoHit2D from the (potential secondary) CDCSimHit information related to the CDCHit.
 
TrackingUtilities::CDCRecoHit2D getClosestPrimaryRecoHit2D (const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
 Construct an TrackingUtilities::CDCRecoHit2D from the closest primary CDCSimHit information related to the CDCHit.
 

Static Public Member Functions

static const CDCSimHitLookUpgetInstance ()
 Getter for the singletone instance.
 

Private Member Functions

void fillPrimarySimHits ()
 Constructs the relation from reassigned secondary to a close by primary hit from the same MCParticle.
 
TrackingUtilities::MayBePtr< const CDCSimHitgetClosestPrimarySimHit (const CDCSimHit *ptrSimHit) const
 Helper function to find the closest primary hit for the given CDCSimHit from the same MCParticle - nullptr if no suitable hit can be found.
 
void fillRLInfo ()
 Construct the look up relation for the right left passage information as used in track finding.
 

Private Attributes

const CDCMCMapm_ptrMCMap
 Reference to the CDCMCMap to be used in this event.
 
std::map< const CDCHit *, TrackingUtilities::MayBePtr< const CDCSimHit > > m_primarySimHits
 Memory for the look up relation of close primary CDCSimHits.
 
std::map< const CDCHit *, TrackingUtilities::ERightLeftm_rightLeftInfos
 Memory for the look up relation of the right left passage information as defined in tracking.
 

Detailed Description

Singletone class to gather local information about the hits.

Because of the reassignment of secondary hits and the different definition of the right left passage in the CDCSimHit compared to the definition used in tracking finding, we provide this class to collect an manage localised information about each hit such as the local direction of travel and said left right passage information.

Definition at line 43 of file CDCSimHitLookUp.h.

Member Function Documentation

◆ clear()

void clear ( )

Clear all information from the last event.

Definition at line 38 of file CDCSimHitLookUp.cc.

39{
40 m_ptrMCMap = nullptr;
41
42 m_primarySimHits.clear();
43 m_rightLeftInfos.clear();
44}
std::map< const CDCHit *, TrackingUtilities::MayBePtr< const CDCSimHit > > m_primarySimHits
Memory for the look up relation of close primary CDCSimHits.
const CDCMCMap * m_ptrMCMap
Reference to the CDCMCMap to be used in this event.
std::map< const CDCHit *, TrackingUtilities::ERightLeft > m_rightLeftInfos
Memory for the look up relation of the right left passage information as defined in tracking.

◆ fill()

void fill ( const CDCMCMap * ptrMCMap)

Gather the information about the right left passage using the CDCMCMap.

Definition at line 46 of file CDCSimHitLookUp.cc.

47{
48 B2DEBUG(25, "In CDCSimHitLookUp::fill()");
49 clear();
50 m_ptrMCMap = ptrMCMap;
51
53 fillRLInfo();
54
55 B2DEBUG(25, "m_primarySimHits.size(): " << m_primarySimHits.size());
56 B2DEBUG(25, "m_rightLeftInfos.size(): " << m_rightLeftInfos.size());
57}
void fillRLInfo()
Construct the look up relation for the right left passage information as used in track finding.
void fillPrimarySimHits()
Constructs the relation from reassigned secondary to a close by primary hit from the same MCParticle.
void clear()
Clear all information from the last event.

◆ fillPrimarySimHits()

void fillPrimarySimHits ( )
private

Constructs the relation from reassigned secondary to a close by primary hit from the same MCParticle.

Definition at line 59 of file CDCSimHitLookUp.cc.

60{
61 if (not m_ptrMCMap) {
62 B2WARNING("CDCMCMap not set. Cannot setup primary sim hit map");
63 return;
64 }
65
66 const CDCMCMap& mcMap = *m_ptrMCMap;
67 int nMissingPrimarySimHits = 0;
68 for (const auto& relation : mcMap.getSimHitsByHit()) {
69
70 const CDCHit* ptrHit = std::get<const CDCHit* const>(relation);
71 const CDCSimHit* ptrSimHit = std::get<const CDCSimHit*>(relation);
72
73 if (not ptrSimHit) {
74 B2ERROR("CDCHit has no related CDCSimHit in CDCSimHitLookUp::fill()");
75 continue;
76 }
77
78 if (mcMap.isReassignedSecondary(ptrSimHit)) {
79 MayBePtr<const CDCSimHit> primarySimHit = getClosestPrimarySimHit(ptrSimHit);
80 if (not primarySimHit) {
81 ++nMissingPrimarySimHits;
82 }
83 m_primarySimHits[ptrHit] = primarySimHit;
84 }
85 }
86 if (nMissingPrimarySimHits != 0) {
87 B2WARNING("NO primary hit found for " << nMissingPrimarySimHits << " reassigned secondaries");
88 }
89}
const std::multimap< const CDCHit *, const CDCSimHit * > & getSimHitsByHit() const
Getter for the CDCHit -> CDCSimHit relations.
Definition CDCMCMap.h:134
bool isReassignedSecondary(const CDCSimHit *ptrSimHit) const
Indicates if the CDCSimHit has been reassigned to a primary MCParticle.
Definition CDCMCMap.h:110
TrackingUtilities::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...

◆ fillRLInfo()

void fillRLInfo ( )
private

Construct the look up relation for the right left passage information as used in track finding.

Definition at line 210 of file CDCSimHitLookUp.cc.

211{
212
213 if (not m_ptrMCMap) {
214 B2WARNING("CDCMCMap not set. Cannot setup right left passage information map");
215 return;
216 }
217 const CDCMCMap& mcMap = *m_ptrMCMap;
218
219 for (const auto& relation : mcMap.getSimHitsByHit()) {
220
221 const CDCHit* ptrHit = std::get<const CDCHit* const>(relation);
222 const CDCSimHit* ptrSimHit = std::get<const CDCSimHit*>(relation);
223
224 if (not ptrSimHit) continue;
225 const CDCSimHit& simHit = *ptrSimHit;
226
227 Vector3D directionOfFlight = getDirectionOfFlight(ptrHit);
228 if (directionOfFlight.isNull()) continue;
229
230 // find out if the wire is right or left of the track ( view in flight direction )
231 Vector3D trackPosToWire{simHit.getPosWire() - simHit.getPosTrack()};
232 ERightLeft rlInfo = trackPosToWire.xy().isRightOrLeftOf(directionOfFlight.xy());
233 m_rightLeftInfos[ptrHit] = rlInfo;
234 }
235}
B2Vector3D getPosWire() const
The method to get position on wire.
Definition CDCSimHit.h:198
B2Vector3D getPosTrack() const
The method to get position on the track.
Definition CDCSimHit.h:216
TrackingUtilities::Vector3D getDirectionOfFlight(const CDCHit *ptrHit)
Calculate the local direction of flight. If the hit is secondary take the direction of flight from a ...
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition Vector3D.h:513
bool isNull() const
Checks if the vector is the null vector.
Definition Vector3D.h:160
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

◆ getClosestPrimaryDriftLength()

double getClosestPrimaryDriftLength ( const CDCHit * ptrHit) const

Look up the drift length from the primary ionisation to the wire from related simulated hit.

If no primary sim hit is available use the information from the secondary hit

Definition at line 291 of file CDCSimHitLookUp.cc.

292{
293 const CDCSimHit* ptrPrimarySimHit = getClosestPrimarySimHit(ptrHit);
294 if (ptrPrimarySimHit) {
295 const CDCSimHit& primarySimHit = *ptrPrimarySimHit;
296 return primarySimHit.getDriftLength();
297 } else {
298 return getDriftLength(ptrHit);
299 }
300}
double getDriftLength() const
The method to get drift length.
Definition CDCSimHit.h:180
double getDriftLength(const CDCHit *ptrHit) const
Look up the drift length from the primary ionisation to the wire from related simulated hit.

◆ getClosestPrimaryRecoHit2D()

CDCRecoHit2D getClosestPrimaryRecoHit2D ( const CDCHit * ptrHit,
const std::vector< TrackingUtilities::CDCWireHit > & wireHits ) const

Construct an TrackingUtilities::CDCRecoHit2D from the closest primary CDCSimHit information related to the CDCHit.

Definition at line 353 of file CDCSimHitLookUp.cc.

355{
356 return getClosestPrimaryRecoHit3D(ptrHit, wireHits).getRecoHit2D();
357}
TrackingUtilities::CDCRecoHit3D getClosestPrimaryRecoHit3D(const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
Construct an CDCRecoHit3D from the closest primary CDCSimHit information related to the CDCHit.
CDCRecoHit2D getRecoHit2D() const
Constructs a two dimensional reconstructed hit by carrying out the stereo !

◆ getClosestPrimaryRecoHit3D()

CDCRecoHit3D getClosestPrimaryRecoHit3D ( const CDCHit * ptrHit,
const std::vector< TrackingUtilities::CDCWireHit > & wireHits ) const

Construct an CDCRecoHit3D from the closest primary CDCSimHit information related to the CDCHit.

Definition at line 336 of file CDCSimHitLookUp.cc.

338{
339 CDCRLWireHit rlWireHit = getRLWireHit(ptrHit, wireHits);
340 double driftLength = getClosestPrimaryDriftLength(ptrHit);
341 rlWireHit.setRefDriftLength(driftLength);
342 Vector3D recoPos3D = getClosestPrimaryRecoPos3D(ptrHit);
343 return CDCRecoHit3D(rlWireHit, recoPos3D);
344}
double getClosestPrimaryDriftLength(const CDCHit *ptrHit) const
Look up the drift length from the primary ionisation to the wire from related simulated hit.
TrackingUtilities::CDCRLWireHit getRLWireHit(const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
Retrieve the wire hit including right left passage information for the given CDCHit form the given wi...
TrackingUtilities::Vector3D getClosestPrimaryRecoPos3D(const CDCHit *ptrHit) const
Look up the position of the primary ionisation from the closest primary simulated hit.
void setRefDriftLength(double driftLength)
Setter for the drift length at the reference position of the wire.

◆ getClosestPrimaryRecoPos3D()

Vector3D getClosestPrimaryRecoPos3D ( const CDCHit * ptrHit) const

Look up the position of the primary ionisation from the closest primary simulated hit.

If no primary sim hit is available use the information from the secondary hit

Definition at line 281 of file CDCSimHitLookUp.cc.

282{
283 const CDCSimHit* ptrPrimarySimHit = getClosestPrimarySimHit(ptrHit);
284 if (ptrPrimarySimHit) {
285 const CDCSimHit& primarySimHit = *ptrPrimarySimHit;
286 return Vector3D{primarySimHit.getPosTrack()};
287 } else {
288 return getRecoPos3D(ptrHit);
289 }
290}
TrackingUtilities::Vector3D getRecoPos3D(const CDCHit *ptrHit) const
Look up the position of the primary ionisation from related simulated hit.

◆ getClosestPrimarySimHit() [1/2]

const CDCSimHit * getClosestPrimarySimHit ( const CDCHit * ptrHit) const

Look up and return the closest primary simulated hit for the given CDCHit - if no suitable hit can be found return the secondary.

Definition at line 159 of file CDCSimHitLookUp.cc.

160{
161 if (not m_ptrMCMap) {
162 B2WARNING("CDCMCMap not set in look up of closest primary sim hit.");
163 return nullptr;
164 }
165 const CDCMCMap& mcMap = *m_ptrMCMap;
166
167 if (mcMap.isReassignedSecondary(ptrHit)) {
168 auto itFoundPrimarySimHit = m_primarySimHits.find(ptrHit);
169 if (itFoundPrimarySimHit != m_primarySimHits.end()) {
170 const CDCSimHit* simHit = itFoundPrimarySimHit->second;
171 if (simHit) return simHit;
172 }
173 }
174 // Return the normal (potentially secondary) CDCSimHit of no primary is available
175 return mcMap.getSimHit(ptrHit);
176}
TrackingUtilities::MayBePtr< const CDCSimHit > getSimHit(const CDCHit *hit) const
Seeks the CDCSimHit related to the CDCHit.
Definition CDCMCMap.cc:250

◆ getClosestPrimarySimHit() [2/2]

MayBePtr< const CDCSimHit > getClosestPrimarySimHit ( const CDCSimHit * ptrSimHit) const
private

Helper function to find the closest primary hit for the given CDCSimHit from the same MCParticle - nullptr if no suitable hit can be found.

Definition at line 91 of file CDCSimHitLookUp.cc.

92{
93 if (not ptrSimHit) {
94 return nullptr;
95 }
96 const CDCSimHit& simHit = *ptrSimHit;
97
98 if (not m_ptrMCMap) {
99 B2WARNING("CDCMCMap not set. Cannot find primary sim hit");
100 return nullptr;
101 }
102
103 const CDCMCMap& mcMap = *m_ptrMCMap;
104
105 // Check if the CDCSimHit was reassigned from a secondary particle to its primary particle.
106 if (not mcMap.isReassignedSecondary(ptrSimHit)) {
107 return ptrSimHit;
108 } else {
109
110 // Try to find the hit on the same wire from the primary particle.
111 const MCParticle* ptrMCParticle = mcMap.getMCParticle(ptrSimHit);
112 if (not ptrMCParticle) {
113 return nullptr;
114 }
115
116 WireID wireID = simHit.getWireID();
117 std::vector<const CDCSimHit*> primarySimHitsOnSameOrNeighborWire;
118 const CDCWireTopology& wireTopology = CDCWireTopology::getInstance();
119
120 for (const auto& simHitByMCParticleRelation : mcMap.getSimHits(ptrMCParticle)) {
121
122 const CDCSimHit* ptrPrimarySimHit = std::get<const CDCSimHit*>(simHitByMCParticleRelation);
123 if (mcMap.isReassignedSecondary(ptrPrimarySimHit) or not ptrPrimarySimHit) continue;
124
125 const CDCSimHit& primarySimHit = *ptrPrimarySimHit;
126
127 if (wireTopology.arePrimaryNeighbors(primarySimHit.getWireID(), wireID) or
128 primarySimHit.getWireID() == wireID) {
129
130 // Found a hit on the same wire from the primary particle.
131 primarySimHitsOnSameOrNeighborWire.push_back(ptrPrimarySimHit);
132 }
133 }
134
135 // Now from the neighboring primary CDCSimHits pick to one with the smallest distance to the
136 // secondary CDCSimHit.
137 auto compareDistanceBetweenSimHits =
138 [&simHit](const CDCSimHit * primarySimHit,
139 const CDCSimHit * otherPrimarySimHit) -> bool {
140 Vector3D primaryHitPos(primarySimHit->getPosTrack());
141 Vector3D otherPrimaryHitPos(otherPrimarySimHit->getPosTrack());
142 Vector3D secondaryHitPos(simHit.getPosTrack());
143 return primaryHitPos.distance(secondaryHitPos) < otherPrimaryHitPos.distance(secondaryHitPos);
144 };
145
146 auto itClosestPrimarySimHit = std::min_element(primarySimHitsOnSameOrNeighborWire.begin(),
147 primarySimHitsOnSameOrNeighborWire.end(),
148 compareDistanceBetweenSimHits);
149
150 if (itClosestPrimarySimHit != primarySimHitsOnSameOrNeighborWire.end()) {
151 // Found primary simulated hit for secondary hit.
152 return *itClosestPrimarySimHit;
153 } else {
154 return nullptr;
155 }
156 }
157}
WireID getWireID() const
Getter for WireID object.
Definition CDCSimHit.h:171
bool arePrimaryNeighbors(const WireID &wireID, const WireID &otherWireID) const
Checks if two wires are primary neighbors.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
TrackingUtilities::MayBePtr< const MCParticle > getMCParticle(const CDCHit *hit) const
Seeks the MCParticle related to the CDCHit.
Definition CDCMCMap.cc:270
auto getSimHits(const MCParticle *mcParticle) const
Getter for the range MCParticle to CDCSimHits relations which come from the given MCParticle.
Definition CDCMCMap.h:98

◆ getDirectionOfFlight()

Vector3D getDirectionOfFlight ( const CDCHit * ptrHit)

Calculate the local direction of flight. If the hit is secondary take the direction of flight from a close by primary - null vector if it cannot be assumed this way.

Definition at line 178 of file CDCSimHitLookUp.cc.

179{
180 if (not ptrHit) return Vector3D();
181
182 if (not m_ptrMCMap) {
183 B2WARNING("CDCMCMap not set. Cannot find direction of flight");
184 return Vector3D();
185 }
186
187 const CDCMCMap& mcMap = *m_ptrMCMap;
188
189 const CDCSimHit* ptrSimHit = mcMap.getSimHit(ptrHit);
190
191 if (not ptrSimHit) return Vector3D();
192
193 const CDCSimHit* ptrPrimarySimHit =
194 mcMap.isReassignedSecondary(ptrHit) ? getClosestPrimarySimHit(ptrHit) : ptrSimHit;
195
196 if (not ptrPrimarySimHit) {
197 // if no primary simhit is close to the secondary hit we can only take the secondary
198 ptrPrimarySimHit = ptrSimHit;
199
200 // or invent something better at some point...
201 }
202
203 const CDCSimHit& primarySimHit = *ptrPrimarySimHit;
204
205 // Take the momentum of the primary hit
206 Vector3D directionOfFlight{primarySimHit.getMomentum()};
207 return directionOfFlight;
208}
B2Vector3D getMomentum() const
The method to get momentum.
Definition CDCSimHit.h:192

◆ getDriftLength()

double getDriftLength ( const CDCHit * ptrHit) const

Look up the drift length from the primary ionisation to the wire from related simulated hit.

Definition at line 262 of file CDCSimHitLookUp.cc.

263{
264 if (not m_ptrMCMap) {
265 B2WARNING("CDCMCMap not set. Cannot find reconstructed position");
266 return NAN;
267 }
268
269 const CDCMCMap& mcMap = *m_ptrMCMap;
270 const CDCSimHit* ptrSimHit = mcMap.getSimHit(ptrHit);
271
272 if (not ptrSimHit) {
273 B2WARNING("No CDCSimHit related to CDCHit");
274 return NAN;
275 }
276
277 const CDCSimHit& simHit = *ptrSimHit;
278 return simHit.getDriftLength();
279}

◆ getInstance()

const CDCSimHitLookUp & getInstance ( )
static

Getter for the singletone instance.

Definition at line 33 of file CDCSimHitLookUp.cc.

34{
36}
static const CDCSimHitLookUp & getSimHitLookUp()
Getter for the singleton instance of the CDCSimHitLookUp.

◆ getRecoHit2D()

CDCRecoHit2D getRecoHit2D ( const CDCHit * ptrHit,
const std::vector< TrackingUtilities::CDCWireHit > & wireHits ) const

Construct an TrackingUtilities::CDCRecoHit2D from the (potential secondary) CDCSimHit information related to the CDCHit.

Definition at line 346 of file CDCSimHitLookUp.cc.

348{
349 return getRecoHit3D(ptrHit, wireHits).getRecoHit2D();
350}
TrackingUtilities::CDCRecoHit3D getRecoHit3D(const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
Construct an CDCRecoHit3D from the (potential secondary) CDCSimHit information related to the CDCHit.

◆ getRecoHit3D()

CDCRecoHit3D getRecoHit3D ( const CDCHit * ptrHit,
const std::vector< TrackingUtilities::CDCWireHit > & wireHits ) const

Construct an CDCRecoHit3D from the (potential secondary) CDCSimHit information related to the CDCHit.

Definition at line 325 of file CDCSimHitLookUp.cc.

327{
328 CDCRLWireHit rlWireHit = getRLWireHit(ptrHit, wireHits);
329 double driftLength = getDriftLength(ptrHit);
330 rlWireHit.setRefDriftLength(driftLength);
331 Vector3D recoPos3D = getRecoPos3D(ptrHit);
332 return CDCRecoHit3D(rlWireHit, recoPos3D);
333}

◆ getRecoPos3D()

Vector3D getRecoPos3D ( const CDCHit * ptrHit) const

Look up the position of the primary ionisation from related simulated hit.

Definition at line 243 of file CDCSimHitLookUp.cc.

244{
245 if (not m_ptrMCMap) {
246 B2WARNING("CDCMCMap not set. Cannot find reconstructed position");
247 return Vector3D();
248 }
249
250 const CDCMCMap& mcMap = *m_ptrMCMap;
251 const CDCSimHit* ptrSimHit = mcMap.getSimHit(ptrHit);
252
253 if (not ptrSimHit) {
254 B2WARNING("No CDCSimHit related to CDCHit");
255 return Vector3D();
256 }
257
258 const CDCSimHit& simHit = *ptrSimHit;
259 return Vector3D{simHit.getPosTrack()};
260}

◆ getRLInfo()

ERightLeft getRLInfo ( const CDCHit * ptrHit) const

Look up the Monte Carlo right left passage information for the given hit.

Definition at line 237 of file CDCSimHitLookUp.cc.

238{
239 auto itFoundHit = m_rightLeftInfos.find(ptrHit);
240 return itFoundHit == m_rightLeftInfos.end() ? ERightLeft::c_Invalid : itFoundHit->second;
241}

◆ getRLWireHit()

CDCRLWireHit getRLWireHit ( const CDCHit * ptrHit,
const std::vector< TrackingUtilities::CDCWireHit > & wireHits ) const

Retrieve the wire hit including right left passage information for the given CDCHit form the given wire hits.

Definition at line 315 of file CDCSimHitLookUp.cc.

317{
318 ERightLeft rlInfo = getRLInfo(ptrHit);
319 double driftLength = getDriftLength(ptrHit);
320 const CDCWireHit* wireHit = getWireHit(ptrHit, wireHits);
321 B2ASSERT("Could not find CDCWireHit for the requested hit", wireHit);
322 return CDCRLWireHit(wireHit, rlInfo, driftLength, CDCWireHit::c_simpleDriftLengthVariance);
323}
static constexpr const double c_simpleDriftLengthVariance
A default value for the drift length variance if no variance from the drift length translation is ava...
Definition CDCWireHit.h:67
const TrackingUtilities::CDCWireHit * getWireHit(const CDCHit *ptrHit, const std::vector< TrackingUtilities::CDCWireHit > &wireHits) const
Retrieve the wire hit the given CDCHit form the given wire hits.
TrackingUtilities::ERightLeft getRLInfo(const CDCHit *ptrHit) const
Look up the Monte Carlo right left passage information for the given hit.

◆ getWireHit()

const CDCWireHit * getWireHit ( const CDCHit * ptrHit,
const std::vector< TrackingUtilities::CDCWireHit > & wireHits ) const

Retrieve the wire hit the given CDCHit form the given wire hits.

Definition at line 302 of file CDCSimHitLookUp.cc.

304{
305 if (not ptrHit) return nullptr;
306 ConstVectorRange<CDCWireHit> wireHit{std::equal_range(wireHits.begin(), wireHits.end(), *ptrHit)};
307
308 if (wireHit.empty()) {
309 return nullptr;
310 } else {
311 return &(wireHit.front());
312 }
313}

Member Data Documentation

◆ m_primarySimHits

std::map<const CDCHit*, TrackingUtilities::MayBePtr<const CDCSimHit> > m_primarySimHits
private

Memory for the look up relation of close primary CDCSimHits.

Definition at line 130 of file CDCSimHitLookUp.h.

◆ m_ptrMCMap

const CDCMCMap* m_ptrMCMap
private

Reference to the CDCMCMap to be used in this event.

Definition at line 127 of file CDCSimHitLookUp.h.

◆ m_rightLeftInfos

std::map<const CDCHit*, TrackingUtilities::ERightLeft> m_rightLeftInfos
private

Memory for the look up relation of the right left passage information as defined in tracking.

Definition at line 133 of file CDCSimHitLookUp.h.


The documentation for this class was generated from the following files: