Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
JetScapeModuleBase.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file JetScapeModuleBase.cc
1
/*******************************************************************************
2
* Copyright (c) The JETSCAPE Collaboration, 2018
3
*
4
* Modular, task-based framework for simulating all aspects of heavy-ion collisions
5
*
6
* For the list of contributors see AUTHORS.
7
*
8
* Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
9
*
10
* or via email to bugs.jetscape@gmail.com
11
*
12
* Distributed under the GNU General Public License 3.0 (GPLv3 or later).
13
* See COPYING for details.
14
******************************************************************************/
15
16
#include "
JetScapeModuleBase.h
"
17
#include "
JetScapeXML.h
"
18
#include "
JetScapeTaskSupport.h
"
19
#include "
JetScapeLogger.h
"
20
21
#include <iostream>
22
23
namespace
Jetscape {
24
25
// Create an instance of the static map to register modules
26
JetScapeModuleFactory::map_type
*
JetScapeModuleFactory::moduleMap
=
27
new
JetScapeModuleFactory::map_type
;
28
29
int
JetScapeModuleBase::current_event
= 0;
30
31
// ---------------------------------------------------------------------------
34
JetScapeModuleBase::JetScapeModuleBase
()
35
:
JetScapeTask
(), xml_main_file_name(
""
), xml_user_file_name(
""
),
36
mt19937_generator_(nullptr) {}
37
38
// ---------------------------------------------------------------------------
41
JetScapeModuleBase::~JetScapeModuleBase
() {
disconnect_all
(); }
42
43
// ---------------------------------------------------------------------------
46
void
JetScapeModuleBase::Init
() {
47
if
(!
JetScapeXML::Instance
()->GetXMLRootMain()) {
48
JSWARN
<<
"Not a valid JetScape Main XML file or no XML file loaded!"
;
49
exit(-1);
50
}
51
if
(!
JetScapeXML::Instance
()->GetXMLRootUser()) {
52
JSWARN
<<
"Not a valid JetScape XML file or no XML file loaded!"
;
53
exit(-1);
54
}
55
}
56
57
// ---------------------------------------------------------------------------
60
shared_ptr<std::mt19937>
JetScapeModuleBase::GetMt19937Generator
() {
61
// Instantiate if it isn't there yet
62
if
(!
mt19937_generator_
) {
63
mt19937_generator_
=
64
JetScapeTaskSupport::Instance
()->
GetMt19937Generator
(
GetMyTaskNumber
());
65
}
66
return
mt19937_generator_
;
67
}
68
69
}
// end namespace Jetscape
JETSCAPE
blob
main
src
framework
JetScapeModuleBase.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:24
using
1.8.2 with
sPHENIX GitHub integration