Belle II Software development
FullGridChi2TrackTimeExtractor Class Referencefinalabstract

Class to extract the event t0 using the chi-squared approach. More...

#include <FullGridChi2TrackTimeExtractor.h>

Inheritance diagram for FullGridChi2TrackTimeExtractor:
BaseEventTimeExtractor< RecoTrack * > Findlet< AIOTypes... > 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

 FullGridChi2TrackTimeExtractor ()
 Constructor.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override final
 Copy the parameters.
 
void apply (std::vector< RecoTrack * > &) override final
 Timing extraction for this findlet.
 
bool wasSuccessful () const
 Returns true if the last run t0 extraction was successful.
 
virtual void initialize () override
 Initialize the event t0 store obj ptr.
 
virtual void beginEvent () override
 Create the event t0 store obj ptr.
 
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 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 resetEventT0 () const
 Reset the t0 value to cached value if it exists or clear it otherwise.
 
void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Protected Attributes

StoreObjPtr< EventT0m_eventT0
 Pointer to the storage of the eventwise T0 estimation in the data store.
 
bool m_wasSuccessful
 Variable to show that the execution was successful.
 

Private Types

using Super = BaseEventTimeExtractor< RecoTrack * >
 Type of the base class.
 

Private Attributes

GridEventTimeExtractor< Chi2BasedEventTimeExtractorm_gridExtractor
 Slow grid based extractor.
 
IterativeChi2BasedEventTimeExtractor m_finalExtractor
 Refining extractor in the end.
 
bool m_skipIfSVDEventT0Present = true
 Skip FullGrid EventT0 extraction if SVD EventT0 is present.
 
bool m_param_overwriteExistingEstimation
 Parameter if it is fine to overwrite the current EventT0.
 
std::optional< EventT0::EventT0Componentm_eventT0Before
 Storage for the event t0 before this module ran.
 
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

Class to extract the event t0 using the chi-squared approach.

Definition at line 26 of file FullGridChi2TrackTimeExtractor.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

Type of the base class.

Definition at line 29 of file FullGridChi2TrackTimeExtractor.h.

◆ ToVector

using ToVector = typename ToVectorImpl<T>::Type
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ FullGridChi2TrackTimeExtractor()

Constructor.

Definition at line 21 of file FullGridChi2TrackTimeExtractor.cc.

22{
25}
IterativeChi2BasedEventTimeExtractor m_finalExtractor
Refining extractor in the end.
GridEventTimeExtractor< Chi2BasedEventTimeExtractor > m_gridExtractor
Slow grid based extractor.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.

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 ( std::vector< RecoTrack * > &  recoTracks)
finaloverride

Timing extraction for this findlet.

Definition at line 44 of file FullGridChi2TrackTimeExtractor.cc.

45{
46 // Don't execute this time consuming algorithm if a valid SVD based EventT0 estimate is present
47 if (m_skipIfSVDEventT0Present and m_eventT0->hasTemporaryEventT0(Const::EDetector::SVD)) {
48 return;
49 }
50
51 const auto& temporaryT0Extractions = m_eventT0->getTemporaryEventT0s(Const::CDC);
52 B2ASSERT("There should only be a single or none extraction at this stage!", temporaryT0Extractions.size() <= 1);
53
54 if (temporaryT0Extractions.empty()) {
55 m_gridExtractor.apply(recoTracks);
56 // if neither the hit based nor the grid based extraction finds something, we can not do anything
57 if (not m_gridExtractor.wasSuccessful()) {
58 m_wasSuccessful = false;
59 return;
60 }
61 } else {
62 // Make sure to actually use the temporary hit based extraction result
63 m_eventT0->setEventT0(temporaryT0Extractions[0]);
64 }
65
66 m_finalExtractor.apply(recoTracks);
68
69 if (not wasSuccessful()) {
70 B2DEBUG(25, "Resetting the event t0 as the final extraction was not successful.");
72 }
73}
StoreObjPtr< EventT0 > m_eventT0
Pointer to the storage of the eventwise T0 estimation in the data store.
bool m_wasSuccessful
Variable to show that the execution was successful.
bool m_skipIfSVDEventT0Present
Skip FullGrid EventT0 extraction if SVD EventT0 is present.
void apply(std::vector< RecoTrack * > &recoTracks) override final
Timing extraction for this findlet.
bool wasSuccessful() const
Returns true if the last run t0 extraction was successful.
void resetEventT0() const
Reset the t0 value to cached value if it exists or clear it otherwise.

◆ beginEvent()

void beginEvent
overridevirtualinherited

Create the event t0 store obj ptr.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 39 of file BaseEventTimeExtractor.icc.h.

46 {
47 Super::beginEvent();
48
49 m_wasSuccessful = false;
50
51 if (not m_eventT0.isValid()) {
52 m_eventT0.create();
53 }
54
55 m_eventT0Before = m_eventT0->getEventT0Component();
56 }
std::optional< EventT0::EventT0Component > m_eventT0Before
Storage for the event t0 before this module ran.

◆ 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}
Interface for an algorithm part that needs to receive the module processing signals.
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 
)
finaloverridevirtual

Copy the parameters.

Reimplemented from BaseEventTimeExtractor< RecoTrack * >.

Definition at line 28 of file FullGridChi2TrackTimeExtractor.cc.

29{
30 m_gridExtractor.exposeParameters(moduleParamList, prefixed("Grid", prefix));
31 m_finalExtractor.exposeParameters(moduleParamList, prefixed("Refiner", prefix));
32
33 moduleParamList->getParameter<unsigned int>("GridIterations").setDefaultValue(1);
34 moduleParamList->getParameter<bool>("RefinerUseLastEventT0").setDefaultValue(true);
35
36 moduleParamList->addParameter(prefixed(prefix, "skipIfSVDEventT0Present"),
38 "Skip execution of the time consuming FullGridChi2 algorithm if a valid SVD based EventT0 estimate is present. " \
39 "If set to true, this module is only used to get an CDC based EventT0 in the few events where no sufficient SVD information is available to estimate EventT0.",
41}
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override final
Expose our parameters to the super module.
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
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.

Reimplemented in HitBasedT0Extractor.

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
overridevirtualinherited

Initialize the event t0 store obj ptr.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 36 of file BaseEventTimeExtractor.icc.h.

39 {
40 Super::initialize();
41 m_eventT0.registerInDataStore();
42 }

◆ resetEventT0()

void resetEventT0
protectedinherited

Reset the t0 value to cached value if it exists or clear it otherwise.

Definition at line 43 of file BaseEventTimeExtractor.icc.h.

60 {
61 if (m_eventT0Before) {
62 m_eventT0->setEventT0(*m_eventT0Before);
63 } else {
64 m_eventT0->clearEventT0();
65 }
66 }

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

◆ wasSuccessful()

bool wasSuccessful
inherited

Returns true if the last run t0 extraction was successful.

Definition at line 30 of file BaseEventTimeExtractor.icc.h.

22 {
23 return m_wasSuccessful;
24 }

Member Data Documentation

◆ m_eventT0

StoreObjPtr<EventT0> m_eventT0
protectedinherited

Pointer to the storage of the eventwise T0 estimation in the data store.

Definition at line 46 of file BaseEventTimeExtractor.dcl.h.

◆ m_eventT0Before

std::optional<EventT0::EventT0Component> m_eventT0Before
privateinherited

Storage for the event t0 before this module ran.

Definition at line 56 of file BaseEventTimeExtractor.dcl.h.

◆ m_finalExtractor

IterativeChi2BasedEventTimeExtractor m_finalExtractor
private

Refining extractor in the end.

Definition at line 45 of file FullGridChi2TrackTimeExtractor.h.

◆ m_gridExtractor

Slow grid based extractor.

Definition at line 43 of file FullGridChi2TrackTimeExtractor.h.

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

bool m_param_overwriteExistingEstimation
privateinherited

Parameter if it is fine to overwrite the current EventT0.

Definition at line 53 of file BaseEventTimeExtractor.dcl.h.

◆ m_skipIfSVDEventT0Present

bool m_skipIfSVDEventT0Present = true
private

Skip FullGrid EventT0 extraction if SVD EventT0 is present.

Definition at line 47 of file FullGridChi2TrackTimeExtractor.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_wasSuccessful

bool m_wasSuccessful
protectedinherited

Variable to show that the execution was successful.

Definition at line 49 of file BaseEventTimeExtractor.dcl.h.


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