24 #include "PartonShower.h"
25 #include "JetScapeLogger.h"
26 #include "JetScapeReader.h"
27 #include "JetScapeBanner.h"
35 using namespace Jetscape;
42 ostream &
operator<<(ostream & ostr,
const fjcore::PseudoJet & jet);
53 int main(
int argc,
char** argv)
55 JetScapeLogger::Instance()->SetDebug(
false);
56 JetScapeLogger::Instance()->SetRemark(
false);
59 JetScapeLogger::Instance()->SetVerboseLevel(0);
65 fjcore::JetDefinition jet_def(fjcore::antikt_algorithm, 0.7);
67 vector<shared_ptr<PartonShower>> mShowers;
74 auto reader=make_shared<JetScapeReaderAscii>(
"test_out.dat");
84 cout<<
"Analyze current event = "<<
reader->GetCurrentEvent()<<endl;
85 mShowers=
reader->GetPartonShowers();
88 for (
int i=0;i<mShowers.size();i++)
90 cout<<
" Analyze parton shower = "<<i<<endl;
92 mShowers[i]->PrintVertices();
93 mShowers[i]->PrintPartons();
95 finals += mShowers[i]->GetFinalPartonsForFastJet().size();
97 fjcore::ClusterSequence cs(mShowers[i]->GetFinalPartonsForFastJet(), jet_def);
99 vector<fjcore::PseudoJet> jets = fjcore::sorted_by_pt(cs.inclusive_jets(2));
101 cout<<jet_def.description()<<endl;
104 for (
int k=0;
k<jets.size();
k++)
105 cout<<
"Anti-kT jet "<<
k<<
" : "<<jets[
k]<<endl;
107 cout<<
"Shower initiating parton : "<<*(mShowers[i]->GetPartonAt(0))<<endl;
114 mShowers[i]->SaveAsGV(
"my_test.gv");
115 mShowers[i]->SaveAsGML(
"my_test.gml");
116 mShowers[i]->SaveAsGraphML(
"my_test.graphml");
122 cout <<
" Found " << finals <<
" final state partons." << endl;
123 auto hadrons =
reader->GetHadrons();
124 cout<<
"Number of hadrons is: " << hadrons.size() << endl;
126 fjcore::ClusterSequence hcs(
reader->GetHadronsForFastJet(), jet_def);
127 vector<fjcore::PseudoJet> hjets = fjcore::sorted_by_pt(hcs.inclusive_jets(2));
128 cout<<
"AT HADRONIC LEVEL " << endl;
129 for (
int k=0;
k<hjets.size();
k++)
130 cout<<
"Anti-kT jet "<<
k<<
" : "<<hjets[
k]<<endl;
144 INFO<<
"Some GTL graph/shower analysis/dfs search output:";
148 search.calc_comp_num(
true);
149 search.scan_whole_graph(
true);
154 cout<<
"DFS graph search feature from GTL:"<<endl;
155 cout<<
"Number of Nodes reached from node 0 = "<< search.number_of_reached_nodes () <<endl;
156 cout<<
"Node/Vertex ordering result from DFS:"<<endl;
157 dfs::dfs_iterator itt2, endt2;
158 for (itt2 = search.begin(), endt2=search.end(); itt2 !=endt2; ++itt2)
163 cout<<
"Edge/Parton ordering result from DFS:"<<endl;
164 dfs::tree_edges_iterator itt, endt;
165 for (itt = search.tree_edges_begin(), endt=search.tree_edges_end(); itt !=endt; ++itt)
171 dfs::roots_iterator itt3, endt3;
172 cout<<
"List of root nodes found in graph/shower : ";
173 for (itt3 = search.roots_begin(), endt3=search.roots_end(); itt3 !=endt3; ++itt3)
186 ShowJetscapeBanner();
188 INFO_NICE<<
"------------------------------------";
189 INFO_NICE<<
"| Reader Test JetScape Framework ... |";
190 INFO_NICE<<
"------------------------------------";
197 ostream &
operator<<(ostream & ostr,
const fjcore::PseudoJet & jet) {
201 ostr <<
" pt = " << jet.pt()
202 <<
" m = " << jet.m()
203 <<
" y = " << jet.rap()
204 <<
" phi = " << jet.phi();