9 #include <tracking/modules/VXDTFHelperTools/SecMapTrainerBaseModule.h>
10 #include <tracking/trackFindingVXD/filterMap/map/FiltersContainer.h>
11 #include "framework/datastore/StoreObjPtr.h"
29 SecMapTrainerBaseModule::SecMapTrainerBaseModule() :
32 m_eventData(
"EventMetaData",
DataStore::c_Event)
34 InitializeVariables();
37 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.");
38 setPropertyFlags(c_ParallelProcessingCertified | c_TerminateInAllProcesses);
40 addParam(
"spTCarrayName", m_PARAMspTCarrayName,
41 "the name of the storeArray containing the SpacePointTrackCands used for the secMap-generation",
string(
""));
43 addParam(
"allowTraining", m_PARAMallowTraining,
44 "If true, training will be executed and filled into rootFiles, if not, only things like basf2 -m work but no training can be done",
48 if (m_PARAMallowTraining ==
false)
return;
53 void SecMapTrainerBaseModule::initialize()
55 B2INFO(
"~~~~~~~~~~~SecMapTrainerBaseModule - initialize ~~~~~~~~~~");
57 B2FATAL(
"you want to execute SecMapTrainerVXDTF but the parameter 'allowTraining' is false! Aborting...");
60 auto rngAppendix = []() ->
int {
return gRandom->Integer(std::numeric_limits<int>::max()); };
66 auto config = setup.second->getConfig();
85 B2DEBUG(5,
"~~~~~~~~~~~SecMapTrainerBaseModule - experiment/run/event " << thisExperiment <<
"/" << thisRun <<
"/" << thisEvent <<
89 trainer.initializeEvent(thisExperiment, thisRun, thisEvent);
96 B2DEBUG(1,
"event " << thisEvent <<
": there is no SpacePointTrackCandidate!");
99 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
": size of array nSpacePointTrackCands: " << nSPTCs);
103 unsigned nAccepted = 0;
104 for (
unsigned iTC = 0; iTC not_eq nSPTCs; ++ iTC) {
106 B2DEBUG(10,
"current SPTC has got " << currentTC->
getNHits() <<
" hits stored");
109 B2DEBUG(10,
"current SPTC will now be checked with secMap " << trainer.getConfig().secMapName <<
" hits stored");
110 bool accepted = trainer.storeTC(*currentTC, iTC);
111 nAccepted += (accepted ? 1 : 0);
114 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
": number of TCs total/accepted: " << nSPTCs <<
"/" << nAccepted);
119 unsigned nTCsProcessed = trainer.processTracks();
121 B2DEBUG(5,
"SecMapTrainerBaseModule, event " << thisEvent <<
" with mapTrainer " << trainer.getConfig().secMapName <<
122 ": number of TCs processed: " << nTCsProcessed <<
123 ", calculations done!");
133 B2DEBUG(1,
" SecMapTrainerBaseModule::terminate:: start.");
137 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 event() override
event.
void terminate() override
terminate.
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 ...
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
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
int getEntries() const
Get the number of objects in the array.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.