Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4Accumulables Namespace Reference

Functions

G4MergeMode GetMergeMode (const G4String &mergeModeName)
 
template<typename T >
G4MergeFunction< T > GetMergeFunction (G4MergeMode mergeMode)
 
template<G4bool >
G4MergeFunction< G4boolGetMergeFunction (G4MergeMode mergeMode)
 

Function Documentation

template<typename T >
G4MergeFunction<T> G4Accumulables::GetMergeFunction ( G4MergeMode  mergeMode)

Definition at line 57 of file G4MergeMode.hh.

58 {
59  switch ( mergeMode ) {
61  // return std::bind([](const T& x, const T& y) { return x + y; });
62  return [](const T& x, const T& y) { return x + y; };
63 
65  return [](const T& x, const T& y) { return x * y; };
66 
68  // return std::bind([](const T& x, const T& y) { return std::max(x,y);});
69  return [](const T& x, const T& y) { return std::max(x,y); };
70 
72  // return std::bind([](const T& x, const T& y) { return std::min(x,y);});
73  return [](const T& x, const T& y) { return std::min(x,y); };
74  }
75 }
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments

Here is the call graph for this function:

template<G4bool >
G4MergeFunction<G4bool> G4Accumulables::GetMergeFunction ( G4MergeMode  mergeMode)

Definition at line 78 of file G4MergeMode.hh.

79 {
80  switch ( mergeMode ) {
83  // return std::bind([](const T& x, const T& y) { return x + y; });
84  return [](const G4bool& x, const G4bool& y) { return x || y; };
85 
88  return [](const G4bool& x, const G4bool& y) { return x && y; };
89  }
90 }
bool G4bool
Definition: G4Types.hh:79
G4MergeMode G4Accumulables::GetMergeMode ( const G4String mergeModeName)

Definition at line 36 of file G4MergeMode.cc.

36  {
37  if ( mergeModeName == "+" ) { return G4MergeMode::kAddition; }
38  else if ( mergeModeName == "*" ) { return G4MergeMode::kMultiplication; }
39  else {
40  G4ExceptionDescription description;
41  description
42  << " \"" << mergeModeName << "\" merge mode is not supported." << G4endl
43  << " " << "Addition will be applied.";
44  G4Exception("G4Analysis::GetMergeMode",
45  "Analysis_W013", JustWarning, description);
46  return G4MergeMode::kAddition;
47  }
48 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function: