Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -30,6 +30,7 @@
|
||||
#define G4MergeMode_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Exception.hh"
|
||||
|
||||
#include <functional>
|
||||
#include <cmath>
|
||||
@@ -41,7 +42,7 @@ enum class G4MergeMode {
|
||||
kMultiplication, // "And" if boolean type
|
||||
kMaximum, // "Or" if boolean type
|
||||
kMinimum // "And" if boolean type
|
||||
};
|
||||
};
|
||||
|
||||
// Generic merge function
|
||||
template <typename T>
|
||||
@@ -62,7 +63,7 @@ G4MergeFunction<T> GetMergeFunction(G4MergeMode mergeMode)
|
||||
|
||||
case G4MergeMode::kMultiplication:
|
||||
return [](const T& x, const T& y) { return x * y; };
|
||||
|
||||
|
||||
case G4MergeMode::kMaximum:
|
||||
// return std::bind([](const T& x, const T& y) { return std::max(x,y);});
|
||||
return [](const T& x, const T& y) { return std::max(x,y); };
|
||||
@@ -70,10 +71,13 @@ G4MergeFunction<T> GetMergeFunction(G4MergeMode mergeMode)
|
||||
case G4MergeMode::kMinimum:
|
||||
// return std::bind([](const T& x, const T& y) { return std::min(x,y);});
|
||||
return [](const T& x, const T& y) { return std::min(x,y); };
|
||||
|
||||
default:
|
||||
return [](const T&, const T&) { return 0.0; };
|
||||
}
|
||||
|
||||
// Must never get here, but we need a return to satisfy MSVC
|
||||
G4Exception("G4Accumulables::GetMergeFunction<T>",
|
||||
"Analysis_F001", FatalException,
|
||||
"Undefined merge mode");
|
||||
return [](const T&, const T&) { return T(); };
|
||||
}
|
||||
|
||||
template <G4bool>
|
||||
|
||||
Reference in New Issue
Block a user