Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:38

0001 // $Id$
0002 //
0003 //    File: JEventProcessor_janaview.h
0004 // Created: Fri Oct  3 08:14:14 EDT 2014
0005 // Creator: davidl (on Darwin harriet.jlab.org 13.4.0 i386)
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;   // width in pixels
0040                 UInt_t h;   // height in pixels
0041                 Int_t rank; // 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;  // pixels -- just max box size, no spacing
0053                 Int_t totheight; // pixels -- sum of box heights, no spacing
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 // _JEventProcessor_janaview_
0087