Skip to content
Snippets Groups Projects
Commit 54e5fb97 authored by Mark K Jones's avatar Mark K Jones Committed by GitHub
Browse files

Merge pull request #13 from MarkKJones/gui

Initial online GUI directory
parents 8e1d95c5 ada4c7ee
No related branches found
No related tags found
No related merge requests found
Showing
with 12086 additions and 0 deletions
online
*.o
*.d
##################################################
# This is an example configuration file
# for the onlineGUI.
# Documentation for the onlineGUI can be found here:
# http://www.jlab.org/~moffit/onlineGUI/
#
protorootfile ../ROOTfiles/hms1190_XXXXX.root
#protorootfile ROOTfiles/hadron_XXXXX.root
#goldenrootfile ROOTfiles/hadron_golden.root
#definecut zerocut BB.tp.e.LA[0]>0
# FIRST PAGE
newpage 2 3 # remove logy to make linear scale y-axis
title HMS DC 1 Wiremaps
hdc1x1_wm -nostat
hdc1y1_wm -nostat
hdc1u1_wm -nostat
hdc1v1_wm -nostat
hdc1x2_wm -nostat
hdc1y2_wm -nostat
newpage 2 3 # remove logy to make linear scale y-axis
title HMS DC 1 Wiremaps v time
hdc1x1_wm_time -nostat -type colz
hdc1y1_wm_time -nostat -type colz
hdc1u1_wm_time -nostat -type colz
hdc1v1_wm_time -nostat -type colz
hdc1x2_wm_time -nostat -type colz
hdc1y2_wm_time -nostat -type colz
newpage 2 3 # remove logy to make linear scale y-axis
title HMS DC 2 Wiremaps
hdc2x1_wm -nostat
hdc2y1_wm -nostat
hdc2u1_wm -nostat
hdc2v1_wm -nostat
hdc2x2_wm -nostat
hdc2y2_wm -nostat
File added
Changelog starting with v1.2
Jul 9, 2010 - version v1.2.1
* Implement goldenrootfile for TTree Draws from Brad Sawatzky
* Fix a bug with setting the drawcommand title if the end of the string contains
spaces or tabs after the end quote. It's really a hack. Not sure of
unintended consequences.
// GetRootFileName.C
//
// Helper macro for OnlineGUI to determine ROOT Filename
// from a given runnumber
//
//
TString GetRootFileName(UInt_t runnumber)
{
TString file_path = "ROOTfiles/";
TString expID = "ndtest";
TString filename;
filename = file_path + expID;
filename += "_";
filename += runnumber;
filename += "-all.root";
return filename;
}
// GetRunNumber.C
//
// Helper macro for OnlineGUI to determine runnumber
//
#ifdef USEPODD
#include "src/THaRun.h"
#endif
UInt_t GetRunNumber()
{
#ifdef USEPODD
// This is specific to the Hall-A C++/ROOT Analyzer (PODD)
// Must use "analyzer" to obtain this info.
THaRun* runinfo = (THaRun*)gROOT->FindObject("Run_Data");
if(runinfo==NULL) return 0;
return runinfo->GetNumber();
#else
return 0;
#endif
}
# Makefile for standalone version of panguin/onlineGUI
# - B. Moffit
#
# Choose the compiler.
GCC=g++
GLD=g++
ifdef INSURE
GCC=insure
GLD=insure
endif
ROOTLIBS = $(shell root-config --libs)
ROOTGLIBS = $(shell root-config --glibs)
INCLUDES = -I$(ROOTSYS)/include
CXX = $(GCC)
CXXFLAGS = -Wall -fno-exceptions -fPIC $(INCLUDES) -fpermissive
LD = $(GLD)
LDFLAGS =
SOFLAGS = -shared
GLIBS = $(ROOTGLIBS) -L/usr/X11R6/lib -lXpm -lX11
LIBS = $(GLIBS) $(ROOTLIBS) $(ROOTGLIBS)
MAKEDEPEND = $(GCC)
ALL_LIBS = $(LIBS)
CXXFLAGS += -DSTANDALONE
# Insert extra headers needed by GetRootFileName.C or GetRunNumber.C
ifdef PAN_SRC_PATH
PANSRCPATH = $(PAN_SRC_PATH)
else
PANSRCPATH = ../../pan/src
endif
# XTRAHEADERS = $(PANSRCPATH)/TaFileName.hh $(PANSRCPATH)/TaString.hh\
# $(PANSRCPATH)/TaDataBase.hh
# INCLUDES += -I$(PANSRCPATH)
# LIBPANCLASS = $(PANSRCPATH)/libpan.a
# LIBS += $(LIBPANCLASS)
SRC = online.C
DEPS = $(SRC:.C=.d)
OBJS = $(SRC:.C=.o)
HEAD = $(SRC:.C=.h)
# Make the dictionary
CXXFLAGS += -DDICT
OBJS += onlineDict.o
PROGS = online
install: all
mv $(PROGS) ../
all: $(PROGS)
$(PROGS): $(OBJS) $(SRC) $(HEAD)
rm -f $@
@echo "Generating" $@
$(LD) $(CXXFLAGS) -o $@ $(OBJS) $(ALL_LIBS)
# Dictionary
onlineDict.C: $(DOBJS) onlineLinkDef.h
@echo "Generating Dictionary..."
$(ROOTSYS)/bin/rootcint -f $@ -c -p -DDICT $(HEAD) \
$(XTRAHEADERS) onlineLinkDef.h
clean:
rm -f *.o core *~ *.d *.tar *.so *Dict* $(PROGS)
realclean: clean
rm -f *.d ../$(PROGS)
.SUFFIXES:
.SUFFIXES: .c .cc .cpp .C .o .d
%.o: %.C
$(CXX) $(CXXFLAGS) -c $<
%.d: %.C
@echo Creating dependencies for $<
@$(SHELL) -ec '$(MAKEDEPEND) -MM $(INCLUDES) -c $< \
| sed '\''s%^.*\.o%$*\.o%g'\'' \
| sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
[ -s $@ ] || rm -f $@'
-include $(DEPS)
This diff is collapsed.
##################################################
# This is an example configuration file
# for the onlineGUI.
# Documentation for the onlineGUI can be found here:
# http://www.jlab.org/~moffit/onlineGUI/
#
protorootfile ROOTfiles/hadron_XXXXX.root
goldenrootfile ROOTfiles/hadron_golden.root
definecut zerocut BB.tp.e.LA[0]>0
# FIRST PAGE
newpage 2 2 logy # remove logy to make linear scale y-axis
title Tree Variable draw
BB.tp.e.LA[0] BB.tp.e.LA[0]>0 -title "Left ADC 0"
BB.tp.e.LA[1] BB.tp.e.LA[1]>0 -title "Left ADC 1"
BB.tp.e.LA[2] BB.tp.e.LA[2]>0 -nostat -title "Left ADC 2"
BB.tp.e.LA[3] BB.tp.e.LA[3]>0 -title "Left ADC 3" -nostat
# SECOND PAGE
newpage 2 2 logy
title multiplot Tree Variable Draw
# Same as the first page, more compact
multiplot 0 3 BB.tp.e.LA[XXXXX] BB.tp.e.LA[XXXXX]>0 -title "Left ADC XXXXX"
# THIRD PAGE
newpage 2 2 logy
title Histogram Draw
# Will also show histograms from goldenrootfile, if specified
E_L_adc_0
E_L_adc_1 -noshowgolden
E_L_adc_2 -nostat
E_L_adc_3 -nostat
# FOURTH PAGE
newpage 2 2 logy
title multiplot Histogram Draw
# Same as the third page, more compact.
# Will also show histograms from goldenrootfile, if specified
multiplot 0 3 E_L_adc_XXXXX -noshowgolden
# FIFTH PAGE
newpage 2 2 logy
title multiplot Histogram Draw with options
# Same as the third page, more compact.
# Will also show histograms from goldenrootfile, if specified
multiplot 0 3 E_L_adc_XXXXX -nostat
# SIXTH PAGE
newpage 1 1 logy
title Advanced Tree Draw with options
# Also use the "zerocut" cut defined above
10*sqrt(BB.tp.e.LA[0]) zerocut -tree T -type line -nostat -title "x10 sqrt(Left ADC 0)"
This diff is collapsed.
This diff is collapsed.
File added
##################################################
# This is an example configuration file
# for the onlineGUI.
# Documentation for the onlineGUI can be found here:
# http://www.jlab.org/~moffit/onlineGUI/
#
rootfile /group/hallc/mkj/hcana/hcana_dir/examples/hodtest.root
#protorootfile ROOTfiles/hadron_XXXXX.root
#goldenrootfile ROOTfiles/hadron_golden.root
#definecut zerocut BB.tp.e.LA[0]>0
# FIRST PAGE
newpage 2 2 # remove logy to make linear scale y-axis
title HMS Scint TDCs
hpostdc1 -nostat
hpostdc2 -nostat
hpostdc3 -nostat
hpostdc4 -nostat
newpage 2 2 # remove logy to make linear scale y-axis
title HMS Scint Neg TDCs
hnegtdc1 -nostat
hnegtdc2 -nostat
hnegtdc3 -nostat
hnegtdc4 -nostat
This diff is collapsed.
///////////////////////////////////////////////////////////////////
// Macro to help with online analysis
// B. Moffit (moffit@jlab.org)
// - Originally written in Oct. 2003
// Documentation and updates available at:
// http://www.jlab.org/~moffit/onlineGUI/
//
#include <TTree.h>
#include <TFile.h>
#include <TGButton.h>
#include <TGFrame.h>
#include <TRootEmbeddedCanvas.h>
#include "TGLabel.h"
#include "TGString.h"
#include <RQ_OBJECT.h>
#include <TQObject.h>
#include <vector>
#include <TString.h>
#include <TCut.h>
#include <TTimer.h>
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#define UPDATETIME 2000
using namespace std;
/* TTree *raw; */
/* TFile *file; */
struct fileObject {
TString name;
TString title;
TString type;
TString directory;
};
struct RootFileObject {
TFile* RootFile;
vector <TTree*> RootTree;
vector <Int_t> TreeEntries;
vector < vector <TString> > TreeVars;
Bool_t fUpdate;
TH1D *mytemp1d;
TH2D *mytemp2d;
TH3D *mytemp3d;
vector <fileObject> vfileObjects;
};
struct drawcommand {
TString variable;
TString cut;
TString type;
TString title;
TString treename;
TString nostat;
TString noshowgolden;
TString macro;
TString directory;
TString objname;
TString objtype;
TString objtitle;
};
class OnlineConfig {
RQ_OBJECT("OnlineConfig");
// Class that takes care of the config file
private:
TString confFileName; // config filename
ifstream *fConfFile; // original config file
void ParseFile();
vector < vector <TString> > sConfFile; // the config file, in memory
// pageInfo is the vector of the pages containing the sConfFile index
// and how many commands issued within that page (title, 1d, etc.)
TString rootfilename; // Just the name
TString goldenrootfilename; // Golden rootfile for comparisons
TString protorootfile; // Prototype for getting the rootfilename
TString guicolor; // User's choice of background color
TString plotsdir; // Where to store sample plots.. automatically stored as .jpg's).
vector < pair <UInt_t,UInt_t> > pageInfo;
vector <TCut> cutList;
vector <UInt_t> GetDrawIndex(UInt_t);
Bool_t fFoundCfg;
Bool_t fMonitor;
Bool_t ParseForMultiPlots();
public:
OnlineConfig();
OnlineConfig(TString);
Bool_t ParseConfig();
TString GetRootFile() { return rootfilename; };
TString GetGoldenFile() { return goldenrootfilename; };
TString GetGuiColor() { return guicolor; };
TString GetPlotsDir() { return plotsdir; };
TCut GetDefinedCut(TString ident);
vector <TString> GetCutIdent();
// Page utilites
UInt_t GetPageCount() { return pageInfo.size(); };
pair <UInt_t,UInt_t> GetPageDim(UInt_t);
Bool_t IsLogx(UInt_t page);
Bool_t IsLogy(UInt_t page);
Bool_t IsLogz(UInt_t page);
TString GetPageTitle(UInt_t);
UInt_t GetDrawCount(UInt_t); // Number of histograms in a page
drawcommand GetDrawCommand(UInt_t,UInt_t);
vector <TString> SplitString(TString,TString);
void OverrideRootFile(UInt_t);
Bool_t IsMonitor() { return fMonitor; };
};
class OnlineGUI {
// Class that takes care of the GUI
RQ_OBJECT("OnlineGUI")
private:
//UInt_t fRunNum;
TGMainFrame *fMain;
TGHorizontalFrame *fTopframe;
TGVerticalFrame *vframe;
TGRadioButton *fRadioPage[50];
TGPictureButton *wile;
TRootEmbeddedCanvas *fEcanvas;
TGHorizontalFrame *fBottomFrame;
TGHorizontalFrame *hframe;
TGTextButton *fNext;
TGTextButton *fPrev;
TGTextButton *fExit;
TGLabel *fRunNumber;
TGTextButton *fPrint;
TCanvas *fCanvas; // Present Embedded canvas
OnlineConfig *fConfig;
UInt_t current_page;
RootFileObject fRootFile;
RootFileObject fGoldenFile;
Bool_t doGolden;
UInt_t runNumber;
TTimer *timer;
Bool_t fPrintOnly;
Bool_t fFileAlive;
public:
OnlineGUI(OnlineConfig&,Bool_t,UInt_t RunNum=0);
void CreateGUI(const TGWindow *p, UInt_t w, UInt_t h);
virtual ~OnlineGUI();
void DoDraw();
void DrawPrev();
void DrawNext();
void DoRadio();
void CheckPageButtons();
// Specific Draw Methods
void GetFileObjects(RootFileObject *r);
void GetTreeVars(RootFileObject *r);
void GetRootTree(RootFileObject *r);
UInt_t GetTreeIndex(TString,RootFileObject *r);
UInt_t GetTreeIndexFromName(TString, RootFileObject *r);
drawcommand fileObject2command(drawcommand,RootFileObject *r);
void TreeDraw(drawcommand);
void HistDraw(drawcommand);
void MacroDraw(drawcommand);
void CanvasDraw(drawcommand,UInt_t);
void GraphDraw(drawcommand);
void DoDrawClear(RootFileObject *r);
void TimerUpdate();
void BadDraw(TString);
void CheckRootFile();
Int_t OpenRootFile();
void ObtainRunNumber();
void PrintToFile();
void PrintPages();
void MyCloseWindow();
void CloseGUI();
};
This diff is collapsed.
/********************************************************************
* onlineDict.h
* CAUTION: DON'T CHANGE THIS FILE. THIS FILE IS AUTOMATICALLY GENERATED
* FROM HEADER FILES LISTED IN G__setup_cpp_environmentXXX().
* CHANGE THOSE HEADER FILES AND REGENERATE THIS FILE.
********************************************************************/
#ifdef __CINT__
#error onlineDict.h/C is only for compilation. Abort cint.
#endif
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define G__ANSIHEADER
#define G__DICTIONARY
#define G__PRIVATE_GVALUE
#include "G__ci.h"
#include "FastAllocString.h"
extern "C" {
extern void G__cpp_setup_tagtableonlineDict();
extern void G__cpp_setup_inheritanceonlineDict();
extern void G__cpp_setup_typetableonlineDict();
extern void G__cpp_setup_memvaronlineDict();
extern void G__cpp_setup_globalonlineDict();
extern void G__cpp_setup_memfunconlineDict();
extern void G__cpp_setup_funconlineDict();
extern void G__set_cpp_environmentonlineDict();
}
#include "TObject.h"
#include "TMemberInspector.h"
#include "online.h"
#include <algorithm>
namespace std { }
using namespace std;
#ifndef G__MEMFUNCBODY
#endif
extern G__linked_taginfo G__onlineDictLN_TString;
extern G__linked_taginfo G__onlineDictLN_vectorlEunsignedsPintcOallocatorlEunsignedsPintgRsPgR;
extern G__linked_taginfo G__onlineDictLN_basic_ifstreamlEcharcOchar_traitslEchargRsPgR;
extern G__linked_taginfo G__onlineDictLN_vectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_TList;
extern G__linked_taginfo G__onlineDictLN_TTimer;
extern G__linked_taginfo G__onlineDictLN_vectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR;
extern G__linked_taginfo G__onlineDictLN_maplEstringcOTObjArraymUcOlesslEstringgRcOallocatorlEpairlEconstsPstringcOTObjArraymUgRsPgRsPgR;
extern G__linked_taginfo G__onlineDictLN_TCut;
extern G__linked_taginfo G__onlineDictLN_TQObjSender;
extern G__linked_taginfo G__onlineDictLN_TGWindow;
extern G__linked_taginfo G__onlineDictLN_pairlEunsignedsPintcOintgR;
extern G__linked_taginfo G__onlineDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_TGTextButton;
extern G__linked_taginfo G__onlineDictLN_TGVerticalFrame;
extern G__linked_taginfo G__onlineDictLN_TGHorizontalFrame;
extern G__linked_taginfo G__onlineDictLN_TGMainFrame;
extern G__linked_taginfo G__onlineDictLN_TGPictureButton;
extern G__linked_taginfo G__onlineDictLN_TGRadioButton;
extern G__linked_taginfo G__onlineDictLN_TCanvas;
extern G__linked_taginfo G__onlineDictLN_TRootEmbeddedCanvas;
extern G__linked_taginfo G__onlineDictLN_TGLabel;
extern G__linked_taginfo G__onlineDictLN_TVectorTlEfloatgR;
extern G__linked_taginfo G__onlineDictLN_TVectorTlEdoublegR;
extern G__linked_taginfo G__onlineDictLN_TMatrixTBaselEfloatgR;
extern G__linked_taginfo G__onlineDictLN_TMatrixTBaselEdoublegR;
extern G__linked_taginfo G__onlineDictLN_RootFileObject;
extern G__linked_taginfo G__onlineDictLN_vectorlETTreemUcOallocatorlETTreemUgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlETTreemUcOallocatorlETTreemUgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_vectorlEintcOallocatorlEintgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlEintcOallocatorlEintgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_vectorlETStringcOallocatorlETStringgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlETStringcOallocatorlETStringgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_vectorlEvectorlETStringcOallocatorlETStringgRsPgRcOallocatorlEvectorlETStringcOallocatorlETStringgRsPgRsPgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlEvectorlETStringcOallocatorlETStringgRsPgRcOallocatorlEvectorlETStringcOallocatorlETStringgRsPgRsPgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_vectorlEfileObjectcOallocatorlEfileObjectgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlEfileObjectcOallocatorlEfileObjectgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_drawcommand;
extern G__linked_taginfo G__onlineDictLN_OnlineConfig;
extern G__linked_taginfo G__onlineDictLN_pairlEunsignedsPintcOunsignedsPintgR;
extern G__linked_taginfo G__onlineDictLN_vectorlEpairlEunsignedsPintcOunsignedsPintgRcOallocatorlEpairlEunsignedsPintcOunsignedsPintgRsPgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlEpairlEunsignedsPintcOunsignedsPintgRcOallocatorlEpairlEunsignedsPintcOunsignedsPintgRsPgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_vectorlETCutcOallocatorlETCutgRsPgR;
extern G__linked_taginfo G__onlineDictLN_reverse_iteratorlEvectorlETCutcOallocatorlETCutgRsPgRcLcLiteratorgR;
extern G__linked_taginfo G__onlineDictLN_OnlineGUI;
/* STUB derived class for protected member access */
void onlineGUI_Style() {
// These options are documented in the ROOT Reference Guide
// under the TStyle Class:
// http://root.cern.ch/root/Reference.html
gStyle->SetOptFit(0);
gStyle->SetOptStat(1110);
gStyle->SetPalette(1);
gStyle->SetNdivisions(505);
gStyle->SetCanvasColor(10);
gStyle->SetPadTopMargin(.01);
gStyle->SetPadLeftMargin(.15);
gStyle->SetPadRightMargin(.05);
gStyle->SetPadBottomMargin(.10);
gStyle->SetTitleXOffset(0.8);
gStyle->SetTitleYOffset(0.8);
gStyle->SetLabelFont(42,"X");
gStyle->SetLabelFont(42,"Y");
gStyle->SetStatH(0.4);
gStyle->SetPadTickX(1);
gStyle->SetPadTickY(1);
// prepare gStyle to be useful
// 1 = solid
// 2 = long dash (30 10)
// 3 = dotted (4 8)
// 4 = dash-dot (15 12 4 12)
// 5 = short dash ( 15 15 )
// 6 = dash-dot-dot
gStyle->SetLineStyleString(1,"[]");
gStyle->SetLineStyleString(2,"[30 10]");
gStyle->SetLineStyleString(3,"[4 8]");
gStyle->SetLineStyleString(4,"[15 12 4 12]");
gStyle->SetLineStyleString(5,"[15 15]");
gStyle->SetLineStyleString(6,"[15 12 4 12 4 12]");
gStyle->SetLabelSize(0.08,"X");
gStyle->SetLabelSize(0.08,"Y");
gStyle->SetNdivisions(505,"Y");
gStyle->SetOptDate(0);
gStyle->SetDateY(.98);
gStyle->SetStripDecimals(kFALSE);
gStyle->SetTitleSize(0.08,"T");
gStyle->SetStatW(0.45);
}
/* #pragma link C++ class TaRootRep; */
/* #pragma link C++ class TaFileName; */
/* #pragma link C++ class TaString; */
#pragma link C++ class OnlineGUI;
#pragma link C++ class OnlineConfig;
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment