RandomNumberShredder.cc
Go to the documentation of this file.
1 #include "RandomNumberShredder.h"
2 #include <fwk/CentralConfig.h>
3 #include <utl/Branch.h>
4 #include <fwk/RandomEngineRegistry.h>
5 #include <utl/ErrorLogger.h>
6 #include <evt/Event.h>
7 
8 #include <sstream>
9 
10 using namespace std;
11 using namespace utl;
12 using namespace fwk;
13 
14 
15 namespace RandomNumberShredderOG {
16 
19  {
20  const Branch topB = CentralConfig::GetInstance()->GetTopBranch("RandomNumberShredder");
21  fNDetector = topB.GetChild("NDetector").Get<unsigned int>();
22  fNPhysics = topB.GetChild("NPhysics").Get<unsigned int>();
23  return eSuccess;
24  }
25 
26 
28  RandomNumberShredder::Run(evt::Event& /*event*/)
29  {
30  if (fNDetector) {
31  ostringstream info;
32  info << "Burning " << fNDetector << " eDetector random numbers.";
33  INFO(info);
34  for (unsigned int i = 0; i < fNDetector; ++i)
35  RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector).GetEngine().flat();
36  }
37  if (fNPhysics) {
38  ostringstream info;
39  info << "Burning " << fNPhysics << " ePhysics random numbers.";
40  INFO(info);
41  for (unsigned int i = 0; i < fNPhysics; ++i)
42  RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::ePhysics).GetEngine().flat();
43  }
44  return eSuccess;
45  }
46 
47 }
Branch GetTopBranch() const
Definition: Branch.cc:63
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Definition: Branch.cc:211
T Get() const
Definition: Branch.h:271
Class representing a document branch.
Definition: Branch.h:107
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60

, generated on Tue Sep 26 2023.