Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // adaption_info.icc is part of ExSample -- A Library for Sampling Sudakov-Type Distributions
0004 //
0005 // Copyright (C) 2008-2019 Simon Platzer -- simon.plaetzer@desy.de, The Herwig Collaboration
0006 //
0007 // ExSample is licenced under version 3 of the GPL, see COPYING for details.
0008 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0009 //
0010 //
0011 namespace exsample {
0012 
0013   template<class OStream>
0014   void adaption_info::put(OStream& os) const {
0015     os << dimension;
0016     ostream_traits<OStream>::separator(os);
0017     for (std::size_t k = 0; k < dimension; ++k) {
0018       os << lower_left[k];
0019       ostream_traits<OStream>::separator(os);
0020     }
0021     for (std::size_t k = 0; k < dimension; ++k) {
0022       os << upper_right[k];
0023       ostream_traits<OStream>::separator(os);
0024     }
0025     os << presampling_points;
0026     ostream_traits<OStream>::separator(os);
0027     os << histo_depth;
0028     ostream_traits<OStream>::separator(os);
0029     for (std::size_t k = 0; k < dimension; ++k) {
0030       os << adapt[k];
0031       ostream_traits<OStream>::separator(os);
0032     }
0033     os << freeze_grid;
0034     ostream_traits<OStream>::separator(os);
0035     os << maxtry;
0036     ostream_traits<OStream>::separator(os);
0037     os << efficiency_threshold;
0038     ostream_traits<OStream>::separator(os);
0039     os << gain_threshold;
0040     ostream_traits<OStream>::separator(os);
0041   }
0042 
0043   template<class IStream>
0044   void adaption_info::get(IStream& is) {
0045     is >> dimension;
0046     lower_left.resize(dimension);
0047     upper_right.resize(dimension);
0048     adapt.resize(dimension);
0049     for (std::size_t k = 0; k < dimension; ++k) {
0050       is >> lower_left[k];
0051     }
0052     for (std::size_t k = 0; k < dimension; ++k) {
0053       is >> upper_right[k];
0054     }
0055     is >> presampling_points >> histo_depth;
0056     for (std::size_t k = 0; k < dimension; ++k) {
0057       // strange. is >> adapt[k]
0058       // gives: warning: value computet is not used
0059       // with gcc 4.2.1
0060       bool v; is >> v;
0061       adapt[k] = v;
0062     }
0063     is >> freeze_grid >> maxtry
0064        >> efficiency_threshold >> gain_threshold;
0065   }
0066 
0067 }