File indexing completed on 2025-08-05 08:19:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef PARTONSHOWER_H
0019 #define PARTONSHOWER_H
0020
0021 #include "GTL/graph.h"
0022 #include <GTL/edge_map.h>
0023 #include <GTL/node_map.h>
0024 #include "JetClass.h"
0025 #include "JetScapeLogger.h"
0026
0027 using std::shared_ptr;
0028
0029 namespace Jetscape {
0030
0031
0032
0033
0034 class Vertex;
0035 class Parton;
0036
0037 class PartonShower : public graph {
0038
0039 public:
0040 PartonShower();
0041 virtual ~PartonShower();
0042
0043 node new_vertex(shared_ptr<Vertex> v);
0044 int new_parton(node s, node t, shared_ptr<Parton> p);
0045
0046 shared_ptr<Vertex> GetVertex(node n) { return vMap[n]; }
0047 shared_ptr<Parton> GetParton(edge e) { return pMap[e]; }
0048
0049 shared_ptr<Parton> GetPartonAt(int n);
0050 shared_ptr<Vertex> GetVertexAt(int n);
0051
0052 node GetNodeAt(int n);
0053 edge GetEdgeAt(int n);
0054
0055 int GetNumberOfParents(int n);
0056 int GetNumberOfChilds(int n);
0057
0058 vector<shared_ptr<Parton>> GetFinalPartons();
0059 vector<fjcore::PseudoJet> GetFinalPartonsForFastJet();
0060
0061
0062
0063
0064
0065 int GetNumberOfPartons() const { return number_of_edges(); }
0066 int GetNumberOfVertices() const { return number_of_nodes(); }
0067
0068 void save_node_info_handler(ostream *o, node n) const;
0069 void save_edge_info_handler(ostream *o, edge n) const;
0070
0071 void load_edge_info_handler(edge e, GML_pair *read);
0072 void load_node_info_handler(node n, GML_pair *read);
0073 void pre_clear_handler();
0074
0075 void PrintVertices() { PrintNodes(false); }
0076 void PrintPartons() { PrintEdges(false); }
0077 void PrintNodes(bool verbose = true);
0078 void PrintEdges(bool verbose = true);
0079
0080 void SaveAsGML(string fName) { save(fName.c_str()); }
0081 void SaveAsGV(string fName);
0082 void SaveAsGraphML(string fName);
0083
0084 private:
0085 node_map<shared_ptr<Vertex>> vMap;
0086 edge_map<shared_ptr<Parton>> pMap;
0087
0088 vector<shared_ptr<Parton>> pFinal;
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106 };
0107
0108 }
0109 #endif