File indexing completed on 2025-01-18 10:01:38
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _JEventProcessor_janaview_
0009 #define _JEventProcessor_janaview_
0010
0011 #include <set>
0012 using std::set;
0013
0014 #include <TLatex.h>
0015
0016 #include <JANA/JEventProcessor.h>
0017
0018 #include "jv_mainframe.h"
0019
0020 #include "JVFactoryInfo.h"
0021
0022 class JEventProcessor_janaview:public JEventProcessor{
0023 public:
0024
0025 class CGobj{
0026 public:
0027 CGobj(string nametag):nametag(nametag),x1(0.0),y1(0.0),x2(0.0),y2(0.0),rank(0){
0028 TLatex ltmp(0.0, 0.0, nametag.c_str());
0029 ltmp.SetTextSizePixels(20);
0030 ltmp.GetBoundingBox(w, h);
0031 }
0032
0033 string nametag;
0034 Float_t x1;
0035 Float_t y1;
0036 Float_t x2;
0037 Float_t y2;
0038 Float_t ymid;
0039 UInt_t w;
0040 UInt_t h;
0041 Int_t rank;
0042
0043 set<CGobj*> callees;
0044 set<CGobj*> decendants;
0045 set<CGobj*> ancestors;
0046 };
0047
0048 class CGrankprop{
0049 public:
0050 CGrankprop(void):totwidth(0),totheight(0){}
0051 vector<CGobj*> cgobjs;
0052 Int_t totwidth;
0053 Int_t totheight;
0054 };
0055
0056
0057 JEventProcessor_janaview();
0058 ~JEventProcessor_janaview();
0059 const char* className(void){return "JEventProcessor_janaview";}
0060
0061 pthread_mutex_t mutex;
0062 pthread_cond_t cond;
0063 std::shared_ptr<const JEvent> loop;
0064 int eventnumber;
0065 map<string, CGobj*> cgobjs;
0066
0067 void Lock(void){pthread_mutex_lock(&mutex);}
0068 void Unlock(void){pthread_mutex_unlock(&mutex);}
0069
0070 void NextEvent(void);
0071 string MakeNametag(const string &name, const string &tag);
0072 void GetObjectTypes(vector<JVFactoryInfo> &facinfo);
0073 void GetAssociatedTo(JObject *jobj, vector<const JObject*> &associatedTo);
0074 void MakeCallGraph(string nametag="");
0075
0076 private:
0077 void Init() override;
0078 void BeginRun(const std::shared_ptr<const JEvent>& event) override;
0079 void Process(const std::shared_ptr<const JEvent>& event) override;
0080 void EndRun() override;
0081 void Finish() override;
0082 };
0083
0084 extern JEventProcessor_janaview *JEP;
0085
0086 #endif
0087