void dt_pileup_product(){ gStyle->SetOptFit(0); gStyle->SetPalette(1); //gStyle->SetOptStat(111111111); gStyle->SetOptStat(1); gStyle->SetStatBorderSize(0); gStyle->SetStatColor(0); gStyle->SetStatW(0.3); gStyle->SetStatH(0.35); gStyle->SetCanvasColor(0); gStyle->SetPadBottomMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetOptTitle(1); gStyle->SetTitleBorderSize(0); gStyle->SetTitleFillColor(0); gStyle->SetTextFont(22); // font: times_bold //gStyle->SetLineStyle(5); // gStyle->SetLineWidth(5); gStyle->SetTitleFontSize(0.04); gStyle->SetTitleSize(0.04,"xyz"); gStyle->SetTitleOffset(1.3,"x"); gStyle->SetTitleOffset(1.0,"y"); // gStyle->SetLabelSize(0.05,"x"); // gStyle->SetLabelSize(0.05,"y"); gStyle->SetNdivisions(507,"xy"); // gStyle->SetNdivisions(505,"x"); // gStyle->SetNdivisions(505,"y"); //////////////// // For pileup: // TFile *_file0 = TFile::Open("rootfiles/fadc_1994.root");// 48 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_1995.root");// 110 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_1996.root");// 162 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2000.root");// 230 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2001.root");// 300 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2008.root");// 470 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2005.root");// 570 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2009.root");// 670 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2010.root");// 800 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2011.root");// 1000 kHz // For deadtime: // TFile *_file0 = TFile::Open("rootfiles/fadc_2040.root");// 48 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2041.root");// 110 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2043.root");// 162 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2044.root");// 230 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2045.root");// 300 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2046.root");// 470 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2048.root");// 570 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2050.root");// 670 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2051.root");// 800 kHz // TFile *_file0 = TFile::Open("rootfiles/fadc_2052.root");// 1000 kHz const Int_t n = 10; // error = RMS/sqrt(entries): here entries are number of pairs. Double_t x[n] = {48,110,162,230,300,470, 570, 670, 800, 1000}; //DT*pileup Double_t y1[n] = {0.00132392*0.0048549*100,0.00417742*0.0109287*100,0.00582668*0.0158137*100,0.00681062*0.0242279*100,0.00951465*0.0309823*100,0.0146133*0.0492053*100,0.0195043*0.0614268*100, 0.0218767*0.0736206*100,0.0259968*0.0901658*100,0.0329144*0.116552*100}; // narrow path Double_t y[n] = {0.0064161*0.000943345*100,0.0134761*0.00238707*100,0.0210444*0.00353316*100,0.0246118*0.00553059*100,0.0329269*0.0071695*100,0.0500218*0.0124324*100,0.0659235*0.0160459*100,0.071749*0.0195882*100,0.087681*0.0262003*100,0.106164*0.0367181*100}; // wide path Double_t ex[n] = {0.48*2, 1.1*2, 1.62*2,2.3*2, 3.0*2, 4.7*2, 5.7*2, 6.7*2,8*2, 10*2};//2% of x[n] Double_t ey1[n] = {0.00132392*0.0048549,0.00417742*0.0109287,0.00582668*0.0158137,0.00681062*0.0242279,0.00951465*0.0309823,0.0146133*0.0492053,0.0195043*0.0614268, 0.0218767*0.0736206,0.0259968*0.0901658,0.0329144*0.116552}; // narrow path//1% of y1[n] Double_t ey[n] = {0.0064161*0.000943345,0.0134761*0.00238707,0.0210444*0.00353316,0.0246118*0.00553059,0.0329269*0.0071695,0.0500218*0.0124324,0.0659235*0.0160459,0.071749*0.0195882,0.087681*0.0262003,0.106164*0.0367181}; // wide path//1% of y[n] TCanvas *c1 = new TCanvas ("c1", "dt_pileup_product",1000,700);// x, y TGraphErrors* gr = new TGraphErrors(n,x,y1,ex,ey1); //TGraph* gr = new TGraph(n,x,y); gr->SetLineColor(2); //2 //gr->SetTitle("Observed vs. expected asymmetry"); gr->SetTitle(""); //gr->SetLineStyle(3); //gr->SetLineWidth(1); gr->SetMarkerColor(2); //2 //gr->SetMaximum(505000); gr->SetMinimum(0.0); gr->SetMarkerStyle(4);//22 gr->GetXaxis()->CenterTitle(); gr->GetXaxis()->SetTitle("Events rate [kHz]"); gr->GetYaxis()->CenterTitle(); gr->GetYaxis()->SetTitle("Deadtime [%]"); //c1->SetGridx(); //c1->SetGridy(); // c1->SetLogx(); // c1->SetLogy(); gr->Draw("AP"); TLine* line = new TLine(0.0000001*1.e6,0.0000001*1.e6,0.0042*1.e6,0.0042*1.e6);// 45 deg line line->SetLineStyle(3); line->SetLineColor(1); //line->Draw("same"); tex = new TLatex(0.000267057*1.e6,0.00132685*1.e6,"Line of 45 deg."); tex->SetTextFont(22); tex->SetTextSize(0.0384615); tex->SetLineWidth(2); //tex->Draw(); TArrow *arrow = new TArrow(0.000939684*1.e6,0.00133709*1.e6,0.00125358*1.e6,0.00133709*1.e6,0.02,">"); arrow->SetFillColor(1); arrow->SetFillStyle(1001); //arrow->Draw(); ////////////////////////////////////////////////////////// TGraphErrors* gr1 = new TGraphErrors(n,x,y,ex,ey); //TGraph* gr1 = new TGraph(n,x,y1); gr1->SetLineColor(4); //2 gr1->SetMarkerColor(4); gr1->SetMarkerStyle(4);//22 gr1->Draw("P"); TLegend *legend=new TLegend(0.25,0.8,0.35,0.9); // TLegend *legend=new TLegend(0.35,0.1,0.55,0.35); legend->SetTextFont(72);//72 legend->SetTextSize(0.04);//0.04 legend->SetFillColor(0); //legend->SetTextColor(2); // legend->SetHeader(""); legend->SetFillStyle(0); legend->SetBorderSize(0); legend->AddEntry(gr,"narrow path [20 ns]","lep"); legend->AddEntry(gr1,"wide path [100 ns]","lep"); legend->Draw(); c1->Update(); } // TFile *_file0 = TFile::Open("rootfiles/fadc_1994.root");// 48 kHz // Narrow Wide // Pileup I1 39 190 // Integral of big hump I2 29422 29426 // I1 + I2 29461 29616 // Total integral 29458 29613 // Pileup fraction:I1/Total Integral 0.00132392 0.0064161 // TFile *_file0 = TFile::Open("rootfiles/fadc_1995.root");// 110 kHz // Narrow Wide // Pileup I1 136 443 // Integral of big hump I2 32431 32436 // I1 + I2 32567 32879 // Total integral 32556 32873 // Pileup fraction:I1/Total Integral 0.00417742 0.0134761 //TFile *_file0 = TFile::Open("rootfiles/fadc_1996.root");// 162 kHz // Narrow Wide // Pileup I1 197 723 // Integral of big hump I2 33633 33644 // I1 + I2 33830 34367 // Total integral 33810 34356 // Pileup fraction:I1/Total Integral 0.00582668 0.0210444 //TFile *_file0 = TFile::Open("rootfiles/fadc_2000.root");// 230 kHz // Narrow Wide // Pileup I1 223 821 // Integral of big hump I2 32540 32545 // I1 + I2 32763 33366 // Total integral 32743 33358 // Pileup fraction:I1/Total Integral 0.00681062 0.0246118 // TFile *_file0 = TFile::Open("rootfiles/fadc_2001.root");// 300 kHz // Narrow Wide // Pileup I1 287 1018 // Integral of big hump I2 29905 29917 // I1 + I2 30192 30935 // Total integral 30164 30917 // Pileup fraction:I1/Total Integral 0.00951465 0.0329269 //TFile *_file0 = TFile::Open("rootfiles/fadc_2005.root");// 570 kHz // Narrow Wide // Pileup I1 772 2744 // Integral of big hump I2 38889 38915 // I1 + I2 39661 41659 // Total integral 39581 41624 // Pileup fraction:I1/Total Integral 0.0195043 0.0659235 ////////////////////////////////////////////////////////////////////////////// // TFile *_file0 = TFile::Open("rootfiles/fadc_2008.root");// 470 kHz // Narrow Wide // Pileup I1 420 1494 // Integral of big hump I2 28374 28389 // I1 + I2 28794 29883 // Total integral 28741 29867 // Pileup fraction:I1/Total Integral 0.0146133 0.0500218 // TFile *_file0 = TFile::Open("rootfiles/fadc_2009.root");// 670 kHz // Narrow Wide // Pileup I1 605 2095 // Integral of big hump I2 27114 27137 // I1 + I2 27719 29232 // Total integral 27655 29199 // Pileup fraction:I1/Total Integral 0.0218767 0.071749 // TFile *_file0 = TFile::Open("rootfiles/fadc_2010.root");// 800 kHz // Narrow Wide // Pileup I1 935 3373 // Integral of big hump I2 35113 35141 // I1 + I2 36048 38514 // Total integral 35966 38469 // Pileup fraction:I1/Total Integral 0.0259968 0.087681 // TFile *_file0 = TFile::Open("rootfiles/fadc_2011.root");// 1000 kHz // Narrow Wide // Pileup I1 948 3319 // Integral of big hump I2 27950 27995 // I1 + I2 28898 31314 // Total integral 28802 31263 // Pileup fraction:I1/Total Integral 0.0329144 0.106164 ////////////////////////////////////////////////////////////////////////////// // Double_t ent_nar = h_nar->Integral(1,100); // Double_t pileup_nar = h_nar->Integral(1,20); // Double_t pileup_fr_nar = pileup_nar/ent_nar; // Double_t ent_wid = h_wide->Integral(1,100); // Double_t pileup_wid = h_wide->Integral(1,35); // Double_t pileup_fr_wid = pileup_wid/ent_wid; // Double_t Int_bump_nar = h_nar->Integral(20,100); // Double_t Int_bump_wid = h_wide->Integral(35,100); // cout<<"\n//\t\t\t\t Narrow"<<"\t\tWide"<