9#include <tracking/modules/VXDTFHelperTools/SecMapTrainerBaseModule.h>
10#include <tracking/trackFindingVXD/filterMap/map/FiltersContainer.h>
11#include "framework/datastore/StoreObjPtr.h"
36 setDescription(
"this module analyzes a big number of events (pGun or evtGen) to create raw sectorMaps which are needed for the VXDTF 2.0. This information will be exported via root files.");
40 "the name of the storeArray containing the SpacePointTrackCands used for the secMap-generation", std::string(
""));
43 "If true, training will be executed and filled into rootFiles, if not, only things like basf2 -m work but no training can be done",
54 B2INFO(
"~~~~~~~~~~~SecMapTrainerBaseModule - initialize ~~~~~~~~~~");
56 B2FATAL(
"you want to execute SecMapTrainerVXDTF but the parameter 'allowTraining' is false! Aborting...");
59 auto rngAppendix = []() ->
int {
return gRandom->Integer(std::numeric_limits<int>::max()); };
65 auto config = setup.second->getConfig();
84 B2DEBUG(5,
"~~~~~~~~~~~SecMapTrainerBaseModule - experiment/run/event " << thisExperiment <<
"/" << thisRun <<
"/" << thisEvent <<
88 trainer.initializeEvent(thisExperiment, thisRun, thisEvent);
95 B2DEBUG(1,
"event " << thisEvent <<
": there is no SpacePointTrackCandidate!");
98 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
": size of array nSpacePointTrackCands: " << nSPTCs);
102 unsigned nAccepted = 0;
103 for (
unsigned iTC = 0; iTC not_eq nSPTCs; ++ iTC) {
105 B2DEBUG(10,
"current SPTC has got " << currentTC->
getNHits() <<
" hits stored");
108 B2DEBUG(10,
"current SPTC will now be checked with secMap " << trainer.getConfig().secMapName <<
" hits stored");
109 bool accepted = trainer.storeTC(*currentTC, iTC);
110 nAccepted += (accepted ? 1 : 0);
113 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
": number of TCs total/accepted: " << nSPTCs <<
"/" << nAccepted);
118 unsigned nTCsProcessed = trainer.processTracks();
120 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
" with mapTrainer " << trainer.getConfig().secMapName <<
121 ": number of TCs processed: " << nTCsProcessed <<
122 ", calculations done!");
132 B2DEBUG(1,
" SecMapTrainerBaseModule::terminate:: start.");
136 B2INFO(
" SecMapTrainerBaseModule, everything is done. Terminating.");
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.
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().
void initialize() override
initialize.
void event() override
event.
void terminate() override
terminate.
static void InitializeVariables()
initialize variables to avoid nondeterministic behavior.
std::string m_PARAMspTCarrayName
Name of storeArray containing the spacePointTrackCands.
StoreObjPtr< EventMetaData > m_eventData
Event Data for distinguishing events.
bool m_PARAMallowTraining
If true, training will be executed and filled into rootFiles, if not, only things like basf2 -m work ...
SecMapTrainerBaseModule()
SecMapTrainerVXDTFModule constructor.
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
contains the spacePointTrackCands to be analyzed for the secMap-Training.
std::vector< SecMapTrainer< SelectionVariableFactory< SecMapTrainerHit > > > m_secMapTrainers
contains the trainers for the secMaps to be trained.
This class contains all relevant tools for training a VXDTFFilters.
Storage for (VXD) SpacePoint-based track candidates.
unsigned int getNHits() const
get the number of hits (space points) in the track candidate
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.
Abstract base class for different kinds of events.