DAS  3.0
Das Analysis System
Variation

Description

Generic structure to hold the relevant information to identify the variation indices. This structure may be passed over to physics (simple or composite) objects to vary (or not) the kinematics or the weight respectively.

#include <Variation.h>

+ Inheritance diagram for Variation:

Public Member Functions

 ~Variation ()=default
 
 Variation (const TString &group, const TString &name, size_t index=0, int bit=0)
 
 Variation (const Variation &v)
 
 Variation (Variation &&v)
 
template<class T >
const T & getCorrection (const std::string_view &group, const std::vector< T > &corrections) const
 
template<class PhysicsObject >
const WeightgetWeight (const PhysicsObject &object) const
 
template<class PhysicsObject >
FourVector getCorrP4 (const PhysicsObject &object) const
 
template<class PhysicsObject >
const DAS::WeightgetWeight (const PhysicsObject &object) const
 

Public Attributes

const TString group
 
const TString name
 
const std::size_t index
 
const int bit
 

Constructor & Destructor Documentation

◆ ~Variation()

~Variation ( )
default

Destructor.

◆ Variation() [1/3]

Variation ( const TString &  group,
const TString &  name,
size_t  index = 0,
int  bit = 0 
)
inline

Normal constructor.

36  :
38  { }

◆ Variation() [2/3]

Variation ( const Variation v)
inline

Copy constructor.

42  :
43  group(v.group), name(v.name), index(v.index), bit(v.bit)
44  { }

◆ Variation() [3/3]

Variation ( Variation &&  v)
inline

Move constructor.

48  :
49  group(std::move(v.group)), name(std::move(v.name)),
50  index(std::move(v.index)), bit(std::move(v.bit))
51  { }

Member Function Documentation

◆ getCorrection()

const T & getCorrection ( const std::string_view &  group,
const std::vector< T > &  corrections 
) const
inline

Retrieves a correction from a vector. Returns the value at index 0 in the vector, unless this systematic variation modifies the correction, in which case the modified value is returned.

Parameters
groupAn identifier for the group of variations, used when retrieving active variations from the metainfo.
correctionsA vector of values from which to fetch corrections.
89 {
90  if (index >= corrections.size() || group != this->group)
91  return corrections.front();
92  return corrections.at(index);
93 }

◆ getCorrP4()

FourVector getCorrP4 ( const PhysicsObject object) const
inline

Retrieves the corrected four-momentum of an object in the current variation. This function uses the static variable ScaleVar in the object's class to determine which group it should use.

Warning
The class used to determine the group is determined at compile time from the type of the variable passed as argument.
Todo:
remove template once RecPhoton inherits from PhysicsObject
105 {
106  return group == PhysicsObject::ScaleVar ? object.CorrP4(index) : object.CorrP4(0);
107 }

◆ getWeight() [1/2]

const Weight& getWeight ( const PhysicsObject object) const

Retrieves the weight of an object in the current variation. This function uses the static variable WeightVar in the object's class to determine which group it should use.

Warning
The class used to determine the group is determined at compile time from the type of the variable passed as argument.

◆ getWeight() [2/2]

const DAS::Weight& getWeight ( const PhysicsObject object) const
inline
Todo:
remove template once RecPhoton inherits from PhysicsObject
98 {
99  return getCorrection(PhysicsObject::WeightVar, object.weights);
100 }

Member Data Documentation

◆ bit

const int bit

correlation bit

◆ group

const TString group

e.g. event, recjet

◆ index

const std::size_t index

index in the vector where the variation factor is stored

◆ name

const TString name

variation name (including "Up" or "Down")


The documentation for this struct was generated from the following file:
DAS::Uncertainties::Variation::name
const TString name
variation name (including "Up" or "Down")
Definition: Variation.h:25
DAS::Uncertainties::Variation::bit
const int bit
correlation bit
Definition: Variation.h:28
DAS::Uncertainties::Variation::getCorrection
const T & getCorrection(const std::string_view &group, const std::vector< T > &corrections) const
Definition: Variation.h:87
DAS::Uncertainties::Variation::group
const TString group
e.g. event, recjet
Definition: Variation.h:24
weights
DAS::Weights weights
Definition: classes.h:12
DAS::Uncertainties::Variation::index
const std::size_t index
index in the vector where the variation factor is stored
Definition: Variation.h:27