Belle II Software  release-05-02-19
TrackQETrainingDataCollectorModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jonas Wagner, Sebastian Racs *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 #include <tracking/trackFindingVXD/variableExtractors/SimpleVariableRecorder.h>
13 
14 #include <tracking/trackFitting/trackQualityEstimator/variableExtractors/EventInfoExtractor.h>
15 #include <tracking/trackFitting/trackQualityEstimator/variableExtractors/RecoTrackExtractor.h>
16 #include <tracking/trackFitting/trackQualityEstimator/variableExtractors/SubRecoTrackExtractor.h>
17 #include <tracking/trackFitting/trackQualityEstimator/variableExtractors/HitInfoExtractor.h>
18 
19 #include <framework/datastore/StoreArray.h>
20 #include <framework/core/Module.h>
21 
22 #include <memory>
23 
24 
25 namespace Belle2 {
34  class TrackQETrainingDataCollectorModule : public Module {
35 
36  public:
39 
41  void initialize() override;
42 
44  void beginRun() override;
45 
47  void event() override;
48 
50  void terminate() override;
51 
52 
53  protected:
54 
56  std::string m_recoTracksStoreArrayName = "RecoTracks";
58  std::string m_svdCDCRecoTracksStoreArrayName = "SVDCDCRecoTracks";
60  std::string m_svdPlusCDCStandaloneRecoTracksStoreArrayName = "SVDPlusCDCStandaloneRecoTracks";
62  std::string m_cdcRecoTracksStoreArrayName = "CDCRecoTracks";
64  std::string m_svdRecoTracksStoreArrayName = "SVDRecoTracks";
66  std::string m_pxdRecoTracksStoreArrayName = "PXDRecoTracks";
67 
69  std::string m_TrainingDataOutputName = "QETrainingOutput.root";
70 
72  bool m_collectEventFeatures = false;
73 
76 
78  std::unique_ptr<EventInfoExtractor> m_eventInfoExtractor;
80  std::unique_ptr<RecoTrackExtractor> m_recoTrackExtractor;
82  std::unique_ptr<SubRecoTrackExtractor> m_subRecoTrackExtractor;
84  std::unique_ptr<HitInfoExtractor> m_hitInfoExtractor;
85 
87  std::unique_ptr<SimpleVariableRecorder> m_recorder;
88 
90  std::vector<Named<float*>> m_variableSet;
91 
94  float m_truth = NAN;
95  };
97 }
Belle2::TrackQETrainingDataCollectorModule::m_cdcRecoTracksStoreArrayName
std::string m_cdcRecoTracksStoreArrayName
Name of the CDC StoreArray.
Definition: TrackQETrainingDataCollectorModule.h:70
Belle2::TrackQETrainingDataCollectorModule::m_truth
float m_truth
truth information collected with m_estimatorMC type is float to be consistend with m_variableSet (and...
Definition: TrackQETrainingDataCollectorModule.h:102
Belle2::TrackQETrainingDataCollectorModule::m_svdRecoTracksStoreArrayName
std::string m_svdRecoTracksStoreArrayName
Name of the SVD StoreArray.
Definition: TrackQETrainingDataCollectorModule.h:72
Belle2::TrackQETrainingDataCollectorModule::beginRun
void beginRun() override
sets magnetic field strength
Definition: TrackQETrainingDataCollectorModule.cc:80
Belle2::TrackQETrainingDataCollectorModule::m_collectEventFeatures
bool m_collectEventFeatures
Parameter to enable event-wise features.
Definition: TrackQETrainingDataCollectorModule.h:80
Belle2::TrackQETrainingDataCollectorModule::m_TrainingDataOutputName
std::string m_TrainingDataOutputName
name of the output rootfile
Definition: TrackQETrainingDataCollectorModule.h:77
Belle2::TrackQETrainingDataCollectorModule::m_subRecoTrackExtractor
std::unique_ptr< SubRecoTrackExtractor > m_subRecoTrackExtractor
pointer to object that extracts info from the related sub RecoTracks
Definition: TrackQETrainingDataCollectorModule.h:90
Belle2::TrackQETrainingDataCollectorModule::m_svdCDCRecoTracksStoreArrayName
std::string m_svdCDCRecoTracksStoreArrayName
Name of the SVD-CDC StoreArray.
Definition: TrackQETrainingDataCollectorModule.h:66
Belle2::TrackQETrainingDataCollectorModule::m_variableSet
std::vector< Named< float * > > m_variableSet
set of named variables to be collected
Definition: TrackQETrainingDataCollectorModule.h:98
Belle2::TrackQETrainingDataCollectorModule::m_hitInfoExtractor
std::unique_ptr< HitInfoExtractor > m_hitInfoExtractor
pointer to object that extracts info from the hits within the RecoTrack
Definition: TrackQETrainingDataCollectorModule.h:92
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackQETrainingDataCollectorModule::TrackQETrainingDataCollectorModule
TrackQETrainingDataCollectorModule()
Constructor of the module.
Definition: TrackQETrainingDataCollectorModule.cc:18
Belle2::TrackQETrainingDataCollectorModule::terminate
void terminate() override
write out data from m_recorder
Definition: TrackQETrainingDataCollectorModule.cc:127
Belle2::TrackQETrainingDataCollectorModule::event
void event() override
applies the selected quality estimation method for a given set of TCs
Definition: TrackQETrainingDataCollectorModule.cc:85
Belle2::TrackQETrainingDataCollectorModule::m_pxdRecoTracksStoreArrayName
std::string m_pxdRecoTracksStoreArrayName
Name of the PXD StoreArray.
Definition: TrackQETrainingDataCollectorModule.h:74
Belle2::TrackQETrainingDataCollectorModule::m_recoTracksStoreArrayName
std::string m_recoTracksStoreArrayName
Name of the recoTrack StoreArray.
Definition: TrackQETrainingDataCollectorModule.h:64
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TrackQETrainingDataCollectorModule::m_recoTracks
StoreArray< RecoTrack > m_recoTracks
Store Array of the recoTracks.
Definition: TrackQETrainingDataCollectorModule.h:83
Belle2::TrackQETrainingDataCollectorModule::m_svdPlusCDCStandaloneRecoTracksStoreArrayName
std::string m_svdPlusCDCStandaloneRecoTracksStoreArrayName
Name of the StoreArray of SVD tracks combined with CDC-tracks from standalone CDC tracking.
Definition: TrackQETrainingDataCollectorModule.h:68
Belle2::TrackQETrainingDataCollectorModule::m_eventInfoExtractor
std::unique_ptr< EventInfoExtractor > m_eventInfoExtractor
pointer to object that extracts info from the whole event
Definition: TrackQETrainingDataCollectorModule.h:86
Belle2::TrackQETrainingDataCollectorModule::m_recorder
std::unique_ptr< SimpleVariableRecorder > m_recorder
pointer to the object that writes out the collected data into a root file
Definition: TrackQETrainingDataCollectorModule.h:95
Belle2::TrackQETrainingDataCollectorModule::initialize
void initialize() override
Initializes the Module.
Definition: TrackQETrainingDataCollectorModule.cc:65
Belle2::TrackQETrainingDataCollectorModule::m_recoTrackExtractor
std::unique_ptr< RecoTrackExtractor > m_recoTrackExtractor
pointer to object that extracts info from the root RecoTrack
Definition: TrackQETrainingDataCollectorModule.h:88