Analysis Software
Documentation for sPHENIX simulation software
 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 
24 {
25 }
26 
28 {
29 }
30 
32 {
33  this->SetId("Printer");
34  fHadronOutfile.open("finalStateHadrons.dat");
36  shared_from_this());
37 
38  //hadronPrinter->GetFinalHadronList.connect(hadro.get(), &Hadronization::GetHadrons);
39 }
40 
42 {
43  VERBOSE(2) <<"Run HadronPrinter: ";
46 }
47 
49  {this->finalHadrons.clear();}
50 
51 void HadronPrinter::WriteTask(weak_ptr<JetScapeWriter> w)
52 {
53  VERBOSE(8);
55 }
56 
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