Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4OptStatsSettings.h"
00015
00016 #include "TStyle.h"
00017 #include "TMath.h"
00018
00019 #include "TGo4Condition.h"
00020 #include "TGo4Marker.h"
00021 #include "TGo4QSettings.h"
00022
00023
00024 TGo4OptStatsSettings::TGo4OptStatsSettings( QWidget* parent ) :
00025 QDialog( parent )
00026 {
00027
00028 setupUi(this);
00029
00030 bool showstat = go4sett->getStatBoxVisible();
00031 DrawStatboxButton->setChecked(showstat);
00032 OptStatGroupBox->setEnabled(showstat);
00033
00034 fStatW = go4sett->getOptStatW()*0.01;
00035 fStatH = go4sett->getOptStatH()*0.01;
00036
00037 if (fStatW<0.005) fStatW = gStyle->GetStatW();
00038 if (fStatH<0.005) fStatH = gStyle->GetStatH();
00039
00040 StatWidthBox->setValue(fStatW);
00041 StatHeightBox->setValue(fStatH);
00042
00043 int optstats = go4sett->getOptStat();
00044
00045 bool k= (optstats/100000000)%10 ;
00046 bool s=(optstats/10000000)%10;
00047 bool i=(optstats/1000000)%10;
00048 bool o=(optstats/100000)%10;
00049 bool u=(optstats/10000)%10;
00050 bool r=(optstats/1000)%10;
00051 bool m=(optstats/100)%10;
00052 bool e=(optstats/10)%10;
00053 bool n=(optstats/1)%10;
00054
00055 DrawNameButton->setChecked(n);
00056 DrawEntriesButton->setChecked(e);
00057 DrawIntegralButton->setChecked(i);
00058 DrawRMSButton->setChecked(r);
00059 DrawMeanButton->setChecked(m);
00060 DrawCurtosisButton->setChecked(k);
00061 DrawUnderflowButton->setChecked(u);
00062 DrawOverflowButton->setChecked(o);
00063 DrawSkewnessButton->setChecked(s);
00064
00065 DrawErrorsButton->setChecked(go4sett->getStatBoxErrors());
00066 }
00067
00068
00069 void TGo4OptStatsSettings::setFlags()
00070 {
00071 bool drawbox=DrawStatboxButton->isChecked();
00072 bool drawerrors=DrawErrorsButton->isChecked();
00073 int leader=1000000000;
00074 bool k=DrawCurtosisButton->isChecked();
00075 int kurt=100000000* (int) k;
00076 if(drawerrors) kurt*=2;
00077 bool s=DrawSkewnessButton->isChecked();
00078 int skew=10000000* (int) s;
00079 if(drawerrors) skew*=2;
00080 bool i=DrawIntegralButton->isChecked();
00081 int integ=1000000* (int) i;
00082 bool o=DrawOverflowButton->isChecked();
00083 int over=100000* (int) o;
00084 bool u=DrawUnderflowButton->isChecked();
00085 int under=10000* (int) u;
00086 bool r=DrawRMSButton->isChecked();
00087 int rms=1000* (int) r;
00088 if(drawerrors) rms*=2;
00089 bool m=DrawMeanButton->isChecked();
00090 int mean=100* (int) m;
00091 if(drawerrors) mean*=2;
00092 bool e=DrawEntriesButton->isChecked();
00093 int ent=10* (int) e;
00094 bool n=DrawNameButton->isChecked();
00095 int nm= (int) n;
00096 int optstats=leader+kurt+skew+integ+over+under+rms+mean+ent+nm;
00097
00098 go4sett->setStatBoxVisible(drawbox);
00099 go4sett->setStatBoxErrors(drawerrors);
00100 go4sett->setOptStat(optstats);
00101
00102 if (TMath::Abs(fStatW-StatWidthBox->value())>0.005)
00103 go4sett->setOptStatW((int)(StatWidthBox->value()*100));
00104
00105 if (TMath::Abs(fStatH-StatHeightBox->value())>0.005)
00106 go4sett->setOptStatH((int)(StatHeightBox->value()*100));
00107 }