PYTHIA  8.311
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
WeightsBase Class Reference

#include <Weights.h>

Inheritance diagram for WeightsBase:
WeightsFragmentation WeightsLHEF WeightsMerging WeightsShower VinciaWeights WeightsSimpleShower

Public Member Functions

virtual void init ()
 Initialize the weights.
 
virtual void init (bool)
 
virtual void clear ()
 Reset all internal values.
 
virtual void bookVectors (vector< double > weights, vector< string > names)
 
virtual void collectWeightValues (vector< double > &outputWeights, double norm=1.)
 WeightsBase class. More...
 
virtual void collectWeightNames (vector< string > &outputNames)
 Similar function to return processed weight names.
 
string getWeightsName (int iPos) const
 
virtual double getWeightsValue (int iPos) const
 
int getWeightsSize () const
 
void bookWeight (string name, double defaultValue=1.)
 Function to create a new, synchronized, pair of weight name and value. More...
 
void setValueByIndex (int iPos, double val)
 Functions to set values of weights.
 
void setValueByName (string name, double val)
 
virtual void reweightValueByIndex (int iPos, double val)
 Functions to reweight weight values, by index or by name.
 
virtual void reweightValueByName (string name, double val)
 
int findIndexOfName (string name)
 
void setPtrs (Info *infoPtrIn)
 Set the pointers.
 

Protected Member Functions

void parse (string wvecKey, map< string, map< string, double > > &dct)
 Parse a WVec of variations into a dictionary. More...
 

Protected Attributes

vector< double > weightValues
 Weight values and names.
 
vector< string > weightNames
 
InfoinfoPtr {}
 Pointers necessary for variation initialization.
 

Friends

class History
 Friends for internal protected members.
 
class PartonLevel
 

Detailed Description

This is a base class to store weight information in a way that allows unified access in the structure that contains all event generation weights information (WeightContainer below). The main purpuse of this class is to supply convenience features to make defining new categories of weights easy. All weights should inherit from this base class. The specialized classes may then contain specialized functions, or only act as a glorified book-keeping structure.

Member Function Documentation

virtual void bookVectors ( vector< double >  weights,
vector< string >  names 
)
inlinevirtual

Store the current event information (replace whitespace with underscore for HepMC).

Reimplemented in WeightsLHEF, and WeightsMerging.

void bookWeight ( string  name,
double  defaultValue = 1. 
)
inline

Function to create a new, synchronized, pair of weight name and value.

Check if name already exists.

void collectWeightValues ( vector< double > &  outputWeights,
double  norm = 1. 
)
virtual

WeightsBase class.

Function to return processed weights to weight container, e.g. if weights should be combined before proceeding.

Reimplemented in WeightsFragmentation, WeightsLHEF, WeightsMerging, and WeightsSimpleShower.

int findIndexOfName ( string  name)
inline

Function to find the index of a given entry in the weightNames vector, e.g., to be able to synchronize with the weightValues vector.

string getWeightsName ( int  iPos) const
inline

Get the stored information. Direcly use storage members here in the base class, and access those through non-virtual getters. Note: NOT opting for a map data structure, since information will anyway have to be serialized in output. Change weight names for compatibility with Rivet by replacing colons with full stops.

void parse ( string  wvecKey,
map< string, map< string, double > > &  dct 
)
protected

Parse a WVec of variations into a dictionary.

Parse a WVec of variations into a weight group map.

Skip blank lines and remove leading spaces.

Separate line by spaces, and read key/value pairs.

virtual void reweightValueByName ( string  name,
double  val 
)
inlinevirtual

Use existing functions: Find index of name, then set by index.

Reimplemented in WeightsMerging.


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