LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
RNGsnapshot.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
4 #include "cetlib/container_algorithms.h"
5 
6 #include <string>
7 #include <vector>
8 
9 using namespace std;
10 
11 namespace art {
12 
13  RNGsnapshot::RNGsnapshot(std::string const& ekind,
14  std::string const& lbl,
15  std::vector<unsigned long> const& est)
16  {
17  saveFrom(ekind, lbl, est);
18  }
19 
20  void
21  RNGsnapshot::saveFrom(std::string const& ekind,
22  std::string const& lbl,
23  std::vector<unsigned long> const& est)
24  {
25  engine_kind_ = ekind;
26  label_ = lbl;
27  // N.B. implicit conversion from unsigned long to unsigned int.
28  cet::copy_all(est, std::back_inserter(state_));
29  }
30 
31  std::vector<unsigned long>
32  RNGsnapshot::restoreState() const
33  {
34  std::vector<unsigned long> est;
35  // N.B. implicit conversion from unsigned long to unsigned int.
36  cet::copy_all(state_, std::back_inserter(est));
37  return est;
38  }
39 
40 } // namespace art
STL namespace.
Definition: MVAAlg.h:12