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.
 
TrackingUtilities::Index getInTrackId (const CDCHit *ptrHit) const
 Getter for the index of the hit within its track.
 
TrackingUtilities::Index getInTrackSegmentId (const CDCHit *ptrHit) const
 Getter for the index of the segment of the hit within its track.
 
TrackingUtilities::Index getNPassedSuperLayers (const CDCHit *ptrHit) const
 Getter for the number of super layers traversed until this hit.
 
TrackingUtilities::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 239 of file CDCMCTrackStore.cc.

240{
241 if (not m_ptrMCMap) {
242 B2WARNING("CDCMCMap not set. Cannot sort track");
243 return;
244 }
245
246 const CDCSimHitLookUp& simHitLookUp = *m_ptrSimHitLookUp;
247
248 std::stable_sort(mcTrack.begin(), mcTrack.end(),
249 [&simHitLookUp](const CDCHit * ptrHit, const CDCHit * ptrOtherHit) -> bool {
250
251 const CDCSimHit* ptrSimHit = simHitLookUp.getClosestPrimarySimHit(ptrHit);
252 const CDCSimHit* ptrOtherSimHit = simHitLookUp.getClosestPrimarySimHit(ptrOtherHit);
253
254 if (not ptrSimHit)
255 {
256 B2FATAL("No CDCSimHit for CDCHit");
257 }
258
259 if (not ptrOtherSimHit)
260 {
261 B2FATAL("No CDCSimHit for CDCHit");
262 }
263
264 double secondaryFlightTime = ptrSimHit->getFlightTime();
265 double otherSecondaryFlightTime = ptrOtherSimHit->getFlightTime();
266
268 return (secondaryFlightTime < std::fmin(INFINITY, otherSecondaryFlightTime));
269 });
270
271}
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.

◆ 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 345 of file CDCMCTrackStore.cc.

346{
347 const CDCSimHitLookUp& simHitLookUp = *m_ptrSimHitLookUp;
348 const CDCHit* ptrHit = mcSegment.front();
349 const CDCHit* ptrNextHit = nextMCSegment.front();
350
351 assert(ptrHit);
352 assert(ptrNextHit);
353
354 const CDCHit& hit = *ptrHit;
355 const CDCHit& nextHit = *ptrNextHit;
356
357 if (hit.getISuperLayer() != nextHit.getISuperLayer()) {
358 return true;
359 } else if (hit.getISuperLayer() == 0) {
360 const CDCSimHit* ptrSimHit = simHitLookUp.getClosestPrimarySimHit(ptrHit);
361 const CDCSimHit* ptrNextSimHit = simHitLookUp.getClosestPrimarySimHit(ptrNextHit);
362
363 ROOT::Math::XYZVector pos(ptrSimHit->getPosTrack());
364 ROOT::Math::XYZVector mom(ptrSimHit->getMomentum());
365 ROOT::Math::XYZVector nextMom(ptrNextSimHit->getMomentum());
366 ROOT::Math::XYZVector nextPos(ptrNextSimHit->getPosTrack());
367
368 const auto dotXY = [](const ROOT::Math::XYZVector & lhs, const ROOT::Math::XYZVector & rhs) { return lhs.X() * rhs.X() + lhs.Y() * rhs.Y(); };
369 if (dotXY(pos, nextPos) < 0) return true;
370 if (dotXY(nextPos - pos, nextMom) < 0) return true;
371 if (dotXY(nextPos - pos, mom) < 0) return true;
372
373 // TODO introduce a smarter check here
374 return false;
375 } else {
376 return false;
377 }
378}
unsigned short getISuperLayer() const
Getter for iSuperLayer.
Definition CDCHit.h:184
B2Vector3D getPosTrack() const
The method to get position on the track.
Definition CDCSimHit.h:216
B2Vector3D getMomentum() const
The method to get momentum.
Definition CDCSimHit.h:192
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...

◆ clear()

void clear ( )

Clear all Monte Carlo hits.

Definition at line 37 of file CDCMCTrackStore.cc.

38{
39
40 B2DEBUG(29, "In CDCMCTrackStore::clear()");
41
42 m_ptrMCMap = nullptr;
43
46
47 m_inTrackIds.clear();
48 m_inTrackSegmentIds.clear();
50 m_nLoops.clear();
51
52}
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 56 of file CDCMCTrackStore.cc.

57{
58
59 B2DEBUG(29, "In CDCMCTrackStore::fill()");
60 clear();
61
62 m_ptrMCMap = ptrMCMap;
63 m_ptrSimHitLookUp = ptrSimHitLookUp;
64
65 // Put the right hits into the right track
67
68 // Split the tracks into segments
70
71 // Assign the reverse mapping from CDCHits to position in track
73
74 // Assigns the reverse mapping from CDCHits to segment ids
76
77 // Assigns the reverse mapping from CDCHits to the number of already traversed superlayers
79
80 B2DEBUG(28, "m_mcTracksByMCParticleIdx.size(): " << m_mcTracksByMCParticleIdx.size());
81 B2DEBUG(28, "m_mcSegmentsByMCParticleIdx.size(): " << m_mcSegmentsByMCParticleIdx.size());
82
83 B2DEBUG(28, "m_inTrackIds.size(): " << m_inTrackIds.size());
84 B2DEBUG(28, "m_inTrackSegmentIds.size() " << m_inTrackSegmentIds.size());
85 B2DEBUG(28, "m_nPassedSuperLayers.size(): " << m_nPassedSuperLayers.size());
86 B2DEBUG(28, "m_nLoops.size(): " << m_nLoops.size());
87
88}
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 278 of file CDCMCTrackStore.cc.

279{
280
281 for (const std::pair<ITrackType, CDCHitVector> mcTrackAndMCParticleIdx : getMCTracksByMCParticleIdx()) {
282
283 const CDCHitVector& mcTrack = mcTrackAndMCParticleIdx.second;
284
285 //Fill the in track ids
286 int iHit = -1;
287 for (const CDCHit* ptrHit : mcTrack) {
288 ++iHit;
289 m_inTrackIds[ptrHit] = iHit;
290 }
291 }
292
293}
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 295 of file CDCMCTrackStore.cc.

296{
297 for (const std::pair<ITrackType, std::vector<CDCHitVector> > mcSegmentsAndMCParticleIdx : getMCSegmentsByMCParticleIdx()) {
298 const std::vector<CDCHitVector>& mcSegments = mcSegmentsAndMCParticleIdx.second;
299
300 int iSegment = -1;
301 for (const CDCHitVector& mcSegment : mcSegments) {
302 ++iSegment;
303 for (const CDCHit* ptrHit : mcSegment) {
304
305 m_inTrackSegmentIds[ptrHit] = iSegment;
306 }
307 }
308 }
309
310}
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 125 of file CDCMCTrackStore.cc.

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

◆ 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 91 of file CDCMCTrackStore.cc.

92{
93 if (not m_ptrMCMap) {
94 B2WARNING("CDCMCMap not set. Cannot create tracks");
95 return;
96 }
97
98 const CDCMCMap& mcMap = *m_ptrMCMap;
99
100 for (const auto& relation : mcMap.getHitsByMCParticle()) {
101
102 const MCParticle* ptrMCParticle = std::get<const MCParticle* const>(relation);
103 const CDCHit* ptrHit = std::get<const CDCHit*>(relation);
104
105 if (not mcMap.isBackground(ptrHit) and ptrMCParticle) {
106
107 ITrackType mcParticleIdx = ptrMCParticle->getArrayIndex();
108 //Append hit to its own track
109 m_mcTracksByMCParticleIdx[mcParticleIdx].push_back(ptrHit);
110 }
111 }
112
113
114 //Sort the tracks along the time of flight
115 for (std::pair<const ITrackType, CDCHitVector>& mcTrackAndMCParticleIdx : m_mcTracksByMCParticleIdx) {
116
117 //int mcParticleIdx = mcTrackAndMCParticleIdx.first;
118 CDCHitVector& mcTrack = mcTrackAndMCParticleIdx.second;
119 arrangeMCTrack(mcTrack);
120
121 }
122
123}
bool isBackground(const CDCSimHit *simHit) const
Indicates if the CDCSimHit is considered background.
Definition CDCMCMap.cc:260
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 312 of file CDCMCTrackStore.cc.

313{
314
315 for (const std::pair<ITrackType, std::vector<CDCHitVector> > mcSegmentsAndMCParticleIdx : getMCSegmentsByMCParticleIdx()) {
316 const std::vector<CDCHitVector>& mcSegments = mcSegmentsAndMCParticleIdx.second;
317
318 const CDCHitVector* ptrLastMCSegment = nullptr;
319 int nPassedSuperLayers = 0;
320 int nLoops = 0;
321
322 for (const CDCHitVector& mcSegment : mcSegments) {
323 if (ptrLastMCSegment and changedSuperLayer(*ptrLastMCSegment, mcSegment)) {
324 ++nPassedSuperLayers;
325
326 // Increase the superlayer number if the track leaves the CDC for the inner volume.
327 // Feel free to do something smarter here.
328 if (ptrLastMCSegment->front()->getISuperLayer() == 0 and
329 mcSegment.front()->getISuperLayer() == 0) {
330 ++nLoops;
331 }
332 }
333
334 for (const CDCHit* ptrHit : mcSegment) {
335 m_nPassedSuperLayers[ptrHit] = nPassedSuperLayers;
336 m_nLoops[ptrHit] = nLoops;
337 }
338
339 ptrLastMCSegment = &mcSegment;
340
341 }
342 }
343}
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 31 of file CDCMCTrackStore.cc.

32{
34}
static const CDCMCTrackStore & getMCTrackStore()
Getter for the singleton instance of the CDCMCTrackStore.

◆ getInTrackId()

Index getInTrackId ( const CDCHit * ptrHit) const

Getter for the index of the hit within its track.

Definition at line 381 of file CDCMCTrackStore.cc.

382{
383
384 auto itFoundHit = m_inTrackIds.find(ptrHit);
385 return itFoundHit == m_inTrackIds.end() ? c_InvalidIndex : itFoundHit->second;
386
387}

◆ getInTrackSegmentId()

Index getInTrackSegmentId ( const CDCHit * ptrHit) const

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

Definition at line 391 of file CDCMCTrackStore.cc.

392{
393
394 auto itFoundHit = m_inTrackSegmentIds.find(ptrHit);
395 return itFoundHit == m_inTrackSegmentIds.end() ? c_InvalidIndex : itFoundHit->second;
396
397}

◆ 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.

66 { return m_mcSegmentsByMCParticleIdx;}

◆ 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.

61 { return m_mcTracksByMCParticleIdx;}

◆ getNLoops()

Index getNLoops ( const CDCHit * ptrHit) const

Getter for the number of traversed loops until this hit.

Definition at line 408 of file CDCMCTrackStore.cc.

409{
410
411 auto itFoundHit = m_nLoops.find(ptrHit);
412 return itFoundHit == m_nLoops.end() ? c_InvalidIndex : itFoundHit->second;
413
414}

◆ getNPassedSuperLayers()

Index getNPassedSuperLayers ( const CDCHit * ptrHit) const

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

Definition at line 400 of file CDCMCTrackStore.cc.

401{
402
403 auto itFoundHit = m_nPassedSuperLayers.find(ptrHit);
404 return itFoundHit == m_nPassedSuperLayers.end() ? c_InvalidIndex : itFoundHit->second;
405
406}

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: