Belle II Software development
CDCCKFResultStorer Class Referenceabstract

Store resulting tracks and relations on the dataStore. More...

#include <CDCCKFResultStorer.h>

Inheritance diagram for CDCCKFResultStorer:
Findlet< const CDCCKFResult > CompositeProcessingSignalListener ProcessingSignalListener

Public Types

using IOTypes = std::tuple< AIOTypes... >
 Types that should be served to apply on invocation.
 
using IOVectors = std::tuple< std::vector< AIOTypes >... >
 Vector types that should be served to apply on invocation.
 

Public Member Functions

void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override
 Expose the parameters of the sub findlets.
 
void apply (const std::vector< CDCCKFResult > &results) override
 Do the track/hit finding/merging.
 
void initialize () override
 Register the store arrays.
 
virtual std::string getDescription ()
 Brief description of the purpose of the concrete findlet.
 
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 = typename ToVectorImpl< T >::Type
 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 = TrackFindingCDC::Findlet< const CDCCKFResult >
 Parent class.
 

Private Attributes

std::string m_param_writeOutDirectionAsString = "both"
 Parameter for the distance given to the framework (can not handle EForwardBackward directly)
 
TrackFindingCDC::EForwardBackward m_param_writeOutDirection = TrackFindingCDC::EForwardBackward::c_Unknown
 Direction parameter converted from the string parameters.
 
bool m_param_exportTracks = true
 Export the tracks or not.
 
bool m_param_exportAllTracks = false
 Export all tracks, even if they did not reach the center of the CDC.
 
std::string m_param_outputRecoTrackStoreArrayName = "CKFRecoTracks"
 StoreArray name of the output Track Store Array.
 
std::string m_param_outputRelationRecoTrackStoreArrayName = "RecoTracks"
 StoreArray name of the tracks, the output reco tracks should be related to.
 
std::string m_param_trackFindingDirectionAsString = "forward"
 Parameter for the direction of the CKF.
 
TrackFindingCDC::EForwardBackward m_param_trackFindingDirection = TrackFindingCDC::EForwardBackward::c_Unknown
 Direction parameter converted from the string parameters.
 
bool m_param_setTakenFlag = true
 Set flag that hit is taken.
 
RecoHitInformation::OriginTrackFinder m_trackFinderType = RecoHitInformation::c_SVDtoCDCCKF
 What was used to seed the CKF (typically c_SVDtoCDCCKF, c_ECLtoCDCCKF)
 
std::string m_seedComponentString = "SVD"
 Where does the seed track for the CKF come from (typically SVD, ECL)
 
StoreArray< RecoTrackm_outputRecoTracks
 Output Reco Tracks Store Array.
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized = false
 Flag to keep track whether initialization happened before.
 
bool m_terminated = false
 Flag to keep track whether termination happened before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Store resulting tracks and relations on the dataStore.

Definition at line 28 of file CDCCKFResultStorer.h.

Member Typedef Documentation

◆ IOTypes

using IOTypes = std::tuple<AIOTypes...>
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOVectors

using IOVectors = std::tuple< std::vector<AIOTypes>... >
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ Super

Parent class.

Definition at line 30 of file CDCCKFResultStorer.h.

◆ ToVector

using ToVector = typename ToVectorImpl<T>::Type
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 55 of file CompositeProcessingSignalListener.cc.

56{
58}
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
References to subordinary signal processing listener contained in this findlet.

◆ apply()

void apply ( const std::vector< CDCCKFResult > &  results)
override

Do the track/hit finding/merging.

Definition at line 87 of file CDCCKFResultStorer.cc.

88{
89 for (const CDCCKFResult& result : results) {
90 if (result.size() < 2) {
91 continue;
92 }
93
94 genfit::MeasuredStateOnPlane const* trackState = nullptr;
95 if (m_param_trackFindingDirection == TrackFindingCDC::EForwardBackward::c_Forward) {
96 trackState = &result.at(1).getTrackState();
97 } else if (m_param_trackFindingDirection == TrackFindingCDC::EForwardBackward::c_Backward) {
98 trackState = &result.back().getTrackState();
99 } else {
100 B2FATAL("CDCCKFResultStorer: No valid direction specified. Please use forward/backward.");
101 }
102
103 // only accept paths that reached the center of the CDC (for ECL seeding)
105 && m_param_trackFindingDirection == TrackFindingCDC::EForwardBackward::c_Backward
106 && result.back().getWireHit()->getWire().getICLayer() > 2) {
107 continue;
108 }
109
110 const ROOT::Math::XYZVector& trackPosition = ROOT::Math::XYZVector(trackState->getPos());
111 const ROOT::Math::XYZVector& trackMomentum = ROOT::Math::XYZVector(trackState->getMom());
112 const double trackCharge = trackState->getCharge();
113
114 RecoTrack* newRecoTrack = m_outputRecoTracks.appendNew(trackPosition, trackMomentum, trackCharge);
115
116 unsigned int sortingParameter = 0;
117 for (const CDCCKFState& state : result) {
118 if (state.isSeed()) {
119 continue;
120 }
121
122 const TrackFindingCDC::CDCWireHit* wireHit = state.getWireHit();
123
124 auto rl = state.getRLinfo() == TrackFindingCDC::ERightLeft::c_Right ?
125 RecoHitInformation::RightLeftInformation::c_right :
126 RecoHitInformation::RightLeftInformation::c_left;
127
128 newRecoTrack->addCDCHit(wireHit->getHit(), sortingParameter, rl, m_trackFinderType);
129 sortingParameter++;
130
132 wireHit->getAutomatonCell().setTakenFlag();
133 }
134 }
135
136 const RecoTrack* seed = result.front().getSeed();
137 if (not seed) {
138 continue;
139 }
140
141 seed->addRelationTo(newRecoTrack, m_param_writeOutDirection);
142 newRecoTrack->addRelationTo(seed, m_param_writeOutDirection);
143 }
144}
StoreArray< RecoTrack > m_outputRecoTracks
Output Reco Tracks Store Array.
RecoHitInformation::OriginTrackFinder m_trackFinderType
What was used to seed the CKF (typically c_SVDtoCDCCKF, c_ECLtoCDCCKF)
bool m_param_exportAllTracks
Export all tracks, even if they did not reach the center of the CDC.
bool m_param_setTakenFlag
Set flag that hit is taken.
TrackFindingCDC::EForwardBackward m_param_writeOutDirection
Direction parameter converted from the string parameters.
TrackFindingCDC::EForwardBackward m_param_trackFindingDirection
Direction parameter converted from the string parameters.
Define states for CKF algorithm, which can be seed track or CDC wire hit.
Definition: CDCCKFState.h:25
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
bool addCDCHit(const UsedCDCHit *cdcHit, const unsigned int sortingParameter, RightLeftInformation rightLeftInformation=RightLeftInformation::c_undefinedRightLeftInformation, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a cdc hit with the given information to the reco track.
Definition: RecoTrack.h:243
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:246
void setTakenFlag(bool setTo=true)
Sets the taken flag to the given value. Default value true.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
CDCCKFPath CDCCKFResult
Alias for the collection of CDC CKF-algorithm states.
Definition: CDCCKFResult.h:18

◆ beginEvent()

void beginEvent ( )
overridevirtualinherited

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

Reimplemented from ProcessingSignalListener.

Reimplemented in SpacePointTagger< Belle2::CKFToPXDResult, Belle2::PXDCluster >, SpacePointTagger< Belle2::CKFToSVDResult, Belle2::SVDCluster >, BaseEventTimeExtractor< RecoTrack * >, BaseEventTimeExtractor< TrackFindingCDC::CDCWireHit & >, SharingHitsMatcher< Belle2::TrackFindingCDC::CDCTrack, Belle2::TrackFindingCDC::CDCSegment2D >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCFacet >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCWireHit, true >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegment2D >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCTrack >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegmentPair >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegmentTriple >, RecoTrackStorer, ROIFinder, and SVDHoughTracking.

Definition at line 31 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
Interface for an algorithm part that needs to receive the module processing signals.
virtual void beginEvent()
Receive signal for the start of a new event.

◆ beginRun()

void beginRun ( )
overridevirtualinherited

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

Reimplemented from ProcessingSignalListener.

Reimplemented in LayerRelationFilter< AFilter >, FourHitFilter, QualityIndicatorFilter, ThreeHitFilter, TwoHitVirtualIPFilter, TwoHitVirtualIPQIFilter, RecoTrackStorer, ROIFinder, SpacePointLoaderAndPreparer, and TrackCandidateResultRefiner.

Definition at line 23 of file CompositeProcessingSignalListener.cc.

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

◆ endRun()

void endRun ( )
overridevirtualinherited

Receive and dispatch signal for the end of the run.

Reimplemented from ProcessingSignalListener.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

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

◆ exposeParameters()

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

Expose the parameters of the sub findlets.

Reimplemented from Findlet< const CDCCKFResult >.

Definition at line 19 of file CDCCKFResultStorer.cc.

20{
21 Super::exposeParameters(moduleParamList, prefix);
22
23 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "exportTracks"), m_param_exportTracks,
24 "Export the result tracks into a StoreArray.",
26
27 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "outputRecoTrackStoreArrayName"),
29 "StoreArray name of the output Track Store Array.");
30 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "outputRelationRecoTrackStoreArrayName"),
32 "StoreArray name of the tracks, the output reco tracks should be related to.");
33
34 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "writeOutDirection"),
36 "Write out the relations with the direction of the CDC part as weight");
37
38 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "trackFindingDirection"),
40 "Direction in which the track is reconstructed (SVD/ECL seed)",
42
43 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "exportAllTracks"),
45 "Export all tracks, even if they did not reach the center of the CDC",
47
48 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "seedComponent"),
50 "Where does the seed track come from (typically SVD, ECL)",
52
53 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "setTakenFlag"),
55 "Set flag that hit is taken",
57}
std::string m_seedComponentString
Where does the seed track for the CKF come from (typically SVD, ECL)
bool m_param_exportTracks
Export the tracks or not.
std::string m_param_outputRelationRecoTrackStoreArrayName
StoreArray name of the tracks, the output reco tracks should be related to.
std::string m_param_trackFindingDirectionAsString
Parameter for the direction of the CKF.
std::string m_param_writeOutDirectionAsString
Parameter for the distance given to the framework (can not handle EForwardBackward directly)
std::string m_param_outputRecoTrackStoreArrayName
StoreArray name of the output Track Store Array.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription()

virtual std::string getDescription ( )
inlinevirtualinherited

Brief description of the purpose of the concrete findlet.

Definition at line 60 of file Findlet.h.

61 {
62 return "(no description)";
63 }

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
overridevirtual

Register the store arrays.

Reimplemented from ProcessingSignalListener.

Definition at line 59 of file CDCCKFResultStorer.cc.

60{
62
63 if (not m_param_exportTracks) {
64 return;
65 }
66
69
71 relationRecoTracks.registerRelationTo(m_outputRecoTracks);
72 m_outputRecoTracks.registerRelationTo(relationRecoTracks);
73
75
77
78 if (m_seedComponentString == "SVD") {
79 m_trackFinderType = RecoHitInformation::c_SVDtoCDCCKF;
80 } else if (m_seedComponentString == "ECL") {
81 m_trackFinderType = RecoHitInformation::c_ECLtoCDCCKF;
82 } else {
83 B2FATAL("CDCCKFResultStorer: No valid seed component specified. Please use SVD/ECL.");
84 }
85}
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
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
Definition: StoreArray.h:140
void initialize() override
Receive and dispatch signal before the start of the event processing.
TrackFindingCDC::EForwardBackward fromString(const std::string &directionString)
Helper function to turn a direction string into a valid forward backward information.

◆ terminate()

void terminate ( )
overridevirtualinherited

Receive and dispatch Signal for termination of the event processing.

Reimplemented from ProcessingSignalListener.

Reimplemented in StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::HyperHough >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::QuadraticLegendre >, and StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::Z0TanLambdaLegendre >.

Definition at line 47 of file CompositeProcessingSignalListener.cc.

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

Member Data Documentation

◆ m_initialized

bool m_initialized = false
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_outputRecoTracks

StoreArray<RecoTrack> m_outputRecoTracks
private

Output Reco Tracks Store Array.

Definition at line 69 of file CDCCKFResultStorer.h.

◆ m_param_exportAllTracks

bool m_param_exportAllTracks = false
private

Export all tracks, even if they did not reach the center of the CDC.

Definition at line 51 of file CDCCKFResultStorer.h.

◆ m_param_exportTracks

bool m_param_exportTracks = true
private

Export the tracks or not.

Definition at line 49 of file CDCCKFResultStorer.h.

◆ m_param_outputRecoTrackStoreArrayName

std::string m_param_outputRecoTrackStoreArrayName = "CKFRecoTracks"
private

StoreArray name of the output Track Store Array.

Definition at line 53 of file CDCCKFResultStorer.h.

◆ m_param_outputRelationRecoTrackStoreArrayName

std::string m_param_outputRelationRecoTrackStoreArrayName = "RecoTracks"
private

StoreArray name of the tracks, the output reco tracks should be related to.

Definition at line 55 of file CDCCKFResultStorer.h.

◆ m_param_setTakenFlag

bool m_param_setTakenFlag = true
private

Set flag that hit is taken.

Definition at line 61 of file CDCCKFResultStorer.h.

◆ m_param_trackFindingDirection

TrackFindingCDC::EForwardBackward m_param_trackFindingDirection = TrackFindingCDC::EForwardBackward::c_Unknown
private

Direction parameter converted from the string parameters.

Definition at line 59 of file CDCCKFResultStorer.h.

◆ m_param_trackFindingDirectionAsString

std::string m_param_trackFindingDirectionAsString = "forward"
private

Parameter for the direction of the CKF.

Definition at line 57 of file CDCCKFResultStorer.h.

◆ m_param_writeOutDirection

TrackFindingCDC::EForwardBackward m_param_writeOutDirection = TrackFindingCDC::EForwardBackward::c_Unknown
private

Direction parameter converted from the string parameters.

Definition at line 47 of file CDCCKFResultStorer.h.

◆ m_param_writeOutDirectionAsString

std::string m_param_writeOutDirectionAsString = "both"
private

Parameter for the distance given to the framework (can not handle EForwardBackward directly)

Definition at line 45 of file CDCCKFResultStorer.h.

◆ m_seedComponentString

std::string m_seedComponentString = "SVD"
private

Where does the seed track for the CKF come from (typically SVD, ECL)

Definition at line 65 of file CDCCKFResultStorer.h.

◆ m_subordinaryProcessingSignalListeners

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 52 of file CompositeProcessingSignalListener.h.

◆ m_terminated

bool m_terminated = false
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.

◆ m_trackFinderType

RecoHitInformation::OriginTrackFinder m_trackFinderType = RecoHitInformation::c_SVDtoCDCCKF
private

What was used to seed the CKF (typically c_SVDtoCDCCKF, c_ECLtoCDCCKF)

Definition at line 63 of file CDCCKFResultStorer.h.


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