9#include <tracking/modules/vxdtfQualityEstimator/VXDQETrainingDataCollectorModule.h>
10#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorTripletFit.h>
11#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorRiemannHelixFit.h>
12#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorMC.h>
13#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorCircleFit.h>
14#include <framework/geometry/BFieldManager.h>
24 setDescription(
"Module to collect training data for the VXDQualityEstimatorMVA and store it in a root file.");
29 "Identifier which estimation method to use. Valid identifiers are: [circleFit, "
30 "tripletFit, helixFit]",
35 "If true, MC information is used. Thus, to run over data, this needs to be set to false.",
38 addParam(
"SpacePointTrackCandsStoreArrayName",
40 "Name of StoreArray containing the SpacePointTrackCandidates to be estimated.",
43 addParam(
"MCRecoTracksStoreArrayName",
45 "Name of StoreArray containing MCRecoTracks. Only required for MCInfo method",
50 "Only required for MCInfo method. If false combining several MCTracks is allowed.",
55 "Whether to write out MVA target which requires complete agreement between SVD CLusters "
57 "recognition track and MC track to yield 1, else 0, and thus provides maximal hit "
58 "purity and hit efficiency.",
63 "Name of the output rootfile.",
68 "How to compile information from clusters ['Average']",
73 "Whether to collect timing information",
95 m_estimator = std::make_unique<QualityEstimatorTripletFit>();
97 m_estimator = std::make_unique<QualityEstimatorCircleFit>();
99 m_estimator = std::make_unique<QualityEstimatorRiemannHelixFit>();
101 B2ASSERT(
"Not all QualityEstimators could be initialized!",
m_estimator);
105 B2ASSERT(
"QualityEstimatorMC could be initialized!",
m_estimatorMC);
129 std::vector<SpacePoint const*>
const sortedHits = aTC.getSortedHits();
135 const double mc_quality =
m_estimatorMC->estimateQuality(sortedHits);
136 m_truth = float(mc_quality > 0);
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...
@ c_TerminateInAllProcesses
When using parallel processing, call this module's terminate() function in all processes().
Class implementing the algorithm used for the MC based quality estimation.
void forceUpdateClusterNames()
Setter to force the class to update its cluster names.
Storage for (VXD) SpacePoint-based track candidates.
@ c_isActive
bit 11: SPTC is active (i.e.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
static const double T
[tesla]
std::unique_ptr< SimpleVariableRecorder > m_recorder
pointer to the object that writes out the collected data into a root file
std::string m_SpacePointTrackCandsStoreArrayName
sets the name of the expected StoreArray containing SpacePointTrackCands
bool m_MCStrictQualityEstimator
Required for MCInfo method, activates its strict version.
void initialize() override
Initializes the Module.
void event() override
applies the selected quality estimation method for a given set of TCs
float m_truth
truth information collected with m_estimatorMC type is float to be consistent with m_variableSet (and...
std::string m_EstimationMethod
Identifier which estimation method to use.
float m_nSpacePoints
number of SpacePoints in SPTC as additional info to be collected, type is float to be consistent with...
void terminate() override
write out data from m_recorder
std::unique_ptr< QEResultsExtractor > m_qeResultsExtractor
pointer to object that extracts the results from the estimation method (including QI,...
bool m_UseTimingInfo
whether to collect timing information
bool m_mva_target
Bool to indicate if mva target requiring complete agreement in SVD Clusters between MC and PR track t...
void beginRun() override
sets magnetic field strength
std::unique_ptr< ClusterInfoExtractor > m_clusterInfoExtractor
pointer to object that extracts info from the clusters of a SPTC
std::string m_MCRecoTracksStoreArrayName
sets the name of the expected StoreArray containing MCRecoTracks.
std::vector< Named< float * > > m_variableSet
set of named variables to be collected
bool m_MCInfo
whether to collect MC truth information
std::unique_ptr< QualityEstimatorBase > m_estimatorMC
QualityEstimatorMC as target for training.
std::unique_ptr< QualityEstimatorBase > m_estimator
pointer to the selected QualityEstimator
VXDQETrainingDataCollectorModule()
Constructor of the module.
std::string m_TrainingDataOutputName
name of the output rootfile
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
the storeArray for SpacePointTrackCands as member, is faster than recreating link for each event
std::string m_ClusterInformation
how to compile information from clusters ['Average']
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.
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Abstract base class for different kinds of events.