Belle II Software development
WireHitMCMultiLoopBlocker Class Referenceabstract

Marks all hits that are not on the first loop of the track as background. More...

#include <WireHitMCMultiLoopBlocker.h>

Inheritance diagram for WireHitMCMultiLoopBlocker:
Findlet< CDCWireHit & > 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

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
 Signals the start of the event processing.
 
void beginEvent () final
 Prepare the Monte Carlo information at the start of the event.
 
void apply (std::vector< CDCWireHit > &wireHits) final
 Main algorithm marking the hit of higher loops as background.
 
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 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< CDCWireHit & >
 Type of the base class.
 

Private Attributes

double m_param_useNLoops = INFINITY
 Parameter : Maximal fraction of loops of the mc particles trajectory needs to the hit to unblock it.
 
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

Marks all hits that are not on the first loop of the track as background.

By marking them as background hits are excluded from the track finding procedures Application of this findlet somewhat reduces the complexity of the track finding since only hits within a limited time need to be tracked. It is however useful to validated fitting procedures and to bias multivariate to favor the first loops and do not apply a penalty for uncovered higher order loops

Definition at line 34 of file WireHitMCMultiLoopBlocker.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

using Super = Findlet<CDCWireHit&>
private

Type of the base class.

Definition at line 38 of file WireHitMCMultiLoopBlocker.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 ( std::vector< CDCWireHit > &  wireHits)
final

Main algorithm marking the hit of higher loops as background.

Definition at line 60 of file WireHitMCMultiLoopBlocker.cc.

61{
62 if (not std::isfinite(m_param_useNLoops)) return;
63
64 const CDCMCHitLookUp& mcHitLookUp = CDCMCHitLookUp::getInstance();
65 double nLoops = m_param_useNLoops;
66 auto isWithinMCLoops = [&mcHitLookUp, nLoops](const CDCWireHit & wireHit) {
67
68 // Reject hits with no associated CDCSimHit.
69 const CDCSimHit* simHit = mcHitLookUp.getClosestPrimarySimHit(wireHit.getHit());
70 if (not simHit) return false;
71
72 const double tof = simHit->getFlightTime();
73
74 // Accept hits with no associated MCParticle (e.g. beam background.)
75 const MCParticle* mcParticle = simHit->getRelated<MCParticle>();
76 if (not mcParticle) return true;
77
78 const double speed = mcParticle->get4Vector().Beta() * Const::speedOfLight;
79
80 const ROOT::Math::XYZVector mom3D = mcParticle->getMomentum();
81 const float absMom2D = mom3D.Rho();
82 const float absMom3D = mom3D.R();
83
84 const Vector3D pos3D(0.0, 0.0, 0.0);
85 const double bendRadius = CDCBFieldUtil::absMom2DToBendRadius(absMom2D, pos3D);
86 const double bendCircumfence = 2 * M_PI * bendRadius;
87 const double loopLength = bendCircumfence * absMom3D / absMom2D;
88 const double loopTOF = loopLength / speed;
89
90 if (tof > loopTOF * nLoops) {
91 return false;
92 } else {
93 return true;
94 }
95 };
96
97 for (CDCWireHit& wireHit : wireHits) {
98 if (not isWithinMCLoops(wireHit)) {
99 wireHit->setBackgroundFlag();
100 wireHit->setTakenFlag();
101 }
102 }
103}
Example Detector.
Definition: CDCSimHit.h:21
double getFlightTime() const
The method to get flight time.
Definition: CDCSimHit.h:184
static const double speedOfLight
[cm/ns]
Definition: Const.h:695
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
ROOT::Math::PxPyPzEVector get4Vector() const
Return 4Vector of particle.
Definition: MCParticle.h:207
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
static double absMom2DToBendRadius(double absMom2D, double bZ)
Conversion helper for momenta to two dimensional (absolute) bend radius.
Interface class to the Monte Carlo information for individual hits.
const CDCSimHit * getClosestPrimarySimHit(const CDCHit *ptrHit) const
Getter for the closest simulated hit of a primary particle to the given hit - may return nullptr of n...
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
A three dimensional vector.
Definition: Vector3D.h:33
double m_param_useNLoops
Parameter : Maximal fraction of loops of the mc particles trajectory needs to the hit to unblock it.

◆ beginEvent()

void beginEvent ( )
finalvirtual

Prepare the Monte Carlo information at the start of the event.

Reimplemented from ProcessingSignalListener.

Definition at line 52 of file WireHitMCMultiLoopBlocker.cc.

53{
55 if (std::isfinite(m_param_useNLoops)) {
57 }
58}
void fill()
Fill Monte Carlo look up maps from the DataStore.
static CDCMCManager & getInstance()
Getter for the singleton instance.
Definition: CDCMCManager.cc:74
void beginEvent() override
Receive and dispatch 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}
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 
)
finalvirtual

Expose the parameters to a module.

Reimplemented from Findlet< CDCWireHit & >.

Definition at line 35 of file WireHitMCMultiLoopBlocker.cc.

37{
38 moduleParamList->addParameter(prefixed(prefix, "UseNLoops"),
40 "Maximal number of loops accepted",
42}
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< CDCWireHit & >.

Definition at line 29 of file WireHitMCMultiLoopBlocker.cc.

30{
31 return "Marks all hits that were not reached after the specified number of loops as background "
32 "based on MC information.";
33}

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
finalvirtual

Signals the start of the event processing.

Reimplemented from ProcessingSignalListener.

Definition at line 44 of file WireHitMCMultiLoopBlocker.cc.

45{
47 if (std::isfinite(m_param_useNLoops)) {
49 }
50}
void requireTruthInformation()
Require the MC information store arrays.
void initialize() override
Receive and dispatch signal before the start of the event processing.

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

double m_param_useNLoops = INFINITY
private

Parameter : Maximal fraction of loops of the mc particles trajectory needs to the hit to unblock it.

Definition at line 58 of file WireHitMCMultiLoopBlocker.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.


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