Class to manage modifications to a GTouchable using defined modifier weights.
More...
#include <gdynamicdigitization.h>
|
| | GTouchableModifiers (const std::vector< std::string > &touchableNames) |
| | Constructs GTouchableModifiers with a list of touchable names.
|
| |
| void | insertIdAndWeight (const std::string &touchableName, int idValue, double weight) |
| | Inserts a new (id, weight) pair for given touchable.
|
| |
| void | insertIdWeightAndTime (const std::string &touchableName, int idValue, double weight, double time) |
| | Inserts a new (id, weight, time) triplet for given touchable.
|
| |
| void | assignOverallWeight (const std::string &touchableName, double totalWeight) |
| | Normalizes the modifier weights using a total weight.
|
| |
| bool | isWeightsOnly () const |
| | Checks whether only weight modifiers (without time) are defined.
|
| |
| std::vector< double > | getModifierWeightsVector (const std::string &touchableName) |
| | Gets the modifier weights vector for a given touchable.
|
| |
| std::vector< double > | getModifierWeightsAndTimeVector (const std::string &touchableName) |
| | Gets the modifier weights and time vector for a given touchable.
|
| |
Definition at line 27 of file gdynamicdigitization.h.
◆ GTouchableModifiers()
| GTouchableModifiers::GTouchableModifiers |
( |
const std::vector< std::string > & | touchableNames | ) |
|
|
explicit |
Constructs a GTouchableModifiers object.
Initializes internal maps (modifierWeightsMap) for each provided touchable name.
- Parameters
-
| touchableNames | A vector of touchable names. |
For each touchable name provided, an empty vector is initialized in the modifierWeightsMap.
- Parameters
-
| touchableNames | A vector of touchable names. |
Definition at line 104 of file gdynamicdigitization.cc.
◆ assignOverallWeight()
| void GTouchableModifiers::assignOverallWeight |
( |
const std::string & | tname, |
|
|
double | totalWeight ) |
Normalizes modifier weights using the provided total weight.
For the weights-only map, each weight is divided by totalWeight. For the weights-and-times map, the weight (second element of each triplet) is normalized.
- Parameters
-
| touchableName | The name of the touchable. |
| totalWeight | The total weight used for normalization. |
For modifierWeightsMap, it divides each weight (second element in each pair) by totalWeight. For modifierWeightsAndTimesMap, it divides each weight (second element in each triplet) by totalWeight.
- Parameters
-
| tname | The touchable name. |
| totalWeight | The total weight to use for normalization. |
Definition at line 142 of file gdynamicdigitization.cc.
◆ getModifierWeightsAndTimeVector()
| std::vector< double > GTouchableModifiers::getModifierWeightsAndTimeVector |
( |
const std::string & | touchableName | ) |
|
|
inline |
- Parameters
-
| touchableName | The touchable name. |
- Returns
- The vector of weights and times.
- Note
- This function will crash if the key is not declared.
Definition at line 100 of file gdynamicdigitization.h.
◆ getModifierWeightsVector()
| std::vector< double > GTouchableModifiers::getModifierWeightsVector |
( |
const std::string & | touchableName | ) |
|
|
inline |
- Parameters
-
| touchableName | The touchable name. |
- Returns
- The vector of weights.
- Note
- This function will crash if the key is not declared.
Definition at line 91 of file gdynamicdigitization.h.
◆ insertIdAndWeight()
| void GTouchableModifiers::insertIdAndWeight |
( |
const std::string & | touchableName, |
|
|
int | idValue, |
|
|
double | weight ) |
Inserts an (id, weight) pair for a given touchable.
- Parameters
-
| touchableName | The name of the touchable. |
| idValue | The identifier value. |
| weight | The weight. |
Definition at line 113 of file gdynamicdigitization.cc.
◆ insertIdWeightAndTime()
| void GTouchableModifiers::insertIdWeightAndTime |
( |
const std::string & | touchableName, |
|
|
int | idValue, |
|
|
double | weight, |
|
|
double | time ) |
Inserts an (id, weight, time) triplet for a given touchable.
- Parameters
-
| touchableName | The name of the touchable. |
| idValue | The identifier value. |
| weight | The weight. |
| time | The time. |
Definition at line 126 of file gdynamicdigitization.cc.
◆ isWeightsOnly()
| bool GTouchableModifiers::isWeightsOnly |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: