Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:23

0001 // -*- C++ -*-
0002 //
0003 // Remapper.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef Herwig_Remapper_H
0010 #define Herwig_Remapper_H
0011 //
0012 // This is the declaration of the Remapper class.
0013 //
0014 
0015 #include <iostream>
0016 #include <map>
0017 #include "Herwig/Utilities/XML/Element.h"
0018 
0019 namespace Herwig {
0020 
0021 /**
0022  * \ingroup Matchbox
0023  * \author Simon Platzer
0024  *
0025  * \brief Remapper adapts indivdual MC dimensions
0026  */
0027 struct Remapper {
0028 
0029   std::map<double,double> weights;
0030 
0031   struct SelectorEntry {
0032 
0033     double lower;
0034     double upper;
0035     double value;
0036 
0037   };
0038 
0039   std::map<double,SelectorEntry> selector;
0040 
0041   double minSelection;
0042 
0043   bool smooth;
0044 
0045   Remapper();
0046 
0047   Remapper(unsigned int nBins,
0048        double nMinSelection,
0049        bool nSmooth);
0050 
0051   void fill(double x, double w);
0052 
0053   void finalize();
0054 
0055   std::pair<double,double> generate(double r) const;
0056 
0057   void fromXML(const XML::Element& elem);
0058 
0059   XML::Element toXML() const;
0060 
0061   void test(size_t n, std::ostream&);
0062 
0063 };
0064 
0065 }
0066 
0067 #endif // Herwig_Remapper_H
0068