 |
Belle II Software
release-05-01-25
|
11 #include <tracking/modules/VXDTFHelperTools/SecMapTrainerVXDTFModule.h>
30 SecMapTrainerVXDTFModule::SecMapTrainerVXDTFModule() :
33 m_eventData(
"EventMetaData",
DataStore::c_Event)
41 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.");
45 "the name of the storeArray containing the SpacePointTrackCands used for the secMap-generation",
string(
""));
48 "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 auto rngAppendix = []() ->
int {
return gRandom->Integer(std::numeric_limits<int>::max()); };
60 testData1.
pTmin = 0.02;
61 testData1.
pTmax = 3.5;
76 std::string setupName =
"testData1";
95 B2INFO(
"~~~~~~~~~~~SecMapTrainerVXDTFModule - initialize ~~~~~~~~~~");
97 B2FATAL(
"you want to execute SecMapTrainerVXDTF but the parameter 'allowTraining' is false! Aborting...");
100 trainer.initialize();
117 B2DEBUG(5,
"~~~~~~~~~~~SecMapTrainerVXDTFModule - experiment/run/event " << thisExperiment <<
"/" << thisRun <<
"/" << thisEvent <<
121 trainer.initializeEvent(thisExperiment, thisRun, thisEvent);
129 B2DEBUG(1,
"event " << thisEvent <<
": there is no SpacePointTrackCandidate!");
132 B2DEBUG(5,
"SecMapTrainerVXDTFModule, event " << thisEvent <<
": size of array nSpacePointTrackCands: " << nSPTCs);
138 unsigned nAccepted = 0;
139 for (
unsigned iTC = 0; iTC not_eq nSPTCs; ++ iTC) {
141 B2DEBUG(10,
"currens SPTC has got " << currentTC->
getNHits() <<
" hits stored");
146 bool accepted = trainer.storeTC(*currentTC, iTC);
147 nAccepted += (accepted ? 1 : 0);
150 B2DEBUG(5,
"SecMapTrainerVXDTFModule, event " << thisEvent <<
": number of TCs total/accepted: " << nSPTCs <<
"/" << nAccepted);
155 unsigned nTCsProcessed = trainer.processTracks();
157 B2DEBUG(5,
"SecMapTrainerVXDTFModule, event " << thisEvent <<
" with mapTrainer " << trainer.getConfig().secMapName <<
158 ": number of TCs processed: " << nTCsProcessed <<
159 ", calculations done!");
173 B2DEBUG(1,
" SecMapTrainerVXDTFModule::terminate:: start.");
177 B2INFO(
" SecMapTrainerVXDTFModule, everything is done. Terminating.");
void initialize() override
initialize.
std::vector< int > allowedLayers
stores allowed layers to be used (including virtual IP with layer 0).
void event() override
event.
std::pair< double, double > quantiles
the quantiles to be chosen in the end for determining the cuts first is quantile, second is 1-quantil...
double seedMaxDist2IPXY
Stores a cut for maximum distance of the seed in xy of the given virtual IP.
This class contains everything needed by the VXDTF that is not going to change during a RUN,...
void setDescription(const std::string &description)
Sets the description of the module.
Class that contains all the static sectors to which the filters are attached.
bool m_PARAMallowTraining
If true, training will be executed and filled into rootFiles, if not, only things like basf2 -m work ...
std::vector< SecMapTrainer< SelectionVariableFactory< SecMapTrainerHit > > > m_secMapTrainers
contains the trainers for the secMaps to be trained.
void terminate() override
terminate.
#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...
std::vector< SecMapTrainer< XHitFilterFactory< SecMapTrainerHit > > > m_secMapTrainers
contains the trainers for the secMaps to be trained.
@ 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.
StoreObjPtr< EventMetaData > m_eventData
Event Data for distinguishing events.
void InitializeVariables()
initialize variables to avoid nondeterministic behavior.
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.
double seedMaxDist2IPZ
Stores a cut for maximum distance of the seed in z of the given virtual IP.
B2Vector3< double > B2Vector3D
typedef for common usage with double
std::string m_PARAMspTCarrayName
Name of storeArray containing the spacePointTrackCands.
Abstract base class for different kinds of events.
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.
double pTmax
stores pTCuts for min (.first) and max (.second) ptCut.
void assignFilters(const std::string &setupName, VXDTFFilters< point_t > *filters)
assigns filters.
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
contains the spacePointTrackCands to be analyzed for the secMap-Training.
void setConfig(const SectorMapConfig &config)
set the configuration which is used to create this filter
unsigned nHitsMin
Stores the minimal number of hits a TC must have to be accepted as TC (vIP-Hits are ignored).
double rarenessThreshold
defined 1 == 100%, if relative frequency of sec-combi to the outer-sector is less than threshold,...
static FiltersContainer & getInstance()
one and only way to access the singleton object
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
simple struct containing all the configuration data needed for the SecMapTrainer.
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.
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.
double mField
Magnetic field value to be set for the filters.
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.
std::vector< int > pdgCodesAllowed
Stores all the pdgCodes which are allowed to be used by the SecMap.
Storage for (VXD) SpacePoint-based track candidates.
std::vector< double > uSectorDivider
Defines the sectors boundaries in normalized u coordinates (i.e.