Belle II Software development
TrackExporter Class Referenceabstract

Findlet to exports CDCTracks as RecoTracks. More...

#include <TrackExporter.h>

Inheritance diagram for TrackExporter:
Findlet< 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

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 initialize () final
 Signal initialisation phase to register store array for export.
 
void apply (std::vector< CDCTrack > &tracks) final
 Write give tracks into track store array.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
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<CDCTrack&>
 Type of the base class.
 

Private Attributes

bool m_param_exportTracks = true
 Parameter: Switch if a RecoTrack be generated for each track.
 
std::string m_param_RecoTracksName = ""
 Parameter: Name of the output StoreArray of the RecoTracks generated by this module.
 
bool m_param_discardCovarianceMatrix = false
 Parameter: Discard covariance matrix in favour of a hand written one.
 
double m_param_monopoleMomSeed = 0.0
 Parameter: If non-zero, estimate seeds as for monopoles and set the momentum magnitude as this value.
 
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

Findlet to exports CDCTracks as RecoTracks.

Definition at line 26 of file TrackExporter.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<CDCTrack&>
private

Type of the base class.

Definition at line 30 of file TrackExporter.h.

◆ ToVector

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

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 ( std::vector< CDCTrack > & tracks)
final

Write give tracks into track store array.

Definition at line 69 of file TrackExporter.cc.

70{
71 TMatrixDSym defaultCovSeed(6);
72 defaultCovSeed(0, 0) = 1e-3;
73 defaultCovSeed(1, 1) = 1e-3;
74 defaultCovSeed(2, 2) = 4e-3;
75 defaultCovSeed(3, 3) = 0.01e-3;
76 defaultCovSeed(4, 4) = 0.01e-3;
77 defaultCovSeed(5, 5) = 0.04e-3;
78
79 // Put code to generate gf track cands here if requested.
81 StoreArray<RecoTrack> storedRecoTracks(m_param_RecoTracksName);
82 for (const CDCTrack& track : tracks) {
83 RecoTrack* newRecoTrack;
84 if (m_param_monopoleMomSeed != 0.0)
85 newRecoTrack = RecoTrackUtil::storeInto(track, storedRecoTracks, m_param_monopoleMomSeed);
86 else
87 newRecoTrack = RecoTrackUtil::storeInto(track, storedRecoTracks);
88 if (newRecoTrack) {
89 newRecoTrack->setQualityIndicator(track.getQualityIndicator());
90 }
91 if (newRecoTrack and m_param_discardCovarianceMatrix) {
92 newRecoTrack->setSeedCovariance(defaultCovSeed);
93 }
94 }
95 }
96}
void setSeedCovariance(const TMatrixDSym &seedCovariance)
Set the covariance of the seed. ATTENTION: This is not the fitted covariance.
Definition RecoTrack.h:614
void setQualityIndicator(const float qualityIndicator)
Set the quality index attached to this RecoTrack. 0 means likely fake.
Definition RecoTrack.h:847
bool m_param_exportTracks
Parameter: Switch if a RecoTrack be generated for each track.
bool m_param_discardCovarianceMatrix
Parameter: Discard covariance matrix in favour of a hand written one.
double m_param_monopoleMomSeed
Parameter: If non-zero, estimate seeds as for monopoles and set the momentum magnitude as this value.
std::string m_param_RecoTracksName
Parameter: Name of the output StoreArray of the RecoTracks generated by this module.
static RecoTrack * storeInto(const CDCTrack &track, StoreArray< RecoTrack > &recoTracks, const double momentumSeedMagnitude)
For magnetic monopoles; estimates charge sign from all stereo hits, momentum direction from hits in c...

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

32{
33 moduleParamList->addParameter(prefixed(prefix, "RecoTracksStoreArrayName"),
35 "Name of the output StoreArray of RecoTracks.",
37
38 moduleParamList->addParameter(prefixed(prefix, "WriteRecoTracks"),
40 "Alias for exportTracks",
42
43 moduleParamList->addParameter(prefixed(prefix, "exportTracks"),
45 "Switch for the creation of reco tracks for each cdc track.",
47
48 moduleParamList->addParameter(prefixed(prefix, "discardCovarianceMatrix"),
50 "Discard covariance matrix in favour of a hand written one.",
52 moduleParamList->addParameter(prefixed(prefix, "monopoleMomSeed"),
54 "If non-zero, estimate seeds as for monopoles and set the momentum magnitude as this value.",
56}
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< CDCTrack & >.

Definition at line 26 of file TrackExporter.cc.

27{
28 return "Creates a RecoTrack from each CDCTrack.";
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 ( )
finalvirtual

Signal initialisation phase to register store array for export.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 58 of file TrackExporter.cc.

59{
60 // Output StoreArray
62 StoreArray<RecoTrack> storedRecoTracks(m_param_RecoTracksName);
63 storedRecoTracks.registerInDataStore(DataStore::c_ErrorIfAlreadyRegistered);
65 }
67}
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
Definition DataStore.h:72
static void registerRequiredRelations(StoreArray< RecoTrack > &recoTracks, std::string const &pxdHitsStoreArrayName="", std::string const &svdHitsStoreArrayName="", std::string const &cdcHitsStoreArrayName="", std::string const &bklmHitsStoreArrayName="", std::string const &eklmHitsStoreArrayName="", std::string const &recoHitInformationStoreArrayName="")
Convenience method which registers all relations required to fully use a RecoTrack.
Definition RecoTrack.cc:53

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

bool m_param_discardCovarianceMatrix = false
private

Parameter: Discard covariance matrix in favour of a hand written one.

Definition at line 53 of file TrackExporter.h.

◆ m_param_exportTracks

bool m_param_exportTracks = true
private

Parameter: Switch if a RecoTrack be generated for each track.

Definition at line 47 of file TrackExporter.h.

◆ m_param_monopoleMomSeed

double m_param_monopoleMomSeed = 0.0
private

Parameter: If non-zero, estimate seeds as for monopoles and set the momentum magnitude as this value.

Definition at line 56 of file TrackExporter.h.

◆ m_param_RecoTracksName

std::string m_param_RecoTracksName = ""
private

Parameter: Name of the output StoreArray of the RecoTracks generated by this module.

Definition at line 50 of file TrackExporter.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: