9#include <framework/logging/Logger.h>
11#include <framework/geometry/BFieldManager.h>
13#include <tracking/modules/vxdtfRedesign/TrackFinderVXDBasicPathFinderModule.h>
14#include <tracking/trackFindingVXD/algorithms/NetworkPathConversion.h>
15#include <tracking/trackFindingVXD/segmentNetwork/NodeNetworkHelperFunctions.h>
27 "\n It uses the output produced by the SegmentNetworkProducerModule to create"
28 "SpacePointTrackCands by simply storing all possible paths stored in the SegmentNetwork.");
34 "name for StoreObjPtr< DirectedNodeNetwork> which contains the networks needed.",
37 addParam(
"EventLevelTrackingInfoName",
39 "Name of the EventLevelTrackingInfo that should be used (different one for ROI-finding).",
40 std::string(
"EventLevelTrackingInfo"));
42 addParam(
"SpacePointTrackCandArrayName",
44 "name for StoreArray< SpacePointTrackCand> to be filled.",
49 "If true for each event and each network created a file with a graph is created.",
bool(
false));
53 "Regulates if every node with enough notes below it is used as a seed or only the outermost nodes.",
58 "Regulates if every subset of sufficient length of a path shall be collected as separate path or not.",
63 "Additionally assign a common family identifier to all Tracks that are share a node.",
68 "Select only the best track candidates for each family.",
73 "Number of best track candidates to be created per family.",
78 "Maximal number of families allowed in an event; if exceeded, the event execution will be skipped.",
83 "Maximal number of paths per an event; if exceeded, the event execution will be skipped.",
119 DNN::printCANetwork<Segment< Belle2::TrackNode>>(segmentNetwork, fileName);
125 B2WARNING(
"Basic Path Finder failed, skipping event!");
131 unsigned int nSeeds = 0;
132 for (
auto* aNode : segmentNetwork) {
136 if (aNode->getInnerNodes().empty()) {
141 aNode->getMetaInfo().setSeed(
true);
146 B2WARNING(
"In Event: " <<
m_eventCounter <<
" no seed could be found -> no TCs created!");
152 unsigned short nFamilies =
m_familyDefiner.defineFamilies(segmentNetwork);
153 B2DEBUG(20,
"Number of families in the network: " << nFamilies);
155 B2WARNING(
"Maximal number of track candidates per event was exceeded: " <<
LogVar(
" Number of Families", nFamilies)
165 B2WARNING(
"VXDBasicPathFinder got signal to abort the event.");
181 std::vector<const SpacePoint*> path = sptc.
getHits();
188 std::vector<SpacePointTrackCand> bestPaths =
m_sptcSelector->returnSelection();
189 for (
unsigned short iCand = 0; iCand < bestPaths.size(); iCand++) {
191 std::vector<const SpacePoint*> path = cand.
getHits();
static ROOT::Math::XYZVector getFieldInTesla(const ROOT::Math::XYZVector &pos)
return the magnetic field at a given position in Tesla.
The CACell class This Class stores all relevant information one wants to have stored in a cell for a ...
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
DirectedNodeNetwork< Belle2::Segment< Belle2::TrackNode >, Belle2::CACell > & accessSegmentNetwork()
Returns reference to the SegmentNetwork stored in this container, intended for read and write access.
void set_collectedPaths(int in)
Sets number of paths found.
Network of directed nodes of the type EntryType.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Storage for (VXD) SpacePoint-based track candidates.
short getFamily() const
return family identifier
const std::vector< const Belle2::SpacePoint * > & getHits() const
get hits (space points) of track candidate
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
SpacePointTrackCandCreator< StoreArray< Belle2::SpacePointTrackCand > > m_sptcCreator
Tool for creating SPTCs, which fills storeArray directly.
bool m_PARAMprintNetworks
If true for each event and each network created a file with a graph is created.
unsigned int m_eventCounter
Event number counter.
PathCollectorRecursive< NodeNetworkType, NodeType, Path, Belle2::NodeCompatibilityCheckerBase< NodeType > > m_pathCollector
Algorithm for finding paths of segments.
void initialize() override
initialize
std::unique_ptr< SPTCSelectorXBestPerFamily > m_sptcSelector
Pointer to SPTC selector class which performs the x best candidate selection.
TrackFinderVXDBasicPathFinderModule()
Constructor.
StoreObjPtr< EventLevelTrackingInfo > m_eventLevelTrackingInfo
Access to the EventLevelTrackingInfo object in the datastore.
void event() override
event
std::string m_PARAMEventLevelTrackingInfoName
Name of the EventLevelTrackingInfo that should be used (different one for ROI-finding)
CellularAutomaton< NodeNetworkType, Belle2::CAValidator< Belle2::CACell > > m_cellularAutomaton
member variables
StoreArray< Belle2::SpacePointTrackCand > m_TCs
output containers
StoreObjPtr< Belle2::DirectedNodeNetworkContainer > m_network
input containers
unsigned short m_PARAMmaxFamilies
Maximal number of families in event; if exceeded, the execution of the trackfinder will be stopped.
NodeFamilyDefiner< NodeNetworkType, NodeType, Path > m_familyDefiner
Class to evaluate connected nodes, in this case for the directed node network, and assigns a family t...
void beginRun() override
beginRun
std::string m_PARAMsecMapName
the name of the SectorMap used for this instance.
bool m_PARAMsetFamilies
If true additionally assign a common family identifier to all Tracks that are share a node.
std::vector< Path > m_collectedPaths
Path collection obtained from evaluation of the provided segment network.
bool m_PARAMstoreSubsets
Regulates if every subset of sufficient length of a path shall be collected as separate path or not.
unsigned int m_PARAMmaxPaths
Maximal number of paths per event; if exceeded, the execution of the trackfinder will be stopped.
std::string m_PARAMNetworkName
name for StoreObjPtr<DirectedNodeNetwork> which contains the networks needed
bool m_PARAMselectBestPerFamily
If true create track candidate only for the best candidate of a family.
std::string m_PARAMSpacePointTrackCandArrayName
module parameters
bool m_PARAMstrictSeeding
Regulates if every node with enough nodes below it is used as a seed or only the outermost nodes.
unsigned short m_PARAMxBestPerFamily
Maximal number of best candidates to be created per family.
Class to store variables with their name which were sent to the logging service.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
SpacePointTrackCand convertNetworkPath(NetworkPath networkPath)
Create new SPTC from network path.
Abstract base class for different kinds of events.