9 #include <tracking/trackFindingVXD/filterMap/map/FiltersContainer.h>
10 #include <tracking/trackFindingVXD/sectorMapTools/SecMapTrainer.h>
12 #include <tracking/modules/vxdtfRedesign/VXDTFTrainingDataCollectorModule.h>
14 #include <framework/logging/Logger.h>
15 #include <framework/datastore/StoreObjPtr.h>
34 setDescription(
"This module collect the data needed to train the VXDTF sector map. The data are saved on a root file that eventually will be chained and used by the training module.");
35 setPropertyFlags(c_ParallelProcessingCertified |
36 c_TerminateInAllProcesses);
38 addParam(
"SpacePointTrackCandsName", m_PARAMSpacePointTrackCandsName,
39 "the name of the storeArray containing the SpacePointTrackCands used for extracting and collecting the training data.",
string(
""));
41 addParam(
"NameTag", m_PARAMNameTag,
"A name tag that will be attached to the name of the output file. If left empty (\"\") a "
42 "random number will be attached!", std::string(
""));
49 void VXDTFTrainingDataCollectorModule::initialize()
54 m_spacePointTrackCands.isRequired(m_PARAMSpacePointTrackCandsName);
57 auto config = setup.second->getConfig();
59 std::string nameAppendix = m_PARAMNameTag;
61 if (nameAppendix == std::string(
"")) {
62 int randomInt = gRandom->Integer(std::numeric_limits<int>::max());
63 nameAppendix = std::to_string(randomInt);
67 newMap(setup.first, nameAppendix);
69 m_secMapTrainers.push_back(std::move(newMap));
73 for (
auto& trainer : m_secMapTrainers) {
82 void VXDTFTrainingDataCollectorModule::event()
85 int thisExperiment = m_eventData->getExperiment();
86 int thisRun = m_eventData->getRun();
87 int thisEvent = m_eventData->getEvent();
89 for (
auto& collector : m_secMapTrainers)
90 collector.initializeEvent(thisExperiment, thisRun, thisEvent);
94 unsigned nSPTCs = m_spacePointTrackCands.getEntries();
99 for (
unsigned iTC = 0; iTC < nSPTCs; ++ iTC) {
101 for (
auto& dataCollector : m_secMapTrainers)
102 dataCollector.storeTC(*currentTC, iTC);
106 for (
auto& dataCollector : m_secMapTrainers) {
107 unsigned nTCsProcessed = dataCollector.processTracks();
110 "VXDTFTrainingDataCollectorModule, event " << thisEvent <<
111 " with mapTrainer " << dataCollector.getConfig().secMapName <<
112 ": number of TCs processed: " << nTCsProcessed <<
113 ", calculations done!");
120 void VXDTFTrainingDataCollectorModule::terminate()
122 for (
auto& dataCollector : m_secMapTrainers)
123 dataCollector.terminate();
In the store you can park objects that have to be accessed by various modules.
This class contains everything needed by the VXDTF that is not going to change during a RUN,...
static FiltersContainer & getInstance()
one and only way to access the singleton object
const setupNameToFilters_t & getAllSetups(void)
returns all the available setups.
This class contains all relevant tools for training a VXDTFFilters.
Storage for (VXD) SpacePoint-based track candidates.
The VXDTFTrainingDataCollectorModule.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.