Belle II Software development
Advancer Class Reference

Helper findlet for performing an extrapolation of a mSoP of one plane to another plane using the representation stored in the mSoP. More...

#include <Advancer.h>

Inheritance diagram for Advancer:
ProcessingSignalListener

Public Member Functions

double extrapolateToPlane (genfit::MeasuredStateOnPlane &measuredStateOnPlane, const genfit::SharedPlanePtr &plane) const
 Extrapolate the mSoP of one plane to another plane and return the traveled distance or NAN, if travelling into the wrong direction.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix)
 Expose the parameters.
 
void setMaterialEffectsToParameterValue () const
 Call this to set the material effects handling accorinf to the given parameters.
 
void resetMaterialEffects () const
 Call this to reset the material effects back to their default value (turned on).
 
void initialize () final
 Convert the string parameter to a valid forward backward information.
 
virtual void beginRun ()
 Receive signal for the beginning of a new run.
 
virtual void beginEvent ()
 Receive signal for the start of a new event.
 
virtual void endRun ()
 Receive signal for the end of the run.
 
virtual void terminate ()
 Receive Signal for termination of the event processing.
 

Private Attributes

bool m_param_useMaterialEffects = false
 Use material effects during extrapolation or not.
 
std::string m_param_directionAsString = "both"
 Parameter for the distance given to the framework (can not handle EForwardBackward directly)
 
TrackFindingCDC::EForwardBackward m_param_direction = TrackFindingCDC::EForwardBackward::c_Unknown
 Direction parameter converted from the string parameters.
 
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

Helper findlet for performing an extrapolation of a mSoP of one plane to another plane using the representation stored in the mSoP.

Will return the travelled distance or NAN, if

  • the extrapolation failed or
  • the extrapolation was into another direction as the direction parameter. See below.

Definition at line 37 of file Advancer.h.

Member Function Documentation

◆ beginEvent()

void beginEvent ( )
virtualinherited

Receive signal for the start of a new event.

Reimplemented in TruthAxialSegmentPairVarSet, TruthSegmentVarSet, BestMatchedTruthVarSet, TruthTrackVarSet, MonopoleStereoHitFinder, MonopoleStereoHitFinderQuadratic, SegmentFinderFacetAutomaton, SegmentTrackCombiner, StereoHitFinder, TrackFinderSegmentPairAutomaton, TrackFinderSegmentTripleAutomaton, TrackFinderAutomaton, AxialTrackCreatorMCTruth, CDCMCCloneLookUpFiller, SegmentCreatorMCTruth, WireHitMCMultiLoopBlocker, CDCCKFStateCreator, CKFToCDCFindlet, CKFToCDCFromEclFindlet, SpacePointTagger< AResult, ACluster >, SpacePointTagger< Belle2::CKFToPXDResult, Belle2::PXDCluster >, SpacePointTagger< Belle2::CKFToSVDResult, Belle2::SVDCluster >, CKFToPXDFindlet, CKFToSVDFindlet, CKFToSVDSeedFindlet, DATCONFPGAFindlet, BaseEventTimeExtractor< AIOTypes >, BaseEventTimeExtractor< RecoTrack * >, BaseEventTimeExtractor< TrackFindingCDC::CDCWireHit & >, SharingHitsMatcher< ACollectorItem, ACollectionItem >, 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 >, BkgTruthClusterVarSet, SegmentTrackTruthVarSet, StereoHitTruthVarSet, StoreVectorSwapper< IOType, a_alwaysWrite >, 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 >, CompositeProcessingSignalListener, RecoTrackStorer, ROIFinder, SVDHoughTracking, and FindletStoreArrayInput< TWrappedFindlet >.

Definition at line 45 of file ProcessingSignalListener.cc.

46{
47 if (not m_initialized) {
48 B2DEBUG(20, typeid(*this).name() << " was not initialized");
49 }
50}
bool m_initialized
Flag to keep track whether initialization happened before.

◆ beginRun()

◆ endRun()

void endRun ( )
virtualinherited

Receive signal for the end of the run.

Reimplemented in CompositeProcessingSignalListener.

Definition at line 52 of file ProcessingSignalListener.cc.

53{
54 if (not m_initialized) {
55 B2DEBUG(20, typeid(*this).name() << " was not initialized");
56 }
57}

◆ exposeParameters()

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

Expose the parameters.

Definition at line 52 of file Advancer.cc.

53{
54 moduleParamList->addParameter(prefixed(prefix, "useMaterialEffects"),
56 "Use the material effects during extrapolation.",
58
59 moduleParamList->addParameter(prefixed(prefix, "direction"), m_param_directionAsString,
60 "The direction where the extrapolation will happen.");
61}
bool m_param_useMaterialEffects
Use material effects during extrapolation or not.
Definition: Advancer.h:57
std::string m_param_directionAsString
Parameter for the distance given to the framework (can not handle EForwardBackward directly)
Definition: Advancer.h:60
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ extrapolateToPlane()

double extrapolateToPlane ( genfit::MeasuredStateOnPlane &  measuredStateOnPlane,
const genfit::SharedPlanePtr &  plane 
) const

Extrapolate the mSoP of one plane to another plane and return the traveled distance or NAN, if travelling into the wrong direction.

Definition at line 22 of file Advancer.cc.

24{
26
27 double returnValue = NAN;
28 try {
29 const double extrapolatedS = measuredStateOnPlane.extrapolateToPlane(plane);
30
31 if (arcLengthInRightDirection(extrapolatedS, m_param_direction)) {
32 returnValue = static_cast<double>(m_param_direction) * extrapolatedS;
33 }
34 } catch (const genfit::Exception& e) {
35 B2DEBUG(29, "Extrapolation failed: " << e.what());
36 }
37
39 return returnValue;
40}
void resetMaterialEffects() const
Call this to reset the material effects back to their default value (turned on).
Definition: Advancer.cc:47
TrackFindingCDC::EForwardBackward m_param_direction
Direction parameter converted from the string parameters.
Definition: Advancer.h:62
void setMaterialEffectsToParameterValue() const
Call this to set the material effects handling accorinf to the given parameters.
Definition: Advancer.cc:42
constexpr bool arcLengthInRightDirection(double arcLength2D, TrackFindingCDC::EForwardBackward forwardBackward)
Given the calculated arc length between a start point and an end point, checks if the travelled path ...

◆ initialize()

void initialize ( )
finalvirtual

Convert the string parameter to a valid forward backward information.

Reimplemented from ProcessingSignalListener.

Definition at line 63 of file Advancer.cc.

64{
66
68}
virtual void initialize()
Receive 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.

◆ resetMaterialEffects()

void resetMaterialEffects ( ) const

Call this to reset the material effects back to their default value (turned on).

Definition at line 47 of file Advancer.cc.

48{
49 genfit::MaterialEffects::getInstance()->setNoEffects(false);
50}

◆ setMaterialEffectsToParameterValue()

void setMaterialEffectsToParameterValue ( ) const

Call this to set the material effects handling accorinf to the given parameters.

Definition at line 42 of file Advancer.cc.

43{
44 genfit::MaterialEffects::getInstance()->setNoEffects(not m_param_useMaterialEffects);
45}

◆ terminate()

void terminate ( )
virtualinherited

Receive Signal for termination of the event processing.

Reimplemented in AsicBackgroundLibraryCreator, AxialTrackCreatorHitHough, AxialTrackCreatorSegmentHough, StereoHitTrackQuadTreeMatcher< AQuadTree >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::HyperHough >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::QuadraticLegendre >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::Z0TanLambdaLegendre >, and CompositeProcessingSignalListener.

Definition at line 59 of file ProcessingSignalListener.cc.

60{
61 if (m_terminated) {
62 B2DEBUG(20, typeid(*this).name() << " has been terminated before");
63 printBacktrace(LogConfig::c_Debug, 10);
64 }
65 m_terminated = true;
66
67 if (not m_initialized) {
68 B2DEBUG(20, typeid(*this).name() << " was not initialized before termination");
69 printBacktrace(LogConfig::c_Debug, 10);
70 }
71 m_initialized = false;
72}
@ c_Debug
Debug: for code development.
Definition: LogConfig.h:26
bool m_terminated
Flag to keep track whether termination happened before.

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_param_direction

TrackFindingCDC::EForwardBackward m_param_direction = TrackFindingCDC::EForwardBackward::c_Unknown
private

Direction parameter converted from the string parameters.

Definition at line 62 of file Advancer.h.

◆ m_param_directionAsString

std::string m_param_directionAsString = "both"
private

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

Definition at line 60 of file Advancer.h.

◆ m_param_useMaterialEffects

bool m_param_useMaterialEffects = false
private

Use material effects during extrapolation or not.

Definition at line 57 of file Advancer.h.

◆ m_terminated

bool m_terminated = false
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: