Belle II Software  release-08-01-10
CDCMCCloneLookUp Class Reference

Class providing information whether a PR CDC track is the best match or a clone. More...

#include <CDCMCCloneLookUp.h>

Collaboration diagram for CDCMCCloneLookUp:

Public Member Functions

 CDCMCCloneLookUp (CDCMCCloneLookUp &)=delete
 Singleton: Delete copy constructor and assignment operator.
 
CDCMCCloneLookUpoperator= (const CDCMCCloneLookUp &)=delete
 Operator =.
 
void fill (std::vector< CDCTrack > &cdcTracks)
 fill with all cdcTracks in an event More...
 
void clear ()
 Clear eventwise lookup tables.
 
bool isTrackClone (const CDCTrack &cdcTrack)
 getter for information from m_cdcTrackIsCloneMap
 

Static Public Member Functions

static CDCMCCloneLookUpgetInstance ()
 Getter for the singletone instance.
 

Private Member Functions

 CDCMCCloneLookUp ()=default
 Singleton: Default ctor only available to getInstance method.
 
std::map< const ITrackType, std::vector< CDCTrack * > > getMatchedCDCTracksByMCID (std::vector< CDCTrack > &cdcTracks)
 Helper function which returns a map of MCTrackIDs to vectors of CDTrack pointers. More...
 
CDCTrackfindBestMatchedTrack (std::vector< CDCTrack * > matchedTrackPtrs)
 Helper function which takes a vector of pointers to CDCTracks which are matched to the same MC particle. More...
 

Private Attributes

std::map< const CDCTrack *, bool > m_cdcTrackIsCloneMap
 Map of track pointers to isClone indicator from MCTruth-based assumption.
 

Detailed Description

Class providing information whether a PR CDC track is the best match or a clone.

In contrast to all other MC lookup classes, it requires the information of all tracks in an event to decide which are clones. Therofore, it has to be filled once with a CDCTrack vector before being used.

The definition of which track is a better match and thus which to classify * as a clone is encoded in the separate functor CompareCDCTracks.

Definition at line 35 of file CDCMCCloneLookUp.h.

Member Function Documentation

◆ fill()

void fill ( std::vector< CDCTrack > &  cdcTracks)

fill with all cdcTracks in an event

Fill LookUp Table which stores information, which tracks are clones from curlers.

per default, set all tracks to "not clone"

get lookup table of MC track IDs to vectors of CDC track pointers

Vector of track pointers which are mapped to this mcTrackID

Definition at line 91 of file CDCMCCloneLookUp.cc.

92 {
94  for (const CDCTrack& cdcTrack : cdcTracks) {
95  const CDCTrack* ptrCDCTrack = &cdcTrack;
96  m_cdcTrackIsCloneMap[ptrCDCTrack] = false; // not clone
97  }
98 
100  std::map<const ITrackType, std::vector<CDCTrack*>> matchedCDCTracksByMCID =
101  getMatchedCDCTracksByMCID(cdcTracks);
102 
103  for (auto& mcIDAndCDCTracks : matchedCDCTracksByMCID) {
105  std::vector<CDCTrack*>& matchedTrackPtrs = mcIDAndCDCTracks.second;
106 
107  if (matchedTrackPtrs.size() == 1) { // only one matching track
108  m_cdcTrackIsCloneMap[matchedTrackPtrs.at(0)] = false; // not clone
109 
110  } else { // multiple matching tracks
111  for (const CDCTrack* ptrCDCTrack : matchedTrackPtrs) {
112  m_cdcTrackIsCloneMap[ptrCDCTrack] = true; // default that all are clones
113  }
114  const CDCTrack* ptrNonCloneTrack = findBestMatchedTrack(matchedTrackPtrs);
115  m_cdcTrackIsCloneMap[ptrNonCloneTrack] = false; // not clone
116  }
117  }
118 }
std::map< const ITrackType, std::vector< CDCTrack * > > getMatchedCDCTracksByMCID(std::vector< CDCTrack > &cdcTracks)
Helper function which returns a map of MCTrackIDs to vectors of CDTrack pointers.
std::map< const CDCTrack *, bool > m_cdcTrackIsCloneMap
Map of track pointers to isClone indicator from MCTruth-based assumption.
CDCTrack * findBestMatchedTrack(std::vector< CDCTrack * > matchedTrackPtrs)
Helper function which takes a vector of pointers to CDCTracks which are matched to the same MC partic...
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41

◆ findBestMatchedTrack()

CDCTrack * findBestMatchedTrack ( std::vector< CDCTrack * >  matchedTrackPtrs)
private

Helper function which takes a vector of pointers to CDCTracks which are matched to the same MC particle.

Returns track ptr which is assumed to be not a clone.

Definition at line 73 of file CDCMCCloneLookUp.cc.

◆ getMatchedCDCTracksByMCID()

std::map< const ITrackType, std::vector< CDCTrack * > > getMatchedCDCTracksByMCID ( std::vector< CDCTrack > &  cdcTracks)
private

Helper function which returns a map of MCTrackIDs to vectors of CDTrack pointers.

Need that to find clone candidates: tracks with same MCTrackID

Definition at line 24 of file CDCMCCloneLookUp.cc.


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