 |
Belle II Software
release-05-02-19
|
11 #include <tracking/modules/VXDTFHelperTools/SecMapTrainerBaseModule.h>
12 #include <tracking/trackFindingVXD/filterMap/map/FiltersContainer.h>
13 #include "framework/datastore/StoreObjPtr.h"
31 SecMapTrainerBaseModule::SecMapTrainerBaseModule() :
34 m_eventData(
"EventMetaData",
DataStore::c_Event)
36 InitializeVariables();
39 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.");
42 addParam(
"spTCarrayName", m_PARAMspTCarrayName,
43 "the name of the storeArray containing the SpacePointTrackCands used for the secMap-generation",
string(
""));
45 addParam(
"allowTraining", m_PARAMallowTraining,
46 "If true, training will be executed and filled into rootFiles, if not, only things like basf2 -m work but no training can be done",
50 if (m_PARAMallowTraining ==
false)
return;
57 B2INFO(
"~~~~~~~~~~~SecMapTrainerBaseModule - initialize ~~~~~~~~~~");
59 B2FATAL(
"you want to execute SecMapTrainerVXDTF but the parameter 'allowTraining' is false! Aborting...");
62 auto rngAppendix = []() ->
int {
return gRandom->Integer(std::numeric_limits<int>::max()); };
68 auto config =
setup.second->getConfig();
87 B2DEBUG(5,
"~~~~~~~~~~~SecMapTrainerBaseModule - experiment/run/event " << thisExperiment <<
"/" << thisRun <<
"/" << thisEvent <<
91 trainer.initializeEvent(thisExperiment, thisRun, thisEvent);
98 B2DEBUG(1,
"event " << thisEvent <<
": there is no SpacePointTrackCandidate!");
101 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
": size of array nSpacePointTrackCands: " << nSPTCs);
105 unsigned nAccepted = 0;
106 for (
unsigned iTC = 0; iTC not_eq nSPTCs; ++ iTC) {
108 B2DEBUG(10,
"current SPTC has got " << currentTC->
getNHits() <<
" hits stored");
111 B2DEBUG(10,
"current SPTC will now be checked with secMap " << trainer.getConfig().secMapName <<
" hits stored");
112 bool accepted = trainer.storeTC(*currentTC, iTC);
113 nAccepted += (accepted ? 1 : 0);
116 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
": number of TCs total/accepted: " << nSPTCs <<
"/" << nAccepted);
121 unsigned nTCsProcessed = trainer.processTracks();
123 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
" with mapTrainer " << trainer.getConfig().secMapName <<
124 ": number of TCs processed: " << nTCsProcessed <<
125 ", calculations done!");
135 B2DEBUG(1,
" SecMapTrainerBaseModule::terminate:: start.");
139 B2INFO(
" SecMapTrainerBaseModule, everything is done. Terminating.");
This class contains everything needed by the VXDTF that is not going to change during a RUN,...
void initialize() override
initialize.
void setDescription(const std::string &description)
Sets the description of the module.
void event() override
event.
std::vector< SecMapTrainer< SelectionVariableFactory< SecMapTrainerHit > > > m_secMapTrainers
contains the trainers for the secMaps to be trained.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ 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().
std::string m_PARAMspTCarrayName
Name of storeArray containing the spacePointTrackCands.
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
contains the spacePointTrackCands to be analyzed for the secMap-Training.
unsigned int getNHits() const
get the number of hits (space points) in the track candidate
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Abstract base class for different kinds of events.
StoreObjPtr< EventMetaData > m_eventData
Event Data for distinguishing events.
static FiltersContainer & getInstance()
one and only way to access the singleton object
const setupNameToFilters_t & getAllSetups(void)
returns all the available setups.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
bool m_PARAMallowTraining
If true, training will be executed and filled into rootFiles, if not, only things like basf2 -m work ...
This class contains all relevant tools for training a VXDTFFilters.
In the store you can park objects that have to be accessed by various modules.
int getEntries() const
Get the number of objects in the array.
Storage for (VXD) SpacePoint-based track candidates.
void terminate() override
terminate.