19 virtual ~vertex() {cout<<
" Vertex Detructor ..."<<endl;}
28 parton (
double mpt,
double meta,
double mphi,
double me,
bool mfinal) {
pt=mpt;
eta=meta;
phi=mphi;
e=me;
final=mfinal;}
29 virtual ~parton() {cout<<
" Parton Destructor ..."<<endl;}
42 virtual ~shower2() {cout<<
"Shower2 Detrcutor ..."<<endl;}
55 cout<<
"Load edge ... "<<e<<endl;
61 if (((
string) (tmp->
key)).find(
"pT")<1)
73 cout<<
"Load node ... "<<n<<endl;
117 if (((
string) (tmp->
key)).find(
"MyID")<1)
168 vector<weak_ptr<parton>> myv; list<edge> le=
all_edges();
173 for (list<edge>::iterator
it=le.begin();
it!=le.end(); ++
it)
175 if (
PP[*
it]->isFinal())
176 myv.push_back(
PP[*
it]);
189 int main (
int argc,
char* argv[])
191 auto mS=make_shared<shower2>();
194 node nnn11=mS->new_vertex(make_shared<vertex>(0));
196 node nnn22=mS->new_vertex(make_shared<vertex>(1));
197 node nnn33=mS->new_vertex(make_shared<vertex>(1));
198 node nnn44=mS->new_vertex(make_shared<vertex>(2));
199 node nnn55=mS->new_vertex(make_shared<vertex>(2));
200 node nnn66=mS->new_vertex(make_shared<vertex>(3));
201 node nnn77=mS->new_vertex(make_shared<vertex>(3));
202 node nnn88=mS->new_vertex(make_shared<vertex>(4));
216 mS->new_parton(nnn11,nnn22,unique_ptr<parton>(
new parton(100,0,0,100,
false)));
217 mS->new_parton(nnn11,nnn33,unique_ptr<parton>(
new parton(200,0,0,200,
false)));
218 mS->new_parton(nnn33,nnn44,unique_ptr<parton>(
new parton(50,0,0,50,
true)));
219 mS->new_parton(nnn33,nnn55,unique_ptr<parton>(
new parton(150,0,0,150,
false)));
220 mS->new_parton(nnn55,nnn66,unique_ptr<parton>(
new parton(80,0,0,80,
true)));
221 mS->new_parton(nnn55,nnn77,unique_ptr<parton>(
new parton(70,0,0,70,
false)));
222 mS->new_parton(nnn77,nnn88,unique_ptr<parton>(
new parton(60,0,0,60,
true)));
242 for (git0 = mS->nodes_begin(), gend0 = mS->nodes_end(); git0 != gend0; ++git0)
244 cout<<*git0<<
" "<<mS->GetNodeValue(*git0)<<
" "<<git0->
indeg()<<
" "<<git0->outdeg()<<endl;
249 for (git3 = mS->edges_begin(), gend3 = mS->edges_end(); git3 != gend3; ++git3)
251 cout<<*git3<<
" "<<mS->GetEdgeValue(*git3)<<
" "<<mS->GetFinal(*git3)<<endl;
254 list<node> ln=mS->all_nodes();
255 cout<<ln.size()<<endl;
257 list<edge> le=mS->all_edges();
258 cout<<le.size()<<endl;
267 for (itt2 = search.
begin(), endt2=search.
end(); itt2 !=endt2; ++itt2)
284 for (itt22 = search2.
begin(), endt22=search2.
end(); itt22 !=endt22; ++itt22)
299 vector<weak_ptr<parton>> myv=mS->GetPartons();
300 cout<<myv.size()<<endl;
302 for (
const auto&
v : myv)
303 cout<<
v.lock()->pt<<endl;
307 mS->save(
"test.gml");
310 cout<<
" mS->clear()"<<endl;