CONEXRandomFile.cc
Go to the documentation of this file.
1 
9 #include <io/CONEXRandomFile.h>
10 #include <evt/Event.h>
11 #include <utl/RandomEngine.h>
12 #include <utl/ErrorLogger.h>
13 #include <utl/AugerUnits.h>
14 #include <fwk/RandomEngineRegistry.h>
15 
16 #include <CLHEP/Random/Randomize.h>
17 
18 #include <sstream>
19 
20 using namespace io;
21 using namespace evt;
22 using namespace utl;
23 using namespace fwk;
24 using namespace CLHEP;
25 
26 
27 CONEXRandomFile::CONEXRandomFile(const std::string& fileName, const Mode mode, utl::Branch* const b) :
28  CONEXFile(fileName, mode, b)
29 { }
30 
31 
32 int
34 {
35  RandomEngine& rand = RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
36  const int r = int(RandFlat::shoot(&rand.GetEngine(), 0, GetNEvents()));
37 
38  std::ostringstream info;
39  info << "CONEXRandomFile::NextEntry() -> " << r;
40  INFO(info);
41 
42  return r;
43 }
Read profiles from CONEX.
Definition: CONEXFile.h:36
virtual int NextEntry()
RandomEngineType & GetEngine()
Definition: RandomEngine.h:32
Mode
Available open modes.
Definition: IoCodes.h:16
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
Class representing a document branch.
Definition: Branch.h:107
Wraps the random number engine used to generate distributions.
Definition: RandomEngine.h:27
int GetNEvents() override
Definition: CONEXFile.cc:265

, generated on Tue Sep 26 2023.