 |
Belle II Software
release-05-02-19
|
12 #include <reconstruction/modules/KlId/KLMExpert/KLMExpertModule.h>
13 #include <mdst/dataobjects/KlId.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/logging/Logger.h>
17 #include <mdst/dataobjects/ECLCluster.h>
18 #include <tracking/dataobjects/TrackClusterSeparation.h>
20 #include <mva/interface/Interface.h>
21 #include <boost/algorithm/string/predicate.hpp>
24 #include "reconstruction/modules/KlId/KLMExpert/KlId.h"
32 KLMExpertModule::KLMExpertModule():
Module(), m_feature_variables(18, 0)
36 "path to the classifier you want to use. It is recommended to use the default classifiers and not to mess around with this.",
73 std::stringstream ss((*m_weightfile_representation)->m_data);
91 m_expert = supported_interfaces[general_options.m_method]->getExpert();
94 std::vector<float> dummy;
107 KlId* klid =
nullptr;
112 const TVector3& clusterPos = cluster.getClusterPosition();
125 ECLCluster* closestECLCluster = get<0>(closestECLAndDist);
129 if (!(closestECLCluster ==
nullptr)) {
130 m_KLMECLE = closestECLCluster -> getEnergy(eclHypothesis);
138 m_KLMECLZ40 = closestECLCluster -> getAbsZernike40();
139 m_KLMECLZ51 = closestECLCluster -> getAbsZernike51();
165 float best_dist = 1e10;
166 for (
auto trackSeperation : trackSeperations) {
168 if (dist < best_dist) {
205 B2DEBUG(175,
"KLM Expert classification: " << IDMVAOut);
207 cluster.addRelationTo(klid, IDMVAOut);
float m_KLMECLTiming
timing of associated ECL cluster
virtual void beginRun() override
beginn run
float m_KLMInitialTrackSepAngle
angular distance from track to cluster at track starting point
float m_KLMnextCluster
distance to next KLM cluster
static std::map< std::string, AbstractInterface * > getSupportedInterfaces()
Returns interfaces supported by the MVA Interface.
void setDescription(const std::string &description)
Sets the description of the module.
void getOptions(Options &options) const
Fills an Option object from the xml tree.
float m_KLMECLE
energy measured in associated ECL cluster
Helper functions for all klid modules to improve readability of the code.
#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< float > m_feature_variables
vars to be classified
float m_KLMtime
timing of KLM Cluster
EHypothesisBit
The hypothesis bits for this ECLCluster (Connected region (CR) is split using this hypothesis.
The Weightfile class serializes all information about a training into an xml tree.
float m_KLMECLminTrackDist
track distance between associated ECL cluster and track extrapolated into ECL
virtual void event() override
process event
float m_KLMTrackSepDist
distance from track separation object
float m_KLMavInterClusterDist
average distance between all KLM clusters
float m_KLMECLTerror
uncertanty on time in associated ECL cluster
float m_KLMnLayer
number of layers hit in KLM cluster
virtual void initialize() override
init
float m_KLMhitDepth
hit depth in KLM, distance to IP
float m_KLMTrackSepAngle
angular distance from track separation object.
std::pair< Belle2::ECLCluster *, double > findClosestECLCluster(const TVector3 &klmClusterPosition, const Belle2::ECLCluster::EHypothesisBit eclhypothesis=Belle2::ECLCluster::EHypothesisBit::c_neutralHadron)
Find the closest ECLCluster with a neutral hadron hypothesis, and return it with its distance.
Class for accessing objects in the database.
float m_KLMECLdeltaL
distance between track entry pofloat and cluster center, might be removed
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
virtual ~KLMExpertModule()
Destructor.
float m_KLMECLZ51
zernike moment 5,1 of closest ECL
float m_KLMECLEerror
uncertanty on E in associated ECL cluster
float m_KLMnInnermostLayer
number of innermost layers hit
float m_KLMECLZMVA
output of a BDT fitted on various Z-moments for the closest ECL cluster
Abstract base class for different kinds of events.
float m_KLMTrackClusterSepAngle
angle between trach momentum and cluster (measured from ip)
static Weightfile loadFromFile(const std::string &filename)
Static function which loads a Weightfile from a file.
float m_KLMTrackRotationAngle
angle between track at poca and trackbeginning
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the Database representation of the weightfile.
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
General options which are shared by all MVA trainings.
float m_KLMECLDist
distance associated ECL <-> KLM cluster, extrapolated by genfit
StoreArray< KlId > m_klids
storearray
float m_KLMglobalZ
global Z position in KLM
static void initSupportedInterfaces()
Static function which initliazes all supported interfaces, has to be called once before getSupportedI...
Wraps the data of a single event into a Dataset.
StoreArray< KLMCluster > m_klmClusters
storearray
float m_KLMECLZ40
zernike moment 4,0 of closest ECL
double getDistance() const
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
std::tuple< const Belle2::KLMCluster *, double, double > findClosestKLMCluster(const TVector3 &klmClusterPosition)
find nearest KLMCluster, tis distance and the av intercluster distance
static Weightfile loadFromStream(std::istream &stream)
Static function which deserializes a Weightfile from a stream.
float m_KLMenergy
Energy deposit in KLM (0.2 GeV * nHitCells)
float m_KLMnCluster
varibales to write out.
std::string m_identifier
mva identifier.
float m_KLMECLE9oE25
E in surrounding 9 crystals divided by surrounding 25 crydtalls.
Store one Track-KLMCluster separation as a ROOT object.
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA Expert.
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called everytime the weightfile in the database changes i...
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.