GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4OptStatsSettings.cpp
Go to the documentation of this file.
1 // $Id: TGo4OptStatsSettings.cpp 999 2013-07-25 11:58:59Z linev $
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 "TGo4OptStatsSettings.h"
15 
16 #include "TStyle.h"
17 #include "TMath.h"
18 
19 #include "TGo4Condition.h"
20 #include "TGo4Marker.h"
21 #include "TGo4QSettings.h"
22 
23 
25  QDialog( parent )
26 {
27  //setObjectName(name);
28  setupUi(this);
29 
30  bool showstat = go4sett->getStatBoxVisible();
31  DrawStatboxButton->setChecked(showstat);
32  OptStatGroupBox->setEnabled(showstat);
33 
34  fStatW = go4sett->getOptStatW()*0.01;
35  fStatH = go4sett->getOptStatH()*0.01;
36 
37  if (fStatW<0.005) fStatW = gStyle->GetStatW();
38  if (fStatH<0.005) fStatH = gStyle->GetStatH();
39 
40  StatWidthBox->setValue(fStatW);
41  StatHeightBox->setValue(fStatH);
42 
43  int optstats = go4sett->getOptStat();
44  //std::cout <<"Found options stat: "<<optstats << std::endl;
45  bool k= (optstats/100000000)%10 ;
46  bool s=(optstats/10000000)%10;
47  bool i=(optstats/1000000)%10;
48  bool o=(optstats/100000)%10;
49  bool u=(optstats/10000)%10;
50  bool r=(optstats/1000)%10;
51  bool m=(optstats/100)%10;
52  bool e=(optstats/10)%10;
53  bool n=(optstats/1)%10;
54 
55  DrawNameButton->setChecked(n);
56  DrawEntriesButton->setChecked(e);
57  DrawIntegralButton->setChecked(i);
58  DrawRMSButton->setChecked(r);
59  DrawMeanButton->setChecked(m);
60  DrawCurtosisButton->setChecked(k);
61  DrawUnderflowButton->setChecked(u);
62  DrawOverflowButton->setChecked(o);
63  DrawSkewnessButton->setChecked(s);
64 
65  DrawErrorsButton->setChecked(go4sett->getStatBoxErrors());
66 }
67 
68 
70 {
71  bool drawbox=DrawStatboxButton->isChecked();
72  bool drawerrors=DrawErrorsButton->isChecked();
73  int leader=1000000000; // leading value to correctly decode "name only" option
74  bool k=DrawCurtosisButton->isChecked();
75  int kurt=100000000* (int) k;
76  if(drawerrors) kurt*=2;
77  bool s=DrawSkewnessButton->isChecked();
78  int skew=10000000* (int) s;
79  if(drawerrors) skew*=2;
80  bool i=DrawIntegralButton->isChecked();
81  int integ=1000000* (int) i;
82  bool o=DrawOverflowButton->isChecked();
83  int over=100000* (int) o;
84  bool u=DrawUnderflowButton->isChecked();
85  int under=10000* (int) u;
86  bool r=DrawRMSButton->isChecked();
87  int rms=1000* (int) r;
88  if(drawerrors) rms*=2;
89  bool m=DrawMeanButton->isChecked();
90  int mean=100* (int) m;
91  if(drawerrors) mean*=2;
92  bool e=DrawEntriesButton->isChecked();
93  int ent=10* (int) e;
94  bool n=DrawNameButton->isChecked();
95  int nm= (int) n;
96  int optstats=leader+kurt+skew+integ+over+under+rms+mean+ent+nm;
97  //std::cout <<"Set options stat to "<<optstats << std::endl;
98  go4sett->setStatBoxVisible(drawbox);
99  go4sett->setStatBoxErrors(drawerrors);
100  go4sett->setOptStat(optstats);
101 
102  if (TMath::Abs(fStatW-StatWidthBox->value())>0.005)
103  go4sett->setOptStatW((int)(StatWidthBox->value()*100));
104 
105  if (TMath::Abs(fStatH-StatHeightBox->value())>0.005)
106  go4sett->setOptStatH((int)(StatHeightBox->value()*100));
107 }
TGo4OptStatsSettings(QWidget *parent=0)
void setStatBoxErrors(bool on=true)
bool getStatBoxVisible()
void setOptStat(int value)
TGo4QSettings * go4sett
bool getStatBoxErrors()
void setOptStatW(int value)
void setOptStatH(int value)
void setStatBoxVisible(bool on=true)