FairRoot/PandaRoot
PhotosDebugRandom.cxx
Go to the documentation of this file.
1 #include <iostream>
2 #include "PhotosDebugRandom.h"
3 #include "Log.h"
4 using std::ios_base;
5 
6 namespace Photospp
7 {
8 
11 double PhotosDebugRandom::uran_saved[97] = { 0 };
13 
15 {
16  i97_saved=i97;
17  j97_saved=j97;
19 
20  for(int i=0;i<97;i++) uran_saved[i]=uran[i];
21 }
22 
24 {
25  i97=i97_saved;
26  j97=j97_saved;
28 
29  for(int i=0;i<97;i++) uran[i]=uran_saved[i];
30 }
31 
32 void PhotosDebugRandom::setState(int i, int j, double c, double list[97])
33 {
34  i97=i;
35  j97=j;
36  cran=c;
37  for(int i=0;i<97;i++) uran[i]=list[i];
38 }
39 
40 void PhotosDebugRandom::setSaveState(int i, int j, double c, double list[97])
41 {
42  i97_saved=i;
43  j97_saved=j;
44  cran_saved=c;
45  for(int i=0;i<97;i++) uran_saved[i]=list[i];
46 }
47 
49 {
50  int coutPrec = cout.precision(18);
51  ios_base::fmtflags flags = cout.setf(ios_base::floatfield);
52 
54 
55  cout<<"double uran_state[97] = { ";
56  for(int i=0;i<96;i++) cout<<uran[i]<<", ";
57  cout<<uran[96]<<" };"<<endl<<endl;
58  cout<<"PhotosDebugRandom::setState( "<<i97<<", "<<j97<<", "<<cran<<", uran_state );"<<endl;
59 
61 
62  // Revert output stream flags and precision
63  cout.precision(coutPrec);
64  cout.flags (flags);
65 }
66 
67 } // namespace Photospp
Int_t i
Definition: run_full.C:25
static ostream & Info(bool count=true)
Definition: Log.cxx:38
static double cran
Definition: PhotosRandom.h:40
static void setSaveState(int i, int j, double c, double list[97])
static void RevertOutput()
Definition: Log.h:90
static void setState(int i, int j, double c, double list[97])
static double uran[97]
Definition: PhotosRandom.h:39
static void RedirectOutput(void(*func)(), ostream &where=*out)
Definition: Log.cxx:90