00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 void TGo4CreateNewHistogram::init()
00017 {
00018 HisName->setText(go4sett->getHistName());
00019 HisTitle->setText("histogram title");
00020
00021 int htype = go4sett->getHistType();
00022 HisClassType->setButton(htype / 10);
00023 HisType->setButton(htype % 10);
00024
00025 int npoints;
00026 double min, max;
00027
00028 go4sett->getHistAxisPars(0, npoints, min, max);
00029 XNoOfBins->setText(QString::number(npoints));
00030 Xmin->setText(QString::number(min));
00031 Xmax->setText(QString::number(max));
00032
00033 go4sett->getHistAxisPars(1, npoints, min, max);
00034 YNoOfBins->setText(QString::number(npoints));
00035 Ymin->setText(QString::number(min));
00036 Ymax->setText(QString::number(max));
00037
00038 go4sett->getHistAxisPars(2, npoints, min, max);
00039 ZNoOfBins->setText(QString::number(npoints));
00040 Zmin->setText(QString::number(min));
00041 Zmax->setText(QString::number(max));
00042
00043 fSelectedCmd = 0;
00044 }
00045
00046 void TGo4CreateNewHistogram::SetAnalysisAvaliable(bool on)
00047 {
00048 CearteRemote->setEnabled(on);
00049 }
00050
00051 void TGo4CreateNewHistogram::SetLocalAvaliable(bool on)
00052 {
00053 CreateHistogram->setEnabled(on);
00054 }
00055
00056 int TGo4CreateNewHistogram::GetSelectedCmd()
00057 {
00058 return fSelectedCmd;
00059 }
00060
00061 TH1* TGo4CreateNewHistogram::MakeHistogram()
00062 {
00063 const char* hname = HisName->text().latin1();
00064 const char* htitle = HisTitle->text().latin1();
00065 int htype = HisClassType->selectedId()*10 + HisType->selectedId();
00066
00067 int nxbins = XNoOfBins->text().toInt();
00068 int nybins = YNoOfBins->text().toInt();
00069 int nzbins = ZNoOfBins->text().toInt();
00070
00071 double xmin = Xmin->text().toDouble();
00072 double xmax = Xmax->text().toDouble();
00073 double ymin = Ymin->text().toDouble();
00074 double ymax = Ymax->text().toDouble();
00075 double zmin = Zmin->text().toDouble();
00076 double zmax = Zmax->text().toDouble();
00077
00078 go4sett->setHistName(hname);
00079 go4sett->setHistType(htype);
00080 go4sett->setHistAxisPars(0, nxbins, xmin, xmax);
00081 go4sett->setHistAxisPars(1, nybins, ymin, ymax);
00082 go4sett->setHistAxisPars(2, nzbins, zmin, zmax);
00083
00084 TDirectory* savdir = gDirectory;
00085 gROOT->cd();
00086 TH1* h = 0;
00087 switch(htype) {
00088 case 11: h = new TH1S(hname, htitle, nxbins, xmin, xmax); break;
00089 case 12: h = new TH1D(hname, htitle, nxbins, xmin, xmax); break;
00090 case 13: h = new TH1F(hname, htitle, nxbins, xmin, xmax); break;
00091 case 14: h = new TH1I(hname, htitle, nxbins, xmin, xmax); break;
00092 case 15: h = new TH1C(hname, htitle, nxbins, xmin, xmax); break;
00093 case 21: h = new TH2S(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax); break;
00094 case 22: h = new TH2D(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax); break;
00095 case 23: h = new TH2F(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax); break;
00096 case 24: h = new TH2I(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax); break;
00097 case 25: h = new TH2C(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax); break;
00098 case 31: h = new TH3S(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax, nzbins, zmin, zmax); break;
00099 case 32: h = new TH3D(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax, nzbins, zmin, zmax); break;
00100 case 33: h = new TH3F(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax, nzbins, zmin, zmax); break;
00101 case 34: h = new TH3I(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax, nzbins, zmin, zmax); break;
00102 case 35: h = new TH3C(hname, htitle, nxbins, xmin, xmax, nybins, ymin, ymax, nzbins, zmin, zmax); break;
00103 }
00104
00105 if (savdir!=0) savdir->cd();
00106
00107 return h;
00108 }
00109
00110 void TGo4CreateNewHistogram::CreateLocalHist()
00111 {
00112 fSelectedCmd = 1;
00113 accept();
00114 }
00115
00116 void TGo4CreateNewHistogram::CreateRemoteHis()
00117 {
00118 fSelectedCmd = 2;
00119 accept();
00120 }
00121
00122
00123
00124