Belle II Software development
TrackCreatorSingleSegments Class Referenceabstract

Searches for segments that have not been used at all and creates tracks from them. More...

#include <TrackCreatorSingleSegments.h>

Inheritance diagram for TrackCreatorSingleSegments:
Findlet< const CDCSegment2D, CDCTrack & > CompositeProcessingSignalListener ProcessingSignalListener

Public Types

using IOTypes
 Types that should be served to apply on invocation.
 
using IOVectors
 Vector types that should be served to apply on invocation.
 

Public Member Functions

 TrackCreatorSingleSegments ()
 Constructor setting up default parameters.
 
std::string getDescription () final
 Short description of the findlet.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters to a module.
 
void apply (const std::vector< CDCSegment2D > &segments, std::vector< CDCTrack > &tracks) final
 Main algorithm.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void initialize () override
 Receive and dispatch signal before the start of the event processing.
 
void beginRun () override
 Receive and dispatch signal for the beginning of a new run.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 

Protected Types

using ToVector
 Short hand for ToRangeImpl.
 

Protected Member Functions

void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Private Types

using Super = Findlet<const CDCSegment2D, CDCTrack&>
 Type of the base class.
 

Private Attributes

std::map< ISuperLayer, size_t > m_param_minimalHitsBySuperLayerId
 Parameter: Map of super layer ids to minimum hit number for which left over segments shall be forwarded as tracks, if they exceed the minimal hit requirement.
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized
 Flag to keep track whether initialization happened before.
 
bool m_terminated
 Flag to keep track whether termination happened before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Searches for segments that have not been used at all and creates tracks from them.

Accepts number of hits a segment must exceed to be promoted to a track. This number can be set differently for each super layer Usually only the segments of the inner most super layer might be interesting to be treated as tracks.

Definition at line 34 of file TrackCreatorSingleSegments.h.

Member Typedef Documentation

◆ IOTypes

using IOTypes
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOVectors

using IOVectors
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ Super

using Super = Findlet<const CDCSegment2D, CDCTrack&>
private

Type of the base class.

Definition at line 38 of file TrackCreatorSingleSegments.h.

◆ ToVector

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ TrackCreatorSingleSegments()

Constructor setting up default parameters.

Definition at line 21 of file TrackCreatorSingleSegments.cc.

22{
23 m_param_minimalHitsBySuperLayerId = std::map<ISuperLayer, size_t> ({{0, 15}});
24}
std::map< ISuperLayer, size_t > m_param_minimalHitsBySuperLayerId
Parameter: Map of super layer ids to minimum hit number for which left over segments shall be forward...

Member Function Documentation

◆ addProcessingSignalListener()

void addProcessingSignalListener ( ProcessingSignalListener * psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 53 of file CompositeProcessingSignalListener.cc.

56{
58}
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition Findlet.h:26

◆ apply()

void apply ( const std::vector< CDCSegment2D > & segments,
std::vector< CDCTrack > & tracks )
final

Main algorithm.

Definition at line 41 of file TrackCreatorSingleSegments.cc.

43{
44 // Create tracks from left over segments
45 // First figure out which segments do not share any hits with any of the given tracks
46 // (if the tracks vector is empty this is the case for all segments)
47 const bool toHits = true;
48 for (const CDCSegment2D& segment : segments) {
49 segment.unsetAndForwardMaskedFlag(toHits);
50 }
51
52 for (const CDCTrack& track : tracks) {
53 track.setAndForwardMaskedFlag();
54 }
55
56 for (const CDCSegment2D& segment : segments) {
57 segment.receiveMaskedFlag(toHits);
58 }
59
60 if (not m_param_minimalHitsBySuperLayerId.empty()) {
61 for (const CDCSegment2D& segment : segments) {
62 if (segment->hasMaskedFlag()) {
63 int nMasked = 0;
64 for (const CDCRecoHit2D& recoHit2D : segment) {
65 if (recoHit2D.getWireHit()->hasMaskedFlag()) ++nMasked;
66 }
67 // code above could be replaced by the following line, but needs to be tested
68 //nMasked = std::count_if( segment.begin(), segment.end(), [](const CDCRecoHit2D& recoHit2D)->bool{ return recoHit2D.getWireHit()->hasMaskedFlag(); });
69
70 // Relaxed requirement of only 20% of hits masked by other tracks
71 if (nMasked > segment.size() * 0.2) continue;
72 }
73 ISuperLayer iSuperLayer = segment.getISuperLayer();
74 if (m_param_minimalHitsBySuperLayerId.count(iSuperLayer) and
75 segment.size() >= m_param_minimalHitsBySuperLayerId[iSuperLayer]) {
76
77 if (segment.getTrajectory2D().isFitted()) {
78 tracks.push_back(CDCTrack(segment));
79 segment.setAndForwardMaskedFlag(toHits);
80 for (const CDCSegment2D& otherSegment : segments) {
81 otherSegment.receiveMaskedFlag(toHits);
82 }
83 }
84 }
85 }
86 }
87}

◆ beginEvent()

void beginEvent ( )
overrideinherited

Receive and dispatch signal for the start of a new event.

Definition at line 36 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
void beginEvent() override
Receive and dispatch signal for the start of a new event.
virtual void beginEvent()
Receive signal for the start of a new event.

◆ beginRun()

void beginRun ( )
overrideinherited

Receive and dispatch signal for the beginning of a new run.

Definition at line 33 of file CompositeProcessingSignalListener.cc.

24{
27 psl->beginRun();
28 }
29}
void beginRun() override
Receive and dispatch signal for the beginning of a new run.
virtual void beginRun()
Receive signal for the beginning of a new run.

◆ endRun()

void endRun ( )
overrideinherited

Receive and dispatch signal for the end of the run.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

40{
42 psl->endRun();
43 }
45}
void endRun() override
Receive and dispatch signal for the end of the run.
virtual void endRun()
Receive signal for the end of the run.

◆ exposeParameters()

void exposeParameters ( ModuleParamList * moduleParamList,
const std::string & prefix )
finalvirtual

Expose the parameters to a module.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 31 of file TrackCreatorSingleSegments.cc.

32{
33 moduleParamList->addParameter(prefixed(prefix, "MinimalHitsBySuperLayerId"),
35 "Map of super layer ids to minimum hit number, "
36 "for which left over segments shall be forwarded as tracks, "
37 "if the exceed the minimal hit requirement. Default empty.",
39}
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription()

std::string getDescription ( )
finalvirtual

Short description of the findlet.

Reimplemented from Findlet< const CDCSegment2D, CDCTrack & >.

Definition at line 26 of file TrackCreatorSingleSegments.cc.

27{
28 return "Creates a track for each segments that is yet unused by any of the given tracks.";
29}

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 56 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
overrideinherited

Receive and dispatch signal before the start of the event processing.

Definition at line 30 of file CompositeProcessingSignalListener.cc.

16{
19 psl->initialize();
20 }
21}
void initialize() override
Receive and dispatch signal before the start of the event processing.
virtual void initialize()
Receive signal before the start of the event processing.

◆ terminate()

void terminate ( )
overrideinherited

Receive and dispatch Signal for termination of the event processing.

Definition at line 42 of file CompositeProcessingSignalListener.cc.

48{
50 psl->terminate();
51 }
53}
void terminate() override
Receive and dispatch Signal for termination of the event processing.
virtual void terminate()
Receive Signal for termination of the event processing.

Member Data Documentation

◆ m_initialized

bool m_initialized
privateinherited

Flag to keep track whether initialization happened before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initializedAs

std::string m_initializedAs
privateinherited

Name of the type during initialisation.

Definition at line 58 of file ProcessingSignalListener.h.

◆ m_param_minimalHitsBySuperLayerId

std::map<ISuperLayer, size_t> m_param_minimalHitsBySuperLayerId
private

Parameter: Map of super layer ids to minimum hit number for which left over segments shall be forwarded as tracks, if they exceed the minimal hit requirement.

Defaults to {{0, 15}}, meaning a segment with more then 15 hits in the first super layer will become a track.

Definition at line 64 of file TrackCreatorSingleSegments.h.

◆ m_subordinaryProcessingSignalListeners

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 60 of file CompositeProcessingSignalListener.h.

◆ m_terminated

bool m_terminated
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.


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