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.");
25 setPropertyFlags(c_ParallelProcessingCertified | c_TerminateInAllProcesses);
27 addParam(
"EstimationMethod",
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",
39 m_SpacePointTrackCandsStoreArrayName,
40 "Name of StoreArray containing the SpacePointTrackCandidates to be estimated.",
41 m_SpacePointTrackCandsStoreArrayName);
43 addParam(
"MCRecoTracksStoreArrayName",
44 m_MCRecoTracksStoreArrayName,
45 "Name of StoreArray containing MCRecoTracks. Only required for MCInfo method",
46 m_MCRecoTracksStoreArrayName);
48 addParam(
"MCStrictQualityEstimator",
49 m_MCStrictQualityEstimator,
50 "Only required for MCInfo method. If false combining several MCTracks is allowed.",
51 m_MCStrictQualityEstimator);
53 addParam(
"mva_target",
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.",
61 addParam(
"TrainingDataOutputName",
62 m_TrainingDataOutputName,
63 "Name of the output rootfile.",
64 m_TrainingDataOutputName);
66 addParam(
"ClusterInformation",
68 "How to compile information from clusters ['Average']",
69 m_ClusterInformation);
71 addParam(
"UseTimingInfo",
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);
127 std::vector<SpacePoint const*>
const sortedHits = aTC.getSortedHits();
133 const double mc_quality =
m_estimatorMC->estimateQuality(sortedHits);
134 m_truth = float(mc_quality > 0);
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]
VXD Quality Estimator Data Collector Module to collect data for a MVA training using VXDQE_teacher....
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 consistend 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 consistend 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 mehtod (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
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']
#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.