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
 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
 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 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 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.
 
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.
 
void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 
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.
 
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_initialized
 Flag to keep track whether initialization happened before.
 
bool m_terminated = false
 Flag to keep track whether termination happened before.
 
bool m_terminated
 Flag to keep track whether termination happened before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 
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
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<CDCWireHit&>
private

Type of the base class.

Definition at line 38 of file WireHitMCMultiLoopBlocker.h.

◆ ToVector

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Member Function Documentation

◆ addProcessingSignalListener() [1/2]

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.

◆ addProcessingSignalListener() [2/2]

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< 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}
double getFlightTime() const
The method to get flight time.
Definition CDCSimHit.h:183
static const double speedOfLight
[cm/ns]
Definition Const.h:695
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
Definition Particle.h:567
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.
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.
double m_param_useNLoops
Parameter : Maximal fraction of loops of the mc particles trajectory needs to the hit to unblock it.
HepGeom::Vector3D< double > Vector3D
3D Vector
Definition Cell.h:34

◆ beginEvent()

void beginEvent ( )
finalvirtual

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

Reimplemented from CompositeProcessingSignalListener.

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.

◆ beginRun() [1/2]

void beginRun ( )
overridevirtualinherited

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

Reimplemented from ProcessingSignalListener.

Reimplemented in DATCONSVDClusterizer, LayerPXDRelationFilter< AFilter, APrefilter >, LayerPXDRelationFilter< TrackFindingCDC::ChooseableFilter< PXDPairFilterFactory > >, LayerPXDRelationFilter< TrackFindingCDC::ChooseableFilter< PXDPairFilterFactory > >, LayerSVDRelationFilter< AFilter, APrefilter >, LayerSVDRelationFilter< TrackFindingCDC::ChooseableFilter< SVDPairFilterFactory > >, LayerSVDRelationFilter< TrackFindingCDC::ChooseableFilter< SVDPairFilterFactory > >, SectorMapBasedSVDPairFilter, SimplePXDStateFilter, SimpleSVDStateFilter, CutsFromDBWireHitFilter, MVA< Filter< AVarSet::Object > >, MVA< Filter< typename AVarSet::Object > >, MVA< Filter< typename AVarSet::Object > >, WireHitCreator, FourHitFilter, LayerRelationFilter< AFilter >, LayerRelationFilter< TrackFindingCDC::ChooseableFilter< RelationFilterFactory > >, LayerRelationFilter< TrackFindingCDC::ChooseableFilter< RelationFilterFactory > >, QualityIndicatorFilter, RecoTrackStorer, ROIFinder, SpacePointLoaderAndPreparer, ThreeHitFilter, TrackCandidateResultRefiner, TwoHitVirtualIPFilter, and TwoHitVirtualIPQIFilter.

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.
ProcessingSignalListener()
Allow default construction.

◆ beginRun() [2/2]

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.

◆ endRun() [1/2]

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.

◆ endRun() [2/2]

void endRun ( )
overrideinherited

Receive and dispatch signal for the end of the run.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

◆ exposeParameters()

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

Expose the parameters to a module.

Reimplemented from CompositeProcessingSignalListener.

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() [1/2]

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ getNProcessingSignalListener() [2/2]

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 56 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
finalvirtual

Signals the start of the event processing.

Reimplemented from CompositeProcessingSignalListener.

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.

◆ terminate() [1/2]

◆ terminate() [2/2]

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.

Member Data Documentation

◆ m_initialized [1/2]

bool m_initialized
privateinherited

Flag to keep track whether initialization happened before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initialized [2/2]

bool m_initialized = false
privateinherited

Flag to keep track whether initialization happened before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initializedAs [1/2]

std::string m_initializedAs
privateinherited

Name of the type during initialisation.

Definition at line 58 of file ProcessingSignalListener.h.

◆ m_initializedAs [2/2]

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 [1/2]

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_subordinaryProcessingSignalListeners [2/2]

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 [1/2]

bool m_terminated
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.

◆ m_terminated [2/2]

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: