Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8724498
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
View Options
diff --git a/include/HEJ/Weights.hh b/include/HEJ/Parameters.hh
similarity index 100%
copy from include/HEJ/Weights.hh
copy to include/HEJ/Parameters.hh
diff --git a/include/HEJ/Weights.hh b/include/HEJ/Weights.hh
index 8de138e..ca82f1f 100644
--- a/include/HEJ/Weights.hh
+++ b/include/HEJ/Weights.hh
@@ -1,97 +1,11 @@
/** \file
- * \brief Container for event Weights
+ * \brief Legacy Header for Weights
+ * \note This Header was moved to "HEJ/Parameters.hh"
*
* \authors Jeppe Andersen, Tuomas Hapola, Marian Heil, Andreas Maier, Jennifer Smillie
* \date 2019
* \copyright GPLv2 or later
*/
#pragma once
-#include "HEJ/exceptions.hh"
-
-#include <vector>
-
-namespace HEJ{
- //! Collection of parameters, e.g. Weights, assigned to a single event
- /**
- * A number of member functions of the MatrixElement class return Parameters
- * objects containing the squares of the matrix elements for the various
- * scale choices.
- */
- template<class T>
- struct Parameters {
- T central;
- std::vector<T> variations;
-
- template<class T_ext>
- Parameters<T>& operator*=(Parameters<T_ext> const & other);
- Parameters<T>& operator*=(double factor);
- template<class T_ext>
- Parameters<T>& operator/=(Parameters<T_ext> const & other);
- Parameters<T>& operator/=(double factor);
- };
-
- template<class T1, class T2> inline
- Parameters<T1> operator*(Parameters<T1> a, Parameters<T2> const & b) {
- return a*=b;
- }
- template<class T> inline
- Parameters<T> operator*(Parameters<T> a, double b) {
- return a*=b;
- }
- template<class T> inline
- Parameters<T> operator*(double b, Parameters<T> a) {
- return a*=b;
- }
- template<class T1, class T2> inline
- Parameters<T1> operator/(Parameters<T1> a, Parameters<T2> const & b) {
- return a/=b;
- }
- template<class T> inline
- Parameters<T> operator/(Parameters<T> a, double b) {
- return a/=b;
- }
-
- //! Shortcut for Weights, e.g. used by the MatrixElement
- using Weights = Parameters<double>;
-
- template<class T>
- template<class T_ext>
- Parameters<T>& Parameters<T>::operator*=(Parameters<T_ext> const & other) {
- if(other.variations.size() != variations.size()) {
- throw std::invalid_argument{"Wrong number of Parameters"};
- }
- central *= other.central;
- for(std::size_t i = 0; i < variations.size(); ++i) {
- variations[i] *= other.variations[i];
- }
- return *this;
- };
-
- template<class T>
- Parameters<T>& Parameters<T>::operator*=(double factor) {
- central *= factor;
- for(auto & wt: variations) wt *= factor;
- return *this;
- };
-
- template<class T>
- template<class T_ext>
- Parameters<T>& Parameters<T>::operator/=(Parameters<T_ext> const & other) {
- if(other.variations.size() != variations.size()) {
- throw std::invalid_argument{"Wrong number of Parameters"};
- }
- central /= other.central;
- for(std::size_t i = 0; i < variations.size(); ++i) {
- variations[i] /= other.variations[i];
- }
- return *this;
- };
-
- template<class T>
- Parameters<T>& Parameters<T>::operator/=(double factor) {
- central /= factor;
- for(auto & wt: variations) wt /= factor;
- return *this;
- };
-}
+#include "HEJ/Parameters.hh"
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Jan 20, 11:33 PM (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242904
Default Alt Text
(3 KB)
Attached To
rHEJ HEJ
Event Timeline
Log In to Comment