9#include <tracking/modules/VXDTFHelperTools/SecMapTrainerVXDTFModule.h>
30 m_eventData(
"EventMetaData",
DataStore::c_Event)
38 setDescription(
"this module analyzes a big number of events (pGun or evtGen) to create raw sectorMaps which are needed for the VXDTF. This information will be exported via root files.");
42 "the name of the storeArray containing the SpacePointTrackCands used for the secMap-generation", std::string(
""));
45 "If true, training will be executed and filled into rootFiles, if not, only things like basf2 -m work but no training can be done",
51 auto rngAppendix = []() ->
int {
return gRandom->Integer(std::numeric_limits<int>::max()); };
57 testData1.
pTmin = 0.02;
58 testData1.
pTmax = 3.5;
73 std::string setupName =
"testData1";
92 B2INFO(
"~~~~~~~~~~~SecMapTrainerVXDTFModule - initialize ~~~~~~~~~~");
94 B2FATAL(
"you want to execute SecMapTrainerVXDTF but the parameter 'allowTraining' is false! Aborting...");
114 B2DEBUG(5,
"~~~~~~~~~~~SecMapTrainerVXDTFModule - experiment/run/event " << thisExperiment <<
"/" << thisRun <<
"/" << thisEvent <<
118 trainer.initializeEvent(thisExperiment, thisRun, thisEvent);
126 B2DEBUG(1,
"event " << thisEvent <<
": there is no SpacePointTrackCandidate!");
129 B2DEBUG(5,
"SecMapTrainerVXDTFModule, event " << thisEvent <<
": size of array nSpacePointTrackCands: " << nSPTCs);
135 unsigned nAccepted = 0;
136 for (
unsigned iTC = 0; iTC not_eq nSPTCs; ++ iTC) {
138 B2DEBUG(10,
"currens SPTC has got " << currentTC->
getNHits() <<
" hits stored");
143 bool accepted = trainer.storeTC(*currentTC, iTC);
144 nAccepted += (accepted ? 1 : 0);
147 B2DEBUG(5,
"SecMapTrainerVXDTFModule, event " << thisEvent <<
": number of TCs total/accepted: " << nSPTCs <<
"/" << nAccepted);
152 unsigned nTCsProcessed = trainer.processTracks();
154 B2DEBUG(5,
"SecMapTrainerVXDTFModule, event " << thisEvent <<
" with mapTrainer " << trainer.getConfig().secMapName <<
155 ": number of TCs processed: " << nTCsProcessed <<
156 ", calculations done!");
170 B2DEBUG(1,
" SecMapTrainerVXDTFModule::terminate:: start.");
174 B2INFO(
" SecMapTrainerVXDTFModule, 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
void assignFilters(const std::string &setupName, VXDTFFilters< point_t > *filters)
assigns filters.
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.
std::string m_PARAMspTCarrayName
Name of storeArray containing the spacePointTrackCands.
SecMapTrainerVXDTFModule()
SecMapTrainerVXDTFModule constructor.
void InitializeVariables()
initialize variables to avoid nondeterministic behavior.
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 ...
std::vector< SecMapTrainer< XHitFilterFactory< SecMapTrainerHit > > > m_secMapTrainers
contains the trainers for the secMaps to be trained.
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
contains the spacePointTrackCands to be analyzed for the secMap-Training.
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.
Class that contains all the static sectors to which the filters are attached.
void setConfig(const SectorMapConfig &config)
set the configuration which is used to create this filter
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.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Abstract base class for different kinds of events.
simple struct containing all the configuration data needed for the SecMapTrainer.
double pTmin
stores pTCuts for min pT allowed for this .
std::vector< double > vSectorDivider
Defines the sectors boundaries in normalized v coordinates (i.e.
double pTSmear
allows smearing of the cuts.
std::vector< int > pdgCodesAllowed
Stores all the pdgCodes which are allowed to be used by the SecMap.
double mField
Magnetic field value to be set for the filters.
double seedMaxDist2IPXY
Stores a cut for maximum distance of the seed in xy of the given virtual IP.
std::pair< double, double > quantiles
the quantiles to be chosen in the end for determining the cuts first is quantile, second is 1-quantil...
std::vector< double > uSectorDivider
Defines the sectors boundaries in normalized u coordinates (i.e.
double rarenessThreshold
defined 1 == 100%, if relative frequency of sec-combi to the outer-sector is less than threshold,...
std::string secMapName
Sets the human readable proto-name of the sectorMap.
B2Vector3D vIP
Stores the position of the assumed position of the interaction point - The virtual IP.
double seedMaxDist2IPZ
Stores a cut for maximum distance of the seed in z of the given virtual IP.
double pTmax
stores pTCuts for min (.first) and max (.second) ptCut.
unsigned nHitsMin
Stores the minimal number of hits a TC must have to be accepted as TC (vIP-Hits are ignored).
std::vector< int > allowedLayers
stores allowed layers to be used (including virtual IP with layer 0).