gdynamicDigitization
Loading...
Searching...
No Matches
GTouchableModifiers Class Reference

Class to manage modifications to a GTouchable using defined modifier weights. More...

#include <gdynamicdigitization.h>

Collaboration diagram for GTouchableModifiers:
Collaboration graph

Public Member Functions

 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.
 

Detailed Description

Definition at line 27 of file gdynamicdigitization.h.

Constructor & Destructor Documentation

◆ GTouchableModifiers()

GTouchableModifiers::GTouchableModifiers ( const std::vector< std::string > & touchableNames)
explicit

Constructs a GTouchableModifiers object.

Initializes internal maps (modifierWeightsMap) for each provided touchable name.

Parameters
touchableNamesA vector of touchable names.

For each touchable name provided, an empty vector is initialized in the modifierWeightsMap.

Parameters
touchableNamesA vector of touchable names.

Definition at line 104 of file gdynamicdigitization.cc.

Member Function Documentation

◆ 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
touchableNameThe name of the touchable.
totalWeightThe 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
tnameThe touchable name.
totalWeightThe 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
touchableNameThe 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
touchableNameThe 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
touchableNameThe name of the touchable.
idValueThe identifier value.
weightThe 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
touchableNameThe name of the touchable.
idValueThe identifier value.
weightThe weight.
timeThe time.

Definition at line 126 of file gdynamicdigitization.cc.

◆ isWeightsOnly()

bool GTouchableModifiers::isWeightsOnly ( ) const
inline
Returns
True if modifierWeightsMap is not empty.

Definition at line 82 of file gdynamicdigitization.h.


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