Belle II Software  release-08-01-10
ReweightingDataset Class Reference

Dataset for Reweighting Wraps a dataset and provides each data-point with a new weight. More...

#include <DataDriven.h>

Inheritance diagram for ReweightingDataset:
Collaboration diagram for ReweightingDataset:

Public Member Functions

 ReweightingDataset (const GeneralOptions &general_options, Dataset &dataset, const std::vector< float > &weights)
 Constructs a new ReweightingDataset. More...
 
virtual unsigned int getNumberOfFeatures () const override
 Returns the number of features in this dataset.
 
virtual unsigned int getNumberOfSpectators () const override
 Returns the number of features in this dataset.
 
virtual unsigned int getNumberOfEvents () const override
 Returns the number of events in this dataset.
 
virtual std::vector< float > getFeature (unsigned int iFeature) override
 Returns all values of one feature in a std::vector<float> More...
 
virtual std::vector< float > getSpectator (unsigned int iSpectator) override
 Returns all values of one spectator in a std::vector<float> More...
 
virtual std::vector< float > getWeights () override
 Returns all weights.
 
virtual std::vector< float > getTargets () override
 Returns all targets.
 
virtual std::vector< bool > getSignals () override
 Returns all is Signals.
 
virtual void loadEvent (unsigned int event) override
 Load the event number iEvent. More...
 
virtual float getSignalFraction ()
 Returns the signal fraction of the whole sample.
 
virtual unsigned int getFeatureIndex (const std::string &feature)
 Return index of feature with the given name. More...
 
virtual unsigned int getSpectatorIndex (const std::string &spectator)
 Return index of spectator with the given name. More...
 

Public Attributes

GeneralOptions m_general_options
 GeneralOptions passed to this dataset.
 
std::vector< float > m_input
 Contains all feature values of the currently loaded event.
 
std::vector< float > m_spectators
 Contains all spectators values of the currently loaded event.
 
float m_weight
 Contains the weight of the currently loaded event.
 
float m_target
 Contains the target value of the currently loaded event.
 
bool m_isSignal
 Defines if the currently loaded event is signal or background.
 

Private Attributes

Datasetm_dataset
 Wrapped dataset.
 
std::vector< float > m_weights
 sPlot weights
 

Detailed Description

Dataset for Reweighting Wraps a dataset and provides each data-point with a new weight.

Definition at line 29 of file DataDriven.h.

Constructor & Destructor Documentation

◆ ReweightingDataset()

ReweightingDataset ( const GeneralOptions general_options,
Dataset dataset,
const std::vector< float > &  weights 
)

Constructs a new ReweightingDataset.

Parameters
general_optionsshared options defining the dataset (variables, ...)
datasetcontaining the data-points
weightsreweighting weights

Definition at line 25 of file DataDriven.cc.

26  : Dataset(general_options), m_dataset(dataset), m_weights(weights) { }
Dataset(const GeneralOptions &general_options)
Constructs a new dataset given the general options.
Definition: Dataset.cc:26
std::vector< float > m_weights
sPlot weights
Definition: DataDriven.h:97
Dataset & m_dataset
Wrapped dataset.
Definition: DataDriven.h:96

Member Function Documentation

◆ getFeature()

virtual std::vector<float> getFeature ( unsigned int  iFeature)
inlineoverridevirtual

Returns all values of one feature in a std::vector<float>

Parameters
iFeaturethe position of the feature to return

Reimplemented from Dataset.

Definition at line 59 of file DataDriven.h.

59 { return m_dataset.getFeature(iFeature); }
virtual std::vector< float > getFeature(unsigned int iFeature)
Returns all values of one feature in a std::vector<float>
Definition: Dataset.cc:74

◆ getFeatureIndex()

unsigned int getFeatureIndex ( const std::string &  feature)
virtualinherited

Return index of feature with the given name.

Parameters
featurename of the feature

Definition at line 50 of file Dataset.cc.

◆ getSpectator()

virtual std::vector<float> getSpectator ( unsigned int  iSpectator)
inlineoverridevirtual

Returns all values of one spectator in a std::vector<float>

Parameters
iSpectatorthe position of the feature to return

Reimplemented from Dataset.

Definition at line 65 of file DataDriven.h.

◆ getSpectatorIndex()

unsigned int getSpectatorIndex ( const std::string &  spectator)
virtualinherited

Return index of spectator with the given name.

Parameters
spectatorname of the spectator

Definition at line 62 of file Dataset.cc.

◆ loadEvent()

void loadEvent ( unsigned int  event)
overridevirtual

Load the event number iEvent.

Parameters
eventevent number to load

Implements Dataset.

Definition at line 28 of file DataDriven.cc.


The documentation for this class was generated from the following files: