File indexing completed on 2025-08-03 08:20:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include <iostream>
0017
0018 #include "PartonPrinter.h"
0019 #include "GTL/graph.h"
0020 #include <GTL/edge_map.h>
0021 #include <GTL/node_map.h>
0022 #include "JetClass.h"
0023 #include "JetScapeLogger.h"
0024 #include <string>
0025
0026 using namespace std;
0027
0028 namespace Jetscape {
0029
0030
0031 RegisterJetScapeModule<PartonPrinter> PartonPrinter::reg("PartonPrinter");
0032
0033 PartonPrinter::PartonPrinter() {}
0034
0035 PartonPrinter::~PartonPrinter() {}
0036
0037 void PartonPrinter::Init() {
0038 this->SetId("PartonPrinter");
0039 JSINFO << "Initialize PartonPrinter ...";
0040 string filename = GetXMLElementText({"PartonPrinter","FileName"});
0041
0042 dist_output.open(filename,std::ios::app);
0043 }
0044
0045 void PartonPrinter::Exec() {
0046 VERBOSE(2) << "Run PartonPrinter: print shower from event # "
0047 << GetCurrentEvent() << " ...";
0048 }
0049
0050 void PartonPrinter::GetFinalPartons(
0051 shared_ptr<PartonShower>
0052 pShower ) {
0053 if (pShower) {
0054
0055 for (unsigned int ipart = 0;
0056 ipart < pShower.get()->GetFinalPartons().size(); ++ipart) {
0057
0058 if (std::abs(pShower.get()->GetFinalPartons().at(ipart)->pid()) == 21) {
0059 dist_output << ipart << " "
0060 << pShower.get()->GetFinalPartons().at(ipart)->pid() << " "
0061 << pShower.get()->GetFinalPartons().at(ipart)->e() << " "
0062 << pShower.get()->GetFinalPartons().at(ipart)->px() << " "
0063 << pShower.get()->GetFinalPartons().at(ipart)->py() << " "
0064 << pShower.get()->GetFinalPartons().at(ipart)->pz() << endl;
0065 }
0066
0067
0068 }
0069
0070 }
0071 }
0072
0073 void PartonPrinter::GetFinalPartons2(shared_ptr<PartonShower> pShower) {
0074 if (pShower) {
0075
0076
0077
0078
0079
0080
0081
0082
0083 this->pFinals.push_back(pShower.get()->GetFinalPartons());
0084 }
0085 }
0086
0087 void PartonPrinter::Clear() {
0088
0089
0090 this->pFinals.clear();
0091 }
0092
0093 void PartonPrinter::GetPartonsAtTime(shared_ptr<PartonShower> pShower,
0094 vector<shared_ptr<Parton>> &fPartons,
0095 double time) {}
0096
0097 }