GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4MacroDialog.cpp
Go to the documentation of this file.
1 // $Id: TGo4MacroDialog.cpp 2132 2018-09-14 09:52:45Z adamczew $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4MacroDialog.h"
15 
16 #include <QToolTip>
17 
19  : QDialog( parent )
20 {
21  setObjectName("Go4MacroDialog");
22  setupUi(this);
23  setCommand("Add");
24 }
25 
26 void TGo4MacroDialog::setCommand( const QString & selection )
27 {
28  if(selection.contains("Add"))
29  {
30  fxCommand="addhistos(\"\",\"\",1,kTRUE);";
31  SyntaxLabel->setText("Bool_t addhistos(const char* histo1, const char* histo2, Double_t factor, Bool_t draw)");
32  setToolTip("Add histograms: result=histo1 + factor * histo2. \n If draw==true, display in new viewpanel, otherwise just update existing displays");
33  }
34  else if (selection.contains("Divide"))
35  {
36  fxCommand="divhistos(\"\",\"\",kTRUE, kTRUE);";
37  SyntaxLabel->setText("Bool_t divhistos(const char* histo1, const char* histo2, Bool_t draw, Bool_t floatresult)");
38  setToolTip("Divide histograms: result=histo1 by histo2.\n If draw==true, display in new viewpanel, otherwise just update existing displays. \n If floatresult==true, result histogram will be TH1F, otherwise same type as original histograms");
39  }
40  else if (selection.contains("Rebin"))
41  {
42  fxCommand="rebin(\"\",2,0,kTRUE);";
43  SyntaxLabel->setText("Bool_t rebin(const char* histo, int ngroupX, int ngroupY, Bool_t draw)");
44  setToolTip("Rebin histogram histo by merging ngroup neighboured channels together. \n If draw=true, display in new viewpanel, otherwise just update existing displays ");
45  }
46  else if (selection.contains("Projection X"))
47  {
48  fxCommand="projectionX(\"\",\"\",-1,-1,kTRUE);";
49  SyntaxLabel->setText("Bool_t projectionX(const char* histo, const char* polycon, Int_t firstybin, Int_t lastybin, Bool_t draw)");
50  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 ");
51  }
52  else if (selection.contains("Projection Y"))
53  {
54  fxCommand="projectionY(\"\",\"\",-1,-1,kTRUE);";
55  SyntaxLabel->setText("Bool_t projectionY(const char* histo, const char* polycon, Int_t firstxbin, Int_t lastxbin, Bool_t draw)");
56  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 ");
57  }
58  else if (selection.contains("Correlate"))
59  {
60  fxCommand="corrhistos(\"\",\"\",kTRUE);";
61  SyntaxLabel->setText("Bool_t corrhistos(const char* histo1, const char* histo2, Bool_t draw)");
62  setToolTip(" Correlate bin contents of two histograms in a graph.\n If draw==true, display in new viewpanel, otherwise just update existing displays ");
63  }
64  else if (selection.contains("Histogram of"))
65  {
66  fxCommand="hishisto(\"\",1000,kTRUE);";
67  SyntaxLabel->setText("Bool_t hishisto(const char* histo, Int_t bins, Bool_t draw)");
68  setToolTip(" Create histogram and fill with contents of histogram histo. \n If draw==true, display in new viewpanel, otherwise just update existing displays ");
69  }
70  else if (selection.contains("Profile X"))
71  {
72  fxCommand="profileX(\"\",-1,-1,kTRUE);";
73  SyntaxLabel->setText("Bool_t profileX(const char* histo, Int_t firstybin, Int_t lastybin, Bool_t draw)");
74  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 ");
75  }
76  else if (selection.contains("Profile Y"))
77  {
78  fxCommand="profileY(\"\",-1,-1,kTRUE);";
79  SyntaxLabel->setText("Bool_t profileY(const char* histo, Int_t firstxbin, Int_t lastxbin, Bool_t draw)");
80  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 ");
81  }
82  else if (selection.contains("Scale X"))
83  {
84  fxCommand="scalex(\"\",1,0,kTRUE);";
85  SyntaxLabel->setText("Bool_t scalex(const char* histo, Double_t a1, Double_t a0, Bool_t draw)");
86  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 ");
87  }
88  else if (selection.contains("Fourier"))
89  {
90  fxCommand="fft(\"\",\"R2C M\",kTRUE);";
91  SyntaxLabel->setText("Bool_t fft(const char* histo, Option_t opt, Bool_t draw)");
92  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 ");
93  }
94 
95 
96  else
97  {
98  fxCommand="unknown macro function" ;
99  }
100 }
102 {
103  return fxCommand;
104 }
105 
106 
107 
108 
109 
TGo4MacroDialog(QWidget *parent=0)
const QString & getCommand()
virtual void setCommand(const QString &selection)