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 particleSeperator =
"\t";
67 auto reader=make_shared<JetScapeReaderAscii>(argv[1]);
68 std::ofstream dist_output (argv[2]);
69 int SN=0, TotalPartons=0;
70 while (!
reader->Finished())
75 auto mShowers=
reader->GetPartonShowers();
78 for (
int i=0;
i < mShowers.size();
i++)
80 TotalPartons = TotalPartons + mShowers[
i]->GetFinalPartons().size();
89 <<
"\t" <<
"Event\t" << SN
90 <<
"\t" <<
"weight\t" <<
reader->GetEventWeight()
91 <<
"\t" <<
"EPangle\t" <<
reader->GetEventPlaneAngle()
92 <<
"\t" <<
"N_partons\t" << TotalPartons
104 dist_output <<
"#" <<
"\t"
105 <<
reader->GetEventPlaneAngle() <<
"\t"
108 << TotalPartons <<
"\t"
109 <<
"pstat-EPx" <<
"\t"
112 <<
"Eta" <<
"\t"<<
"Phi" <<
"\n";
115 for (
int i=0;
i < mShowers.size();
i++)
119 for (
int ipart = 0; ipart < mShowers[
i]->GetFinalPartons().size(); ++ipart)
121 Parton p = *mShowers[
i]->GetFinalPartons().at(ipart);
125 << particleSeperator << p.
pid()
126 << particleSeperator << p.
pstat()
127 << particleSeperator << p.e()
128 << particleSeperator << p.px()
129 << particleSeperator << p.py()
130 << particleSeperator << p.pz();
133 if (!writeHeaderV2) {
134 dist_output << particleSeperator << p.eta()
135 << particleSeperator << p.phi();
148 <<
"\t" <<
"sigmaGen\t" <<
reader->GetSigmaGen()
149 <<
"\t" <<
"sigmaErr\t" <<
reader->GetSigmaErr()