32 using namespace fjcore;
34 using namespace Jetscape;
42 int main(
int argc,
char** argv)
46 JetScapeLogger::Instance()->SetDebug(
false);
47 JetScapeLogger::Instance()->SetRemark(
false);
50 JetScapeLogger::Instance()->SetVerboseLevel(0);
55 bool writeHeaderV2 =
false;
57 writeHeaderV2 =
static_cast<bool>(argv[3]);
58 std::cout <<
"NOTE: Writing header v2, and final cross section and error at EOF.\n";
64 auto reader = make_shared<JetScapeReaderAscii>(argv[1]);
65 std::ofstream dist_output (argv[2]);
66 vector<shared_ptr<Hadron>> hadrons;
68 while (!
reader->Finished())
75 hadrons =
reader->GetHadrons();
76 cout<<
"Number of hadrons is: " << hadrons.size() << endl;
78 if (hadrons.size() > 0)
84 <<
"\t" <<
"Event\t" << SN
85 <<
"\t" <<
"weight\t" <<
reader->GetEventWeight()
86 <<
"\t" <<
"EPangle\t" <<
reader->GetEventPlaneAngle()
87 <<
"\t" <<
"N_hadrons\t" << hadrons.size()
99 dist_output <<
"#" <<
"\t"
100 <<
reader->GetEventPlaneAngle() <<
"\t"
103 << hadrons.size() <<
"\t"
104 <<
"pstat-EPx" <<
"\t"
107 <<
"Eta" <<
"\t"<<
"Phi" <<
"\n";
110 for (
unsigned int i=0;
i<hadrons.size();
i++)
113 << particleSeperator << hadrons[
i].get()->pid()
114 << particleSeperator << hadrons[
i].get()->pstat()
115 << particleSeperator << hadrons[
i].get()->e()
116 << particleSeperator << hadrons[
i].get()->px()
117 << particleSeperator << hadrons[
i].get()->py()
118 << particleSeperator << hadrons[
i].get()->pz();
121 if (!writeHeaderV2) {
122 dist_output << particleSeperator << hadrons[
i].get()->eta()
123 << particleSeperator << hadrons[
i].get()->phi();
135 <<
"\t" <<
"sigmaGen\t" <<
reader->GetSigmaGen()
136 <<
"\t" <<
"sigmaErr\t" <<
reader->GetSigmaErr()