Belle II Software development
CDCMCTrackStore Class Reference

Class to organize and present the monte carlo hit information. More...

#include <CDCMCTrackStore.h>

Public Types

using CDCHitVector = std::vector< const CDCHit * >
 Type for an ordered sequence of pointers to the CDCHit.
 

Public Member Functions

 CDCMCTrackStore ()=default
 Default constructor - for cppcheck.
 
 CDCMCTrackStore (CDCMCTrackStore &)=delete
 Singleton: Delete copy constructor and assignment operator.
 
CDCMCTrackStoreoperator= (const CDCMCTrackStore &)=delete
 Operator =.
 
void clear ()
 Clear all Monte Carlo hits.
 
void fill (const CDCMCMap *ptrMCMap, const CDCSimHitLookUp *ptrSimHitLookUp)
 Fill the store with the tracks from Monte Carlo information.
 
const std::map< ITrackType, Belle2::TrackFindingCDC::CDCMCTrackStore::CDCHitVector > & getMCTracksByMCParticleIdx () const
 Getter for the stored Monte Carlo tracks ordered by their Monte Carlo Id.
 
const std::map< ITrackType, std::vector< Belle2::TrackFindingCDC::CDCMCTrackStore::CDCHitVector > > & getMCSegmentsByMCParticleIdx () const
 Getter for the stored Monte Carlo segments ordered by their Monte Carlo Id.
 
Index getInTrackId (const CDCHit *ptrHit) const
 Getter for the index of the hit within its track.
 
Index getInTrackSegmentId (const CDCHit *ptrHit) const
 Getter for the index of the segment of the hit within its track.
 
Index getNPassedSuperLayers (const CDCHit *ptrHit) const
 Getter for the number of super layers traversed until this hit.
 
Index getNLoops (const CDCHit *ptrHit) const
 Getter for the number of traversed loops until this hit.
 

Static Public Member Functions

static const CDCMCTrackStoregetInstance ()
 Getter for the singletone instance.
 

Private Member Functions

void fillMCTracks ()
 Construct the tracks by grouping the hits by the mc particle id and sorted them for the FlightTime of the related CDCSimHits.
 
void fillMCSegments ()
 Construct the segments by dividing the mc tracks in to disconnected parts and sorted them for the FlightTime of the related CDCSimHits.
 
void arrangeMCTrack (CDCHitVector &mcTrack) const
 Sorts the given track for the FlightTime of the associated CDCSimHits.
 
void fillInTrackId ()
 Fill the look up table for the in track index of each hit.
 
void fillInTrackSegmentId ()
 Fill the look up table for the in track segment index of each hit.
 
void fillNLoopsAndNPassedSuperLayers ()
 Fill the look up table of the number of traversed super layers until each hit.
 
bool changedSuperLayer (const CDCHitVector &mcSegment, const CDCHitVector &nextMCSegment) const
 Helper function to decide whether the number of passed superlayers changed from one segment to the next.
 

Private Attributes

const CDCMCMapm_ptrMCMap
 Reference to the MC map of the current event.
 
const CDCSimHitLookUpm_ptrSimHitLookUp
 Reference to the CDCSimHit look up for additional information about related primary sim hits.
 
std::map< ITrackType, CDCHitVectorm_mcTracksByMCParticleIdx
 The memory for the tracks made of CDCHits sorted for the time of flight and associated to the Monte Carlo particle id.
 
std::map< ITrackType, std::vector< CDCHitVector > > m_mcSegmentsByMCParticleIdx
 The memory for the segments made of CDCHits sorted for the time of flight and associated to the Monte Carlo particle id.
 
std::map< const CDCHit *, int > m_inTrackIds
 Look up table for index of the hit within its track.
 
std::map< const CDCHit *, int > m_inTrackSegmentIds
 Look up table for index of the segment of the hits within their respective tracks.
 
std::map< const CDCHit *, int > m_nPassedSuperLayers
 Look up table for the number of super layers the particle traversed before making the individual hit.
 
std::map< const CDCHit *, int > m_nLoops
 Look up table for the number of loops the particle traversed before making the individual hit.
 

Detailed Description

Class to organize and present the monte carlo hit information.

Definition at line 28 of file CDCMCTrackStore.h.

Member Typedef Documentation

◆ CDCHitVector

using CDCHitVector = std::vector<const CDCHit*>

Type for an ordered sequence of pointers to the CDCHit.

Definition at line 32 of file CDCMCTrackStore.h.

Member Function Documentation

◆ arrangeMCTrack()

void arrangeMCTrack ( CDCHitVector mcTrack) const
private

Sorts the given track for the FlightTime of the associated CDCSimHits.

Sort with NaN as high.

Definition at line 235 of file CDCMCTrackStore.cc.

236{
237 if (not m_ptrMCMap) {
238 B2WARNING("CDCMCMap not set. Cannot sort track");
239 return;
240 }
241
242 const CDCSimHitLookUp& simHitLookUp = *m_ptrSimHitLookUp;
243
244 std::stable_sort(mcTrack.begin(), mcTrack.end(),
245 [&simHitLookUp](const CDCHit * ptrHit, const CDCHit * ptrOtherHit) -> bool {
246
247 const CDCSimHit* ptrSimHit = simHitLookUp.getClosestPrimarySimHit(ptrHit);
248 const CDCSimHit* ptrOtherSimHit = simHitLookUp.getClosestPrimarySimHit(ptrOtherHit);
249
250 if (not ptrSimHit)
251 {
252 B2FATAL("No CDCSimHit for CDCHit");
253 }
254
255 if (not ptrOtherSimHit)
256 {
257 B2FATAL("No CDCSimHit for CDCHit");
258 }
259
260 double secondaryFlightTime = ptrSimHit->getFlightTime();
261 double otherSecondaryFlightTime = ptrOtherSimHit->getFlightTime();
262
264 return (secondaryFlightTime < std::fmin(INFINITY, otherSecondaryFlightTime));
265 });
266
267}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
const CDCSimHitLookUp * m_ptrSimHitLookUp
Reference to the CDCSimHit look up for additional information about related primary sim hits.
const CDCMCMap * m_ptrMCMap
Reference to the MC map of the current event.
Singletone class to gather local information about the hits.

◆ changedSuperLayer()

bool changedSuperLayer ( const CDCHitVector mcSegment,
const CDCHitVector nextMCSegment 
) const
private

Helper function to decide whether the number of passed superlayers changed from one segment to the next.

The number of passed superlayers is easily detectable in a switch of the superlayer number form one segment to the next. An exception to this rule happens were particles are curling back exiting the super layer 0 and reentering the CDC super layer 0. There is no change of super layer number in this case since consecutive segments (only looking at the CDC) have the super layer number 0. Since this case would screw the evaluation of segment pair or triple selection we have to treat it separately.

Definition at line 341 of file CDCMCTrackStore.cc.

342{
343 const CDCSimHitLookUp& simHitLookUp = *m_ptrSimHitLookUp;
344 const CDCHit* ptrHit = mcSegment.front();
345 const CDCHit* ptrNextHit = nextMCSegment.front();
346
347 assert(ptrHit);
348 assert(ptrNextHit);
349
350 const CDCHit& hit = *ptrHit;
351 const CDCHit& nextHit = *ptrNextHit;
352
353 if (hit.getISuperLayer() != nextHit.getISuperLayer()) {
354 return true;
355 } else if (hit.getISuperLayer() == 0) {
356 const CDCSimHit* ptrSimHit = simHitLookUp.getClosestPrimarySimHit(ptrHit);
357 const CDCSimHit* ptrNextSimHit = simHitLookUp.getClosestPrimarySimHit(ptrNextHit);
358
359 Vector3D pos(ptrSimHit->getPosTrack());
360 Vector3D mom(ptrSimHit->getMomentum());
361 Vector3D nextMom(ptrNextSimHit->getMomentum());
362 Vector3D nextPos(ptrNextSimHit->getPosTrack());
363
364 if (pos.dotXY(nextPos) < 0) return true;
365 if ((nextPos - pos).dotXY(nextMom) < 0) return true;
366 if ((nextPos - pos).dotXY(mom) < 0) return true;
367
368 // TODO introduce a smarter check here
369 return false;
370 } else {
371 return false;
372 }
373}
unsigned short getISuperLayer() const
Getter for iSuperLayer.
Definition: CDCHit.h:184
Example Detector.
Definition: CDCSimHit.h:21
B2Vector3D getPosTrack() const
The method to get position on the track.
Definition: CDCSimHit.h:217
B2Vector3D getMomentum() const
The method to get momentum.
Definition: CDCSimHit.h:193
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...
A three dimensional vector.
Definition: Vector3D.h:33

◆ clear()

void clear ( )

Clear all Monte Carlo hits.

Definition at line 33 of file CDCMCTrackStore.cc.

34{
35
36 B2DEBUG(29, "In CDCMCTrackStore::clear()");
37
38 m_ptrMCMap = nullptr;
39
42
43 m_inTrackIds.clear();
44 m_inTrackSegmentIds.clear();
46 m_nLoops.clear();
47
48}
std::map< const CDCHit *, int > m_inTrackIds
Look up table for index of the hit within its track.
std::map< ITrackType, std::vector< CDCHitVector > > m_mcSegmentsByMCParticleIdx
The memory for the segments made of CDCHits sorted for the time of flight and associated to the Monte...
std::map< const CDCHit *, int > m_nPassedSuperLayers
Look up table for the number of super layers the particle traversed before making the individual hit.
std::map< const CDCHit *, int > m_nLoops
Look up table for the number of loops the particle traversed before making the individual hit.
std::map< const CDCHit *, int > m_inTrackSegmentIds
Look up table for index of the segment of the hits within their respective tracks.
std::map< ITrackType, CDCHitVector > m_mcTracksByMCParticleIdx
The memory for the tracks made of CDCHits sorted for the time of flight and associated to the Monte C...

◆ fill()

void fill ( const CDCMCMap ptrMCMap,
const CDCSimHitLookUp ptrSimHitLookUp 
)

Fill the store with the tracks from Monte Carlo information.

It uses the CDCMCMap to construct the Monte Carlo tracks.

Definition at line 52 of file CDCMCTrackStore.cc.

53{
54
55 B2DEBUG(29, "In CDCMCTrackStore::fill()");
56 clear();
57
58 m_ptrMCMap = ptrMCMap;
59 m_ptrSimHitLookUp = ptrSimHitLookUp;
60
61 // Put the right hits into the right track
63
64 // Split the tracks into segments
66
67 // Assign the reverse mapping from CDCHits to position in track
69
70 // Assigns the reverse mapping from CDCHits to segment ids
72
73 // Assigns the reverse mapping from CDCHits to the number of already traversed superlayers
75
76 B2DEBUG(28, "m_mcTracksByMCParticleIdx.size(): " << m_mcTracksByMCParticleIdx.size());
77 B2DEBUG(28, "m_mcSegmentsByMCParticleIdx.size(): " << m_mcSegmentsByMCParticleIdx.size());
78
79 B2DEBUG(28, "m_inTrackIds.size(): " << m_inTrackIds.size());
80 B2DEBUG(28, "m_inTrackSegmentIds.size() " << m_inTrackSegmentIds.size());
81 B2DEBUG(28, "m_nPassedSuperLayers.size(): " << m_nPassedSuperLayers.size());
82 B2DEBUG(28, "m_nLoops.size(): " << m_nLoops.size());
83
84}
void fillMCTracks()
Construct the tracks by grouping the hits by the mc particle id and sorted them for the FlightTime of...
void fillNLoopsAndNPassedSuperLayers()
Fill the look up table of the number of traversed super layers until each hit.
void clear()
Clear all Monte Carlo hits.
void fillInTrackId()
Fill the look up table for the in track index of each hit.
void fillMCSegments()
Construct the segments by dividing the mc tracks in to disconnected parts and sorted them for the Fli...
void fillInTrackSegmentId()
Fill the look up table for the in track segment index of each hit.

◆ fillInTrackId()

void fillInTrackId ( )
private

Fill the look up table for the in track index of each hit.

Definition at line 274 of file CDCMCTrackStore.cc.

275{
276
277 for (const std::pair<ITrackType, CDCHitVector> mcTrackAndMCParticleIdx : getMCTracksByMCParticleIdx()) {
278
279 const CDCHitVector& mcTrack = mcTrackAndMCParticleIdx.second;
280
281 //Fill the in track ids
282 int iHit = -1;
283 for (const CDCHit* ptrHit : mcTrack) {
284 ++iHit;
285 m_inTrackIds[ptrHit] = iHit;
286 }
287 }
288
289}
std::vector< const CDCHit * > CDCHitVector
Type for an ordered sequence of pointers to the CDCHit.
const std::map< ITrackType, Belle2::TrackFindingCDC::CDCMCTrackStore::CDCHitVector > & getMCTracksByMCParticleIdx() const
Getter for the stored Monte Carlo tracks ordered by their Monte Carlo Id.

◆ fillInTrackSegmentId()

void fillInTrackSegmentId ( )
private

Fill the look up table for the in track segment index of each hit.

Definition at line 291 of file CDCMCTrackStore.cc.

292{
293 for (const std::pair<ITrackType, std::vector<CDCHitVector> > mcSegmentsAndMCParticleIdx : getMCSegmentsByMCParticleIdx()) {
294 const std::vector<CDCHitVector>& mcSegments = mcSegmentsAndMCParticleIdx.second;
295
296 int iSegment = -1;
297 for (const CDCHitVector& mcSegment : mcSegments) {
298 ++iSegment;
299 for (const CDCHit* ptrHit : mcSegment) {
300
301 m_inTrackSegmentIds[ptrHit] = iSegment;
302 }
303 }
304 }
305
306}
const std::map< ITrackType, std::vector< Belle2::TrackFindingCDC::CDCMCTrackStore::CDCHitVector > > & getMCSegmentsByMCParticleIdx() const
Getter for the stored Monte Carlo segments ordered by their Monte Carlo Id.

◆ fillMCSegments()

void fillMCSegments ( )
private

Construct the segments by dividing the mc tracks in to disconnected parts and sorted them for the FlightTime of the related CDCSimHits.

Definition at line 121 of file CDCMCTrackStore.cc.

122{
123 for (std::pair<const ITrackType, CDCHitVector>& mcTrackAndMCParticleIdx : m_mcTracksByMCParticleIdx) {
124
125 ITrackType mcParticleIdx = mcTrackAndMCParticleIdx.first;
126 CDCHitVector& mcTrack = mcTrackAndMCParticleIdx.second;
127
128 if (mcTrack.empty()) continue;
129 std::vector<CDCHitVector>& mcSegments = m_mcSegmentsByMCParticleIdx[mcParticleIdx];
130 mcSegments.clear();
131
132 // Split track into runs in the same superlayer
133 auto superLayerRanges = adjacent_groupby(mcTrack.begin(), mcTrack.end(), [](const CDCHit * hit) {
134 return hit->getISuperLayer();
135 });
136
137 std::vector<CDCHitVector> superLayerRuns;
138 for (const auto& superLayerRange : superLayerRanges) {
139 superLayerRuns.push_back({superLayerRange.begin(), superLayerRange.end()});
140 }
141
142 std::vector<std::vector<CDCHitVector>::iterator> smallSuperLayerRuns;
143 for (auto itSuperLayerRun = superLayerRuns.begin();
144 itSuperLayerRun != superLayerRuns.end();
145 ++itSuperLayerRun) {
146 if (itSuperLayerRun->size() < 3) smallSuperLayerRuns.push_back(itSuperLayerRun);
147 }
148
149 // Merge small run to an adjacent run
150 for (auto itSuperLayerRun : smallSuperLayerRuns) {
151 ISuperLayer iSL = itSuperLayerRun->front()->getISuperLayer();
152
153 // Look in both directions to adopt the hits in this small runs
154 auto itSuperLayerRunBefore = superLayerRuns.end();
155 int hitDistanceBefore = INT_MAX;
156 if (std::distance(superLayerRuns.begin(), itSuperLayerRun) >= 2) {
157 itSuperLayerRunBefore = itSuperLayerRun - 2;
158 if (itSuperLayerRunBefore->front()->getISuperLayer() == iSL) {
159 hitDistanceBefore = (itSuperLayerRunBefore - 1)->size();
160 } else {
161 itSuperLayerRunBefore = superLayerRuns.end();
162 }
163 }
164
165 auto itSuperLayerRunAfter = superLayerRuns.end();
166 int hitDistanceAfter = INT_MAX;
167 if (std::distance(itSuperLayerRun, superLayerRuns.end()) > 2) {
168 itSuperLayerRunAfter = itSuperLayerRun + 2;
169 if (itSuperLayerRunAfter->front()->getISuperLayer() == iSL) {
170 hitDistanceAfter = (itSuperLayerRunAfter + 1)->size();
171 } else {
172 itSuperLayerRunAfter = superLayerRuns.end();
173 }
174 }
175
176 auto itMergeSuperLayerRun = superLayerRuns.end();
177 bool mergeBefore = false;
178 if (hitDistanceBefore < hitDistanceAfter) {
179 itMergeSuperLayerRun = itSuperLayerRunBefore;
180 mergeBefore = true;
181 } else {
182 itMergeSuperLayerRun = itSuperLayerRunAfter;
183 mergeBefore = false;
184 }
185
186 if (itMergeSuperLayerRun == superLayerRuns.end()) continue;
187 else if (mergeBefore) {
188 itMergeSuperLayerRun->insert(itMergeSuperLayerRun->end(), itSuperLayerRun->begin(), itSuperLayerRun->end());
189 itSuperLayerRun->clear();
190 } else {
191 itMergeSuperLayerRun->insert(itMergeSuperLayerRun->begin(), itSuperLayerRun->begin(), itSuperLayerRun->end());
192 itSuperLayerRun->clear();
193 }
194 }
195
196 // Remove empty small runs
197 erase_remove_if(superLayerRuns, Size() == 0u);
198
199 // Concat the runs that are now in the same superlayer
200 auto mergeSameSuperLayer = [](CDCHitVector & lhs, CDCHitVector & rhs) {
201 if (lhs.empty() or rhs.empty()) return true;
202 if (lhs.front()->getISuperLayer() != rhs.front()->getISuperLayer()) return false;
203 lhs.insert(lhs.end(), rhs.begin(), rhs.end());
204 rhs.clear();
205 return true;
206 };
207 erase_unique(superLayerRuns, mergeSameSuperLayer);
208
209 // Now analyse the runs in turn and break them in the connected segments
210 for (const CDCHitVector& superLayerRun : superLayerRuns) {
211 const CDCWireTopology& wireTopology = CDCWireTopology::getInstance();
212 auto areNeighbors = [&wireTopology](const CDCHit * lhs, const CDCHit * rhs) {
213 WireID lhsWireID(lhs->getISuperLayer(), lhs->getILayer(), lhs->getIWire());
214 WireID rhsWireID(rhs->getISuperLayer(), rhs->getILayer(), rhs->getIWire());
215
216 return (wireTopology.arePrimaryNeighbors(lhsWireID, rhsWireID) or
217 wireTopology.areSeconaryNeighbors(lhsWireID, rhsWireID) or
218 lhsWireID == rhsWireID);
219 };
220
221 auto segmentRanges = unique_ranges(superLayerRun.begin(), superLayerRun.end(), areNeighbors);
222
223 for (const ConstVectorRange<const CDCHit*>& segmentRange : segmentRanges) {
224 mcSegments.emplace_back(segmentRange.begin(), segmentRange.end());
225 }
226 } // end for superLayerRuns
227
228 // Lets sort them along for the time of flight.
229 for (CDCHitVector& mcSegment : mcSegments) {
230 arrangeMCTrack(mcSegment);
231 }
232 } // End for mc track
233}
unsigned short getIWire() const
Getter for iWire.
Definition: CDCHit.h:166
unsigned short getILayer() const
Getter for iLayer.
Definition: CDCHit.h:172
void arrangeMCTrack(CDCHitVector &mcTrack) const
Sorts the given track for the FlightTime of the associated CDCSimHits.
Class representing the sense wire arrangement in the whole of the central drift chamber.
bool arePrimaryNeighbors(const WireID &wireID, const WireID &otherWireID) const
Checks if two wires are primary neighbors.
bool areSeconaryNeighbors(const WireID &wireID, const WireID &otherWireID) const
Checks if two wires are secondary neighbors.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
A pair of iterators usable with the range base for loop.
Definition: Range.h:25
Class to identify a wire inside the CDC.
Definition: WireID.h:34
Functor to get the .size() from an arbitrary objects.
Definition: Functional.h:318

◆ fillMCTracks()

void fillMCTracks ( )
private

Construct the tracks by grouping the hits by the mc particle id and sorted them for the FlightTime of the related CDCSimHits.

Definition at line 87 of file CDCMCTrackStore.cc.

88{
89 if (not m_ptrMCMap) {
90 B2WARNING("CDCMCMap not set. Cannot create tracks");
91 return;
92 }
93
94 const CDCMCMap& mcMap = *m_ptrMCMap;
95
96 for (const auto& relation : mcMap.getHitsByMCParticle()) {
97
98 const MCParticle* ptrMCParticle = std::get<const MCParticle* const>(relation);
99 const CDCHit* ptrHit = std::get<const CDCHit*>(relation);
100
101 if (not mcMap.isBackground(ptrHit) and ptrMCParticle) {
102
103 ITrackType mcParticleIdx = ptrMCParticle->getArrayIndex();
104 //Append hit to its own track
105 m_mcTracksByMCParticleIdx[mcParticleIdx].push_back(ptrHit);
106 }
107 }
108
109
110 //Sort the tracks along the time of flight
111 for (std::pair<const ITrackType, CDCHitVector>& mcTrackAndMCParticleIdx : m_mcTracksByMCParticleIdx) {
112
113 //int mcParticleIdx = mcTrackAndMCParticleIdx.first;
114 CDCHitVector& mcTrack = mcTrackAndMCParticleIdx.second;
115 arrangeMCTrack(mcTrack);
116
117 }
118
119}
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Class to organize and present the Monte Carlo hit information.
Definition: CDCMCMap.h:28
bool isBackground(const CDCSimHit *simHit) const
Indicates if the CDCSimHit is considered background.
Definition: CDCMCMap.cc:259
const std::multimap< const MCParticle *, const CDCHit * > & getHitsByMCParticle() const
Getter for the MCParticle -> CDCHit relations.
Definition: CDCMCMap.h:140

◆ fillNLoopsAndNPassedSuperLayers()

void fillNLoopsAndNPassedSuperLayers ( )
private

Fill the look up table of the number of traversed super layers until each hit.

Definition at line 308 of file CDCMCTrackStore.cc.

309{
310
311 for (const std::pair<ITrackType, std::vector<CDCHitVector> > mcSegmentsAndMCParticleIdx : getMCSegmentsByMCParticleIdx()) {
312 const std::vector<CDCHitVector>& mcSegments = mcSegmentsAndMCParticleIdx.second;
313
314 const CDCHitVector* ptrLastMCSegment = nullptr;
315 int nPassedSuperLayers = 0;
316 int nLoops = 0;
317
318 for (const CDCHitVector& mcSegment : mcSegments) {
319 if (ptrLastMCSegment and changedSuperLayer(*ptrLastMCSegment, mcSegment)) {
320 ++nPassedSuperLayers;
321
322 // Increase the superlayer number if the track leaves the CDC for the inner volume.
323 // Feel free to do something smarter here.
324 if (ptrLastMCSegment->front()->getISuperLayer() == 0 and
325 mcSegment.front()->getISuperLayer() == 0) {
326 ++nLoops;
327 }
328 }
329
330 for (const CDCHit* ptrHit : mcSegment) {
331 m_nPassedSuperLayers[ptrHit] = nPassedSuperLayers;
332 m_nLoops[ptrHit] = nLoops;
333 }
334
335 ptrLastMCSegment = &mcSegment;
336
337 }
338 }
339}
bool changedSuperLayer(const CDCHitVector &mcSegment, const CDCHitVector &nextMCSegment) const
Helper function to decide whether the number of passed superlayers changed from one segment to the ne...

◆ getInstance()

const CDCMCTrackStore & getInstance ( )
static

Getter for the singletone instance.

Definition at line 27 of file CDCMCTrackStore.cc.

28{
30}
static const CDCMCTrackStore & getMCTrackStore()
Getter for the singleton instance of the CDCMCTrackStore.
Definition: CDCMCManager.cc:85

◆ getInTrackId()

Index getInTrackId ( const CDCHit ptrHit) const

Getter for the index of the hit within its track.

Definition at line 376 of file CDCMCTrackStore.cc.

377{
378
379 auto itFoundHit = m_inTrackIds.find(ptrHit);
380 return itFoundHit == m_inTrackIds.end() ? c_InvalidIndex : itFoundHit->second;
381
382}

◆ getInTrackSegmentId()

Index getInTrackSegmentId ( const CDCHit ptrHit) const

Getter for the index of the segment of the hit within its track.

Definition at line 386 of file CDCMCTrackStore.cc.

387{
388
389 auto itFoundHit = m_inTrackSegmentIds.find(ptrHit);
390 return itFoundHit == m_inTrackSegmentIds.end() ? c_InvalidIndex : itFoundHit->second;
391
392}

◆ getMCSegmentsByMCParticleIdx()

const std::map< ITrackType, std::vector< Belle2::TrackFindingCDC::CDCMCTrackStore::CDCHitVector > > & getMCSegmentsByMCParticleIdx ( ) const
inline

Getter for the stored Monte Carlo segments ordered by their Monte Carlo Id.

Definition at line 64 of file CDCMCTrackStore.h.

◆ getMCTracksByMCParticleIdx()

const std::map< ITrackType, Belle2::TrackFindingCDC::CDCMCTrackStore::CDCHitVector > & getMCTracksByMCParticleIdx ( ) const
inline

Getter for the stored Monte Carlo tracks ordered by their Monte Carlo Id.

Definition at line 60 of file CDCMCTrackStore.h.

◆ getNLoops()

Index getNLoops ( const CDCHit ptrHit) const

Getter for the number of traversed loops until this hit.

Definition at line 403 of file CDCMCTrackStore.cc.

404{
405
406 auto itFoundHit = m_nLoops.find(ptrHit);
407 return itFoundHit == m_nLoops.end() ? c_InvalidIndex : itFoundHit->second;
408
409}

◆ getNPassedSuperLayers()

Index getNPassedSuperLayers ( const CDCHit ptrHit) const

Getter for the number of super layers traversed until this hit.

Definition at line 395 of file CDCMCTrackStore.cc.

396{
397
398 auto itFoundHit = m_nPassedSuperLayers.find(ptrHit);
399 return itFoundHit == m_nPassedSuperLayers.end() ? c_InvalidIndex : itFoundHit->second;
400
401}

Member Data Documentation

◆ m_inTrackIds

std::map<const CDCHit*, int> m_inTrackIds
private

Look up table for index of the hit within its track.

Definition at line 122 of file CDCMCTrackStore.h.

◆ m_inTrackSegmentIds

std::map<const CDCHit*, int> m_inTrackSegmentIds
private

Look up table for index of the segment of the hits within their respective tracks.

Definition at line 125 of file CDCMCTrackStore.h.

◆ m_mcSegmentsByMCParticleIdx

std::map<ITrackType, std::vector<CDCHitVector> > m_mcSegmentsByMCParticleIdx
private

The memory for the segments made of CDCHits sorted for the time of flight and associated to the Monte Carlo particle id.

Definition at line 119 of file CDCMCTrackStore.h.

◆ m_mcTracksByMCParticleIdx

std::map<ITrackType, CDCHitVector> m_mcTracksByMCParticleIdx
private

The memory for the tracks made of CDCHits sorted for the time of flight and associated to the Monte Carlo particle id.

Definition at line 116 of file CDCMCTrackStore.h.

◆ m_nLoops

std::map<const CDCHit*, int> m_nLoops
private

Look up table for the number of loops the particle traversed before making the individual hit.

Definition at line 131 of file CDCMCTrackStore.h.

◆ m_nPassedSuperLayers

std::map<const CDCHit*, int> m_nPassedSuperLayers
private

Look up table for the number of super layers the particle traversed before making the individual hit.

Definition at line 128 of file CDCMCTrackStore.h.

◆ m_ptrMCMap

const CDCMCMap* m_ptrMCMap
private

Reference to the MC map of the current event.

Definition at line 110 of file CDCMCTrackStore.h.

◆ m_ptrSimHitLookUp

const CDCSimHitLookUp* m_ptrSimHitLookUp
private

Reference to the CDCSimHit look up for additional information about related primary sim hits.

Definition at line 113 of file CDCMCTrackStore.h.


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