00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4MacroDialog.h"
00015
00016 #include <QToolTip>
00017
00018 TGo4MacroDialog::TGo4MacroDialog( QWidget* parent )
00019 : QDialog( parent )
00020 {
00021 setObjectName("Go4MacroDialog");
00022 setupUi(this);
00023 setCommand("Add");
00024 }
00025
00026 void TGo4MacroDialog::setCommand( const QString & selection )
00027 {
00028 if(selection.contains("Add"))
00029 {
00030 fxCommand="addhistos(\"\",\"\",1,kTRUE);";
00031 SyntaxLabel->setText("Bool_t addhistos(const char* histo1, const char* histo2, Double_t factor, Bool_t draw)");
00032 setToolTip("Add histograms: result=histo1 + factor * histo2. \n If draw==true, display in new viewpanel, otherwise just update existing displays");
00033 }
00034 else if (selection.contains("Divide"))
00035 {
00036 fxCommand="divhistos(\"\",\"\",kTRUE);";
00037 SyntaxLabel->setText("Bool_t divhistos(const char* histo1, const char* histo2, Bool_t draw)");
00038 setToolTip("Divide histograms: result=histo1 by histo2.\n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00039 }
00040 else if (selection.contains("Rebin"))
00041 {
00042 fxCommand="rebin(\"\",2,0,kTRUE);";
00043 SyntaxLabel->setText("Bool_t rebin(const char* histo, int ngroupX, int ngroupY, Bool_t draw)");
00044 setToolTip("Rebin histogram histo by merging ngroup neighboured channels together. \n If draw=true, display in new viewpanel, otherwise just update existing displays ");
00045 }
00046 else if (selection.contains("Projection X"))
00047 {
00048 fxCommand="projectionX(\"\",\"\",-1,-1,kTRUE);";
00049 SyntaxLabel->setText("Bool_t projectionX(const char* histo, const char* polycon, Int_t firstybin, Int_t lastybin, Bool_t draw)");
00050 setToolTip(" Do projection to X axis for 2d histogram histo.\n Optional polygon condition.\n Parameters firstybin, lastybin for y range. \n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00051 }
00052 else if (selection.contains("Projection Y"))
00053 {
00054 fxCommand="projectionY(\"\",\"\",-1,-1,kTRUE);";
00055 SyntaxLabel->setText("Bool_t projectionY(const char* histo, const char* polycon, Int_t firstxbin, Int_t lastxbin, Bool_t draw)");
00056 setToolTip(" Do projection to Y axis for 2d histogram histo. \n Optional polygon condition.\n Parameters firstxbin, lastxbin for x range. \n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00057 }
00058 else if (selection.contains("Correlate"))
00059 {
00060 fxCommand="corrhistos(\"\",\"\",kTRUE);";
00061 SyntaxLabel->setText("Bool_t corrhistos(const char* histo1, const char* histo2, Bool_t draw)");
00062 setToolTip(" Correlate bin contents of two histograms in a graph.\n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00063 }
00064 else if (selection.contains("Histogram of"))
00065 {
00066 fxCommand="hishisto(\"\",1000,kTRUE);";
00067 SyntaxLabel->setText("Bool_t hishisto(const char* histo, Int_t bins, Bool_t draw)");
00068 setToolTip(" Create histogram and fill with contents of histogram histo. \n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00069 }
00070 else if (selection.contains("Profile X"))
00071 {
00072 fxCommand="profileX(\"\",-1,-1,kTRUE);";
00073 SyntaxLabel->setText("Bool_t profileX(const char* histo, Int_t firstybin, Int_t lastybin, Bool_t draw)");
00074 setToolTip(" Do profile to X axis for 2d histogram histo. \n Parameters firstybin, lastybin for y range. \n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00075 }
00076 else if (selection.contains("Profile Y"))
00077 {
00078 fxCommand="profileY(\"\",-1,-1,kTRUE);";
00079 SyntaxLabel->setText("Bool_t profileY(const char* histo, Int_t firstxbin, Int_t lastxbin, Bool_t draw)");
00080 setToolTip(" Do profile to Y axis for 2d histogram histo. \n Parameters firstxbin, lastxbin for x range. \n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00081 }
00082 else if (selection.contains("Scale X"))
00083 {
00084 fxCommand="scalex(\"\",1,0,kTRUE);";
00085 SyntaxLabel->setText("Bool_t scalex(const char* histo, Double_t a1, Double_t a0, Bool_t draw)");
00086 setToolTip(" Scale x axis of histogram histo by linear function. \n Parameters: x'= a1*x + a0. \n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00087 }
00088 else if (selection.contains("Fourier"))
00089 {
00090 fxCommand="fft(\"\",\"R2C M\",kTRUE);";
00091 SyntaxLabel->setText("Bool_t fft(const char* histo, Option_t opt, Bool_t draw)");
00092 setToolTip(" Do fast fourier transform of 1d histogram. \n Parameters: option string of TVirtualFFT::FFT() \n If draw==true, display in new viewpanel, otherwise just update existing displays ");
00093 }
00094
00095
00096 else
00097 {
00098 fxCommand="unknown macro function" ;
00099 }
00100 }
00101 const QString& TGo4MacroDialog::getCommand()
00102 {
00103 return fxCommand;
00104 }
00105
00106
00107
00108
00109