From: Samir Amar-Youcef Date: Fri, 22 May 2015 07:45:42 +0000 (+0200) Subject: add plots X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=d7af1e49455af102ffcd480aa641f22cf5149add;p=mvd_soft.git add plots --- diff --git a/s-curves/analysis_gui/ANA/Mi26Ana b/s-curves/analysis_gui/ANA/Mi26Ana index 9428ed2..d0145bf 100755 Binary files a/s-curves/analysis_gui/ANA/Mi26Ana and b/s-curves/analysis_gui/ANA/Mi26Ana differ diff --git a/s-curves/analysis_gui/ANA/Mi26Ana.cpp b/s-curves/analysis_gui/ANA/Mi26Ana.cpp index 8198408..14402db 100644 --- a/s-curves/analysis_gui/ANA/Mi26Ana.cpp +++ b/s-curves/analysis_gui/ANA/Mi26Ana.cpp @@ -330,15 +330,20 @@ void Mi26Ana::fitsc() { // ok histo[9] = new TH1F( "chi21" , "chi21" , 1000,0.,1.); histo[10] = new TH1F( "chi22" , "chi22" , 1000,0.,1.); histo[11] = new TH1F( "chi23" , "chi23" , 1000,0.,1.); - - TF1* erf = new TF1("erf","0.5*(1+TMath::Erf((-x+[0])/[1]))",0,100); - + + TH2F* histo2[3]; + histo2[0] = new TH2F( "mean2D","mean2D" ,1152,0,1152,576,0,576); + histo2[1] = new TH2F( "sigma2D","sigma2D",1152,0,1152,576,0,576); + histo2[2] = new TH2F( "chi22D","chi22D",1152,0,1152,576,0,576); + + TF1* erf = new TF1("erf","0.5*(1+TMath::Erf((-x+[0])/[1]))",0,100); + float mean = 0, sigma = 0, chi2 = 0; - int chicount=0; - int meanmin, meanmax; - float meanmean; - float vsigma; - float vtmp=1; + int chicount=0; + int meanmin, meanmax; + float meanmean; + float vsigma; + float vtmp=1; int column; int row; int matrix; @@ -349,8 +354,8 @@ void Mi26Ana::fitsc() { // ok // ULong_t progress_tmp=-1; // Float_t progress; - TCanvas* canv = new TCanvas("Error Function Fit","Error Function Fit", 50,100,750,300); - canv->Divide(3,1); + TCanvas* canv = new TCanvas("Error Function Fit","Error Function Fit", 50,100,750,450); + canv->Divide(3,2); // Read TTree for(int thr=0;thrFill(sigma); histo[8+matrix]->Fill(chi2); + histo2[0]->Fill(column,row, mean); + histo2[1]->Fill(column,row, sigma); + histo2[2]->Fill(column,row, chi2); + if( mean > MAXX[0] ) { MAXX[0]=mean+1; } if( sigma > MAXX[1] ) { MAXX[1]=sigma+1; } if( chi2 > MAXX[2] ) { MAXX[2]=chi2+0.01; } @@ -530,6 +539,18 @@ void Mi26Ana::fitsc() { // ok histo[11]->SetLineColor(4); histo[11]->SetStats(false); histo[11]->Draw("same"); + +// canv->cd(4); +// histo2[0]->Draw("colz"); +// histo2[0]->SetStats(false); +// +// canv->cd(5); +// histo2[1]->Draw("colz"); +// histo2[1]->SetStats(false); +// +// canv->cd(6); +// histo2[2]->Draw("colz"); +// histo2[2]->SetStats(false); canv->Update(); } @@ -610,7 +631,19 @@ void Mi26Ana::fitsc() { // ok histo[11]->SetLineColor(4); histo[11]->SetStats(false); histo[11]->Draw("same"); - + + canv->cd(4); + histo2[0]->Draw("colz"); + histo2[0]->SetStats(false); + + canv->cd(5); + histo2[1]->Draw("colz"); + histo2[1]->SetStats(false); + + canv->cd(6); + histo2[2]->Draw("colz"); + histo2[2]->SetStats(false); + canv->Update(); cout<<"\n-------------"<Fill( mean[i] ); plot2 ->Fill( column, row, mean[i] ); - if( mean[i]==0 && row!=573 && row!=0) + if( mean[i]<=fRMS && row!=573 && row!=0) { - if(pixelprob_arr[pix*fNthr]==0) {pixelprob_arr[pix*fNthr]=0.01;} - plot2a ->Fill( column, row, pixelprob_arr[pix*fNthr] ); - cout<<"\r"<Fill( column, row, pixelprob_arr[pix*fNthr] ); + plot2b ->Fill( column, row, 0.001 ); +// cout<<"\r"<Fill( column, row, mean[i] ); + } } } @@ -943,6 +1008,10 @@ void Mi26Ana::fakes() { // ok plot2->SetStats(false); plot2->Draw("colz"); + cm2->cd(3); + plot2b->SetStats(false); + plot2b->Draw("colz"); + cm2->cd(4); plot2a->SetStats(false); plot2a->Draw("colz"); @@ -955,13 +1024,10 @@ void Mi26Ana::fakes() { // ok plot[i]->Draw("same"); } - - - - cout<<"\r ...done for "<Close(); + cout<<"Output: "<4) strValue<> NPx; strValue.clear(); if (argc>5) strValue<> NRndPx; strValue.clear(); if (argc>6) strValue<> Code; strValue.clear(); + if (argc>7) strValue<> RMS; strValue.clear(); RMS = RMS/100.; // cout<<" -- main 1 -- "<setNRndPx (NRndPx); ana->setNPx (NPx); ana->setCode (Code); + ana->setRMS (RMS); ana->Exec (Mode); delete ana; theApp.Run(); diff --git a/s-curves/analysis_gui/GUI/Makefile b/s-curves/analysis_gui/GUI/Makefile index cff0ab3..6c4ac96 100644 --- a/s-curves/analysis_gui/GUI/Makefile +++ b/s-curves/analysis_gui/GUI/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: scurves -# Generated by qmake (2.01a) (Qt 4.8.5) on: Wed Oct 8 16:06:56 2014 +# Generated by qmake (2.01a) (Qt 4.8.5) on: Thu May 21 13:57:23 2015 # Project: scurves.pro # Template: app # Command: /usr/bin/qmake -o Makefile scurves.pro diff --git a/s-curves/analysis_gui/GUI/main.o b/s-curves/analysis_gui/GUI/main.o index 82ef639..f6ab568 100644 Binary files a/s-curves/analysis_gui/GUI/main.o and b/s-curves/analysis_gui/GUI/main.o differ diff --git a/s-curves/analysis_gui/GUI/runana.sh b/s-curves/analysis_gui/GUI/runana.sh index 460cce3..9781852 100755 --- a/s-curves/analysis_gui/GUI/runana.sh +++ b/s-curves/analysis_gui/GUI/runana.sh @@ -1,7 +1,7 @@ echo "Input: $1" # echo "Mode: $2" rndmpxl=`pwd`/rndmpxl.ini -time ./../ANA/Mi26Ana $1 $rndmpxl $2 $3 $4 $5 +time ./../ANA/Mi26Ana $1 $rndmpxl $2 $3 $4 $5 $6 # echo "Finished!" # # echo "./Mi26Ana $1 $rndmpxl $2 $3 $4 $5" @@ -12,4 +12,5 @@ time ./../ANA/Mi26Ana $1 $rndmpxl $2 $3 $4 $5 # echo $3 # echo $4 # echo $5 +# echo $6 # echo "---------" \ No newline at end of file diff --git a/s-curves/analysis_gui/GUI/scurves b/s-curves/analysis_gui/GUI/scurves index bd6ec77..18b66e3 100755 Binary files a/s-curves/analysis_gui/GUI/scurves and b/s-curves/analysis_gui/GUI/scurves differ diff --git a/s-curves/analysis_gui/GUI/scurves.cpp b/s-curves/analysis_gui/GUI/scurves.cpp index 6f0f4b5..bfd1700 100644 --- a/s-curves/analysis_gui/GUI/scurves.cpp +++ b/s-curves/analysis_gui/GUI/scurves.cpp @@ -134,6 +134,8 @@ void scurves::initGUI() { spinRandPix -> setValue( para ); myfile >> para; spinPix -> setValue( para ); calcRC(para); + myfile >> para; + spinRMS -> setValue( 1.*para/100. ); } @@ -216,7 +218,8 @@ void scurves::Save() { myfile <value() <<" "; - myfile << spinPix ->value() <<" "; + myfile << spinPix ->value() <<" "; + myfile << (int)(100.*spinRMS->value()) <<" "; myfile <isChecked(); strstr4 << checkBank4->isChecked(); + std::stringstream strstr5; + strstr5.str(""); + strstr5 << (int)((float)100.*spinRMS->value()); + string command = "xterm -geometry 65x10+10+10 -e ./runana.sh "; command += " "; command += dirPath + filePath; @@ -645,6 +652,8 @@ void scurves::RunAna(int method) { command += strstr3.str(); command += " "; command += strstr4.str(); + command += " "; + command += strstr5.str(); const char *ptr = command.c_str() ; // cout<0 0 595 - 336 + 338 @@ -557,18 +557,63 @@ Sum - + - 300 - 205 - 95 - 51 + 297 + 201 + 101 + 111 - - RMS + + QFrame::StyledPanel + + QFrame::Raised + + + + + 3 + 3 + 95 + 51 + + + + RMS + + + + + + 20 + 67 + 51 + 16 + + + + RMS <= + + + + + + 15 + 81 + 71 + 23 + + + + 0.990000000000000 + + + 0.010000000000000 + + @@ -577,7 +622,7 @@ 0 0 595 - 20 + 21 diff --git a/s-curves/analysis_gui/GUI/ui_scurves.h b/s-curves/analysis_gui/GUI/ui_scurves.h index 1acc06c..2a073e3 100644 --- a/s-curves/analysis_gui/GUI/ui_scurves.h +++ b/s-curves/analysis_gui/GUI/ui_scurves.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -71,7 +72,10 @@ public: QPushButton *pushRewrite; QPushButton *pushEmpty2; QPushButton *pushSum; + QFrame *frame_5; QPushButton *pushFakes; + QLabel *label_7; + QDoubleSpinBox *spinRMS; QMenuBar *menubar; QStatusBar *statusbar; @@ -79,7 +83,7 @@ public: { if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName(QString::fromUtf8("MainWindow")); - MainWindow->resize(595, 336); + MainWindow->resize(595, 338); centralwidget = new QWidget(MainWindow); centralwidget->setObjectName(QString::fromUtf8("centralwidget")); lineDir = new QLineEdit(centralwidget); @@ -219,13 +223,26 @@ public: pushSum = new QPushButton(centralwidget); pushSum->setObjectName(QString::fromUtf8("pushSum")); pushSum->setGeometry(QRect(300, 150, 95, 51)); - pushFakes = new QPushButton(centralwidget); + frame_5 = new QFrame(centralwidget); + frame_5->setObjectName(QString::fromUtf8("frame_5")); + frame_5->setGeometry(QRect(297, 201, 101, 111)); + frame_5->setFrameShape(QFrame::StyledPanel); + frame_5->setFrameShadow(QFrame::Raised); + pushFakes = new QPushButton(frame_5); pushFakes->setObjectName(QString::fromUtf8("pushFakes")); - pushFakes->setGeometry(QRect(300, 205, 95, 51)); + pushFakes->setGeometry(QRect(3, 3, 95, 51)); + label_7 = new QLabel(frame_5); + label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setGeometry(QRect(20, 67, 51, 16)); + spinRMS = new QDoubleSpinBox(frame_5); + spinRMS->setObjectName(QString::fromUtf8("spinRMS")); + spinRMS->setGeometry(QRect(15, 81, 71, 23)); + spinRMS->setMaximum(0.99); + spinRMS->setSingleStep(0.01); MainWindow->setCentralWidget(centralwidget); menubar = new QMenuBar(MainWindow); menubar->setObjectName(QString::fromUtf8("menubar")); - menubar->setGeometry(QRect(0, 0, 595, 20)); + menubar->setGeometry(QRect(0, 0, 595, 21)); MainWindow->setMenuBar(menubar); statusbar = new QStatusBar(MainWindow); statusbar->setObjectName(QString::fromUtf8("statusbar")); @@ -275,6 +292,7 @@ public: pushEmpty2->setText(QApplication::translate("MainWindow", "Empty 2", 0, QApplication::UnicodeUTF8)); pushSum->setText(QApplication::translate("MainWindow", "Sum", 0, QApplication::UnicodeUTF8)); pushFakes->setText(QApplication::translate("MainWindow", "RMS", 0, QApplication::UnicodeUTF8)); + label_7->setText(QApplication::translate("MainWindow", "RMS <=", 0, QApplication::UnicodeUTF8)); } // retranslateUi };