9#include <reconstruction/modules/KlId/ECLExpert/ECLExpertModule.h>
10#include <mdst/dataobjects/KlId.h>
11#include <framework/datastore/StoreArray.h>
12#include <framework/logging/Logger.h>
14#include <mdst/dataobjects/ECLCluster.h>
15#include <tracking/dataobjects/TrackClusterSeparation.h>
17#include <mva/interface/Interface.h>
18#include <boost/algorithm/string/predicate.hpp>
21#include "reconstruction/modules/KlId/KLMExpert/KlId.h"
24using namespace KlongId;
34 "path to the classifier you want to use. It is recommended to use the default classifiers and not to mess around with this.",
69 std::stringstream ss((*m_weightfile_representation)->m_data);
87 m_expert = supported_interfaces[general_options.m_method]->getExpert();
90 std::vector<float> dummy;
92 m_dataset = std::make_unique<MVA::SingleDataset>(general_options, dummy, 0);
103 KlId* klid =
nullptr;
108 if (!cluster.hasHypothesis(eclHypothesis)) {
continue;}
114 m_ECLZ40 = cluster.getAbsZernike40();
115 m_ECLZ51 = cluster.getAbsZernike51();
162 B2DEBUG(175,
"ECL Expert classification: " << IDMVAOut);
164 cluster.addRelationTo(klid, IDMVAOut);
EHypothesisBit
The hypothesis bits for this ECLCluster (Connected region (CR) is split using this hypothesis.
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
Double32_t m_ECLtheta
Theta [rad].
StoreArray< KlId > m_klids
storearray
Double32_t m_ECLtime
Time.
Double32_t m_ECLphi
Phi [rad].
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
ECLExpertModule()
Constructor.
virtual void initialize() override
init
Double32_t m_ECLE1oE9
E1oE9.
Double32_t m_ECLminTrkDistance
Distance between cluster center and track extrapolation to ECL.
virtual void event() override
process event
Double32_t m_ECLEnergy
Energy [GeV].
Double32_t m_ECLlogEnergyHighestCrystal
Log.
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA Expert.
Double32_t m_ECLE9oE21
E9oE21.
virtual ~ECLExpertModule()
Destructor.
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the Database representation of the weightfile.
Double32_t m_ECLdeltaTime99
Delta Time 99.
std::vector< float > m_feature_variables
vars to be classified
virtual void beginRun() override
begin run
Double32_t m_ECLZMVA
output of a BDT fitted on various Z-moments for the closest ECL cluster
Double32_t m_ECLnumberOfCrystals
Number of Crystals in a shower (sum of weights).
Double32_t m_ECLZ40
Zernike 40.
StoreArray< ECLCluster > m_eclClusters
storearray
Double32_t m_ECLr
Radius [cm].
Double32_t m_ECLPulseShapeDiscriminationMVA
MVA classifier that uses pulse shape discrimination to identify electromagnetic vs hadronic showers.
Double32_t m_ECLNumberOfHadronDigits
Number of hadron digits in cluster (pulse shape discrimination variable).
Double32_t m_ECLlogEnergy
Log.
Double32_t m_ECLsecondMoment
Second Moment.
Double32_t m_ECLDeltaL
DeltaL
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called every time the weightfile in the database changes ...
Double32_t m_ECLZ51
Zernike 51.
std::string m_identifier
mva identifier.
Klong identifcation (KlId) datastore object to store results from KlId calculations.
static void initSupportedInterfaces()
Static function which initliazes all supported interfaces, has to be called once before getSupportedI...
static std::map< std::string, AbstractInterface * > getSupportedInterfaces()
Returns interfaces supported by the MVA Interface.
General options which are shared by all MVA trainings.
The Weightfile class serializes all information about a training into an xml tree.
static Weightfile loadFromStream(std::istream &stream)
Static function which deserializes a Weightfile from a stream.
void getOptions(Options &options) const
Fills an Option object from the xml tree.
static Weightfile loadFromFile(const std::string &filename)
Static function which loads a Weightfile from a file.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
const std::string & getName() const
Returns the name of the module.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
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.
Abstract base class for different kinds of events.