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;
// 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;thr<fNthr;thr++)
histo[4+matrix]->Fill(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; }
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();
}
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-------------"<<endl;
}
//####################################################################
void Mi26Ana::fakes() { // ok
-
+// --------------
+ const char *File = fInputRootFile.Data();
+ char Filein [256] = "";
+ char Fileout[256] = "";
+ strcpy (Filein, File);
+ uint namelength = strlen(Filein);
+ for(uint i=0; i<namelength-4;i++)
+ {
+ Fileout[i] = Filein[i];
+ }
+ strcat (Fileout, "txt");
+
+ fstream myfile;
+ myfile.open( Fileout , ios::out );
+ myfile<<setw(7)<<setprecision(0)<< "column";
+ myfile<<setw(7)<<setprecision(0)<< "row";
+ myfile<<setw(12)<<setprecision(0)<< "RMS";
+ myfile<<endl;
+// --------------
ULong_t progress_tmp=-1;
Float_t progress;
// --------------
plot[2] = new TH1F( "RMS2","RMS2",1000,-1,1);
plot[3] = new TH1F( "RMS3","RMS3",1000,-1,1);
TH2F* plot2 = new TH2F( "RMS2D0","RMS2D",1152,0,1152,576,0,576);
- TH2F* plot2a = new TH2F( "RMS","RMS==0",1152,0,1152,576,0,576);
+ TH2F* plot2a = new TH2F( "RMS21","RMS==0",1152,0,1152,576,0,576);
+ TH2F* plot2b = new TH2F( "RMS22",Form("RMS<=%0.2f",fRMS),1152,0,1152,576,0,576);
int MINX=fNthr,MAXX=0;
plot[matrix]->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"<<column<<"\t"<<row<<"\t"<<pixelprob_arr[pix*fNthr]<<"\t"<<mean[i] <<endl;
+ myfile<<setw(7)<<setprecision(0)<< column;
+ myfile<<setw(7)<<setprecision(0)<< row;
+ myfile<<setw(12)<<setprecision(5)<< mean[i];
+ myfile <<endl;
+
+ if( mean[i]==0 )
+ {
+ if(pixelprob_arr[pix*fNthr]==0) {pixelprob_arr[pix*fNthr]=0.001;}
+ plot2a ->Fill( column, row, pixelprob_arr[pix*fNthr] );
+ plot2b ->Fill( column, row, 0.001 );
+// cout<<"\r"<<column<<"\t"<<row<<"\t"<<pixelprob_arr[pix*fNthr]<<"\t"<<mean[i] <<endl;
+ }
+ else
+ {
+ plot2b ->Fill( column, row, mean[i] );
+ }
}
}
plot2->SetStats(false);
plot2->Draw("colz");
+ cm2->cd(3);
+ plot2b->SetStats(false);
+ plot2b->Draw("colz");
+
cm2->cd(4);
plot2a->SetStats(false);
plot2a->Draw("colz");
plot[i]->Draw("same");
}
-
-
-
-
cout<<"\r ...done for "<<fNthr<<" thresholds! "<<endl;
cout<<"-------------"<<endl;
-// f->Close();
+ cout<<"Output: "<<Fileout<<endl,
+ myfile.close();
cout<<"-------------"<<endl;
}
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCheckBox>
+#include <QtGui/QDoubleSpinBox>
#include <QtGui/QFrame>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
QPushButton *pushRewrite;
QPushButton *pushEmpty2;
QPushButton *pushSum;
+ QFrame *frame_5;
QPushButton *pushFakes;
+ QLabel *label_7;
+ QDoubleSpinBox *spinRMS;
QMenuBar *menubar;
QStatusBar *statusbar;
{
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);
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"));
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
};