#include #include #include #include #include "TROOT.h" #include "TStyle.h" #include "TChain.h" #include "TFile.h" #include "TDirectory.h" #include "TMath.h" #include "TH1I.h" #include "TH1D.h" #include "TH2D.h" #include "TF1.h" #include "TTree.h" #include "TH1F.h" #include "TLorentzVector.h" #include "TRandom.h" #include "TMinuit.h" #include "math.h" #include "TLatex.h" using namespace std; void ps_plot() { //first data double temp[5000]; char name[100]; double x[246]; double y[246]; int line_number_wiener = 246; int line_number_dcdc = 104; int line_umber_droge = 258; ifstream inputfile; sprintf(name,"data_ps.txt"); //file name for wiener inputfile.open(name,ios::in); cout<<" Get the data from "<> temp[i]; } TH1D *histo = new TH1D("histo","histo",5300,-20,1040); histo->Sumw2(); for (int i=0; iSetBinContent(bin_x,y[i]); histo->SetBinError(bin_x,1); } // //second data double temp2[5000]; char name2[100]; double x2[104]; double y2[104]; ifstream inputfile2; sprintf(name2,"data_ps_part2.txt"); //file name for dcdc inputfile2.open(name2,ios::in); cout<<" Get the data from "<> temp2[i]; } TH1D *histo2 = new TH1D("histo","histo",5300,-20,1040); histo2->Sumw2(); for (int i=0; iSetBinContent(bin_x,y2[i]); histo2->SetBinError(bin_x,1); } // //second data double temp3[5000]; char name3[100]; double x3[258]; double y3[258]; ifstream inputfile3; sprintf(name3,"data_ps_part3.txt"); //file name for droge inputfile3.open(name3,ios::in); cout<<" Get the data from "<> temp3[i]; } TH1D *histo3 = new TH1D("histo","histo",5300,-20,1040); histo3->Sumw2(); for (int i=0; iSetBinContent(bin_x,y3[i]); histo3->SetBinError(bin_x,1); } // TCanvas *tC; TPad *c; double small = 1e-5; tC = new TCanvas("Power Supply","Power Supply",600,1000); gPad->SetFillStyle(0); gPad->SetFrameFillStyle(0); c = new TPad("pad","pad", .025, .025, .975, .975); //c = new TPad("pad","pad"); gPad->SetFillStyle(0); gPad->SetFrameFillStyle(0); c->Draw(); c->Divide(1,3,small,small); c->cd(1); histo->SetTitle("Voltage vs Time;Time;Volt "); histo->SetLineColor(kRed); histo->SetStats(0); histo->SetNdivisions(512); histo->SetMaximum(900); histo->SetMinimum(0.); histo->SetAxisRange(0,1000.); histo->SetMarkerColor(kRed); histo->Draw("e1"); for (int i=1; i<=9; i++) { TLine *line_y = new TLine(100*i,0,100*i,900); line_y->SetLineStyle(3); line_y->Draw("SAME"); } for (int i=1; i<=8; i++) { TLine *line_x = new TLine(0,100*i,1000,100*i); line_x->SetLineStyle(3); line_x->Draw("SAME"); } //Draw text TLatex plotTitle; char title[200]; plotTitle.SetTextSize(0.036); plotTitle.SetTextColor(kRed); plotTitle.DrawLatex(800,800,"Pk-Pk > 725mV"); //TLatex plotTitle2; //char title2[200]; //plotTitle2.SetTextSize(0.05); //plotTitle2.DrawLatex(600,600,""); // c->cd(2); histo2->SetTitle("Voltage vs Time;Time;Volt "); histo2->SetLineColor(kBlue); histo2->SetStats(0); histo2->SetNdivisions(512); histo2->SetMaximum(900); histo2->SetMinimum(0.); histo2->SetAxisRange(0,1000.); histo2->SetMarkerColor(kBlue); histo2->Draw("e1"); for (int i=1; i<=9; i++) { TLine *line_y = new TLine(100*i,0,100*i,900); line_y->SetLineStyle(3); line_y->Draw("SAME"); } for (int i=1; i<=8; i++) { TLine *line_x = new TLine(0,100*i,1000,100*i); line_x->SetLineStyle(3); line_x->Draw("SAME"); } c->cd(3); histo3->SetTitle("Voltage vs Time;Time;Volt "); histo3->SetLineColor(kBlack); histo3->SetStats(0); histo3->SetNdivisions(512); histo3->SetMaximum(900); histo3->SetMinimum(0.); histo3->SetAxisRange(0,1000.); histo3->SetMarkerColor(kBlue); histo3->Draw("e1"); for (int i=1; i<=9; i++) { TLine *line_y = new TLine(100*i,0,100*i,900); line_y->SetLineStyle(3); line_y->Draw("SAME"); } for (int i=1; i<=8; i++) { TLine *line_x = new TLine(0,100*i,1000,100*i); line_x->SetLineStyle(3); line_x->Draw("SAME"); } tC->Print("powersupply.png"); }