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
HadronPrinter.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file HadronPrinter.cc
1
/*******************************************************************************
2
* Copyright (c) The JETSCAPE Collaboration, 2020
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 "
HadronPrinter.h
"
17
#include "
JetScapeSignalManager.h
"
18
namespace
Jetscape {
19
20
// Register the module with the base class
21
RegisterJetScapeModule<HadronPrinter>
HadronPrinter::reg
(
"HadronPrinter"
);
22
23
HadronPrinter::HadronPrinter
()
24
{
25
}
26
27
HadronPrinter::~HadronPrinter
()
28
{
29
}
30
31
void
HadronPrinter::Init
()
32
{
33
this->
SetId
(
"Printer"
);
34
fHadronOutfile
.open(
"finalStateHadrons.dat"
);
35
JetScapeSignalManager::Instance
()->
ConnectGetFinalHadronListSignal
(
36
shared_from_this());
37
38
//hadronPrinter->GetFinalHadronList.connect(hadro.get(), &Hadronization::GetHadrons);
39
}
40
41
void
HadronPrinter::Exec
()
42
{
43
VERBOSE
(2) <<
"Run HadronPrinter: "
;
44
GetFinalHadronList
(
finalHadrons
);
45
PrintFinalHadron
();
46
}
47
48
void
HadronPrinter::Clear
()
49
{this->
finalHadrons
.clear();}
50
51
void
HadronPrinter::WriteTask
(weak_ptr<JetScapeWriter> w)
52
{
53
VERBOSE
(8);
54
JetScapeTask::WriteTasks
(w);
55
}
56
57
void
HadronPrinter::PrintFinalHadron
(){
58
char
buffer
[33];
59
60
JSINFO
<<
"HadronPrinter : starting to print hadrons"
;
61
int
i
=0;
62
fHadronOutfile
<<
"# PID pstat E Px Py Pz eta phi"
<< endl;
63
for
(
auto
it
:
finalHadrons
){
64
Hadron
h
= *
it
.get();
65
fHadronOutfile
<< i <<
" "
<< h.
pid
() <<
" "
<< h.
pstat
() <<
" "
<< h.e() <<
" "
<< h.px() <<
" "
<< h.py() <<
" "
<< h.pz() <<
" "
<< h.eta() <<
" "
<< h.phi() << endl;
66
++
i
;
67
}
68
69
}
70
}
71
72
JETSCAPE
blob
main
src
jet
HadronPrinter.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:25
using
1.8.2 with
sPHENIX GitHub integration