// Resize any histograms (they all inherit from h1) stat box. Uses NDC coordinates (e.g. 0.65, 0.5) bool resizeStatBox( TCanvas *c1, TH1* h1, float x1, float y1, float x2=-1, float y2=-1, TString newname = "", int color = -1, TString oldname = "", int iDebug = 0 ) { if( !c1 || !h1 ) {cerr<<"Null pointer given to resizeStatBox!"<<endl; return 0;} c1->Update(); if( oldname.Length() <= 0 ) oldname = "stats"; if( iDebug > 20 ) print_list_of_functions( *h1 ); TPaveStats *stats = (TPaveStats*) h1->FindObject( oldname ); if( iDebug ) cout<<"Found old name (\""<<oldname<<"\"? "<<( stats != 0 )<<endl; if( (!stats) && newname.Length() > 0 ){ // maybe it was already renamed stats = (TPaveStats*) h1->FindObject( newname ); if( iDebug ) cout<<"Found new name (\""<<newname<<"\"? "<<(stats != 0)<<endl; } if( !stats ) {cerr<<"Can't find stat box"<<endl; return 0;} stats->SetX1NDC( x1 ); stats->SetY1NDC( y1 ); if( x2 >= 0 ) stats->SetX2NDC( x2 ); if( y2 >= 0 ) stats->SetY2NDC( y2 ); if( newname.Length() > 0 ) { stats->SetName( newname ); if( iDebug ) cout<<"SetName to "<<newname<<endl; } if( color != -1 ) stats->SetTextColor (color); stats->Draw(); // maybe, just maybe, this will finally make them appear every time, even with draw "same" return 1; }
// --------------------------------------------------------------------------------------------- // The SLAC version bool relocateStatBox (float x1, float y1, float x2=-1, float y2=-1, TString newname = "") { TPaveStats *st = (TPaveStats*)gPad->GetPrimitive("stats"); if (0 == st) {cerr<<"Can't find stat box in pad"<<endl; return 0;} if (newname.Length() > 0) st->SetName(newname); st->SetX1NDC(x1); if (x2 != -1) st->SetX2NDC(x2); st->SetY1NDC(y1); if (y2 != -1) st->SetY2NDC(y2); st->Draw(); return 1; }
void plot_PbPb_fit_ratio_eff() { //=========Macro generated from canvas: Fit/Fit on Efficiency Ratio //========= (Mon Aug 29 17:39:14 2016) by ROOT version6.02/10 TCanvas *Fit = new TCanvas("Fit", "Fit on Efficiency Ratio",0,0,800,500); gStyle->SetOptFit(1); Fit->Range(1.625,-0.3125,55.375,2.8125); Fit->SetFillColor(0); Fit->SetBorderMode(0); Fit->SetBorderSize(2); Fit->SetFrameBorderMode(0); Fit->SetFrameBorderMode(0); Double_t xAxis1[6] = {7, 10, 15, 20, 30, 50}; TH1D *PbPb_fit1 = new TH1D("PbPb_fit1","",5, xAxis1); PbPb_fit1->SetBinContent(1,0.8304669); PbPb_fit1->SetBinContent(2,0.8392248); PbPb_fit1->SetBinContent(3,0.8551938); PbPb_fit1->SetBinContent(4,0.8559738); PbPb_fit1->SetBinContent(5,0.8749088); PbPb_fit1->SetBinError(1,0.06688803); PbPb_fit1->SetBinError(2,0.03626477); PbPb_fit1->SetBinError(3,0.03301156); PbPb_fit1->SetBinError(4,0.02217037); PbPb_fit1->SetBinError(5,0.01963207); PbPb_fit1->SetMinimum(0); PbPb_fit1->SetMaximum(2.5); PbPb_fit1->SetEntries(2335.214); TF1 *myfit1 = new TF1("myfit","pow(10,[0]+[1]*x+x*x*[2])+pow(10,[3]*x*x+[4]*x*x*x+[5])",2,100); myfit1->SetFillColor(19); myfit1->SetFillStyle(0); myfit1->SetMarkerStyle(20); myfit1->SetLineColor(2); myfit1->SetLineWidth(2); myfit1->SetChisquare(5.134234e-08); myfit1->SetNDF(0); myfit1->GetXaxis()->SetLabelFont(42); myfit1->GetXaxis()->SetLabelSize(0.035); myfit1->GetXaxis()->SetTitleSize(0.035); myfit1->GetXaxis()->SetTitleFont(42); myfit1->GetYaxis()->SetLabelFont(42); myfit1->GetYaxis()->SetLabelSize(0.035); myfit1->GetYaxis()->SetTitleSize(0.035); myfit1->GetYaxis()->SetTitleFont(42); myfit1->SetParameter(0,-0.1325891); myfit1->SetParError(0,0.07303413); myfit1->SetParLimits(0,0,0); myfit1->SetParameter(1,-0.004821085); myfit1->SetParError(1,0.00252747); myfit1->SetParLimits(1,0,0); myfit1->SetParameter(2,0.0001629026); myfit1->SetParError(2,6.139007e-05); myfit1->SetParLimits(2,0,0); myfit1->SetParameter(3,0.001400688); myfit1->SetParError(3,0.0009400359); myfit1->SetParLimits(3,0,0); myfit1->SetParameter(4,-4.985927e-05); myfit1->SetParError(4,3.268586e-05); myfit1->SetParLimits(4,0,0); myfit1->SetParameter(5,-0.9198558); myfit1->SetParError(5,0.3015603); myfit1->SetParLimits(5,0,0); PbPb_fit1->GetListOfFunctions()->Add(myfit1); TPaveStats *ptstats = new TPaveStats(0.558,0.6,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("PbPb_fit"); AText->SetTextSize(0.01971428); AText = ptstats->AddText("Entries = 2335 "); AText = ptstats->AddText("Mean = 20.89"); AText = ptstats->AddText("RMS = 11.16"); AText = ptstats->AddText("Underflow = 0"); AText = ptstats->AddText("Overflow = 0"); AText = ptstats->AddText("Integral = 4.256"); AText = ptstats->AddText("#chi^{2} / ndf = 5.134e-08 / 0"); AText = ptstats->AddText("p0 = -0.1326 #pm 0.0730 "); AText = ptstats->AddText("p1 = -0.004821 #pm 0.002527 "); AText = ptstats->AddText("p2 = 0.0001629 #pm 0.0000614 "); AText = ptstats->AddText("p3 = 0.001401 #pm 0.000940 "); AText = ptstats->AddText("p4 = -4.986e-05 #pm 3.269e-05 "); AText = ptstats->AddText("p5 = -0.9199 #pm 0.3016 "); ptstats->SetOptStat(1111111); ptstats->SetOptFit(111); ptstats->Draw(); PbPb_fit1->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(PbPb_fit1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); PbPb_fit1->SetLineColor(ci); PbPb_fit1->SetMarkerStyle(20); PbPb_fit1->GetXaxis()->SetTitle("Gen p_{T}(GeV)"); PbPb_fit1->GetXaxis()->CenterTitle(true); PbPb_fit1->GetXaxis()->SetLabelFont(42); PbPb_fit1->GetXaxis()->SetLabelSize(0.035); PbPb_fit1->GetXaxis()->SetTitleSize(0.035); PbPb_fit1->GetXaxis()->SetTitleFont(42); PbPb_fit1->GetYaxis()->SetTitle("Efficiency p_{T} weight / no weight"); PbPb_fit1->GetYaxis()->CenterTitle(true); PbPb_fit1->GetYaxis()->SetLabelFont(42); PbPb_fit1->GetYaxis()->SetLabelSize(0.035); PbPb_fit1->GetYaxis()->SetTitleSize(0.035); PbPb_fit1->GetYaxis()->SetTitleOffset(1.2); PbPb_fit1->GetYaxis()->SetTitleFont(42); PbPb_fit1->GetZaxis()->SetLabelFont(42); PbPb_fit1->GetZaxis()->SetLabelSize(0.035); PbPb_fit1->GetZaxis()->SetTitleSize(0.035); PbPb_fit1->GetZaxis()->SetTitleFont(42); PbPb_fit1->Draw(""); tex = new TLatex(15,2,"B+ PbPb #sqrt{s}= 5.02 TeV"); tex->SetLineWidth(2); tex->Draw(); Fit->Modified(); Fit->cd(); Fit->SetSelected(Fit); }
void c() { //=========Macro generated from canvas: c/ //========= (Wed Jul 15 12:00:01 2015) by ROOT version6.04/00 TCanvas *c = new TCanvas("c", "",241,92,600,502); c->SetHighLightColor(2); c->Range(-162.5,793.0968,162.5,5327.128); c->SetFillColor(0); c->SetBorderMode(0); c->SetBorderSize(2); c->SetFrameBorderMode(0); c->SetFrameBorderMode(0); TH1D *hist__1__1 = new TH1D("hist__1__1","Difference in PMT-constructed position and mc-truth start position",100,-130,130); hist__1__1->SetBinContent(0,12746); hist__1__1->SetBinContent(1,1411); hist__1__1->SetBinContent(2,1544); hist__1__1->SetBinContent(3,1661); hist__1__1->SetBinContent(4,1683); hist__1__1->SetBinContent(5,1784); hist__1__1->SetBinContent(6,2533); hist__1__1->SetBinContent(7,2615); hist__1__1->SetBinContent(8,2743); hist__1__1->SetBinContent(9,2797); hist__1__1->SetBinContent(10,2647); hist__1__1->SetBinContent(11,2958); hist__1__1->SetBinContent(12,3082); hist__1__1->SetBinContent(13,2971); hist__1__1->SetBinContent(14,3232); hist__1__1->SetBinContent(15,3016); hist__1__1->SetBinContent(16,3336); hist__1__1->SetBinContent(17,3712); hist__1__1->SetBinContent(18,3809); hist__1__1->SetBinContent(19,3902); hist__1__1->SetBinContent(20,3742); hist__1__1->SetBinContent(21,3718); hist__1__1->SetBinContent(22,3825); hist__1__1->SetBinContent(23,4008); hist__1__1->SetBinContent(24,3934); hist__1__1->SetBinContent(25,4167); hist__1__1->SetBinContent(26,4107); hist__1__1->SetBinContent(27,4153); hist__1__1->SetBinContent(28,4438); hist__1__1->SetBinContent(29,4538); hist__1__1->SetBinContent(30,4540); hist__1__1->SetBinContent(31,4452); hist__1__1->SetBinContent(32,4157); hist__1__1->SetBinContent(33,4423); hist__1__1->SetBinContent(34,4408); hist__1__1->SetBinContent(35,4611); hist__1__1->SetBinContent(36,4621); hist__1__1->SetBinContent(37,4339); hist__1__1->SetBinContent(38,4458); hist__1__1->SetBinContent(39,4609); hist__1__1->SetBinContent(40,4519); hist__1__1->SetBinContent(41,4430); hist__1__1->SetBinContent(42,4648); hist__1__1->SetBinContent(43,4358); hist__1__1->SetBinContent(44,4503); hist__1__1->SetBinContent(45,4561); hist__1__1->SetBinContent(46,4632); hist__1__1->SetBinContent(47,4566); hist__1__1->SetBinContent(48,4420); hist__1__1->SetBinContent(49,4395); hist__1__1->SetBinContent(50,4628); hist__1__1->SetBinContent(51,4563); hist__1__1->SetBinContent(52,4471); hist__1__1->SetBinContent(53,4539); hist__1__1->SetBinContent(54,4464); hist__1__1->SetBinContent(55,4581); hist__1__1->SetBinContent(56,4531); hist__1__1->SetBinContent(57,4598); hist__1__1->SetBinContent(58,4456); hist__1__1->SetBinContent(59,4341); hist__1__1->SetBinContent(60,4654); hist__1__1->SetBinContent(61,4672); hist__1__1->SetBinContent(62,4511); hist__1__1->SetBinContent(63,4446); hist__1__1->SetBinContent(64,4356); hist__1__1->SetBinContent(65,4380); hist__1__1->SetBinContent(66,4383); hist__1__1->SetBinContent(67,4469); hist__1__1->SetBinContent(68,4606); hist__1__1->SetBinContent(69,4563); hist__1__1->SetBinContent(70,4413); hist__1__1->SetBinContent(71,4701); hist__1__1->SetBinContent(72,4643); hist__1__1->SetBinContent(73,4427); hist__1__1->SetBinContent(74,3933); hist__1__1->SetBinContent(75,3939); hist__1__1->SetBinContent(76,4093); hist__1__1->SetBinContent(77,3913); hist__1__1->SetBinContent(78,4026); hist__1__1->SetBinContent(79,3843); hist__1__1->SetBinContent(80,3641); hist__1__1->SetBinContent(81,3916); hist__1__1->SetBinContent(82,4042); hist__1__1->SetBinContent(83,3798); hist__1__1->SetBinContent(84,3601); hist__1__1->SetBinContent(85,3249); hist__1__1->SetBinContent(86,3146); hist__1__1->SetBinContent(87,3199); hist__1__1->SetBinContent(88,3035); hist__1__1->SetBinContent(89,3021); hist__1__1->SetBinContent(90,2861); hist__1__1->SetBinContent(91,2848); hist__1__1->SetBinContent(92,2819); hist__1__1->SetBinContent(93,2744); hist__1__1->SetBinContent(94,2542); hist__1__1->SetBinContent(95,2198); hist__1__1->SetBinContent(96,1717); hist__1__1->SetBinContent(97,1743); hist__1__1->SetBinContent(98,1585); hist__1__1->SetBinContent(99,1504); hist__1__1->SetBinContent(100,1475); hist__1__1->SetBinContent(101,12137); hist__1__1->SetEntries(397426); TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("hist__1"); AText->SetTextSize(0.0368); AText = ptstats->AddText("Entries = 397426 "); AText = ptstats->AddText("Mean = -0.08411"); AText = ptstats->AddText("Std Dev = 66.16"); ptstats->SetOptStat(1111); ptstats->SetOptFit(0); ptstats->Draw(); hist__1__1->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(hist__1__1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = 926; color = new TColor(ci, 0, 0, 1, " ", 0.273); hist__1__1->SetFillColor(ci); hist__1__1->SetLineColor(4); hist__1__1->SetLineWidth(2); hist__1__1->GetXaxis()->SetTitle("#DeltaY [cm]"); hist__1__1->GetXaxis()->SetLabelFont(42); hist__1__1->GetXaxis()->SetLabelSize(0.05); hist__1__1->GetXaxis()->SetTitleSize(0.05); hist__1__1->GetXaxis()->SetTitleOffset(0.93); hist__1__1->GetXaxis()->SetTitleFont(22); hist__1__1->GetYaxis()->SetLabelFont(42); hist__1__1->GetYaxis()->SetLabelSize(0.05); hist__1__1->GetYaxis()->SetTitleSize(0.035); hist__1__1->GetYaxis()->SetTitleFont(42); hist__1__1->GetZaxis()->SetLabelFont(42); hist__1__1->GetZaxis()->SetLabelSize(0.035); hist__1__1->GetZaxis()->SetTitleSize(0.035); hist__1__1->GetZaxis()->SetTitleFont(42); hist__1__1->Draw(""); TPaveText *pt = new TPaveText(0.15,0.9368947,0.85,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("Difference in PMT-constructed position and mc-truth start position"); pt->Draw(); c->Modified(); c->cd(); c->SetSelected(c); }
void initial_z_diff() { //=========Macro generated from canvas: c/ //========= (Fri Jul 24 10:47:18 2015) by ROOT version6.04/00 TCanvas *c = new TCanvas("c", "",0,45,600,500); c->SetHighLightColor(2); c->Range(-187.5,-3568.557,187.5,32117.01); c->SetFillColor(0); c->SetBorderMode(0); c->SetBorderSize(2); c->SetFrameBorderMode(0); c->SetFrameBorderMode(0); TH1D *hist__1 = new TH1D("hist__1","Difference in PMT-constructed position and mc-truth start position",100,-150,150); hist__1->SetBinContent(0,49); hist__1->SetBinContent(1,12); hist__1->SetBinContent(2,7); hist__1->SetBinContent(3,9); hist__1->SetBinContent(4,12); hist__1->SetBinContent(5,21); hist__1->SetBinContent(6,30); hist__1->SetBinContent(7,36); hist__1->SetBinContent(8,47); hist__1->SetBinContent(9,67); hist__1->SetBinContent(10,70); hist__1->SetBinContent(11,90); hist__1->SetBinContent(12,140); hist__1->SetBinContent(13,162); hist__1->SetBinContent(14,208); hist__1->SetBinContent(15,208); hist__1->SetBinContent(16,317); hist__1->SetBinContent(17,367); hist__1->SetBinContent(18,460); hist__1->SetBinContent(19,581); hist__1->SetBinContent(20,685); hist__1->SetBinContent(21,838); hist__1->SetBinContent(22,963); hist__1->SetBinContent(23,1079); hist__1->SetBinContent(24,1231); hist__1->SetBinContent(25,1281); hist__1->SetBinContent(26,1264); hist__1->SetBinContent(27,1318); hist__1->SetBinContent(28,1318); hist__1->SetBinContent(29,1265); hist__1->SetBinContent(30,1282); hist__1->SetBinContent(31,1235); hist__1->SetBinContent(32,1315); hist__1->SetBinContent(33,1290); hist__1->SetBinContent(34,1399); hist__1->SetBinContent(35,1363); hist__1->SetBinContent(36,1528); hist__1->SetBinContent(37,1700); hist__1->SetBinContent(38,1822); hist__1->SetBinContent(39,2053); hist__1->SetBinContent(40,2441); hist__1->SetBinContent(41,2903); hist__1->SetBinContent(42,3359); hist__1->SetBinContent(43,4326); hist__1->SetBinContent(44,5618); hist__1->SetBinContent(45,7284); hist__1->SetBinContent(46,9575); hist__1->SetBinContent(47,12857); hist__1->SetBinContent(48,16804); hist__1->SetBinContent(49,21562); hist__1->SetBinContent(50,27189); hist__1->SetBinContent(51,26947); hist__1->SetBinContent(52,21828); hist__1->SetBinContent(53,17254); hist__1->SetBinContent(54,13388); hist__1->SetBinContent(55,10171); hist__1->SetBinContent(56,7452); hist__1->SetBinContent(57,5752); hist__1->SetBinContent(58,4452); hist__1->SetBinContent(59,3522); hist__1->SetBinContent(60,2826); hist__1->SetBinContent(61,2449); hist__1->SetBinContent(62,2170); hist__1->SetBinContent(63,1855); hist__1->SetBinContent(64,1635); hist__1->SetBinContent(65,1515); hist__1->SetBinContent(66,1393); hist__1->SetBinContent(67,1344); hist__1->SetBinContent(68,1279); hist__1->SetBinContent(69,1232); hist__1->SetBinContent(70,1248); hist__1->SetBinContent(71,1277); hist__1->SetBinContent(72,1226); hist__1->SetBinContent(73,1247); hist__1->SetBinContent(74,1229); hist__1->SetBinContent(75,1187); hist__1->SetBinContent(76,1265); hist__1->SetBinContent(77,1253); hist__1->SetBinContent(78,1269); hist__1->SetBinContent(79,1210); hist__1->SetBinContent(80,1055); hist__1->SetBinContent(81,914); hist__1->SetBinContent(82,761); hist__1->SetBinContent(83,632); hist__1->SetBinContent(84,515); hist__1->SetBinContent(85,450); hist__1->SetBinContent(86,356); hist__1->SetBinContent(87,264); hist__1->SetBinContent(88,227); hist__1->SetBinContent(89,176); hist__1->SetBinContent(90,127); hist__1->SetBinContent(91,134); hist__1->SetBinContent(92,85); hist__1->SetBinContent(93,60); hist__1->SetBinContent(94,47); hist__1->SetBinContent(95,29); hist__1->SetBinContent(96,31); hist__1->SetBinContent(97,18); hist__1->SetBinContent(98,14); hist__1->SetBinContent(99,12); hist__1->SetBinContent(100,12); hist__1->SetBinContent(101,63); hist__1->SetEntries(289897); TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("hist"); AText->SetTextSize(0.0368); AText = ptstats->AddText("Entries = 289897 "); AText = ptstats->AddText("Mean = 0.6888"); AText = ptstats->AddText("Std Dev = 33.12"); ptstats->SetOptStat(1111); ptstats->SetOptFit(0); ptstats->Draw(); hist__1->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(hist__1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); hist__1->SetLineColor(ci); hist__1->GetXaxis()->SetTitle("#DeltaZ [cm]"); hist__1->GetXaxis()->SetLabelFont(42); hist__1->GetXaxis()->SetLabelSize(0.035); hist__1->GetXaxis()->SetTitleSize(0.035); hist__1->GetXaxis()->SetTitleFont(42); hist__1->GetYaxis()->SetLabelFont(42); hist__1->GetYaxis()->SetLabelSize(0.035); hist__1->GetYaxis()->SetTitleSize(0.035); hist__1->GetYaxis()->SetTitleFont(42); hist__1->GetZaxis()->SetLabelFont(42); hist__1->GetZaxis()->SetLabelSize(0.035); hist__1->GetZaxis()->SetTitleSize(0.035); hist__1->GetZaxis()->SetTitleFont(42); hist__1->Draw(""); TPaveText *pt = new TPaveText(0.15,0.9368947,0.85,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("Difference in PMT-constructed position and mc-truth start position"); pt->Draw(); c->Modified(); c->cd(); c->SetSelected(c); }
void FitDijetMass_Data() { TFile *inf = new TFile("MassResults_ak7calo.root"); TH1F *hCorMassDen = (TH1F*) inf->Get("DiJetMass"); hCorMassDen->SetXTitle("Corrected Dijet Mass (GeV)"); hCorMassDen->SetYTitle("Events/GeV"); hCorMassDen->GetYaxis()->SetTitleOffset(1.5); hCorMassDen->SetMarkerStyle(20); hCorMassDen->GetXaxis()->SetRangeUser(120.,900.); gROOT->ProcessLine(".L tdrstyle.C"); setTDRStyle(); tdrStyle->SetErrorX(0.5); tdrStyle->SetPadRightMargin(0.08); tdrStyle->SetLegendBorderSize(0); gStyle->SetOptFit(1111); tdrStyle->SetOptStat(0); TCanvas* c2 = new TCanvas("c2","DijetMass", 500, 500); /////// perform 4 parameters fit TF1 *func = new TF1("func", "[0]*((1-x/7000.+[3]*(x/7000)^2)^[1])/(x^[2])", 100., 1000.); func->SetParameter(0, 1.0e+08); func->SetParameter(1, -1.23); func->SetParameter(2, 4.13); func->SetParameter(3, 1.0); func->SetLineColor(4); func->SetLineWidth(3); TVirtualFitter::SetMaxIterations( 10000 ); TVirtualFitter *fitter; TMatrixDSym* cov_matrix; int fitStatus = hCorMassDen->Fit("func","LLI","",130.0, 800.0); // QCD fit TH1F *hFitUncertainty = hCorMassDen->Clone("hFitUncertainty"); hFitUncertainty->SetLineColor(5); hFitUncertainty->SetFillColor(5); hFitUncertainty->SetMarkerColor(5); if (fitStatus == 0) { fitter = TVirtualFitter::GetFitter(); double* m_elements = fitter->GetCovarianceMatrix(); cov_matrix = new TMatrixDSym( func->GetNumberFreeParameters(),m_elements); cov_matrix->Print(); double x, y, e; for(int i=0;i<hFitUncertainty->GetNbinsX();i++) { x = hFitUncertainty->GetBinCenter(i+1); y = func->Eval(x); e = QCDFitUncertainty( func, *cov_matrix, x); hFitUncertainty->SetBinContent(i+1,y); hFitUncertainty->SetBinError(i+1,e); } } hCorMassDen->Draw("ep"); gPad->Update(); TPaveStats *st = (TPaveStats*)hCorMassDen->FindObject("stats"); st->SetName("stats1"); st->SetX1NDC(0.3); //new x start position st->SetX2NDC(0.6); //new x end position st->SetTextColor(4); hCorMassDen->GetListOfFunctions()->Add(st); /////// perform 2 parameters fit TF1 *func2 = new TF1("func2", "[0]*(1-x/7000.)/(x^[1])", 100., 1000.); func2->SetParameter(0, 10000.); func2->SetParameter(1, 5.0); func2->SetLineWidth(3); fitStatus = hCorMassDen->Fit("func2","LLI","",130.0, 800.0); // QCD fit TH1F *hFitUncertainty2 = hCorMassDen->Clone("hFitUncertainty2"); hFitUncertainty2->SetLineColor(kGray); hFitUncertainty2->SetFillColor(kGray); hFitUncertainty2->SetMarkerColor(kGray); if (fitStatus == 0) { fitter = TVirtualFitter::GetFitter(); double* m_elements = fitter->GetCovarianceMatrix(); cov_matrix = new TMatrixDSym( func2->GetNumberFreeParameters(),m_elements); cov_matrix->Print(); double x, y, e; for(int i=0;i<hFitUncertainty2->GetNbinsX();i++) { x = hFitUncertainty2->GetBinCenter(i+1); y = func2->Eval(x); e = QCDFitUncertainty( func2, *cov_matrix, x); hFitUncertainty2->SetBinContent(i+1,y); hFitUncertainty2->SetBinError(i+1,e); } } hFitUncertainty->Draw("E3 same"); hCorMassDen->Draw("ep sames"); hFitUncertainty2->Draw("E3 same"); hCorMassDen->Draw("ep sames"); func2->Draw("same"); c2->SetLogy(1); /* TH1F *hCorMass = hCorMassDen->Clone("hCorMass"); for(int i=0; i<hCorMass->GetNbinsX(); i++){ hCorMass->SetBinContent(i+1, hCorMassDen->GetBinContent(i+1) * hCorMassDen->GetBinWidth(i+1)); hCorMass->SetBinError(i+1, hCorMassDen->GetBinError(i+1) * hCorMassDen->GetBinWidth(i+1)); } // Our observable is the invariant mass RooRealVar invMass("invMass", "Corrected dijet mass", 100., 1000.0, "GeV"); RooDataHist data( "data", "", invMass, hCorMass); ////////////////////////////////////////////// // make QCD model RooRealVar p0("p0", "# events", 600.0, 0.0, 10000000000.); RooRealVar p1("p1","p1", 3.975, -10., 10.) ; RooRealVar p2("p2","p2", 5.302, 4., 8.) ; RooRealVar p3("p3","p3", -1.51, -100., 100.) ; // // define QCD line shape RooGenericPdf qcdModel("qcdModel", "pow(1-@0/7000.+@3*(@0/7000.)*(@0/7000.),@1)*pow(@0/7000.,-@2)", RooArgList(invMass,p1,p2,p3)); // full model RooAddPdf model("model","qcd",RooArgList(qcdModel), RooArgList(p0)); //plot sig candidates, full model, and individual componenets // __ _ _ // / _(_) |_ // | |_| | __| // | _| | |_ // |_| |_|\__| // Important: fit integrating f(x) over ranges defined by X errors, rather // than taking point at center of bin RooFitResult* fit = model.fitTo(data, Minos(kFALSE), Extended(kTRUE), SumW2Error(kFALSE),Save(kTRUE), Range(130.,800.), Integrate(kTRUE) ); // to perform chi^2 minimization fit instead // RooFitResult* fit = model.chi2FitTo(data, Extended(kTRUE), // Save(),Range(50.,526.),Integrate(kTRUE) ); fit->Print(); //plot data TCanvas* cdataNull = new TCanvas("cdataNull","fit to dijet mass",500,500); RooPlot* frame1 = invMass.frame() ; data.plotOn(frame1, DataError(RooAbsData::SumW2) ) ; model.plotOn(frame1, LineColor(kBlue)) ; model.plotOn(frame1, VisualizeError(*fit, 1),FillColor(kYellow)) ; data.plotOn(frame1, DataError(RooAbsData::SumW2) ) ; model.plotOn(frame1, LineColor(kBlue)) ; model.paramOn(frame1, Layout(0.4, 0.85, 0.92)); TPaveText* dataPave = (TPaveText*) frame1->findObject("model_paramBox"); dataPave->SetY1(0.77); gPad->SetLogy(); frame1->GetYaxis()->SetNoExponent(); frame1->GetYaxis()->SetRangeUser(5E-2,5E+4); frame1->GetYaxis()->SetTitle("Events / bin"); frame1->GetYaxis()->SetTitleOffset(1.35); frame1->SetTitle("fit to data with QCD lineshape"); frame1->Draw() ; // S h o w r e s i d u a l a n d p u l l d i s t s // ------------------------------------------------------- //// Construct a histogram with the residuals of the data w.r.t. the curve RooHist* hresid = frame1->residHist() ; // Create a new frame to draw the residual distribution and add the distribution to the frame RooPlot* frame2 = invMass.frame(Title("Residual Distribution")) ; frame2->addPlotable(hresid,"P") ; ///// Construct a histogram with the pulls of the data w.r.t the curve RooHist* hpull = frame1->pullHist() ; //// Create a new frame to draw the pull distribution and add the distribution to the frame RooPlot* frame3 = invMass.frame(Title("Pull Distribution")) ; frame3->addPlotable(hpull,"P") ; TCanvas* cResidual = new TCanvas("cResidual","Residual Distribution",1000,500); cResidual->Divide(2) ; cResidual->cd(1) ; gPad->SetLeftMargin(0.15) ; frame1->GetYaxis()->SetTitleOffset(1.6) ; frame2->Draw() ; cResidual->cd(2) ; gPad->SetLeftMargin(0.15) ; frame1->GetYaxis()->SetTitleOffset(1.6) ; frame3->Draw() ; */ }
void BSA_InCoherent_t() { //=========Macro generated from canvas: c17/Incoherent channe //========= (Tue Aug 21 12:00:26 2018) by ROOT version6.09/01 TCanvas *c17 = new TCanvas("c17", "Incoherent channe",0,0,1200,400); gStyle->SetOptFit(1); c17->Range(0,0,1,1); c17->SetFillColor(0); c17->SetBorderMode(0); c17->SetBorderSize(2); c17->SetLeftMargin(0.025); c17->SetRightMargin(0.02325581); c17->SetFrameBorderMode(0); // ------------>Primitives in pad: c17_1 TPad *c17_1 = new TPad("c17_1", "Incoherent channe_1",0,0,0.262936,0.9); c17_1->Draw(); c17_1->cd(); c17_1->Range(-32.86883,-0.4888889,353.6809,0.4); c17_1->SetFillColor(0); c17_1->SetBorderMode(0); c17_1->SetBorderSize(2); c17_1->SetGridx(); c17_1->SetGridy(); c17_1->SetRightMargin(0); c17_1->SetTopMargin(0); c17_1->SetFrameBorderMode(0); c17_1->SetFrameBorderMode(0); TMultiGraph *multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("0.05<-t<0.21 [GeV^{2}/c^{2}]"); Double_t Graph_fx1154[9] = { 21.59954, 59.03178, 96.06391, 141.7703, 179.2242, 222.8541, 259.5793, 303.38, 337.8675}; Double_t Graph_fy1154[9] = { 0.1020231, 0.03114899, 0.2309077, 0.1341245, 0.01684177, -0.1267998, -0.2824572, -0.2260703, -0.0186068}; Double_t Graph_fex1154[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph_fey1154[9] = { 0.04242532, 0.05165487, 0.05483741, 0.07646672, 0.1006626, 0.09089962, 0.05905575, 0.04462244, 0.05521722}; TGraphErrors *gre = new TGraphErrors(9,Graph_fx1154,Graph_fy1154,Graph_fex1154,Graph_fey1154); gre->SetName("Graph"); gre->SetTitle("Graph"); gre->SetFillColor(1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#00ff00"); gre->SetMarkerColor(ci); gre->SetMarkerStyle(21); TH1F *Graph_Graph1154 = new TH1F("Graph_Graph1154","Graph",100,0,369.4943); Graph_Graph1154->SetMinimum(-0.4042387); Graph_Graph1154->SetMaximum(0.3484709); Graph_Graph1154->SetDirectory(0); Graph_Graph1154->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1154->SetLineColor(ci); Graph_Graph1154->GetXaxis()->SetLabelFont(42); Graph_Graph1154->GetXaxis()->SetLabelSize(0.035); Graph_Graph1154->GetXaxis()->SetTitleSize(0.035); Graph_Graph1154->GetXaxis()->SetTitleFont(42); Graph_Graph1154->GetYaxis()->SetLabelFont(42); Graph_Graph1154->GetYaxis()->SetLabelSize(0.035); Graph_Graph1154->GetYaxis()->SetTitleSize(0.035); Graph_Graph1154->GetYaxis()->SetTitleFont(42); Graph_Graph1154->GetZaxis()->SetLabelFont(42); Graph_Graph1154->GetZaxis()->SetLabelSize(0.035); Graph_Graph1154->GetZaxis()->SetTitleSize(0.035); Graph_Graph1154->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1154); TF1 *myfit1155 = new TF1("myfit","[0]*sin(x*3.1416/180.0)/(1 + [1]*cos(x*3.1416/180.0))",0,369.4943); myfit1155->SetFillColor(19); myfit1155->SetFillStyle(0); myfit1155->SetLineColor(2); myfit1155->SetLineWidth(2); myfit1155->SetChisquare(12.03234); myfit1155->SetNDF(7); myfit1155->GetXaxis()->SetLabelFont(42); myfit1155->GetXaxis()->SetLabelSize(0.035); myfit1155->GetXaxis()->SetTitleSize(0.035); myfit1155->GetXaxis()->SetTitleFont(42); myfit1155->GetYaxis()->SetLabelFont(42); myfit1155->GetYaxis()->SetLabelSize(0.035); myfit1155->GetYaxis()->SetTitleSize(0.035); myfit1155->GetYaxis()->SetTitleFont(42); myfit1155->SetParameter(0,0.2160608); myfit1155->SetParError(0,0.02670852); myfit1155->SetParLimits(0,0,0); myfit1155->SetParameter(1,0.2378828); myfit1155->SetParError(1,0.2292802); myfit1155->SetParLimits(1,0,0); gre->GetListOfFunctions()->Add(myfit1155); TPaveStats *ptstats = new TPaveStats(0.27,0.74,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("#chi^{2} / ndf = 12.03 / 7"); AText = ptstats->AddText("p0 = 0.2161 #pm 0.02671 "); AText = ptstats->AddText("p1 = 0.2379 #pm 0.2293 "); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); gre->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(gre->GetListOfFunctions()); multigraph->Add(gre,""); multigraph->Draw("AP"); multigraph->GetXaxis()->SetTitle("#phi [deg.]"); multigraph->GetXaxis()->SetLabelFont(42); multigraph->GetXaxis()->SetLabelSize(0.035); multigraph->GetXaxis()->SetTitleSize(0.035); multigraph->GetXaxis()->SetTitleFont(42); multigraph->GetYaxis()->SetTitle("A_{LU}"); multigraph->GetYaxis()->SetLabelFont(42); multigraph->GetYaxis()->SetLabelSize(0.035); multigraph->GetYaxis()->SetTitleSize(0.035); multigraph->GetYaxis()->SetTitleFont(42); gPad->Modified(); multigraph->GetYaxis()->SetRangeUser(-0.35, 0.35); TPaveText *pt = new TPaveText(0.2292451,0.9268996,0.7707549,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("0.05<-t<0.21 [GeV^{2}/c^{2}]"); pt->Draw(); c17_1->Modified(); c17->cd(); // ------------>Primitives in pad: c17_2 TPad *c17_2 = new TPad("c17_2", "Incoherent channe_2",0.262936,0,0.5008721,0.9); c17_2->Draw(); c17_2->cd(); c17_2->Range(5.895345,-0.4888889,352.6198,0.4); c17_2->SetFillColor(0); c17_2->SetBorderMode(0); c17_2->SetBorderSize(2); c17_2->SetGridx(); c17_2->SetGridy(); c17_2->SetLeftMargin(0); c17_2->SetRightMargin(0); c17_2->SetTopMargin(0); c17_2->SetFrameBorderMode(0); c17_2->SetFrameBorderMode(0); multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("0.21<-t<0.36 [GeV^{2}/c^{2}]"); Double_t Graph_fx1157[9] = { 21.65555, 61.41754, 96.1904, 139.625, 182.9173, 222.6445, 259.1526, 302.149, 336.8596}; Double_t Graph_fy1157[9] = { 0.04372413, 0.1019325, 0.1737435, 0.1708402, 0.2316287, -0.1435087, -0.1227365, -0.1969296, -0.07714485}; Double_t Graph_fex1157[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph_fey1157[9] = { 0.0517677, 0.05885852, 0.0646232, 0.09789667, 0.1185262, 0.09557657, 0.06953456, 0.04921871, 0.06282415}; gre = new TGraphErrors(9,Graph_fx1157,Graph_fy1157,Graph_fex1157,Graph_fey1157); gre->SetName("Graph"); gre->SetTitle("Graph"); gre->SetFillColor(1); ci = TColor::GetColor("#00ff00"); gre->SetMarkerColor(ci); gre->SetMarkerStyle(21); TH1F *Graph_Graph1157 = new TH1F("Graph_Graph1157","Graph",100,0,368.38); Graph_Graph1157->SetMinimum(-0.3057786); Graph_Graph1157->SetMaximum(0.4097851); Graph_Graph1157->SetDirectory(0); Graph_Graph1157->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1157->SetLineColor(ci); Graph_Graph1157->GetXaxis()->SetLabelFont(42); Graph_Graph1157->GetXaxis()->SetLabelSize(0.035); Graph_Graph1157->GetXaxis()->SetTitleSize(0.035); Graph_Graph1157->GetXaxis()->SetTitleFont(42); Graph_Graph1157->GetYaxis()->SetLabelFont(42); Graph_Graph1157->GetYaxis()->SetLabelSize(0.035); Graph_Graph1157->GetYaxis()->SetTitleSize(0.035); Graph_Graph1157->GetYaxis()->SetTitleFont(42); Graph_Graph1157->GetZaxis()->SetLabelFont(42); Graph_Graph1157->GetZaxis()->SetLabelSize(0.035); Graph_Graph1157->GetZaxis()->SetTitleSize(0.035); Graph_Graph1157->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1157); TF1 *myfit1158 = new TF1("myfit","[0]*sin(x*3.1416/180.0)/(1 + [1]*cos(x*3.1416/180.0))",0,368.38); myfit1158->SetFillColor(19); myfit1158->SetFillStyle(0); myfit1158->SetLineColor(2); myfit1158->SetLineWidth(2); myfit1158->SetChisquare(6.955655); myfit1158->SetNDF(7); myfit1158->GetXaxis()->SetLabelFont(42); myfit1158->GetXaxis()->SetLabelSize(0.035); myfit1158->GetXaxis()->SetTitleSize(0.035); myfit1158->GetXaxis()->SetTitleFont(42); myfit1158->GetYaxis()->SetLabelFont(42); myfit1158->GetYaxis()->SetLabelSize(0.035); myfit1158->GetYaxis()->SetTitleSize(0.035); myfit1158->GetYaxis()->SetTitleFont(42); myfit1158->SetParameter(0,0.1721707); myfit1158->SetParError(0,0.0324291); myfit1158->SetParLimits(0,0,0); myfit1158->SetParameter(1,0.001708824); myfit1158->SetParError(1,0.4101565); myfit1158->SetParLimits(1,0,0); gre->GetListOfFunctions()->Add(myfit1158); ptstats = new TPaveStats(0.27,0.74,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); AText = ptstats->AddText("#chi^{2} / ndf = 6.956 / 7"); AText = ptstats->AddText("p0 = 0.1722 #pm 0.03243 "); AText = ptstats->AddText("p1 = 0.001709 #pm 0.4102 "); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); gre->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(gre->GetListOfFunctions()); multigraph->Add(gre,""); multigraph->Draw("AP"); multigraph->GetXaxis()->SetTitle("#phi [deg.]"); multigraph->GetXaxis()->SetLabelFont(42); multigraph->GetXaxis()->SetLabelSize(0.035); multigraph->GetXaxis()->SetTitleSize(0.035); multigraph->GetXaxis()->SetTitleFont(42); multigraph->GetYaxis()->SetLabelFont(42); multigraph->GetYaxis()->SetLabelSize(0.035); multigraph->GetYaxis()->SetTitleSize(0.035); multigraph->GetYaxis()->SetTitleFont(42); gPad->Modified(); multigraph->GetYaxis()->SetRangeUser(-0.35, 0.35); pt = new TPaveText(0.2194177,0.9304839,0.7805823,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("0.21<-t<0.36 [GeV^{2}/c^{2}]"); pt->Draw(); c17_2->Modified(); c17->cd(); // ------------>Primitives in pad: c17_3 TPad *c17_3 = new TPad("c17_3", "Incoherent channe_3",0.5008721,0,0.7388081,0.9); c17_3->Draw(); c17_3->cd(); c17_3->Range(7.121854,-0.4888889,349.9594,0.4); c17_3->SetFillColor(0); c17_3->SetBorderMode(0); c17_3->SetBorderSize(2); c17_3->SetGridx(); c17_3->SetGridy(); c17_3->SetLeftMargin(0); c17_3->SetRightMargin(0); c17_3->SetTopMargin(0); c17_3->SetFrameBorderMode(0); c17_3->SetFrameBorderMode(0); multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("0.36<-t<0.67 [GeV^{2}/c^{2}]"); Double_t Graph_fx1160[9] = { 22.70538, 60.97743, 94.23011, 138.1892, 183.0975, 222.79, 259.8951, 302.6808, 334.3759}; Double_t Graph_fy1160[9] = { 0.1761498, 0.1945204, 0.1034809, -0.09380414, 0.2967375, -0.1094475, -0.1583282, -0.1819771, -0.09543453}; Double_t Graph_fex1160[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph_fey1160[9] = { 0.06358895, 0.0584754, 0.07622601, 0.115077, 0.1268505, 0.1278475, 0.07389284, 0.04701977, 0.07415904}; gre = new TGraphErrors(9,Graph_fx1160,Graph_fy1160,Graph_fex1160,Graph_fey1160); gre->SetName("Graph"); gre->SetTitle("Graph"); gre->SetFillColor(1); ci = TColor::GetColor("#00ff00"); gre->SetMarkerColor(ci); gre->SetMarkerStyle(21); TH1F *Graph_Graph1160 = new TH1F("Graph_Graph1160","Graph",100,0,365.5429); Graph_Graph1160->SetMinimum(-0.3033832); Graph_Graph1160->SetMaximum(0.4896763); Graph_Graph1160->SetDirectory(0); Graph_Graph1160->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1160->SetLineColor(ci); Graph_Graph1160->GetXaxis()->SetLabelFont(42); Graph_Graph1160->GetXaxis()->SetLabelSize(0.035); Graph_Graph1160->GetXaxis()->SetTitleSize(0.035); Graph_Graph1160->GetXaxis()->SetTitleFont(42); Graph_Graph1160->GetYaxis()->SetLabelFont(42); Graph_Graph1160->GetYaxis()->SetLabelSize(0.035); Graph_Graph1160->GetYaxis()->SetTitleSize(0.035); Graph_Graph1160->GetYaxis()->SetTitleFont(42); Graph_Graph1160->GetZaxis()->SetLabelFont(42); Graph_Graph1160->GetZaxis()->SetLabelSize(0.035); Graph_Graph1160->GetZaxis()->SetTitleSize(0.035); Graph_Graph1160->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1160); TF1 *myfit1161 = new TF1("myfit","[0]*sin(x*3.1416/180.0)/(1 + [1]*cos(x*3.1416/180.0))",0,365.5429); myfit1161->SetFillColor(19); myfit1161->SetFillStyle(0); myfit1161->SetLineColor(2); myfit1161->SetLineWidth(2); myfit1161->SetChisquare(8.926216); myfit1161->SetNDF(7); myfit1161->GetXaxis()->SetLabelFont(42); myfit1161->GetXaxis()->SetLabelSize(0.035); myfit1161->GetXaxis()->SetTitleSize(0.035); myfit1161->GetXaxis()->SetTitleFont(42); myfit1161->GetYaxis()->SetLabelFont(42); myfit1161->GetYaxis()->SetLabelSize(0.035); myfit1161->GetYaxis()->SetTitleSize(0.035); myfit1161->GetYaxis()->SetTitleFont(42); myfit1161->SetParameter(0,0.1371093); myfit1161->SetParError(0,0.03383483); myfit1161->SetParLimits(0,0,0); myfit1161->SetParameter(1,-0.6800102); myfit1161->SetParError(1,0.1832383); myfit1161->SetParLimits(1,0,0); gre->GetListOfFunctions()->Add(myfit1161); ptstats = new TPaveStats(0.27,0.74,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); AText = ptstats->AddText("#chi^{2} / ndf = 8.926 / 7"); AText = ptstats->AddText("p0 = 0.1371 #pm 0.03383 "); AText = ptstats->AddText("p1 = -0.68 #pm 0.1832 "); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); gre->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(gre->GetListOfFunctions()); multigraph->Add(gre,""); multigraph->Draw("AP"); multigraph->GetXaxis()->SetTitle("#phi [deg.]"); multigraph->GetXaxis()->SetLabelFont(42); multigraph->GetXaxis()->SetLabelSize(0.035); multigraph->GetXaxis()->SetTitleSize(0.035); multigraph->GetXaxis()->SetTitleFont(42); multigraph->GetYaxis()->SetLabelFont(42); multigraph->GetYaxis()->SetLabelSize(0.035); multigraph->GetYaxis()->SetTitleSize(0.035); multigraph->GetYaxis()->SetTitleFont(42); gPad->Modified(); multigraph->GetYaxis()->SetRangeUser(-0.35, 0.35); pt = new TPaveText(0.2194177,0.9304839,0.7805823,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("0.36<-t<0.67 [GeV^{2}/c^{2}]"); pt->Draw(); c17_3->Modified(); c17->cd(); // ------------>Primitives in pad: c17_4 TPad *c17_4 = new TPad("c17_4", "Incoherent channe_4",0.7388081,0,0.9767442,0.9); c17_4->Draw(); c17_4->cd(); c17_4->Range(7.951117,-0.4888889,350.3641,0.4); c17_4->SetFillColor(0); c17_4->SetBorderMode(0); c17_4->SetBorderSize(2); c17_4->SetGridx(); c17_4->SetGridy(); c17_4->SetLeftMargin(0); c17_4->SetRightMargin(0); c17_4->SetTopMargin(0); c17_4->SetFrameBorderMode(0); c17_4->SetFrameBorderMode(0); multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("0.67<-t<0.90 [GeV^{2}/c^{2}]"); Double_t Graph_fx1163[9] = { 23.51534, 59.3759, 90.55341, 131.0631, 176.9476, 229.0094, 260.8643, 304.7922, 334.7999}; Double_t Graph_fy1163[9] = { 0.0123906, 0.195403, 0.18963, -0.1677207, -0.8232306, -0.7760588, -0.2579708, -0.2579435, -0.08614626}; Double_t Graph_fex1163[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph_fey1163[9] = { 0.09527872, 0.1168373, 0.1651642, 0.3137499, 0.3909388, 0.4596559, 0.1665094, 0.09339681, 0.09961735}; gre = new TGraphErrors(9,Graph_fx1163,Graph_fy1163,Graph_fex1163,Graph_fey1163); gre->SetName("Graph"); gre->SetTitle("Graph"); gre->SetFillColor(1); ci = TColor::GetColor("#00ff00"); gre->SetMarkerColor(ci); gre->SetMarkerStyle(21); TH1F *Graph_Graph1163 = new TH1F("Graph_Graph1163","Graph",100,0,365.9283); Graph_Graph1163->SetMinimum(-1.394766); Graph_Graph1163->SetMaximum(0.5138451); Graph_Graph1163->SetDirectory(0); Graph_Graph1163->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1163->SetLineColor(ci); Graph_Graph1163->GetXaxis()->SetLabelFont(42); Graph_Graph1163->GetXaxis()->SetLabelSize(0.035); Graph_Graph1163->GetXaxis()->SetTitleSize(0.035); Graph_Graph1163->GetXaxis()->SetTitleFont(42); Graph_Graph1163->GetYaxis()->SetLabelFont(42); Graph_Graph1163->GetYaxis()->SetLabelSize(0.035); Graph_Graph1163->GetYaxis()->SetTitleSize(0.035); Graph_Graph1163->GetYaxis()->SetTitleFont(42); Graph_Graph1163->GetZaxis()->SetLabelFont(42); Graph_Graph1163->GetZaxis()->SetLabelSize(0.035); Graph_Graph1163->GetZaxis()->SetTitleSize(0.035); Graph_Graph1163->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1163); TF1 *myfit1164 = new TF1("myfit","[0]*sin(x*3.1416/180.0)/(1 + [1]*cos(x*3.1416/180.0))",0,365.9283); myfit1164->SetFillColor(19); myfit1164->SetFillStyle(0); myfit1164->SetLineColor(2); myfit1164->SetLineWidth(2); myfit1164->SetChisquare(8.810638); myfit1164->SetNDF(7); myfit1164->GetXaxis()->SetLabelFont(42); myfit1164->GetXaxis()->SetLabelSize(0.035); myfit1164->GetXaxis()->SetTitleSize(0.035); myfit1164->GetXaxis()->SetTitleFont(42); myfit1164->GetYaxis()->SetLabelFont(42); myfit1164->GetYaxis()->SetLabelSize(0.035); myfit1164->GetYaxis()->SetTitleSize(0.035); myfit1164->GetYaxis()->SetTitleFont(42); myfit1164->SetParameter(0,0.2352442); myfit1164->SetParError(0,0.0807391); myfit1164->SetParLimits(0,0,0); myfit1164->SetParameter(1,0.003684647); myfit1164->SetParError(1,0.5673774); myfit1164->SetParLimits(1,0,0); gre->GetListOfFunctions()->Add(myfit1164); ptstats = new TPaveStats(0.27,0.74,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); AText = ptstats->AddText("#chi^{2} / ndf = 8.811 / 7"); AText = ptstats->AddText("p0 = 0.2352 #pm 0.08074 "); AText = ptstats->AddText("p1 = 0.003685 #pm 0.5674 "); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); gre->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(gre->GetListOfFunctions()); multigraph->Add(gre,""); multigraph->Draw("AP"); multigraph->GetXaxis()->SetTitle("#phi [deg.]"); multigraph->GetXaxis()->SetLabelFont(42); multigraph->GetXaxis()->SetLabelSize(0.035); multigraph->GetXaxis()->SetTitleSize(0.035); multigraph->GetXaxis()->SetTitleFont(42); multigraph->GetYaxis()->SetLabelFont(42); multigraph->GetYaxis()->SetLabelSize(0.035); multigraph->GetYaxis()->SetTitleSize(0.035); multigraph->GetYaxis()->SetTitleFont(42); gPad->Modified(); multigraph->GetYaxis()->SetRangeUser(-0.35, 0.35); pt = new TPaveText(0.2194177,0.9304839,0.7805823,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("0.67<-t<0.90 [GeV^{2}/c^{2}]"); pt->Draw(); c17_4->Modified(); c17->cd(); c17->Modified(); c17->cd(); c17->SetSelected(c17); }
int hw1(){ //define landau formula TF1* myf = new TF1("mylandau",landauf,-3,10,3); myf->SetParameters(1.0,2,1); //get ready to initial hist /* const int num = 3; string histvName[num] = {"ld_1e2","ld_1e3","ld_1e4"}; string histvTitle[num] = {"Landau 100 entris","Landau 1000 entris","Landau 10000 entris"}; int histEntries[num] = {100,1000,10000}; //new hist and fill them TCanvas* canvas = new TCanvas("myc","HW1",800,600); TMultiGraph* mg = new TMultiGraph(); for(int i = 0;i<num;i++){ TH1F* tmp=new TH1F(histvName[i].c_str(),histvTitle[i].c_str(),100,-3,10); tmp->FillRandom("mylandau",histEntries[i]); } gDirectory->Get(histvName[2])->Draw("e"); gDirectory->Get(histvName[1])->Draw("esame"); gDirectory->Get(histvName[0])->Draw("esame"); */ TCanvas* canvas = new TCanvas("myc","HW1",800,600); TH1F* h1 = new TH1F("h1","Landau 100 entries",15,-3,10); TH1F* h2 = new TH1F("h2","Landau 1000 entries",60,-3,10); TH1F* h3 = new TH1F("h3","Landau 10000 entries",200,-3,10); h1->FillRandom("mylandau",100); h2->FillRandom("mylandau",1000); h3->FillRandom("mylandau",10000); h3->GetXaxis()->SetTitle("x"); h3->GetXaxis()->CenterTitle(true); h3->GetYaxis()->SetTitle("Entries"); h3->GetYaxis()->CenterTitle(true); h3->SetStats(kFALSE); TF1* fit3 = new TF1("fit3",landauf,-3,10,3); fit3->SetParameters(1.0,2,1); h3->SetMarkerColor(kRed); h3->SetLineColor(kRed); fit3->SetLineColor(kRed+2); h3->Fit("fit3","q","e"); TF1* fit2 = new TF1("fit2",landauf,-3,10,3); fit2->SetParameters(1.0,2,1); h2->SetMarkerColor(kBlue); h2->SetLineColor(kBlue); fit2->SetLineColor(kBlue+2); h2->Fit("fit2","q","esame"); TF1* fit1 = new TF1("fit1",landauf,-3,10,3); fit1->SetParameters(1.0,2,1); h1->SetMarkerColor(kGreen); h1->SetLineColor(kGreen); fit1->SetLineColor(kGreen+2); h1->Fit("fit1","q","esame"); double h1M = h1->GetMean(); double h1R = h1->GetRMS(); double h1S = h1->GetSkewness(); double h2M = h2->GetMean(); double h2R = h2->GetRMS(); double h2S = h2->GetSkewness(); double h3M = h3->GetMean(); double h3R = h3->GetRMS(); double h3S = h3->GetSkewness(); cout<<setprecision(4); cout<<"+----+--------+--------+--------+"<<endl; cout<<"|hist| Mean | RMS |skewness|"<<endl; cout<<"+----+--------+--------+--------+"<<endl; cout<<"+ 1 |"<<setw(8)<<h1M<<"|"<<setw(8)<<h1R<<"|"<<setw(8)<<h1S<<"|"<<endl; cout<<"+----+--------+--------+--------+"<<endl; cout<<"+ 2 |"<<setw(8)<<h2M<<"|"<<setw(8)<<h2R<<"|"<<setw(8)<<h2S<<"|"<<endl; cout<<"+----+--------+--------+--------+"<<endl; cout<<"+ 3 |"<<setw(8)<<h3M<<"|"<<setw(8)<<h3R<<"|"<<setw(8)<<h3S<<"|"<<endl; cout<<"+----+--------+--------+--------+"<<endl; TPaveStats *ptstats = new TPaveStats(0.5747126,0.6334746,0.9353448,0.934322,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetLineWidth(2); ptstats->SetTextAlign(12); ptstats->SetTextFont(132); ptstats->AddText(" hist Mean RMS skewness "); ostringstream os; cout<<setprecision(4); os<<" 1 "<<setw(8)<<h1M<<" "<<setw(8)<<h1R<<" "<<setw(8)<<h1S<<" "; ptstats->AddText(os.str().c_str()); os.str(string()); os<<" 2 "<<setw(8)<<h2M<<" "<<setw(8)<<h2R<<" "<<setw(8)<<h2S<<" "; ptstats->AddText(os.str().c_str()); os.str(string()); os<<" 3 "<<setw(8)<<h3M<<" "<<setw(8)<<h3R<<" "<<setw(8)<<h3S<<" "; ptstats->AddText(os.str().c_str()); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); h1->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(h1); TLegend *leg = new TLegend(0.1582915,0.7237762,0.3580402,0.9230769,NULL,"brNDC"); leg->AddEntry(h1,"100 entries","pe"); leg->AddEntry(h2,"1000 entries","pe"); leg->AddEntry(h3,"10000 entries","pe"); leg->SetFillColor(0); leg->Draw(); //export png TImage *img = TImage::Create(); img->FromPad(canvas); img->WriteImage("hw1.png"); //delete img; //return return 0; }
void main() { TFile *f1 = new TFile("TA2Cristina_Compton.root"); TTree *t1 = (TTree*)f1->Get("TA2CristinaTree"); TFile *f2 = new TFile("TA2Cristina_Pi0.root"); TTree *t2 = (TTree*)f2->Get("TA2CristinaTree"); gStyle->SetOptStat(1111); c1 = new TCanvas("c1","Compton (Left) and Pi0 (Right)"); c1->Divide(2,3); c1->cd(1); t1->Draw("PhotonEnergyDifference:PhotonEnergy"); c1->cd(2); t2->Draw("PhotonEnergyDifference:PhotonEnergy"); c1->cd(3); t1->Draw("PhotonEnergyDifference:PhotonTheta"); c1->cd(4); t2->Draw("PhotonEnergyDifference:PhotonTheta"); c1->cd(5); t1->Draw("PhotonEnergyDifference:PhotonPhi"); c1->cd(6); t2->Draw("PhotonEnergyDifference:PhotonPhi"); c2 = new TCanvas("c2","Compton (Left) and Pi0 (Right)"); c2->Divide(2,3); c2->cd(1); t1->Draw("PhotonEnergyDifference:ProtonEnergy","NProton>0"); c2->cd(2); t2->Draw("PhotonEnergyDifference:ProtonEnergy","NProton>0"); c2->cd(3); t1->Draw("PhotonEnergyDifference:ProtonTheta","NProton>0"); c2->cd(4); t2->Draw("PhotonEnergyDifference:ProtonTheta","NProton>0"); c2->cd(5); t1->Draw("PhotonEnergyDifference:ProtonPhi","NProton>0"); c2->cd(6); t2->Draw("PhotonEnergyDifference:ProtonPhi","NProton>0"); c3 = new TCanvas("c3","Compton and Pi0"); c3->cd(); t1->Draw("PhotonEnergyDifference:PhotonTheta"); // -------------------------------------------------------------------------------- c4 = new TCanvas("c4","Compton and Pi0"); c4->cd(); t2->SetMarkerColor(kBlue+2); t1->SetMarkerColor(kRed); t2->Draw("PhotonEnergyDifference:PhotonTheta>>Pi0(180, 0, 180, 120, 180, 300)"); TH2F *Pi0 = (TH2F*)gDirectory->Get("Pi0"); t1->Draw("PhotonEnergyDifference:PhotonTheta>>Compton(180, 0, 180, 120, 180, 300)"); TH2F *Compton = (TH2F*)gDirectory->Get("Compton"); gStyle->SetStatTextColor(kBlue+2); Pi0->Draw(); c4->Update(); TPaveStats *stats =(TPaveStats*)c4->GetPrimitive("stats"); stats->SetName("h1stats"); stats->SetY1NDC(.508); stats->SetY2NDC(.75); gStyle->SetStatTextColor(kRed); Compton->Draw("sames"); // ------------------------------------------------------------------- c5 = new TCanvas("c5","Compton and Pi0"); c5->cd(); t2->SetMarkerColor(kBlue+2); t1->SetMarkerColor(kRed); t2->Draw("PhotonEnergyDifference:PhotonTheta>>Pi0_1(180, 0, 180, 120, 180, 300)","PhotonEnergy<150"); TH2F *Pi0_1 = (TH2F*)gDirectory->Get("Pi0_1"); t1->Draw("PhotonEnergyDifference:PhotonTheta>>Compton_1(180, 0, 180, 120, 180, 300)","PhotonEnergy<150"); TH2F *Compton_1 = (TH2F*)gDirectory->Get("Compton_1"); gStyle->SetStatTextColor(kBlue+2); Pi0_1->Draw(); c5->Update(); TPaveStats *stats =(TPaveStats*)c5->GetPrimitive("stats"); stats->SetName("h1stats"); stats->SetY1NDC(.508); stats->SetY2NDC(.75); gStyle->SetStatTextColor(kRed); Compton_1->Draw("sames"); //------------------------------------------------------------------------------ c6 = new TCanvas("c6","Compton NPhoton"); c6->cd(); t1->Draw("NPhoton"); c7 = new TCanvas("c7","Pi0 NPhoton"); c7->cd(); t2->Draw("NPhoton"); // ------------------------------------------------------------------- /* c5 = new TCanvas("c5","Compton (Left) and Pi0 (Right)"); c5->Divide(2,3); c5->cd(1); t1->Draw("PhotonEnergyDifference:PhotonEnergy"); // c5->cd(2); t2->Draw("PhotonEnergyDifference:PhotonEnergy","","same"); c5->cd(3); t1->Draw("PhotonEnergyDifference:PhotonEnergy","NProton>0 && NProton<2"); c5->cd(4); t2->Draw("PhotonEnergyDifference:PhotonEnergy"); */ /* Int_t DifferenceArrayLength, NPhoton, NProton; Double_t PhotonEnergyDifference[20], PhotonTheta[20]; t1->SetBranchAddress("NPhoton",&NPhoton); t1->SetBranchAddress("NProton",&NProton); t1->SetBranchAddress("PhotonTheta",&PhotonTheta); t1->SetBranchAddress("DifferenceArrayLength",&DifferenceArrayLength); t1->SetBranchAddress("PhotonEnergyDifference",&PhotonEnergyDifference); TH2F *h1 = new TH2F("h1", "h1 title", 180, 0, 180, 120, 180, 300); Int_t nentries = (Int_t)t1->GetEntries(); for (Int_t i=0;i<nentries;i++) { t1->GetEntry(i); Int_t k = 0; for ( Int_t a = 0; a< NPhoton; a++) { for ( Int_t b = 0; b< NProton; b++) { h1->Fill(PhotonTheta[a],PhotonEnergyDifference[k]); k++; } } } t2->SetBranchAddress("NPhoton",&NPhoton); t2->SetBranchAddress("NProton",&NProton); t2->SetBranchAddress("PhotonTheta",&PhotonTheta); t2->SetBranchAddress("DifferenceArrayLength",&DifferenceArrayLength); t2->SetBranchAddress("PhotonEnergyDifference",&PhotonEnergyDifference); TH2F *h2 = new TH2F("h2","h2 title", 180, 0, 180, 120, 180, 300); TH1F *h3 = new TH1F("h3","h3 title", 180, 0, 180); nentries = (Int_t)t2->GetEntries(); for (i=0;i<nentries;i++) { t2->GetEntry(i); k = 0; for ( a = 0; a< NPhoton; a++) { for ( b = 0; b< NProton; b++) { h2->Fill(PhotonTheta[a],PhotonEnergyDifference[k]); h3->Fill(PhotonTheta[a]); k++; } } } c4 = new TCanvas("c4","Compton and Pi0"); c4->cd(); h2->SetMarkerColor(kCyan); h2->Draw(); h1->SetMarkerColor(kRed); h1->Draw("same"); */ }
void pileup(){ TFile f("/data/ndpc3/b/dmorse/RA3/AnalysisOutput/Pileup/cms525v3_jec2012/hist_Data2012B_Filter_JsonNVertexOne25GeVBarrelPho_Photon_cms525v3_jec2012_Runs190456-195947_Pileup.root"); f.cd(); TCanvas *c1 = new TCanvas("c1","",800,600); gStyle->SetOptStat(0); gStyle->SetFitFormat("5.3f"); TH1F *h_rho25 = (TH1F*)f.Get("rho25"); h_rho25->GetXaxis()->SetRangeUser(0,50); h_rho25->Draw("histo"); c1->Print("Plots/Pileup/rho25.png"); c1->Print("Plots/Pileup/rho25.pdf"); c1->SetLogz(1); TPaveText *Text; Text = new TPaveText(.25,.65,.55,.79,"NDC"); Text->AddText("CMS Preliminary 2012"); Text->SetFillStyle(4000); Text->SetFillColor(0); Text->SetBorderSize(0); Text->AddText("#sqrt{s} = 8 TeV, #intL = 4.04 fb^{-1}"); TH2F* h_EcalDR03 = (TH2F*)f.Get("EcalIsoVsRho25DR03_ee"); h_EcalDR03->GetYaxis()->SetRangeUser(-25,70); h_EcalDR03->GetXaxis()->SetRangeUser(0,40); h_EcalDR03->SetTitle(""); h_EcalDR03->GetYaxis()->SetTitle("Ecal Isolation (DR03)"); h_EcalDR03->GetXaxis()->SetTitle("Rho25 (E_{T} / unit area)"); h_EcalDR03->Draw("colz"); Text->Draw(); c1->Print("Plots/Pileup/Figure5_EcalIsoVsRho25DR03_ee.png"); c1->Print("Plots/Pileup/Figure5_EcalIsoVsRho25DR03_ee.pdf"); TH2F* h_HcalDR03 = (TH2F*)f.Get("HcalIsoVsRho25DR03_ee"); h_HcalDR03->GetYaxis()->SetRangeUser(-3,45); h_HcalDR03->GetXaxis()->SetRangeUser(0,40); h_HcalDR03->SetTitle(""); h_HcalDR03->GetYaxis()->SetTitle("Hcal Isolation (DR03)"); h_HcalDR03->GetXaxis()->SetTitle("Rho25 (E_{T} / unit area)"); h_HcalDR03->Draw("colz"); Text->Draw(); c1->Print("Plots/Pileup/Figure5_HcalIsoVsRho25DR03_ee.png"); c1->Print("Plots/Pileup/Figure5_HcalIsoVsRho25DR03_ee.pdf"); TH2F* h_TrackDR03 = (TH2F*)f.Get("TrackIsoVsRho25DR03_ee"); h_TrackDR03->GetYaxis()->SetRangeUser(-3,80); h_TrackDR03->GetXaxis()->SetRangeUser(0,40); h_TrackDR03->SetTitle(""); h_TrackDR03->GetYaxis()->SetTitle("Track Isolation (DR03)"); h_TrackDR03->GetXaxis()->SetTitle("Rho25 (E_{T} / unit area)"); h_TrackDR03->Draw("colz"); Text->Draw(); c1->Print("Plots/Pileup/Figure5_TrackIsoVsRho25DR03_ee.png"); c1->Print("Plots/Pileup/Figure5_TrackIsoVsRho25DR03_ee.pdf"); TH2F* h_HOverE = (TH2F*)f.Get("HOverEVsRho25_ee"); h_HOverE->GetYaxis()->SetRangeUser(0,.16); h_HOverE->GetXaxis()->SetRangeUser(0,40); h_HOverE->SetTitle(""); h_HOverE->GetXaxis()->SetTitle("Rho25 (E_{T} / unit area)"); h_HOverE->Draw("colz"); Text->Draw(); c1->Print("Plots/Pileup/Figure5_HOverEVsRho25_ee.png"); c1->Print("Plots/Pileup/Figure5_HOverEVsRho25_ee.pdf"); TH2F* h_HOverEAfterIso = (TH2F*)f.Get("HOverEAfterIsoVsRho25_ee"); h_HOverEAfterIso->GetYaxis()->SetRangeUser(0,.16); h_HOverEAfterIso->GetXaxis()->SetRangeUser(0,40); h_HOverEAfterIso->SetTitle(""); h_HOverEAfterIso->GetXaxis()->SetTitle("Rho25 (E_{T} / unit area)"); h_HOverEAfterIso->Draw("colz"); Text->Draw(); c1->Print("Plots/Pileup/Figure5_HOverEAfterIsoVsRho25_ee.png"); c1->Print("Plots/Pileup/Figure5_HOverEAfterIsoVsRho25_ee.pdf"); h_EcalDR03->ProfileX("ecal_pfx",0,450); ecal_pfx->GetYaxis()->SetTitle("Average Ecal Isolation (DR03)"); ecal_pfx->GetYaxis()->SetRangeUser(0,4.6); ecal_pfx->Fit("pol1","","",0,45); ecal_pfx->Draw(); c1->Update(); TPaveStats *st = (TPaveStats*)ecal_pfx->FindObject("stats"); st->SetName("ecalStats"); st->SetTextSize(.04); st->SetX1NDC(.25);st->SetX2NDC(.55); st->SetY1NDC(.52);st->SetY2NDC(.65); Text->Draw(); c1->Print("Plots/Pileup/Figure6_EcalIsoVsRho25_ee_pfx.png"); c1->Print("Plots/Pileup/Figure6_EcalIsoVsRho25_ee_pfx.pdf"); h_HcalDR03->ProfileX("hcal_pfx",0,450); hcal_pfx->GetYaxis()->SetTitle("Average Hcal Isolation (DR03)"); hcal_pfx->GetYaxis()->SetRangeUser(0.1,1.5); hcal_pfx->Fit("pol1","","",0,45); hcal_pfx->Draw(); c1->Update(); TPaveStats *st = (TPaveStats*)hcal_pfx->FindObject("stats"); st->SetName("hcalStats"); st->SetTextSize(.04); st->SetX1NDC(.25);st->SetX2NDC(.55); st->SetY1NDC(.52);st->SetY2NDC(.65); Text->Draw(); c1->Print("Plots/Pileup/Figure6_HcalIsoVsRho25_ee_pfx.png"); c1->Print("Plots/Pileup/Figure6_HcalIsoVsRho25_ee_pfx.pdf"); h_TrackDR03->ProfileX("track_pfx",0,450); track_pfx->GetYaxis()->SetTitle("Average Track Isolation (DR03)"); track_pfx->GetYaxis()->SetRangeUser(0.1,1.2); track_pfx->Fit("pol1","","",0,30); track_pfx->Draw(); c1->Update(); TPaveStats *st = (TPaveStats*)track_pfx->FindObject("stats"); st->SetName("trackStats"); st->SetTextSize(.04); st->SetX1NDC(.25);st->SetX2NDC(.55); st->SetY1NDC(.52);st->SetY2NDC(.65); Text->Draw(); c1->Print("Plots/Pileup/Figure6_TrackIsoVsRho25_ee_pfx.png"); c1->Print("Plots/Pileup/Figure6_TrackIsoVsRho25_ee_pfx.pdf"); gStyle->SetFitFormat("5.6f"); h_HOverE->ProfileX("hovere_pfx",0,450); hovere_pfx->GetYaxis()->SetTitle("Average H/E"); hovere_pfx->Fit("pol1","","",0,45); hovere_pfx->Draw(); Text->Draw(); c1->Print("Plots/Pileup/Figure6_HOverEIsoVsRho25_ee_pfx.png"); c1->Print("Plots/Pileup/Figure6_HOverEIsoVsRho25_ee_pfx.pdf"); h_HOverEAfterIso->ProfileX("hovereafteriso_pfx",0,450); hovereafteriso_pfx->GetYaxis()->SetTitle("Average H/E After Combined Isolation (DR03) < 6.0"); hovereafteriso_pfx->Fit("pol1","","",0,45); hovereafteriso_pfx->Draw(); Text->Draw(); c1->Print("Plots/Pileup/Figure6_HOverEAfterIsoVsRho25_ee_pfx.png"); c1->Print("Plots/Pileup/Figure6_HOverEAfterIsoVsRho25_ee_pfx.pdf"); TH2F* h_chargedHadron = (TH2F*)f.Get("chargedHadronIsoVsRho25_ee"); h_chargedHadron->GetYaxis()->SetRangeUser(-3,120); h_chargedHadron->GetXaxis()->SetRangeUser(0,40); h_chargedHadron->SetTitle(""); h_chargedHadron->Draw("colz"); Text->Draw(); c1->Print("Plots/Pileup/chargedHadronIso_ee.png"); h_chargedHadron->ProfileX("chargedHad_pfx",0,450); chargedHad_pfx->GetYaxis()->SetTitle("Average chargedHadron Isolation"); chargedHad_pfx->GetYaxis()->SetRangeUser(0.4,2); chargedHad_pfx->Fit("pol1","","",0,50); chargedHad_pfx->Draw(); c1->Update(); TPaveStats *st = (TPaveStats*)chargedHad_pfx->FindObject("stats"); st->SetName("hcalStats"); st->SetTextSize(.04); st->SetX1NDC(.21);st->SetX2NDC(.55); st->SetY1NDC(.52);st->SetY2NDC(.65); Text->Draw(); c1->Print("Plots/Pileup/chargedHadronIso_ee_pfx.png"); TH2F* h_neutralHadron = (TH2F*)f.Get("neutralHadronIsoVsRho25_ee"); h_neutralHadron->GetYaxis()->SetRangeUser(-3,40); h_neutralHadron->GetXaxis()->SetRangeUser(0,40); h_neutralHadron->SetTitle(""); h_neutralHadron->Draw("colz"); Text->Draw(); c1->Print("Plots/Pileup/neutralHadronIso_ee.png"); h_neutralHadron->ProfileX("neutralHad_pfx",0,450); neutralHad_pfx->GetYaxis()->SetTitle("Average neutralHadron Isolation"); neutralHad_pfx->GetYaxis()->SetRangeUser(0,1.2); neutralHad_pfx->Fit("pol1","","",0,50); neutralHad_pfx->Draw(); c1->Update(); TPaveStats *st = (TPaveStats*)neutralHad_pfx->FindObject("stats"); st->SetName("hcalStats"); st->SetTextSize(.04); st->SetX1NDC(.21);st->SetX2NDC(.55); st->SetY1NDC(.52);st->SetY2NDC(.65); Text->Draw(); c1->Print("Plots/Pileup/neutralHadronIso_ee_pfx.png"); TH2F* h_photon = (TH2F*)f.Get("photonIsoVsRho25_ee"); h_photon->GetYaxis()->SetRangeUser(-3,100); h_photon->GetXaxis()->SetRangeUser(0,40); h_photon->SetTitle(""); h_photon->Draw("colz"); Text->Draw(); c1->Print("Plots/Pileup/photonIso_ee.png"); h_photon->ProfileX("photon_pfx",0,450); photon_pfx->GetYaxis()->SetTitle("Average photon Isolation"); //photon_pfx->GetYaxis()->SetRangeUser(0,1.2); photon_pfx->Fit("pol1","","",0,50); photon_pfx->Draw(); c1->Update(); TPaveStats *st = (TPaveStats*)photon_pfx->FindObject("stats"); st->SetName("hcalStats"); st->SetTextSize(.04); st->SetX1NDC(.21);st->SetX2NDC(.55); st->SetY1NDC(.52);st->SetY2NDC(.65); Text->Draw(); c1->Print("Plots/Pileup/photonIso_ee_pfx.png"); f.Close(); }
void BSA_InCoherent_xB() { //=========Macro generated from canvas: c16/Incoherent channe //========= (Tue Aug 21 12:00:25 2018) by ROOT version6.09/01 TCanvas *c16 = new TCanvas("c16", "Incoherent channe",0,0,1200,400); gStyle->SetOptFit(1); c16->Range(0,0,1,1); c16->SetFillColor(0); c16->SetBorderMode(0); c16->SetBorderSize(2); c16->SetLeftMargin(0.025); c16->SetRightMargin(0.02325581); c16->SetFrameBorderMode(0); // ------------>Primitives in pad: c16_1 TPad *c16_1 = new TPad("c16_1", "Incoherent channe_1",0,0,0.262936,0.9); c16_1->Draw(); c16_1->cd(); c16_1->Range(-29.34641,-0.4888889,350.2581,0.4); c16_1->SetFillColor(0); c16_1->SetBorderMode(0); c16_1->SetBorderSize(2); c16_1->SetGridx(); c16_1->SetGridy(); c16_1->SetRightMargin(0); c16_1->SetTopMargin(0); c16_1->SetFrameBorderMode(0); c16_1->SetFrameBorderMode(0); TMultiGraph *multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("0.12<x_{B}<0.21 "); Double_t Graph_fx1134[9] = { 24.14331, 62.70082, 96.14623, 141.7289, 180.8857, 220.5862, 258.7856, 303.3336, 334.7288}; Double_t Graph_fy1134[9] = { 0.1330996, -0.03883743, 0.1388413, 0.2120595, 0.03749243, -0.09129921, -0.1273289, -0.1643618, 0.03103783}; Double_t Graph_fex1134[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph_fey1134[9] = { 0.07077824, 0.06445297, 0.05939535, 0.06833722, 0.08559024, 0.08401363, 0.06136237, 0.05845869, 0.08718727}; TGraphErrors *gre = new TGraphErrors(9,Graph_fx1134,Graph_fy1134,Graph_fex1134,Graph_fey1134); gre->SetName("Graph"); gre->SetTitle("Graph"); gre->SetFillColor(1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#00ff00"); gre->SetMarkerColor(ci); gre->SetMarkerStyle(21); TH1F *Graph_Graph1134 = new TH1F("Graph_Graph1134","Graph",100,0,365.7873); Graph_Graph1134->SetMinimum(-0.2731422); Graph_Graph1134->SetMaximum(0.3307184); Graph_Graph1134->SetDirectory(0); Graph_Graph1134->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1134->SetLineColor(ci); Graph_Graph1134->GetXaxis()->SetLabelFont(42); Graph_Graph1134->GetXaxis()->SetLabelSize(0.035); Graph_Graph1134->GetXaxis()->SetTitleSize(0.035); Graph_Graph1134->GetXaxis()->SetTitleFont(42); Graph_Graph1134->GetYaxis()->SetLabelFont(42); Graph_Graph1134->GetYaxis()->SetLabelSize(0.035); Graph_Graph1134->GetYaxis()->SetTitleSize(0.035); Graph_Graph1134->GetYaxis()->SetTitleFont(42); Graph_Graph1134->GetZaxis()->SetLabelFont(42); Graph_Graph1134->GetZaxis()->SetLabelSize(0.035); Graph_Graph1134->GetZaxis()->SetTitleSize(0.035); Graph_Graph1134->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1134); TF1 *myfit1135 = new TF1("myfit","[0]*sin(x*3.1416/180.0)/(1 + [1]*cos(x*3.1416/180.0))",0,365.7873); myfit1135->SetFillColor(19); myfit1135->SetFillStyle(0); myfit1135->SetLineColor(2); myfit1135->SetLineWidth(2); myfit1135->SetChisquare(10.13595); myfit1135->SetNDF(7); myfit1135->GetXaxis()->SetLabelFont(42); myfit1135->GetXaxis()->SetLabelSize(0.035); myfit1135->GetXaxis()->SetTitleSize(0.035); myfit1135->GetXaxis()->SetTitleFont(42); myfit1135->GetYaxis()->SetLabelFont(42); myfit1135->GetYaxis()->SetLabelSize(0.035); myfit1135->GetYaxis()->SetTitleSize(0.035); myfit1135->GetYaxis()->SetTitleFont(42); myfit1135->SetParameter(0,0.1205343); myfit1135->SetParError(0,0.03387604); myfit1135->SetParLimits(0,0,0); myfit1135->SetParameter(1,0.6858633); myfit1135->SetParError(1,0.2646153); myfit1135->SetParLimits(1,0,0); gre->GetListOfFunctions()->Add(myfit1135); TPaveStats *ptstats = new TPaveStats(0.27,0.74,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("#chi^{2} / ndf = 10.14 / 7"); AText = ptstats->AddText("p0 = 0.1205 #pm 0.03388 "); AText = ptstats->AddText("p1 = 0.6859 #pm 0.2646 "); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); gre->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(gre->GetListOfFunctions()); multigraph->Add(gre,""); multigraph->Draw("AP"); multigraph->GetXaxis()->SetTitle("#phi [deg.]"); multigraph->GetXaxis()->SetLabelFont(42); multigraph->GetXaxis()->SetLabelSize(0.035); multigraph->GetXaxis()->SetTitleSize(0.035); multigraph->GetXaxis()->SetTitleFont(42); multigraph->GetYaxis()->SetTitle("A_{LU}"); multigraph->GetYaxis()->SetLabelFont(42); multigraph->GetYaxis()->SetLabelSize(0.035); multigraph->GetYaxis()->SetTitleSize(0.035); multigraph->GetYaxis()->SetTitleFont(42); gPad->Modified(); multigraph->GetYaxis()->SetRangeUser(-0.35, 0.35); c16_1->Modified(); c16->cd(); // ------------>Primitives in pad: c16_2 TPad *c16_2 = new TPad("c16_2", "Incoherent channe_2",0.262936,0,0.5008721,0.9); c16_2->Draw(); c16_2->cd(); c16_2->Range(5.85529,-0.4888889,352.0975,0.4); c16_2->SetFillColor(0); c16_2->SetBorderMode(0); c16_2->SetBorderSize(2); c16_2->SetGridx(); c16_2->SetGridy(); c16_2->SetLeftMargin(0); c16_2->SetRightMargin(0); c16_2->SetTopMargin(0); c16_2->SetFrameBorderMode(0); c16_2->SetFrameBorderMode(0); multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("0.21<x_{B}<0.31 "); Double_t Graph_fx1137[9] = { 21.59357, 60.08662, 95.00395, 140.4897, 181.0443, 224.9978, 260.1264, 302.891, 336.3592}; Double_t Graph_fy1137[9] = { 0.0984356, 0.1891659, 0.2419886, 0.08897874, 0.2077051, -0.3071227, -0.1933684, -0.2875592, -0.08265727}; Double_t Graph_fex1137[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph_fey1137[9] = { 0.04446748, 0.058618, 0.06898028, 0.1082398, 0.135301, 0.1152745, 0.0716065, 0.04680018, 0.05547391}; gre = new TGraphErrors(9,Graph_fx1137,Graph_fy1137,Graph_fex1137,Graph_fey1137); gre->SetName("Graph"); gre->SetTitle("Graph"); gre->SetFillColor(1); ci = TColor::GetColor("#00ff00"); gre->SetMarkerColor(ci); gre->SetMarkerStyle(21); TH1F *Graph_Graph1137 = new TH1F("Graph_Graph1137","Graph",100,0,367.8358); Graph_Graph1137->SetMinimum(-0.4989376); Graph_Graph1137->SetMaximum(0.4195464); Graph_Graph1137->SetDirectory(0); Graph_Graph1137->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1137->SetLineColor(ci); Graph_Graph1137->GetXaxis()->SetLabelFont(42); Graph_Graph1137->GetXaxis()->SetLabelSize(0.035); Graph_Graph1137->GetXaxis()->SetTitleSize(0.035); Graph_Graph1137->GetXaxis()->SetTitleFont(42); Graph_Graph1137->GetYaxis()->SetLabelFont(42); Graph_Graph1137->GetYaxis()->SetLabelSize(0.035); Graph_Graph1137->GetYaxis()->SetTitleSize(0.035); Graph_Graph1137->GetYaxis()->SetTitleFont(42); Graph_Graph1137->GetZaxis()->SetLabelFont(42); Graph_Graph1137->GetZaxis()->SetLabelSize(0.035); Graph_Graph1137->GetZaxis()->SetTitleSize(0.035); Graph_Graph1137->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1137); TF1 *myfit1138 = new TF1("myfit","[0]*sin(x*3.1416/180.0)/(1 + [1]*cos(x*3.1416/180.0))",0,367.8358); myfit1138->SetFillColor(19); myfit1138->SetFillStyle(0); myfit1138->SetLineColor(2); myfit1138->SetLineWidth(2); myfit1138->SetChisquare(7.336971); myfit1138->SetNDF(7); myfit1138->GetXaxis()->SetLabelFont(42); myfit1138->GetXaxis()->SetLabelSize(0.035); myfit1138->GetXaxis()->SetTitleSize(0.035); myfit1138->GetXaxis()->SetTitleFont(42); myfit1138->GetYaxis()->SetLabelFont(42); myfit1138->GetYaxis()->SetLabelSize(0.035); myfit1138->GetYaxis()->SetTitleSize(0.035); myfit1138->GetYaxis()->SetTitleFont(42); myfit1138->SetParameter(0,0.2508538); myfit1138->SetParError(0,0.03583101); myfit1138->SetParLimits(0,0,0); myfit1138->SetParameter(1,-0.1422748); myfit1138->SetParError(1,0.2426713); myfit1138->SetParLimits(1,0,0); gre->GetListOfFunctions()->Add(myfit1138); ptstats = new TPaveStats(0.27,0.74,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); AText = ptstats->AddText("#chi^{2} / ndf = 7.337 / 7"); AText = ptstats->AddText("p0 = 0.2509 #pm 0.03583 "); AText = ptstats->AddText("p1 = -0.1423 #pm 0.2427 "); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); gre->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(gre->GetListOfFunctions()); multigraph->Add(gre,""); multigraph->Draw("AP"); multigraph->GetXaxis()->SetTitle("#phi [deg.]"); multigraph->GetXaxis()->SetLabelFont(42); multigraph->GetXaxis()->SetLabelSize(0.035); multigraph->GetXaxis()->SetTitleSize(0.035); multigraph->GetXaxis()->SetTitleFont(42); multigraph->GetYaxis()->SetLabelFont(42); multigraph->GetYaxis()->SetLabelSize(0.035); multigraph->GetYaxis()->SetTitleSize(0.035); multigraph->GetYaxis()->SetTitleFont(42); gPad->Modified(); multigraph->GetYaxis()->SetRangeUser(-0.35, 0.35); c16_2->Modified(); c16->cd(); // ------------>Primitives in pad: c16_3 TPad *c16_3 = new TPad("c16_3", "Incoherent channe_3",0.5008721,0,0.7388081,0.9); c16_3->Draw(); c16_3->cd(); c16_3->Range(4.159976,-0.4888889,357.6921,0.4); c16_3->SetFillColor(0); c16_3->SetBorderMode(0); c16_3->SetBorderSize(2); c16_3->SetGridx(); c16_3->SetGridy(); c16_3->SetLeftMargin(0); c16_3->SetRightMargin(0); c16_3->SetTopMargin(0); c16_3->SetFrameBorderMode(0); c16_3->SetFrameBorderMode(0); multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("0.31<x_{B}<0.39 "); Double_t Graph_fx1140[9] = { 20.22962, 57.37981, 95.86069, 135.3486, 182.9227, 229.5531, 263.4275, 301.2495, 341.6225}; Double_t Graph_fy1140[9] = { 0.09662004, 0.06965272, 0.269744, -0.170935, -0.1509905, 0.6309487, 0.06270791, -0.2582676, -0.152689}; Double_t Graph_fex1140[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph_fey1140[9] = { 0.05297617, 0.09107484, 0.121636, 0.2287053, 0.3066164, 0.3879093, 0.1400804, 0.07623737, 0.06739512}; gre = new TGraphErrors(9,Graph_fx1140,Graph_fy1140,Graph_fex1140,Graph_fey1140); gre->SetName("Graph"); gre->SetTitle("Graph"); gre->SetFillColor(1); ci = TColor::GetColor("#00ff00"); gre->SetMarkerColor(ci); gre->SetMarkerStyle(21); TH1F *Graph_Graph1140 = new TH1F("Graph_Graph1140","Graph",100,0,373.7618); Graph_Graph1140->SetMinimum(-0.6052533); Graph_Graph1140->SetMaximum(1.166504); Graph_Graph1140->SetDirectory(0); Graph_Graph1140->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1140->SetLineColor(ci); Graph_Graph1140->GetXaxis()->SetLabelFont(42); Graph_Graph1140->GetXaxis()->SetLabelSize(0.035); Graph_Graph1140->GetXaxis()->SetTitleSize(0.035); Graph_Graph1140->GetXaxis()->SetTitleFont(42); Graph_Graph1140->GetYaxis()->SetLabelFont(42); Graph_Graph1140->GetYaxis()->SetLabelSize(0.035); Graph_Graph1140->GetYaxis()->SetTitleSize(0.035); Graph_Graph1140->GetYaxis()->SetTitleFont(42); Graph_Graph1140->GetZaxis()->SetLabelFont(42); Graph_Graph1140->GetZaxis()->SetLabelSize(0.035); Graph_Graph1140->GetZaxis()->SetTitleSize(0.035); Graph_Graph1140->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1140); TF1 *myfit1141 = new TF1("myfit","[0]*sin(x*3.1416/180.0)/(1 + [1]*cos(x*3.1416/180.0))",0,373.7618); myfit1141->SetFillColor(19); myfit1141->SetFillStyle(0); myfit1141->SetLineColor(2); myfit1141->SetLineWidth(2); myfit1141->SetChisquare(10.84482); myfit1141->SetNDF(7); myfit1141->GetXaxis()->SetLabelFont(42); myfit1141->GetXaxis()->SetLabelSize(0.035); myfit1141->GetXaxis()->SetTitleSize(0.035); myfit1141->GetXaxis()->SetTitleFont(42); myfit1141->GetYaxis()->SetLabelFont(42); myfit1141->GetYaxis()->SetLabelSize(0.035); myfit1141->GetYaxis()->SetTitleSize(0.035); myfit1141->GetYaxis()->SetTitleFont(42); myfit1141->SetParameter(0,0.124049); myfit1141->SetParError(0,0.05069177); myfit1141->SetParLimits(0,0,0); myfit1141->SetParameter(1,-0.6977989); myfit1141->SetParError(1,0.2049165); myfit1141->SetParLimits(1,0,0); gre->GetListOfFunctions()->Add(myfit1141); ptstats = new TPaveStats(0.27,0.74,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); AText = ptstats->AddText("#chi^{2} / ndf = 10.84 / 7"); AText = ptstats->AddText("p0 = 0.124 #pm 0.05069 "); AText = ptstats->AddText("p1 = -0.6978 #pm 0.2049 "); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); gre->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(gre->GetListOfFunctions()); multigraph->Add(gre,""); multigraph->Draw("AP"); multigraph->GetXaxis()->SetTitle("#phi [deg.]"); multigraph->GetXaxis()->SetLabelFont(42); multigraph->GetXaxis()->SetLabelSize(0.035); multigraph->GetXaxis()->SetTitleSize(0.035); multigraph->GetXaxis()->SetTitleFont(42); multigraph->GetYaxis()->SetLabelFont(42); multigraph->GetYaxis()->SetLabelSize(0.035); multigraph->GetYaxis()->SetTitleSize(0.035); multigraph->GetYaxis()->SetTitleFont(42); gPad->Modified(); multigraph->GetYaxis()->SetRangeUser(-0.35, 0.35); c16_3->Modified(); c16->cd(); // ------------>Primitives in pad: c16_4 TPad *c16_4 = new TPad("c16_4", "Incoherent channe_4",0.7388081,0,0.9767442,0.9); c16_4->Draw(); c16_4->cd(); c16_4->Range(-17.15326,-0.4888889,360.2184,0.4); c16_4->SetFillColor(0); c16_4->SetBorderMode(0); c16_4->SetBorderSize(2); c16_4->SetGridx(); c16_4->SetGridy(); c16_4->SetLeftMargin(0); c16_4->SetRightMargin(0); c16_4->SetTopMargin(0); c16_4->SetFrameBorderMode(0); c16_4->SetFrameBorderMode(0); multigraph = new TMultiGraph(); multigraph->SetName(""); multigraph->SetTitle("0.39<x_{B}<0.60 "); Double_t Graph_fx1143[9] = { 19.13311, 55.36321, 90.36243, 127.5684, 0, 232.109, 268.7816, 302.6639, 343.0651}; Double_t Graph_fy1143[9] = { 0.1307559, 0.1996612, 0.006608881, -2.830736, 0, -2.034047, 0.1276631, -0.2950426, -0.003784223}; Double_t Graph_fex1143[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t Graph_fey1143[9] = { 0.05218982, 0.09871893, 0.1820512, 4.457049, 0, 1.502801, 0.207584, 0.0825667, 0.06276702}; gre = new TGraphErrors(9,Graph_fx1143,Graph_fy1143,Graph_fex1143,Graph_fey1143); gre->SetName("Graph"); gre->SetTitle("Graph"); gre->SetFillColor(1); ci = TColor::GetColor("#00ff00"); gre->SetMarkerColor(ci); gre->SetMarkerStyle(21); TH1F *Graph_Graph1143 = new TH1F("Graph_Graph1143","Graph",100,0,377.3716); Graph_Graph1143->SetMinimum(-8.179195); Graph_Graph1143->SetMaximum(2.517722); Graph_Graph1143->SetDirectory(0); Graph_Graph1143->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph1143->SetLineColor(ci); Graph_Graph1143->GetXaxis()->SetLabelFont(42); Graph_Graph1143->GetXaxis()->SetLabelSize(0.035); Graph_Graph1143->GetXaxis()->SetTitleSize(0.035); Graph_Graph1143->GetXaxis()->SetTitleFont(42); Graph_Graph1143->GetYaxis()->SetLabelFont(42); Graph_Graph1143->GetYaxis()->SetLabelSize(0.035); Graph_Graph1143->GetYaxis()->SetTitleSize(0.035); Graph_Graph1143->GetYaxis()->SetTitleFont(42); Graph_Graph1143->GetZaxis()->SetLabelFont(42); Graph_Graph1143->GetZaxis()->SetLabelSize(0.035); Graph_Graph1143->GetZaxis()->SetTitleSize(0.035); Graph_Graph1143->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph1143); TF1 *myfit1144 = new TF1("myfit","[0]*sin(x*3.1416/180.0)/(1 + [1]*cos(x*3.1416/180.0))",0,377.3716); myfit1144->SetFillColor(19); myfit1144->SetFillStyle(0); myfit1144->SetLineColor(2); myfit1144->SetLineWidth(2); myfit1144->SetChisquare(8.6938); myfit1144->SetNDF(7); myfit1144->GetXaxis()->SetLabelFont(42); myfit1144->GetXaxis()->SetLabelSize(0.035); myfit1144->GetXaxis()->SetTitleSize(0.035); myfit1144->GetXaxis()->SetTitleFont(42); myfit1144->GetYaxis()->SetLabelFont(42); myfit1144->GetYaxis()->SetLabelSize(0.035); myfit1144->GetYaxis()->SetTitleSize(0.035); myfit1144->GetYaxis()->SetTitleFont(42); myfit1144->SetParameter(0,0.1663497); myfit1144->SetParError(0,0.06722025); myfit1144->SetParLimits(0,0,0); myfit1144->SetParameter(1,-0.5093054); myfit1144->SetParError(1,0.2952021); myfit1144->SetParLimits(1,0,0); gre->GetListOfFunctions()->Add(myfit1144); ptstats = new TPaveStats(0.27,0.74,0.9,0.9,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); AText = ptstats->AddText("#chi^{2} / ndf = 8.694 / 7"); AText = ptstats->AddText("p0 = 0.1663 #pm 0.06722 "); AText = ptstats->AddText("p1 = -0.5093 #pm 0.2952 "); ptstats->SetOptStat(0); ptstats->SetOptFit(111); ptstats->Draw(); gre->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(gre->GetListOfFunctions()); multigraph->Add(gre,""); multigraph->Draw("AP"); multigraph->GetXaxis()->SetTitle("#phi [deg.]"); multigraph->GetXaxis()->SetLabelFont(42); multigraph->GetXaxis()->SetLabelSize(0.035); multigraph->GetXaxis()->SetTitleSize(0.035); multigraph->GetXaxis()->SetTitleFont(42); multigraph->GetYaxis()->SetLabelFont(42); multigraph->GetYaxis()->SetLabelSize(0.035); multigraph->GetYaxis()->SetTitleSize(0.035); multigraph->GetYaxis()->SetTitleFont(42); gPad->Modified(); multigraph->GetYaxis()->SetRangeUser(-0.35, 0.35); c16_4->Modified(); c16->cd(); c16->Modified(); c16->cd(); c16->SetSelected(c16); }
void yz-plane-length() { //=========Macro generated from canvas: c/ //========= (Tue Jul 28 19:55:12 2015) by ROOT version6.04/00 TCanvas *c = new TCanvas("c", "",0,45,600,500); c->SetHighLightColor(2); c->Range(-187.5,-2928.319,187.5,26354.87); c->SetFillColor(0); c->SetBorderMode(0); c->SetBorderSize(2); c->SetFrameBorderMode(0); c->SetFrameBorderMode(0); TH1D *hist__1 = new TH1D("hist__1","Worry Later",100,-150,150); hist__1->SetBinContent(0,14); hist__1->SetBinContent(1,1); hist__1->SetBinContent(3,1); hist__1->SetBinContent(4,2); hist__1->SetBinContent(5,4); hist__1->SetBinContent(6,4); hist__1->SetBinContent(7,9); hist__1->SetBinContent(8,20); hist__1->SetBinContent(9,20); hist__1->SetBinContent(10,19); hist__1->SetBinContent(11,21); hist__1->SetBinContent(12,41); hist__1->SetBinContent(13,42); hist__1->SetBinContent(14,72); hist__1->SetBinContent(15,82); hist__1->SetBinContent(16,124); hist__1->SetBinContent(17,144); hist__1->SetBinContent(18,204); hist__1->SetBinContent(19,254); hist__1->SetBinContent(20,298); hist__1->SetBinContent(21,353); hist__1->SetBinContent(22,426); hist__1->SetBinContent(23,534); hist__1->SetBinContent(24,636); hist__1->SetBinContent(25,718); hist__1->SetBinContent(26,800); hist__1->SetBinContent(27,817); hist__1->SetBinContent(28,856); hist__1->SetBinContent(29,901); hist__1->SetBinContent(30,928); hist__1->SetBinContent(31,930); hist__1->SetBinContent(32,1032); hist__1->SetBinContent(33,1025); hist__1->SetBinContent(34,1121); hist__1->SetBinContent(35,1070); hist__1->SetBinContent(36,1200); hist__1->SetBinContent(37,1355); hist__1->SetBinContent(38,1453); hist__1->SetBinContent(39,1633); hist__1->SetBinContent(40,1926); hist__1->SetBinContent(41,2337); hist__1->SetBinContent(42,2676); hist__1->SetBinContent(43,3487); hist__1->SetBinContent(44,4580); hist__1->SetBinContent(45,5833); hist__1->SetBinContent(46,7742); hist__1->SetBinContent(47,10511); hist__1->SetBinContent(48,13797); hist__1->SetBinContent(49,17765); hist__1->SetBinContent(50,22311); hist__1->SetBinContent(51,22160); hist__1->SetBinContent(52,17962); hist__1->SetBinContent(53,14130); hist__1->SetBinContent(54,10947); hist__1->SetBinContent(55,8303); hist__1->SetBinContent(56,6081); hist__1->SetBinContent(57,4643); hist__1->SetBinContent(58,3602); hist__1->SetBinContent(59,2825); hist__1->SetBinContent(60,2235); hist__1->SetBinContent(61,1955); hist__1->SetBinContent(62,1716); hist__1->SetBinContent(63,1461); hist__1->SetBinContent(64,1266); hist__1->SetBinContent(65,1191); hist__1->SetBinContent(66,1098); hist__1->SetBinContent(67,1054); hist__1->SetBinContent(68,999); hist__1->SetBinContent(69,957); hist__1->SetBinContent(70,982); hist__1->SetBinContent(71,980); hist__1->SetBinContent(72,932); hist__1->SetBinContent(73,910); hist__1->SetBinContent(74,873); hist__1->SetBinContent(75,812); hist__1->SetBinContent(76,785); hist__1->SetBinContent(77,748); hist__1->SetBinContent(78,649); hist__1->SetBinContent(79,593); hist__1->SetBinContent(80,459); hist__1->SetBinContent(81,400); hist__1->SetBinContent(82,321); hist__1->SetBinContent(83,244); hist__1->SetBinContent(84,198); hist__1->SetBinContent(85,180); hist__1->SetBinContent(86,147); hist__1->SetBinContent(87,93); hist__1->SetBinContent(88,73); hist__1->SetBinContent(89,50); hist__1->SetBinContent(90,43); hist__1->SetBinContent(91,37); hist__1->SetBinContent(92,22); hist__1->SetBinContent(93,15); hist__1->SetBinContent(94,10); hist__1->SetBinContent(95,7); hist__1->SetBinContent(96,7); hist__1->SetBinContent(97,3); hist__1->SetBinContent(98,2); hist__1->SetBinContent(99,3); hist__1->SetBinContent(100,3); hist__1->SetBinContent(101,28); hist__1->SetEntries(227323); TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("hist"); AText->SetTextSize(0.0368); AText = ptstats->AddText("Entries = 227323 "); AText = ptstats->AddText("Mean = 0.5797"); AText = ptstats->AddText("Std Dev = 28.66"); ptstats->SetOptStat(1111); ptstats->SetOptFit(0); ptstats->Draw(); hist__1->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(hist__1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); hist__1->SetLineColor(ci); hist__1->GetXaxis()->SetTitle("#DeltaZ [cm]"); hist__1->GetXaxis()->SetLabelFont(42); hist__1->GetXaxis()->SetLabelSize(0.035); hist__1->GetXaxis()->SetTitleSize(0.035); hist__1->GetXaxis()->SetTitleFont(42); hist__1->GetYaxis()->SetLabelFont(42); hist__1->GetYaxis()->SetLabelSize(0.035); hist__1->GetYaxis()->SetTitleSize(0.035); hist__1->GetYaxis()->SetTitleFont(42); hist__1->GetZaxis()->SetLabelFont(42); hist__1->GetZaxis()->SetLabelSize(0.035); hist__1->GetZaxis()->SetTitleSize(0.035); hist__1->GetZaxis()->SetTitleFont(42); hist__1->Draw(""); TPaveText *pt = new TPaveText(0.3779599,0.9368947,0.6220401,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("Worry Later"); pt->Draw(); c->Modified(); c->cd(); c->SetSelected(c); }
void QCDHT_cutflow_weighted() { //=========Macro generated from canvas: c1/c1 //========= (Wed Feb 24 17:48:49 2016) by ROOT version6.02/05 TCanvas *c1 = new TCanvas("c1", "c1",65,52,700,500); c1->Range(-1.25,-2351156,16.25,2.11604e+07); c1->SetFillColor(0); c1->SetBorderMode(0); c1->SetBorderSize(2); c1->SetFrameBorderMode(0); c1->SetFrameBorderMode(0); TH1D *cutflow1 = new TH1D("cutflow1","cut flow",14,0.5,14.5); cutflow1->SetBinContent(1,1.791357e+07); cutflow1->SetBinContent(2,1.791357e+07); cutflow1->SetBinContent(3,1.482016e+07); cutflow1->SetBinContent(4,1.397007e+07); cutflow1->SetBinContent(5,8159947); cutflow1->SetBinContent(6,1368453); cutflow1->SetBinContent(7,12035.83); cutflow1->SetBinContent(8,10653.79); cutflow1->SetBinContent(9,4100.401); cutflow1->SetBinContent(10,4323.004); cutflow1->SetBinContent(11,1820.803); cutflow1->SetBinContent(12,374.2397); cutflow1->SetBinContent(13,35.33991); cutflow1->SetBinContent(14,214.6597); cutflow1->SetEntries(1.137194e+08); TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("cutflow"); AText->SetTextSize(0.0368); AText = ptstats->AddText("Entries = 1.137194e+08"); AText = ptstats->AddText("Mean = 0"); AText = ptstats->AddText("RMS = 0"); ptstats->SetOptStat(1111); ptstats->SetOptFit(0); ptstats->Draw(); cutflow1->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(cutflow1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); cutflow1->SetLineColor(ci); cutflow1->GetXaxis()->SetBinLabel(1,"All"); cutflow1->GetXaxis()->SetBinLabel(2,"Trigger"); cutflow1->GetXaxis()->SetBinLabel(3,"p_{T}"); cutflow1->GetXaxis()->SetBinLabel(4,"|#eta|"); cutflow1->GetXaxis()->SetBinLabel(5,"|#Delta#eta|"); cutflow1->GetXaxis()->SetBinLabel(6,"M(jet_{0},jet(1))"); cutflow1->GetXaxis()->SetBinLabel(7,"M(jets)"); cutflow1->GetXaxis()->SetBinLabel(8,"#tau_{21}"); cutflow1->GetXaxis()->SetBinLabel(9,"0b"); cutflow1->GetXaxis()->SetBinLabel(10,"1b"); cutflow1->GetXaxis()->SetBinLabel(11,"2b"); cutflow1->GetXaxis()->SetBinLabel(12,"3b"); cutflow1->GetXaxis()->SetBinLabel(13,"4b"); cutflow1->GetXaxis()->SetBinLabel(14,"3b+HPHP"); cutflow1->GetXaxis()->SetLabelFont(42); cutflow1->GetXaxis()->SetLabelSize(0.035); cutflow1->GetXaxis()->SetTitleSize(0.035); cutflow1->GetXaxis()->SetTitleFont(42); cutflow1->GetYaxis()->SetLabelFont(42); cutflow1->GetYaxis()->SetLabelSize(0.035); cutflow1->GetYaxis()->SetTitleSize(0.035); cutflow1->GetYaxis()->SetTitleFont(42); cutflow1->GetZaxis()->SetLabelFont(42); cutflow1->GetZaxis()->SetLabelSize(0.035); cutflow1->GetZaxis()->SetTitleSize(0.035); cutflow1->GetZaxis()->SetTitleFont(42); cutflow1->Draw(""); TPaveText *pt = new TPaveText(0.4246264,0.94,0.5753736,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("cut flow"); pt->Draw(); c1->Modified(); c1->cd(); c1->SetSelected(c1); }
void readMCPerform(TString filename="QAresults_AOD.root", Int_t drawOnlyDzerDplus = 1, Int_t runNumber=-1) { const Int_t totTrending=5; Float_t vecForTrend[totTrending]; TString varForTrending[totTrending]={"nDzeroCandperEv","nDplusCandperEv","nDsCandperEv","nLcCandperEv","nDstarCandperEv"}; TTree* trtree=new TTree("trendingHF","tree of trending variables"); trtree->Branch("nrun",&runNumber,"nrun/I"); for(Int_t j=0; j<totTrending; j++){ trtree->Branch(varForTrending[j].Data(),&vecForTrend[j],Form("%s/F",varForTrending[j].Data())); vecForTrend[j]=-99.; } TFile *ff = new TFile(filename.Data()); Int_t color[5] = {kBlack, kRed, kGreen, kBlue, kOrange}; TDirectoryFile *dirD2H = (TDirectoryFile *)ff->Get("PWG3_D2H_QA"); if(!dirD2H){ printf("Directory PWG3_D2H_QA not found in file %s\n",filename.Data()); return; } TList *listD2H = (TList *)dirD2H->Get("nEntriesQA"); if(!listD2H){ printf("TList nEntriesQA not found in file %s\n",filename.Data()); return; } TH1F *hNentries = (TH1F *)listD2H->FindObject("hNentries"); TH2F *hHasSelBit = (TH2F *)listD2H->FindObject("HasSelBit"); TCanvas *cqa = new TCanvas("cqa", "cqa", 800, 500); cqa->Divide(2, 1); cqa->cd(1); hNentries->Draw(); cqa->cd(2); hHasSelBit->Draw("colz"); cqa->SaveAs("plot_D2HQA.png"); Double_t nEv=hNentries->GetBinContent(10); vecForTrend[0]=hHasSelBit->GetBinContent(1)/nEv; vecForTrend[1]=hHasSelBit->GetBinContent(2)/nEv; vecForTrend[2]=hHasSelBit->GetBinContent(3)/nEv; vecForTrend[3]=hHasSelBit->GetBinContent(4)/nEv; vecForTrend[4]=hHasSelBit->GetBinContent(5)/nEv; TDirectoryFile *dir = (TDirectoryFile *)ff->Get("PWGHF_D2H_MCPerform"); TList* list = 0x0; if (dir) { list = (TList *)dir->Get("coutputDperfQA"); if(list){ TH1F *hn = (TH1F *)list->FindObject("fHistNEvents"); TH1F *hnGenD = (TH1F *)list->FindObject("fHistNGenD"); Int_t entries = hn->GetBinContent(3); TH2F *fHistNCand = (TH2F *)list->FindObject("fHistNCand"); TH1F *fHistNCandDzero = (TH1F *)fHistNCand->ProjectionY("fHistNCandDzero", 1, 1); TH1F *fHistNCandDplus = (TH1F *)fHistNCand->ProjectionY("fHistNCandDplus", 2, 2); TH1F *fHistNCandDstar = (TH1F *)fHistNCand->ProjectionY("fHistNCandDstar", 3, 3); TH1F *fHistNCandDs = (TH1F *)fHistNCand->ProjectionY("fHistNCandDs", 4, 4); TH1F *fHistNCandLc = (TH1F *)fHistNCand->ProjectionY("fHistNCandLc", 5, 5); TString names[5] = {"Dzero", "Dplus", "Dstar", "Ds", "Lc2pkpi"}; TString type[2] = {"Prompt", "Feeddown"}; const Int_t nDecays = 5; TH2F *fHistXvtxResVsPt[2 * nDecays]; TH2F *fHistYvtxResVsPt[2 * nDecays]; TH2F *fHistZvtxResVsPt[2 * nDecays]; TH2F *fHistInvMassVsPt[2 * nDecays]; TH2F *fHistDecLenVsPt[2 * nDecays]; TH2F *fHistNormDLxyVsPt[2 * nDecays]; TH2F *fHistCosPointVsPt[2 * nDecays]; TH3F *fHistPtYMultGenDauInAcc[2 * nDecays]; TH3F *fHistPtYMultRecoFilt[2 * nDecays]; TProfile *fHistXvtxRes[2 * nDecays]; TProfile *fHistYvtxRes[2 * nDecays]; TProfile *fHistZvtxRes[2 * nDecays]; TProfile *fHistXvtxMean[2 * nDecays]; TProfile *fHistYvtxMean[2 * nDecays]; TProfile *fHistZvtxMean[2 * nDecays]; TH1F *fHistXvtxRes2[2 * nDecays]; TH1F *fHistYvtxRes2[2 * nDecays]; TH1F *fHistZvtxRes2[2 * nDecays]; TProfile *fHistInvMass[2 * nDecays]; TProfile *fHistDecLen[2 * nDecays]; TProfile *fHistCosp[2 * nDecays]; TH1F *fHistInvMassRes[2 * nDecays]; TH1F *hEffPt[2 * nDecays]; TH1F *htemp; for (Int_t j = 0; j < 5; j++) { //decays for (Int_t i = 0; i < 2; i++) { //prompt and fd Int_t index = j * 2 + i; fHistXvtxResVsPt[index] = (TH2F *)list->FindObject(Form("hXvtxResVsPt%s%s", type[i].Data(), names[j].Data())); fHistYvtxResVsPt[index] = (TH2F *)list->FindObject(Form("hYvtxResVsPt%s%s", type[i].Data(), names[j].Data())); fHistZvtxResVsPt[index] = (TH2F *)list->FindObject(Form("hZvtxResVsPt%s%s", type[i].Data(), names[j].Data())); fHistInvMassVsPt[index] = (TH2F *)list->FindObject(Form("hInvMassVsPt%s%s", type[i].Data(), names[j].Data())); fHistDecLenVsPt[index] = (TH2F *)list->FindObject(Form("hDecLenVsPt%s%s", type[i].Data(), names[j].Data())); fHistCosPointVsPt[index] = (TH2F *)list->FindObject(Form("hCosPointVsPt%s%s", type[i].Data(), names[j].Data())); fHistPtYMultGenDauInAcc[index] = (TH3F *)list->FindObject(Form("hPtYMult%sGenDauInAcc%s", type[i].Data(), names[j].Data())); fHistPtYMultRecoFilt[index] = (TH3F *)list->FindObject(Form("hPtYMult%sRecoFilt%s", type[i].Data(), names[j].Data())); fHistXvtxMean[index] = (TProfile *)fHistXvtxResVsPt[index]->ProfileX(Form("hXvtxMean%s%s", type[i].Data(), names[j].Data())); fHistXvtxMean[index]->SetLineColor(color[j]); fHistXvtxMean[index]->SetLineWidth(2); fHistXvtxMean[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistXvtxMean[index]->GetYaxis()->SetTitle("Xvtx (reco-true) mean (#mum)"); fHistXvtxMean[index]->SetTitle("Xvtx residual vs pT"); fHistYvtxMean[index] = (TProfile *)fHistYvtxResVsPt[index]->ProfileX(Form("hYvtxMean%s%s", type[i].Data(), names[j].Data())); fHistYvtxMean[index]->SetLineColor(color[j]); fHistYvtxMean[index]->SetLineWidth(2); fHistYvtxMean[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistYvtxMean[index]->GetYaxis()->SetTitle("Yvtx (reco-true) mean (#mum)"); fHistYvtxMean[index]->SetTitle("Yvtx residual vs pT"); fHistZvtxMean[index] = (TProfile *)fHistZvtxResVsPt[index]->ProfileX(Form("hZvtxMean%s%s", type[i].Data(), names[j].Data())); fHistZvtxMean[index]->SetLineColor(color[j]); fHistZvtxMean[index]->SetLineWidth(2); fHistZvtxMean[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistZvtxMean[index]->GetYaxis()->SetTitle("Zvtx (reco-true) mean (#mum)"); fHistZvtxMean[index]->SetTitle("Zvtx residual vs pT"); fHistXvtxRes[index] = (TProfile *)fHistXvtxResVsPt[index]->ProfileX(Form("hXvtxRes%s%s", type[i].Data(), names[j].Data()), 1, -1, "s"); fHistYvtxRes[index] = (TProfile *)fHistYvtxResVsPt[index]->ProfileX(Form("hYvtxRes%s%s", type[i].Data(), names[j].Data()), 1, -1, "s"); fHistZvtxRes[index] = (TProfile *)fHistZvtxResVsPt[index]->ProfileX(Form("hZvtxRes%s%s", type[i].Data(), names[j].Data()), 1, -1, "s"); fHistXvtxRes2[index] = (TH1F *)fHistXvtxResVsPt[index]->ProjectionX(Form("hXvtxRes2%s%s", type[i].Data(), names[j].Data())); fHistYvtxRes2[index] = (TH1F *)fHistYvtxResVsPt[index]->ProjectionX(Form("hYvtxRes2%s%s", type[i].Data(), names[j].Data())); fHistZvtxRes2[index] = (TH1F *)fHistZvtxResVsPt[index]->ProjectionX(Form("hZvtxRes2%s%s", type[i].Data(), names[j].Data())); fHistXvtxRes[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistXvtxRes[index]->GetYaxis()->SetTitle("Xvtx (reco-true) RMS (#mum)"); fHistXvtxRes[index]->SetTitle("Xvtx resolution vs pT"); fHistYvtxRes[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistYvtxRes[index]->GetYaxis()->SetTitle("Yvtx (reco-true) RMS (#mum)"); fHistYvtxRes[index]->SetTitle("Yvtx resolution vs pT"); fHistZvtxRes[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistZvtxRes[index]->GetYaxis()->SetTitle("Zvtx (reco-true) RMS (#mum)"); fHistZvtxRes[index]->SetTitle("Zvtx resolution vs pT"); fHistXvtxRes2[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistXvtxRes2[index]->GetYaxis()->SetTitle("Xvtx (reco-true) RMS (#mum)"); fHistXvtxRes2[index]->SetTitle("Xvtx resolution vs pT"); fHistYvtxRes2[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistYvtxRes2[index]->GetYaxis()->SetTitle("Yvtx (reco-true) RMS (#mum)"); fHistYvtxRes2[index]->SetTitle("Yvtx resolution vs pT"); fHistZvtxRes2[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistZvtxRes2[index]->GetYaxis()->SetTitle("Zvtx (reco-true) RMS (#mum)"); fHistZvtxRes2[index]->SetTitle("Zvtx resolution vs pT"); fHistXvtxRes2[index]->SetLineColor(color[j]); fHistYvtxRes2[index]->SetLineColor(color[j]); fHistZvtxRes2[index]->SetLineColor(color[j]); fHistXvtxRes2[index]->SetMarkerColor(color[j]); fHistXvtxRes2[index]->SetMarkerStyle(20); fHistYvtxRes2[index]->SetMarkerColor(color[j]); fHistYvtxRes2[index]->SetMarkerStyle(20); fHistZvtxRes2[index]->SetMarkerColor(color[j]); fHistZvtxRes2[index]->SetMarkerStyle(20); fHistXvtxRes2[index]->SetLineWidth(2); fHistYvtxRes2[index]->SetLineWidth(2); fHistZvtxRes2[index]->SetLineWidth(2); fHistXvtxRes2[index]->Sumw2(); fHistYvtxRes2[index]->Sumw2(); fHistZvtxRes2[index]->Sumw2(); fHistInvMass[index] = (TProfile *)fHistInvMassVsPt[index]->ProfileX(Form("hInvMassVsPt%s%s", type[i].Data(), names[j].Data())); fHistInvMass[index]->SetLineColor(color[j]); fHistInvMass[index]->SetLineWidth(2); fHistInvMass[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistInvMass[index]->GetYaxis()->SetTitle("Inv Mass (GeV/c2)"); fHistInvMass[index]->SetTitle("Inv Mass vs pT"); fHistDecLen[index] = (TProfile *)fHistDecLenVsPt[index]->ProfileX(Form("hDecLenVsPt%s%s", type[i].Data(), names[j].Data())); fHistDecLen[index]->SetLineColor(color[j]); fHistDecLen[index]->SetLineWidth(2); fHistDecLen[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistDecLen[index]->GetYaxis()->SetTitle("Dec Len (#mum)"); fHistDecLen[index]->SetTitle("Prompt Dec Len vs pT"); fHistCosp[index] = (TProfile *)fHistCosPointVsPt[index]->ProfileX(Form("hCosPVsPt%s%s", type[i].Data(), names[j].Data())); fHistCosp[index]->SetLineColor(color[j]); fHistCosp[index]->SetLineWidth(2); fHistCosp[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistCosp[index]->GetYaxis()->SetTitle("Cos Point"); fHistCosp[index]->SetTitle("Prompt CosPoint vs pT"); if (index % 2 == 1) fHistDecLen[index]->SetTitle("FeedDown Dec Len vs pT"); htemp = (TH1F *)fHistPtYMultGenDauInAcc[index]->ProjectionX(Form("hPtDen%s%s", type[i].Data(), names[j].Data())); hEffPt[index] = (TH1F *)fHistPtYMultRecoFilt[index]->ProjectionX(Form("hPtNum%s%s", type[i].Data(), names[j].Data())); fHistPtYMultGenDauInAcc[index]->Sumw2(); fHistPtYMultRecoFilt[index]->Sumw2(); hEffPt[index]->Sumw2(); hEffPt[index]->Divide(htemp); hEffPt[index]->SetLineColor(color[j]); hEffPt[index]->SetLineWidth(2); hEffPt[index]->GetXaxis()->SetTitle("pT (GeV/c)"); hEffPt[index]->GetYaxis()->SetTitle("Prompt Efficiency"); hEffPt[index]->SetTitle("Prompt Efficiency"); hEffPt[index]->SetStats(0); fHistCosp[index]->SetStats(0); fHistDecLen[index]->SetStats(0); if (index % 2 == 1) { hEffPt[index]->GetYaxis()->SetTitle("Feeddown Efficiency"); hEffPt[index]->SetTitle("Feeddown Efficiency"); } fHistInvMassRes[index] = new TH1F(*hEffPt[index]); for (Int_t jj = 1; jj < hEffPt[index]->GetNbinsX() + 1; jj++) { TH1F *hTemp = (TH1F *)fHistInvMassVsPt[index]->ProjectionY("htemp", jj, jj); fHistInvMassRes[index]->SetBinContent(jj, hTemp->GetRMS()); fHistInvMassRes[index]->SetBinError(jj, hTemp->GetRMSError()); fHistInvMassRes[index]->SetLineColor(color[j]); fHistInvMassRes[index]->SetLineWidth(2); fHistInvMassRes[index]->GetXaxis()->SetTitle("pT (GeV/c)"); fHistInvMassRes[index]->GetYaxis()->SetTitle("Inv Mass RMS (GeV/c2)"); fHistInvMassRes[index]->SetTitle("Inv Mass RMS vs pT"); if (index == 0) printf("D0: pt=%f, res=%f \n", fHistInvMassRes[index]->GetBinCenter(jj), fHistInvMassRes[index]->GetBinContent(jj)); TH1F *hTempX = (TH1F *)fHistXvtxResVsPt[index]->ProjectionY("htempX", jj, jj); TH1F *hTempY = (TH1F *)fHistYvtxResVsPt[index]->ProjectionY("htempY", jj, jj); TH1F *hTempZ = (TH1F *)fHistZvtxResVsPt[index]->ProjectionY("htempZ", jj, jj); fHistXvtxRes2[index]->SetBinContent(jj, hTempX->GetRMS()); fHistXvtxRes2[index]->SetBinError(jj, hTempX->GetRMSError()); fHistYvtxRes2[index]->SetBinContent(jj, hTempY->GetRMS()); fHistYvtxRes2[index]->SetBinError(jj, hTempY->GetRMSError()); fHistZvtxRes2[index]->SetBinContent(jj, hTempZ->GetRMS()); fHistZvtxRes2[index]->SetBinError(jj, hTempZ->GetRMSError()); } } } fHistNCandDplus->SetLineColor(2); fHistNCandDstar->SetLineColor(3); fHistNCandDs->SetLineColor(4); fHistNCandLc->SetLineColor(kOrange); fHistNCandDplus->SetLineWidth(2); fHistNCandDstar->SetLineWidth(2); fHistNCandDs->SetLineWidth(2); fHistNCandLc->SetLineWidth(2); fHistNCandDzero->GetXaxis()->SetTitle("pT (GeV/c)"); fHistNCandDzero->GetYaxis()->SetTitle("counts"); TLegend *leg = new TLegend(0.6, 0.7, 0.8, 0.9); leg->AddEntry(fHistNCandDzero, "Dzero", "l"); leg->AddEntry(fHistNCandDplus, "Dplus", "l"); leg->AddEntry(fHistNCandDstar, "Dstar", "l"); leg->AddEntry(fHistNCandDs, "Ds", "l"); leg->AddEntry(fHistNCandLc, "Lc", "l"); TLegend *leg1 = new TLegend(0.5, 0.7, 0.7, 0.9); leg1->AddEntry(fHistYvtxRes2[0], "Dzero", "pl"); leg1->AddEntry(fHistYvtxRes2[2], "Dplus", "pl"); if (drawOnlyDzerDplus == 0) leg1->AddEntry(fHistYvtxRes2[6], "Ds", "pl"); if (drawOnlyDzerDplus == 0) leg1->AddEntry(fHistYvtxRes2[8], "Lc", "pl"); TLegend *leg2 = new TLegend(0.5, 0.7, 0.7, 0.9); leg2->AddEntry(fHistYvtxMean[0], "Dzero", "l"); leg2->AddEntry(fHistYvtxMean[2], "Dplus", "l"); if (drawOnlyDzerDplus == 0) leg2->AddEntry(fHistYvtxMean[6], "Ds", "l"); if (drawOnlyDzerDplus == 0) leg2->AddEntry(fHistYvtxMean[8], "Lc", "l"); TLegend *leg3 = new TLegend(0.2, 0.7, 0.4, 0.9); leg3->AddEntry(fHistNCandDzero, "Dzero", "l"); leg3->AddEntry(fHistNCandDplus, "Dplus", "l"); if (drawOnlyDzerDplus == 0) leg3->AddEntry(fHistNCandDstar, "Dstar", "l"); if (drawOnlyDzerDplus == 0) leg3->AddEntry(fHistNCandDs, "Ds", "l"); if (drawOnlyDzerDplus == 0) leg3->AddEntry(fHistNCandLc, "Lc", "l"); TLegend *leg4 = new TLegend(0.7, 0.7, 0.9, 0.9); leg4->AddEntry(fHistNCandDzero, "Dzero", "l"); leg4->AddEntry(fHistNCandDplus, "Dplus", "l"); if (drawOnlyDzerDplus == 0) leg4->AddEntry(fHistNCandDstar, "Dstar", "l"); if (drawOnlyDzerDplus == 0) leg4->AddEntry(fHistNCandDs, "Ds", "l"); if (drawOnlyDzerDplus == 0) leg4->AddEntry(fHistNCandLc, "Lc", "l"); TCanvas *c0_1 = new TCanvas("c0_1", "c0_1", 500, 500); hnGenD->SetTitle("number of generated D mesons"); hnGenD->Draw(); c0_1->SaveAs("plotDgen.png"); TCanvas *c0_2 = new TCanvas("c0_2", "c0_2", 500, 500); c0_2->SetLogy(); fHistNCandDs->SetTitle("Candidates passing filtering cuts"); fHistNCandDs->Draw(""); c0_2->Update(); TPaveStats *stats = (TPaveStats *)c0_2->GetPrimitive("stats"); stats->SetName("h1stats"); stats->SetY1NDC(0.5); stats->SetY2NDC(0.35); c0_2->Update(); fHistNCandDplus->Draw("sames"); c0_2->Update(); TPaveStats *stats2 = (TPaveStats *)c0_2->GetPrimitive("stats"); stats2->SetName("h2stats"); stats2->SetY1NDC(0.8); stats2->SetY2NDC(.65); c0_2->Update(); fHistNCandDstar->Draw("sames"); c0_2->Update(); TPaveStats *stats3 = (TPaveStats *)c0_2->GetPrimitive("stats"); stats3->SetName("h3stats"); stats3->SetY1NDC(0.65); stats3->SetY2NDC(.5); c0_2->Update(); fHistNCandDzero->Draw("sames"); c0_2->Update(); TPaveStats *stats4 = (TPaveStats *)c0_2->GetPrimitive("stats"); stats4->SetName("h4stats"); stats4->SetY1NDC(0.95); stats4->SetY2NDC(.8); c0_2->Update(); fHistNCandLc->Draw("sames"); c0_2->Update(); TPaveStats *stats5 = (TPaveStats *)c0_2->GetPrimitive("stats"); stats5->SetName("h1stats"); stats5->SetY1NDC(0.35); stats5->SetY2NDC(.2); c0_2->Update(); leg->Draw(); c0_2->SaveAs("plotDcandpt.png"); TCanvas *c0_3 = new TCanvas("c0_3", "c0_3", 500, 500); fHistInvMass[0]->SetMinimum(1.6); fHistInvMass[0]->SetMaximum(2.4); fHistInvMass[0]->Draw(); fHistInvMass[2]->Draw("sames"); fHistInvMass[4]->Draw("sames"); fHistInvMass[6]->Draw("sames"); fHistInvMass[8]->Draw("sames"); leg->Draw(); c0_3->SaveAs("plotDcandInvMass.png"); TCanvas *c0_4 = new TCanvas("c0_4", "c0_4", 500, 500); //fHistInvMassRes[0]->SetMinimum(1.6); //fHistInvMassRes[0]->SetMaximum(2.4); fHistInvMassRes[0]->GetYaxis()->SetTitleOffset(1.4); fHistInvMassRes[0]->SetTitle("D0 Inv Mass RMS vs pT"); fHistInvMassRes[0]->Draw(""); // fHistInvMassRes[2]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistInvMassRes[4]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistInvMassRes[6]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistInvMassRes[8]->Draw("sames"); //leg->Draw(); c0_4->SaveAs("plotD0candInvMassWidth.png"); fHistXvtxMean[0]->SetStats(0); fHistYvtxMean[0]->SetStats(0); fHistZvtxMean[0]->SetStats(0); fHistXvtxMean[2]->SetStats(0); fHistYvtxMean[2]->SetStats(0); fHistZvtxMean[2]->SetStats(0); fHistXvtxRes2[0]->SetStats(0); fHistYvtxRes2[0]->SetStats(0); fHistZvtxRes2[0]->SetStats(0); fHistXvtxRes2[2]->SetStats(0); fHistYvtxRes2[2]->SetStats(0); fHistZvtxRes2[2]->SetStats(0); TCanvas *cc = new TCanvas("cc", "cc", 1200, 500); cc->Divide(3, 1); cc->cd(1); fHistXvtxMean[0]->GetYaxis()->SetTitleOffset(1.4); fHistXvtxMean[0]->SetMinimum(-300.); fHistXvtxMean[0]->SetMaximum(300.); fHistXvtxMean[0]->Draw(); fHistXvtxMean[2]->Draw("sames"); leg2->Draw(); cc->cd(2); fHistYvtxMean[0]->GetYaxis()->SetTitleOffset(1.4); fHistYvtxMean[0]->SetMinimum(-300.); fHistYvtxMean[0]->SetMaximum(300.); fHistYvtxMean[0]->Draw(); fHistYvtxMean[2]->Draw("sames"); leg2->Draw(); cc->cd(3); fHistZvtxMean[0]->GetYaxis()->SetTitleOffset(1.4); fHistZvtxMean[0]->SetMinimum(-300.); fHistZvtxMean[0]->SetMaximum(300.); fHistZvtxMean[0]->Draw(); fHistZvtxMean[2]->Draw("sames"); leg2->Draw(); cc->SaveAs("plotXYZVtxMean.png"); ///////// TCanvas *ccr = new TCanvas("ccr", "ccr", 1200, 500); ccr->Divide(3, 1); ccr->cd(1); fHistXvtxRes2[0]->GetYaxis()->SetTitleOffset(1.4); fHistXvtxRes2[0]->SetMinimum(0.); fHistXvtxRes2[0]->SetMaximum(500.); fHistXvtxRes2[0]->Draw(); fHistXvtxRes2[2]->Draw("sames"); leg2->Draw(); ccr->cd(2); fHistYvtxRes2[0]->GetYaxis()->SetTitleOffset(1.4); fHistYvtxRes2[0]->SetMinimum(0.); fHistYvtxRes2[0]->SetMaximum(500.); fHistYvtxRes2[0]->Draw(); fHistYvtxRes2[2]->Draw("sames"); leg2->Draw(); ccr->cd(3); fHistZvtxRes2[0]->GetYaxis()->SetTitleOffset(1.4); fHistZvtxRes2[0]->SetMinimum(0.); fHistZvtxRes2[0]->SetMaximum(500.); fHistZvtxRes2[0]->Draw(); fHistZvtxRes2[2]->Draw("sames"); leg2->Draw(); ccr->SaveAs("plotXYZVtxRMS.png"); TCanvas *ccc = new TCanvas("ccc", "ccc", 1200, 800); ccc->Divide(3, 2); ccc->cd(1); fHistDecLen[0]->GetYaxis()->SetTitleOffset(1.45); fHistDecLen[0]->Draw(); fHistDecLen[2]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistDecLen[4]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistDecLen[6]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistDecLen[8]->Draw("sames"); leg3->Draw(); ccc->cd(2); fHistCosp[0]->GetYaxis()->SetTitleOffset(1.45); fHistCosp[0]->Draw(); fHistCosp[2]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistCosp[4]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistCosp[6]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistCosp[8]->Draw("sames"); leg4->Draw(); ccc->cd(3); hEffPt[0]->GetYaxis()->SetTitleOffset(1.45); hEffPt[0]->Draw(); hEffPt[2]->Draw("sames"); if (drawOnlyDzerDplus == 0) hEffPt[4]->Draw("sames"); if (drawOnlyDzerDplus == 0) hEffPt[6]->Draw("sames"); if (drawOnlyDzerDplus == 0) hEffPt[8]->Draw("sames"); leg3->Draw(); ccc->cd(4); fHistDecLen[1]->GetYaxis()->SetTitleOffset(1.45); fHistDecLen[1]->Draw(); fHistDecLen[3]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistDecLen[5]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistDecLen[7]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistDecLen[9]->Draw("sames"); leg3->Draw(); ccc->cd(5); fHistCosp[1]->GetYaxis()->SetTitleOffset(1.45); fHistCosp[1]->Draw(); fHistCosp[3]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistCosp[5]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistCosp[7]->Draw("sames"); if (drawOnlyDzerDplus == 0) fHistCosp[9]->Draw("sames"); leg4->Draw(); ccc->cd(6); hEffPt[1]->GetYaxis()->SetTitleOffset(1.45); hEffPt[1]->Draw(); hEffPt[3]->Draw("sames"); if (drawOnlyDzerDplus == 0) hEffPt[5]->Draw("sames"); if (drawOnlyDzerDplus == 0) hEffPt[7]->Draw("sames"); if (drawOnlyDzerDplus == 0) hEffPt[9]->Draw("sames"); leg3->Draw(); ccc->SaveAs("plot_DL_cosp_Eff_prompt_fd.png"); } } trtree->Fill(); if(runNumber>0){ TFile* foutfile=new TFile("trendingHF.root","recreate"); trtree->Write(); TDirectory* outdir=foutfile->mkdir(dirD2H->GetName()); outdir->cd(); listD2H->Write(listD2H->GetName(),1); foutfile->cd(); if(dir && list){ TDirectory* outdir2=foutfile->mkdir(dir->GetName()); outdir2->cd(); list->Write(list->GetName(),1); } foutfile->Close(); delete foutfile; } }
void x_dist_cuts() { //=========Macro generated from canvas: c/ //========= (Fri Jul 24 12:08:10 2015) by ROOT version6.04/00 TCanvas *c = new TCanvas("c", "",0,45,600,500); c->SetHighLightColor(2); c->Range(-187.5,-2144.494,187.5,19300.44); c->SetFillColor(0); c->SetBorderMode(0); c->SetBorderSize(2); c->SetFrameBorderMode(0); c->SetFrameBorderMode(0); TH1D *hist__1 = new TH1D("hist__1","Worry Later",100,-150,150); hist__1->SetBinContent(0,37); hist__1->SetBinContent(1,11); hist__1->SetBinContent(2,6); hist__1->SetBinContent(3,9); hist__1->SetBinContent(4,11); hist__1->SetBinContent(5,17); hist__1->SetBinContent(6,29); hist__1->SetBinContent(7,31); hist__1->SetBinContent(8,40); hist__1->SetBinContent(9,65); hist__1->SetBinContent(10,62); hist__1->SetBinContent(11,79); hist__1->SetBinContent(12,132); hist__1->SetBinContent(13,148); hist__1->SetBinContent(14,184); hist__1->SetBinContent(15,187); hist__1->SetBinContent(16,257); hist__1->SetBinContent(17,316); hist__1->SetBinContent(18,354); hist__1->SetBinContent(19,449); hist__1->SetBinContent(20,495); hist__1->SetBinContent(21,568); hist__1->SetBinContent(22,607); hist__1->SetBinContent(23,624); hist__1->SetBinContent(24,686); hist__1->SetBinContent(25,704); hist__1->SetBinContent(26,739); hist__1->SetBinContent(27,738); hist__1->SetBinContent(28,743); hist__1->SetBinContent(29,732); hist__1->SetBinContent(30,730); hist__1->SetBinContent(31,706); hist__1->SetBinContent(32,773); hist__1->SetBinContent(33,716); hist__1->SetBinContent(34,788); hist__1->SetBinContent(35,760); hist__1->SetBinContent(36,900); hist__1->SetBinContent(37,945); hist__1->SetBinContent(38,1039); hist__1->SetBinContent(39,1194); hist__1->SetBinContent(40,1368); hist__1->SetBinContent(41,1682); hist__1->SetBinContent(42,1928); hist__1->SetBinContent(43,2500); hist__1->SetBinContent(44,3260); hist__1->SetBinContent(45,4389); hist__1->SetBinContent(46,5759); hist__1->SetBinContent(47,7620); hist__1->SetBinContent(48,9955); hist__1->SetBinContent(49,13012); hist__1->SetBinContent(50,16339); hist__1->SetBinContent(51,16048); hist__1->SetBinContent(52,13155); hist__1->SetBinContent(53,10318); hist__1->SetBinContent(54,7953); hist__1->SetBinContent(55,6143); hist__1->SetBinContent(56,4420); hist__1->SetBinContent(57,3422); hist__1->SetBinContent(58,2687); hist__1->SetBinContent(59,2027); hist__1->SetBinContent(60,1643); hist__1->SetBinContent(61,1359); hist__1->SetBinContent(62,1189); hist__1->SetBinContent(63,1057); hist__1->SetBinContent(64,929); hist__1->SetBinContent(65,840); hist__1->SetBinContent(66,792); hist__1->SetBinContent(67,759); hist__1->SetBinContent(68,719); hist__1->SetBinContent(69,673); hist__1->SetBinContent(70,702); hist__1->SetBinContent(71,769); hist__1->SetBinContent(72,693); hist__1->SetBinContent(73,728); hist__1->SetBinContent(74,719); hist__1->SetBinContent(75,698); hist__1->SetBinContent(76,729); hist__1->SetBinContent(77,695); hist__1->SetBinContent(78,732); hist__1->SetBinContent(79,692); hist__1->SetBinContent(80,620); hist__1->SetBinContent(81,592); hist__1->SetBinContent(82,525); hist__1->SetBinContent(83,463); hist__1->SetBinContent(84,407); hist__1->SetBinContent(85,357); hist__1->SetBinContent(86,300); hist__1->SetBinContent(87,229); hist__1->SetBinContent(88,192); hist__1->SetBinContent(89,154); hist__1->SetBinContent(90,113); hist__1->SetBinContent(91,123); hist__1->SetBinContent(92,73); hist__1->SetBinContent(93,55); hist__1->SetBinContent(94,41); hist__1->SetBinContent(95,27); hist__1->SetBinContent(96,27); hist__1->SetBinContent(97,18); hist__1->SetBinContent(98,14); hist__1->SetBinContent(99,8); hist__1->SetBinContent(100,11); hist__1->SetBinContent(101,55); hist__1->SetEntries(173117); TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("hist"); AText->SetTextSize(0.0368); AText = ptstats->AddText("Entries = 173117 "); AText = ptstats->AddText("Mean = 0.6933"); AText = ptstats->AddText("Std Dev = 34.33"); ptstats->SetOptStat(1111); ptstats->SetOptFit(0); ptstats->Draw(); hist__1->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(hist__1); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); hist__1->SetLineColor(ci); hist__1->GetXaxis()->SetTitle("#DeltaZ [cm]"); hist__1->GetXaxis()->SetLabelFont(42); hist__1->GetXaxis()->SetLabelSize(0.035); hist__1->GetXaxis()->SetTitleSize(0.035); hist__1->GetXaxis()->SetTitleFont(42); hist__1->GetYaxis()->SetLabelFont(42); hist__1->GetYaxis()->SetLabelSize(0.035); hist__1->GetYaxis()->SetTitleSize(0.035); hist__1->GetYaxis()->SetTitleFont(42); hist__1->GetZaxis()->SetLabelFont(42); hist__1->GetZaxis()->SetLabelSize(0.035); hist__1->GetZaxis()->SetTitleSize(0.035); hist__1->GetZaxis()->SetTitleFont(42); hist__1->Draw(""); TPaveText *pt = new TPaveText(0.3779599,0.9368947,0.6220401,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("Worry Later"); pt->Draw(); c->Modified(); c->cd(); c->SetSelected(c); }
void CompHist(TH1 *h1, TH1 *href, int run1, int runref) { if (!h1 || !href || h1->Integral()==0 || href->Integral()==0) return; // first check if both histograms are compatible Stat_t s[TH1F::kNstat]; h1->GetStats(s);// s[1] sum of squares of weights, s[0] sum of weights Double_t sumBinContent1 = s[0]; Double_t effEntries1 = (s[1] ? s[0] * s[0] / s[1] : 0.0); href->GetStats(s);// s[1] sum of squares of weights, s[0] sum of weights Double_t sumBinContent2 = s[0]; Double_t effEntries2 = (s[1] ? s[0] * s[0] / s[1] : 0.0); float pval_chi2=1, pval_ks=1,pval_ad=1; bool iswt = (sumBinContent1==0 || effEntries1==0 || sumBinContent2==0 || effEntries2==0 || TMath::Abs(sumBinContent1 - effEntries1) != 0 || TMath::Abs(sumBinContent2 - effEntries2) != 0); if (iswt) { // weighted histograms pval_chi2 = h1->Chi2Test(href,"WW"); // pval_ks = h1->KolmogorovTest(href); } else { // unweighted histograms pval_ks = h1->KolmogorovTest(href); pval_ad = h1->AndersonDarlingTest(href); // double int1 = h1->Integral(); // double intref = href->Integral(); // if (int1==0 || intref==0) return; // h1->Scale(1./int1); // href->Scale(1./intref); // pval_chi2 = h1->Chi2Test(href,"NORM UU"); } if (pval_chi2>minpval && pval_ks>minpval) return; // looks like we have a discrepancy! let's plot the histograms and print the output cout << h1->GetTitle() << ": p-val(chi2) = " << pval_chi2 << ", p-val(KS) = " << pval_ks << ", pval_ad = " << pval_ad << endl; TCanvas *c1 = new TCanvas(); href->SetLineColor(kRed); href->SetMarkerColor(kRed); if (!iswt) href->DrawNormalized(); else href->Draw(); c1->Update(); // Retrieve the stat box TPaveStats *ps = (TPaveStats*)c1->GetPrimitive("stats"); ps->SetName("statsref"); ps->SetTextColor(kRed); ps->SetX1NDC(0.8); ps->SetX2NDC(1.); ps->SetY1NDC(0.6); ps->SetY2NDC(0.8); h1->SetLineColor(kBlack); h1->SetMarkerColor(kBlack); if (!iswt) h1->DrawNormalized("sames"); else h1->Draw("sames"); c1->Update(); TPaveStats *psref = (TPaveStats*)c1->GetPrimitive("stats"); psref->SetName("stats1"); psref->SetX1NDC(0.8); psref->SetX2NDC(1.); psref->SetY1NDC(0.8); psref->SetY2NDC(1.); c1->Modified(); c1->Update(); TLatex *txt = new TLatex(); if (!iswt) txt->DrawLatexNDC(0.02,0.02,Form("p(KS) = %f, p(AD) = %f",pval_ks,pval_ad)); else txt->DrawLatexNDC(0.02,0.02,Form("p(#chi^{2}) = %f",pval_chi2)); c1->SaveAs(Form("%s_%i_%i.png",h1->GetName(),run1,runref)); delete c1; }
void JetEtaBC(void){ std::cout << "Hellowww!!" << std::endl; TFile *file1; file1 = TFile::Open("PF_second.root"); TH1F* f1 = (TH1F*)file1->FindObjectAny("JetEtaBC"); TFile *file2; file2 = TFile::Open("PAT_second.root"); TH1F* f2 = (TH1F*)file2->FindObjectAny("JetEtaBC"); TFile *file3; file3 = TFile::Open("PF_IC5_Jets_Corrected.root"); TH1F* f3 = (TH1F*)file3->FindObjectAny("JetEtaBC"); TFile *file4; file4 = TFile::Open("PF_ak5_tot.root"); TH1F* f4 = (TH1F*)file4->FindObjectAny("JetEtaBC"); TCanvas *c1 = new TCanvas("canvas","Plotting Canvas",150,10,990,660); c1->Range(-0.1486535,-622.7141,1.350808,5500.641); c1->SetFillColor(0); c1->SetBorderSize(2); c1->SetLogy(); c1->SetTickx(1); c1->SetTicky(1); f1->SetStats(kFALSE); f4->GetXaxis()->SetTitle("#eta"); f4->GetXaxis()->SetLabelFont(42); f4->GetXaxis()->SetTitleFont(42); f4->GetYaxis()->SetTitle("Events"); f4->GetYaxis()->SetLabelFont(42); f4->GetYaxis()->SetTitleOffset(1.19); f4->GetYaxis()->SetTitleFont(42); f4->SetLineWidth(4); f1->SetLineColor(1); f2->SetStats(kFALSE); f2->SetLineColor(2); f2->SetLineWidth(3); f3->SetStats(kFALSE); f3->SetLineColor(3); f3->SetLineWidth(2); f4->SetStats(kFALSE); f4->SetLineColor(4); f1->SetLineWidth(1); int entries = f1->GetEntries(); double mean = f1->GetMean(); double RMS = f1->GetRMS(); int entries1 = f2->GetEntries(); double mean1 = f2->GetMean(); double RMS1 = f2->GetRMS(); int entries2 = f3->GetEntries(); double mean2 = f3->GetMean(); double RMS2 = f3->GetRMS(); int entries3 = f4->GetEntries(); double mean3 = f4->GetMean(); double RMS3 = f4->GetRMS(); TPaveStats *ptstats = new TPaveStats(0.8314943,0.7488136,0.9926437,0.8877119,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); ptstats->SetTextColor(1); TPaveStats *ptstats1 = new TPaveStats(0.8314943,0.5988136,0.9926437,0.7377119,"brNDC"); ptstats1->SetName("stats"); ptstats1->SetBorderSize(1); ptstats1->SetFillColor(0); ptstats1->SetTextAlign(12); ptstats1->SetTextFont(42); ptstats1->SetTextColor(2); TPaveStats *ptstats2 = new TPaveStats(0.8314943,0.4488136,0.9926437,0.5877119,"brNDC"); ptstats2->SetName("stats"); ptstats2->SetBorderSize(1); ptstats2->SetFillColor(0); ptstats2->SetTextAlign(12); ptstats2->SetTextFont(42); ptstats2->SetTextColor(3); TPaveStats *ptstats3 = new TPaveStats(0.8314943,0.2988136,0.9926437,0.4377119,"brNDC"); ptstats3->SetName("stats"); ptstats3->SetBorderSize(1); ptstats3->SetFillColor(0); ptstats3->SetTextAlign(12); ptstats3->SetTextFont(42); ptstats3->SetTextColor(4); #include <sstream> std::string s,s1,s2; std::stringstream out,out1,out2; out << "Entries = " << entries << " "; out1 << "Mean = " << mean << " "; out2 << "RMS = " << RMS << " "; s = out.str(); s1 = out1.str(); s2 = out2.str(); std::string s_1,s1_1,s2_1; std::stringstream out_1,out1_1,out2_1; out_1 << "Entries = " << entries1 << " "; out1_1 << "Mean = " << mean1 << " "; out2_1 << "RMS = " << RMS1 << " "; s_1 = out_1.str(); s1_1 = out1_1.str(); s2_1 = out2_1.str(); std::string s_2,s1_2,s2_2; std::stringstream out_2,out1_2,out2_2; out_2 << "Entries = " << entries2 << " "; out1_2 << "Mean = " << mean2 << " "; out2_2 << "RMS = " << RMS2 << " "; s_2 = out_2.str(); s1_2 = out1_2.str(); s2_2 = out2_2.str(); std::string s_3,s1_3,s2_3; std::stringstream out_3,out1_3,out2_3; out_3 << "Entries = " << entries3 << " "; out1_3 << "Mean = " << mean3 << " "; out2_3 << "RMS = " << RMS3 << " "; s_3 = out_3.str(); s1_3 = out1_3.str(); s2_3 = out2_3.str(); TText *text = ptstats->AddText(s.c_str()); text = ptstats->AddText(s1.c_str()); text = ptstats->AddText(s2.c_str()); ptstats->SetOptStat(1110); ptstats->SetOptFit(0); TText *text1 = ptstats1->AddText(s_1.c_str()); text1 = ptstats1->AddText(s1_1.c_str()); text1 = ptstats1->AddText(s2_1.c_str()); ptstats1->SetOptStat(1110); ptstats1->SetOptFit(0); TText *text2 = ptstats2->AddText(s_2.c_str()); text2 = ptstats2->AddText(s1_2.c_str()); text2 = ptstats2->AddText(s2_2.c_str()); ptstats2->SetOptStat(1110); ptstats2->SetOptFit(0); TText *text3 = ptstats3->AddText(s_3.c_str()); text3 = ptstats3->AddText(s1_3.c_str()); text3 = ptstats3->AddText(s2_3.c_str()); ptstats3->SetOptStat(1110); ptstats3->SetOptFit(0); TPaveText *pt = new TPaveText(0.3066092,0.8061864,0.7255747,0.87055085,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetTextFont(42); pt->SetFillColor(0); pt->SetTextColor(1); text = pt->AddText("PF Number of Jets before cuts"); text = pt->AddText("PF Jets Pt > 10 GeV Before Cuts"); TPaveText *pt1 = new TPaveText(0.3066092,0.7261864,0.7055747,0.77055085,"blNDC"); pt1->SetName("title"); pt1->SetBorderSize(0); pt1->SetTextFont(42); pt1->SetFillColor(0); pt1->SetTextColor(2); text1 = pt1->AddText("PAT Jets Eta Before Cuts"); TPaveText *pt2 = new TPaveText(0.3066092,0.6561864,0.7055747,0.70055085,"blNDC"); pt2->SetName("title"); pt2->SetBorderSize(0); pt2->SetTextFont(42); pt2->SetFillColor(0); pt2->SetTextColor(3); text2 = pt2->AddText("PF IC5 Pt > 0 GeV Jets Eta Before Cuts"); TPaveText *pt3 = new TPaveText(0.3266092,0.5861864,0.7055747,0.63055085,"blNDC"); pt3->SetName("title"); pt3->SetBorderSize(0); pt3->SetTextFont(42); pt3->SetFillColor(0); pt3->SetTextColor(4); text3 = pt3->AddText("PF ak5 Eta Before Cuts"); c1->Modified(); f4->Draw(); f2->Draw("SAME"); f3->Draw("SAME"); f1->Draw("SAME"); pt->Draw("SAME"); ptstats->Draw("SAME"); pt1->Draw("SAME"); ptstats1->Draw("SAME"); pt2->Draw("SAME"); ptstats2->Draw("SAME"); pt3->Draw("SAME"); ptstats3->Draw("SAME"); c1->SaveAs("JetEtaBeforeCutsComparisonAllIhaverightnow.gif"); return 0; };
int main(int argc, char** argv){ //=========Macro generated from canvas: Canvas_1/Canvas_1 //========= (Wed Aug 27 23:28:50 2014) by ROOT version5.34/04 TCanvas *Canvas_1 = new TCanvas("Canvas_1", "Canvas_1",258,73,1243,811); Canvas_1->Range(-0.0625,-0.0625,0.0625,0.0625); Canvas_1->SetFillColor(0); Canvas_1->SetBorderMode(0); Canvas_1->SetBorderSize(2); Canvas_1->SetFrameBorderMode(0); Canvas_1->SetFrameBorderMode(0); TFile f(argv[1],"r"); TH2F *h1 = (TH2F*)f.Get("h2dir/h4"); /* TPaletteAxis *palette = new TPaletteAxis(0.050625,-0.05,0.05625,0.05,h1); palette->SetLabelColor(1); palette->SetLabelFont(42); palette->SetLabelOffset(0.005); palette->SetLabelSize(0.035); palette->SetTitleOffset(1); palette->SetTitleSize(0.035); palette->SetFillColor(100); palette->SetFillStyle(1001); h1->GetListOfFunctions()->Add(palette,"br"); */ TPaveStats *ptstats = new TPaveStats(0.700565,0.6608696,0.9007264,0.9006211,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *text = ptstats->AddText("h1"); text->SetTextSize(0.03676191); text = ptstats->AddText("Entries = 101 "); text = ptstats->AddText("Mean x = -0.0003512"); text = ptstats->AddText("Mean y = -0.0003318"); text = ptstats->AddText("RMS x = 0.01432"); text = ptstats->AddText("RMS y = 0.01428"); ptstats->SetOptStat(1111); ptstats->SetOptFit(0); ptstats->Draw(); h1->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(h1); Int_t ci; // for color index setting ci = TColor::GetColor("#000099"); h1->SetLineColor(ci); h1->GetXaxis()->SetTitle("mm"); h1->GetXaxis()->SetLabelFont(42); h1->GetXaxis()->SetLabelSize(0.035); h1->GetXaxis()->SetTitleSize(0.035); h1->GetXaxis()->SetTitleFont(42); h1->GetYaxis()->SetTitle("mm"); h1->GetYaxis()->SetLabelFont(42); h1->GetYaxis()->SetLabelSize(0.035); h1->GetYaxis()->SetTitleSize(0.035); h1->GetYaxis()->SetTitleFont(42); h1->GetZaxis()->SetLabelFont(42); h1->GetZaxis()->SetLabelSize(0.035); h1->GetZaxis()->SetTitleSize(0.035); h1->GetZaxis()->SetTitleFont(42); h1->Draw("COLZ "); TPaveText *pt = new TPaveText(0.1594915,0.9368634,0.8405085,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); text = pt->AddText("2D Energy deposit distribution at z=-25um"); pt->Draw(); Canvas_1->Modified(); Canvas_1->cd(); Canvas_1->SetSelected(Canvas_1); std::cout<<argv[1]<<std::endl; Canvas_1->SaveAs(TString(argv[1])+"35#.png"); }
//========= Macro generated from object: h1/l1l2Pt {(((goodVtx && lepPt[0]>25 && lepPt[1]>20 && l1l2DR>0.3 && !(abs(lepEta[0]) > 1.4 && abs(lepEta[0]) < 1.6) && !(abs(lepEta[1]) > 1.4 && abs(lepEta[1]) < 1.6))*((lepID[0]*lepID[1]==-11*11)||(lepID[0]*lepID[1]==-13*13)))*(totEveW))*(l1l2M>81 && l1l2M < 101)} //========= by ROOT version6.02/05 void initPtSpectrum() { TH1F *h11 = new TH1F("h11","l1l2Pt {(((goodVtx && lepPt[0]>25 && lepPt[1]>20 && l1l2DR>0.3 && !(abs(lepEta[0]) > 1.4 && abs(lepEta[0]) < 1.6) && !(abs(lepEta[1]) > 1.4 && abs(lepEta[1]) < 1.6))*((lepID[0]*lepID[1]==-11*11)||(lepID[0]*lepID[1]==-13*13)))*(totEveW))*(l1l2M>81 && l1l2M < 101)}",500,0,500); h11->SetBinContent(1,0.00162118); h11->SetBinContent(2,0.00445683); h11->SetBinContent(3,0.00644035); h11->SetBinContent(4,0.00748253); h11->SetBinContent(5,0.00769155); h11->SetBinContent(6,0.00751327); h11->SetBinContent(7,0.00721233); h11->SetBinContent(8,0.00682488); h11->SetBinContent(9,0.00637513); h11->SetBinContent(10,0.00593842); h11->SetBinContent(11,0.00554317); h11->SetBinContent(12,0.0052028); h11->SetBinContent(13,0.00483506); h11->SetBinContent(14,0.00455992); h11->SetBinContent(15,0.00425223); h11->SetBinContent(16,0.00398354); h11->SetBinContent(17,0.00370052); h11->SetBinContent(18,0.00348872); h11->SetBinContent(19,0.00326733); h11->SetBinContent(20,0.00307653); h11->SetBinContent(21,0.00290754); h11->SetBinContent(22,0.0027055); h11->SetBinContent(23,0.00256185); h11->SetBinContent(24,0.0024293); h11->SetBinContent(25,0.00226721); h11->SetBinContent(26,0.00216945); h11->SetBinContent(27,0.00203008); h11->SetBinContent(28,0.00190211); h11->SetBinContent(29,0.00176505); h11->SetBinContent(30,0.00170501); h11->SetBinContent(31,0.00158584); h11->SetBinContent(32,0.00152027); h11->SetBinContent(33,0.00145021); h11->SetBinContent(34,0.00136008); h11->SetBinContent(35,0.0012743); h11->SetBinContent(36,0.00123754); h11->SetBinContent(37,0.0011335); h11->SetBinContent(38,0.00108776); h11->SetBinContent(39,0.00105849); h11->SetBinContent(40,0.000988127); h11->SetBinContent(41,0.000939292); h11->SetBinContent(42,0.000887452); h11->SetBinContent(43,0.000858611); h11->SetBinContent(44,0.000834414); h11->SetBinContent(45,0.000771037); h11->SetBinContent(46,0.000734779); h11->SetBinContent(47,0.000702866); h11->SetBinContent(48,0.000678294); h11->SetBinContent(49,0.00064758); h11->SetBinContent(50,0.000604205); h11->SetBinContent(51,0.000591994); h11->SetBinContent(52,0.000573715); h11->SetBinContent(53,0.000530116); h11->SetBinContent(54,0.000523973); h11->SetBinContent(55,0.000498652); h11->SetBinContent(56,0.000484644); h11->SetBinContent(57,0.00044876); h11->SetBinContent(58,0.000427635); h11->SetBinContent(59,0.000415274); h11->SetBinContent(60,0.000411603); h11->SetBinContent(61,0.000384784); h11->SetBinContent(62,0.000367629); h11->SetBinContent(63,0.000363284); h11->SetBinContent(64,0.000343207); h11->SetBinContent(65,0.000344181); h11->SetBinContent(66,0.000322981); h11->SetBinContent(67,0.00029736); h11->SetBinContent(68,0.000294738); h11->SetBinContent(69,0.00027646); h11->SetBinContent(70,0.000265372); h11->SetBinContent(71,0.000258181); h11->SetBinContent(72,0.000230016); h11->SetBinContent(73,0.000241101); h11->SetBinContent(74,0.000233312); h11->SetBinContent(75,0.000217358); h11->SetBinContent(76,0.000211366); h11->SetBinContent(77,0.00020897); h11->SetBinContent(78,0.000200881); h11->SetBinContent(79,0.000188897); h11->SetBinContent(80,0.000189721); h11->SetBinContent(81,0.000178261); h11->SetBinContent(82,0.000170397); h11->SetBinContent(83,0.000165828); h11->SetBinContent(84,0.000162308); h11->SetBinContent(85,0.000154968); h11->SetBinContent(86,0.000145156); h11->SetBinContent(87,0.000131225); h11->SetBinContent(88,0.000136842); h11->SetBinContent(89,0.000126431); h11->SetBinContent(90,0.00012703); h11->SetBinContent(91,0.000124709); h11->SetBinContent(92,0.000120364); h11->SetBinContent(93,0.000109804); h11->SetBinContent(94,0.000113024); h11->SetBinContent(95,0.000106883); h11->SetBinContent(96,0.00010486); h11->SetBinContent(97,0.000106958); h11->SetBinContent(98,9.25021e-05); h11->SetBinContent(99,9.61722e-05); h11->SetBinContent(100,9.26519e-05); h11->SetBinContent(101,8.41135e-05); h11->SetBinContent(102,8.55366e-05); h11->SetBinContent(103,8.95062e-05); h11->SetBinContent(104,7.33281e-05); h11->SetBinContent(105,7.96196e-05); h11->SetBinContent(106,7.66985e-05); h11->SetBinContent(107,7.43018e-05); h11->SetBinContent(108,7.28038e-05); h11->SetBinContent(109,7.24293e-05); h11->SetBinContent(110,6.85346e-05); h11->SetBinContent(111,6.20933e-05); h11->SetBinContent(112,6.46398e-05); h11->SetBinContent(113,5.30301e-05); h11->SetBinContent(114,6.11196e-05); h11->SetBinContent(115,5.72996e-05); h11->SetBinContent(116,5.75992e-05); h11->SetBinContent(117,5.78988e-05); h11->SetBinContent(118,5.19066e-05); h11->SetBinContent(119,4.84611e-05); h11->SetBinContent(120,4.99591e-05); h11->SetBinContent(121,5.38541e-05); h11->SetBinContent(122,5.26556e-05); h11->SetBinContent(123,4.56897e-05); h11->SetBinContent(124,4.65885e-05); h11->SetBinContent(125,4.3892e-05); h11->SetBinContent(126,4.1645e-05); h11->SetBinContent(127,4.25438e-05); h11->SetBinContent(128,4.05214e-05); h11->SetBinContent(129,3.79748e-05); h11->SetBinContent(130,3.99222e-05); h11->SetBinContent(131,3.84242e-05); h11->SetBinContent(132,2.92861e-05); h11->SetBinContent(133,3.36304e-05); h11->SetBinContent(134,3.07092e-05); h11->SetBinContent(135,3.66265e-05); h11->SetBinContent(136,2.88367e-05); h11->SetBinContent(137,2.96606e-05); h11->SetBinContent(138,3.0859e-05); h11->SetBinContent(139,3.13084e-05); h11->SetBinContent(140,3.34057e-05); h11->SetBinContent(141,2.92861e-05); h11->SetBinContent(142,2.62901e-05); h11->SetBinContent(143,2.90614e-05); h11->SetBinContent(144,2.85371e-05); h11->SetBinContent(145,2.8612e-05); h11->SetBinContent(146,2.21706e-05); h11->SetBinContent(147,2.65897e-05); h11->SetBinContent(148,2.40431e-05); h11->SetBinContent(149,2.96606e-05); h11->SetBinContent(150,2.47921e-05); h11->SetBinContent(151,2.32192e-05); h11->SetBinContent(152,2.32941e-05); h11->SetBinContent(153,1.91745e-05); h11->SetBinContent(154,2.20208e-05); h11->SetBinContent(155,2.08224e-05); h11->SetBinContent(156,2.14965e-05); h11->SetBinContent(157,1.85004e-05); h11->SetBinContent(158,1.82757e-05); h11->SetBinContent(159,2.04479e-05); h11->SetBinContent(160,1.75267e-05); h11->SetBinContent(161,1.82757e-05); h11->SetBinContent(162,1.45307e-05); h11->SetBinContent(163,1.8051e-05); h11->SetBinContent(164,1.43809e-05); h11->SetBinContent(165,1.47554e-05); h11->SetBinContent(166,1.84255e-05); h11->SetBinContent(167,1.61785e-05); h11->SetBinContent(168,1.76765e-05); h11->SetBinContent(169,1.52048e-05); h11->SetBinContent(170,1.34072e-05); h11->SetBinContent(171,1.49801e-05); h11->SetBinContent(172,1.21339e-05); h11->SetBinContent(173,1.33323e-05); h11->SetBinContent(174,1.61036e-05); h11->SetBinContent(175,1.27331e-05); h11->SetBinContent(176,1.40813e-05); h11->SetBinContent(177,1.36319e-05); h11->SetBinContent(178,1.26582e-05); h11->SetBinContent(179,1.03363e-05); h11->SetBinContent(180,1.2059e-05); h11->SetBinContent(181,1.19092e-05); h11->SetBinContent(182,1.11602e-05); h11->SetBinContent(183,1.00367e-05); h11->SetBinContent(184,1.09355e-05); h11->SetBinContent(185,8.68847e-06); h11->SetBinContent(186,1.03363e-05); h11->SetBinContent(187,9.88688e-06); h11->SetBinContent(188,1.01116e-05); h11->SetBinContent(189,8.68847e-06); h11->SetBinContent(190,1.19092e-05); h11->SetBinContent(191,9.28767e-06); h11->SetBinContent(192,1.06359e-05); h11->SetBinContent(193,9.81198e-06); h11->SetBinContent(194,8.23907e-06); h11->SetBinContent(195,7.04066e-06); h11->SetBinContent(196,9.36257e-06); h11->SetBinContent(197,8.23907e-06); h11->SetBinContent(198,8.01437e-06); h11->SetBinContent(199,7.86456e-06); h11->SetBinContent(200,8.68847e-06); h11->SetBinContent(201,9.13787e-06); h11->SetBinContent(202,6.06695e-06); h11->SetBinContent(203,5.61755e-06); h11->SetBinContent(204,8.08927e-06); h11->SetBinContent(205,8.38887e-06); h11->SetBinContent(206,8.76337e-06); h11->SetBinContent(207,6.66616e-06); h11->SetBinContent(208,6.59125e-06); h11->SetBinContent(209,4.86854e-06); h11->SetBinContent(210,5.69245e-06); h11->SetBinContent(211,8.23907e-06); h11->SetBinContent(212,7.63986e-06); h11->SetBinContent(213,5.31795e-06); h11->SetBinContent(214,6.06695e-06); h11->SetBinContent(215,6.36655e-06); h11->SetBinContent(216,4.49404e-06); h11->SetBinContent(217,4.64384e-06); h11->SetBinContent(218,4.79364e-06); h11->SetBinContent(219,6.59125e-06); h11->SetBinContent(220,4.11954e-06); h11->SetBinContent(221,3.14583e-06); h11->SetBinContent(222,5.09324e-06); h11->SetBinContent(223,4.19444e-06); h11->SetBinContent(224,6.29165e-06); h11->SetBinContent(225,4.26934e-06); h11->SetBinContent(226,3.59523e-06); h11->SetBinContent(227,5.09324e-06); h11->SetBinContent(228,5.09324e-06); h11->SetBinContent(229,3.59523e-06); h11->SetBinContent(230,3.59523e-06); h11->SetBinContent(231,2.99603e-06); h11->SetBinContent(232,3.96974e-06); h11->SetBinContent(233,2.84623e-06); h11->SetBinContent(234,4.04464e-06); h11->SetBinContent(235,4.94344e-06); h11->SetBinContent(236,3.44543e-06); h11->SetBinContent(237,2.09722e-06); h11->SetBinContent(238,4.19444e-06); h11->SetBinContent(239,3.52033e-06); h11->SetBinContent(240,3.67013e-06); h11->SetBinContent(241,4.41914e-06); h11->SetBinContent(242,4.19444e-06); h11->SetBinContent(243,2.62152e-06); h11->SetBinContent(244,3.67013e-06); h11->SetBinContent(245,3.96974e-06); h11->SetBinContent(246,4.49404e-06); h11->SetBinContent(247,2.84623e-06); h11->SetBinContent(248,2.77133e-06); h11->SetBinContent(249,1.64781e-06); h11->SetBinContent(250,2.92113e-06); h11->SetBinContent(251,2.99603e-06); h11->SetBinContent(252,2.69642e-06); h11->SetBinContent(253,2.69642e-06); h11->SetBinContent(254,3.29563e-06); h11->SetBinContent(255,3.52033e-06); h11->SetBinContent(256,2.09722e-06); h11->SetBinContent(257,2.47172e-06); h11->SetBinContent(258,2.09722e-06); h11->SetBinContent(259,1.34821e-06); h11->SetBinContent(260,3.59523e-06); h11->SetBinContent(261,2.99603e-06); h11->SetBinContent(262,2.24702e-06); h11->SetBinContent(263,1.87252e-06); h11->SetBinContent(264,2.32192e-06); h11->SetBinContent(265,2.69642e-06); h11->SetBinContent(266,2.02232e-06); h11->SetBinContent(267,1.49801e-06); h11->SetBinContent(268,2.69642e-06); h11->SetBinContent(269,3.59523e-06); h11->SetBinContent(270,6.74106e-07); h11->SetBinContent(271,3.81994e-06); h11->SetBinContent(272,2.62152e-06); h11->SetBinContent(273,1.34821e-06); h11->SetBinContent(274,1.12351e-06); h11->SetBinContent(275,2.99603e-07); h11->SetBinContent(276,5.99205e-07); h11->SetBinContent(277,2.84623e-06); h11->SetBinContent(278,2.02232e-06); h11->SetBinContent(279,2.02232e-06); h11->SetBinContent(280,1.57291e-06); h11->SetBinContent(281,1.57291e-06); h11->SetBinContent(282,2.24702e-06); h11->SetBinContent(283,9.73708e-07); h11->SetBinContent(284,1.94742e-06); h11->SetBinContent(285,2.09722e-06); h11->SetBinContent(286,1.79762e-06); h11->SetBinContent(287,2.09722e-06); h11->SetBinContent(288,1.57291e-06); h11->SetBinContent(289,2.24702e-06); h11->SetBinContent(290,1.87252e-06); h11->SetBinContent(291,2.39682e-06); h11->SetBinContent(292,1.57291e-06); h11->SetBinContent(293,2.62152e-06); h11->SetBinContent(294,7.49007e-08); h11->SetBinContent(295,2.99603e-07); h11->SetBinContent(296,2.17212e-06); h11->SetBinContent(297,2.32192e-06); h11->SetBinContent(298,1.04861e-06); h11->SetBinContent(299,1.94742e-06); h11->SetBinContent(300,8.23907e-07); h11->SetBinContent(301,9.73708e-07); h11->SetBinContent(302,1.34821e-06); h11->SetBinContent(303,1.42311e-06); h11->SetBinContent(304,1.04861e-06); h11->SetBinContent(305,1.12351e-06); h11->SetBinContent(306,2.24702e-07); h11->SetBinContent(307,6.74106e-07); h11->SetBinContent(308,4.49404e-07); h11->SetBinContent(309,1.57291e-06); h11->SetBinContent(310,1.49801e-06); h11->SetBinContent(311,1.27331e-06); h11->SetBinContent(312,8.23907e-07); h11->SetBinContent(313,9.73708e-07); h11->SetBinContent(314,1.49801e-07); h11->SetBinContent(315,1.87252e-06); h11->SetBinContent(316,8.23907e-07); h11->SetBinContent(317,9.73708e-07); h11->SetBinContent(318,1.87252e-06); h11->SetBinContent(319,1.19841e-06); h11->SetBinContent(320,1.34821e-06); h11->SetBinContent(321,1.27331e-06); h11->SetBinContent(322,6.74106e-07); h11->SetBinContent(323,7.49006e-07); h11->SetBinContent(324,1.27331e-06); h11->SetBinContent(325,9.73708e-07); h11->SetBinContent(327,1.34821e-06); h11->SetBinContent(328,1.12351e-06); h11->SetBinContent(329,1.12351e-06); h11->SetBinContent(330,7.49006e-07); h11->SetBinContent(331,7.49006e-07); h11->SetBinContent(332,1.64781e-06); h11->SetBinContent(333,9.73708e-07); h11->SetBinContent(334,7.49007e-07); h11->SetBinContent(335,8.98808e-07); h11->SetBinContent(336,1.04861e-06); h11->SetBinContent(337,7.49006e-07); h11->SetBinContent(338,6.74106e-07); h11->SetBinContent(339,7.49006e-07); h11->SetBinContent(340,1.49801e-07); h11->SetBinContent(341,1.19841e-06); h11->SetBinContent(342,1.19841e-06); h11->SetBinContent(343,7.49006e-07); h11->SetBinContent(344,4.49404e-07); h11->SetBinContent(345,7.49007e-08); h11->SetBinContent(346,8.98808e-07); h11->SetBinContent(347,5.99205e-07); h11->SetBinContent(348,-2.24702e-07); h11->SetBinContent(349,8.23907e-07); h11->SetBinContent(350,5.99205e-07); h11->SetBinContent(351,6.74106e-07); h11->SetBinContent(352,5.24305e-07); h11->SetBinContent(353,3.74503e-07); h11->SetBinContent(354,2.24702e-07); h11->SetBinContent(355,9.73708e-07); h11->SetBinContent(356,3.74503e-07); h11->SetBinContent(357,7.49006e-07); h11->SetBinContent(358,4.49404e-07); h11->SetBinContent(359,2.24702e-07); h11->SetBinContent(360,8.98808e-07); h11->SetBinContent(361,2.99603e-07); h11->SetBinContent(362,4.49404e-07); h11->SetBinContent(363,5.24305e-07); h11->SetBinContent(364,5.24305e-07); h11->SetBinContent(365,8.23907e-07); h11->SetBinContent(366,7.49007e-07); h11->SetBinContent(367,9.73708e-07); h11->SetBinContent(368,1.49801e-07); h11->SetBinContent(369,5.99205e-07); h11->SetBinContent(370,5.99205e-07); h11->SetBinContent(371,3.74503e-07); h11->SetBinContent(373,3.74503e-07); h11->SetBinContent(374,5.99205e-07); h11->SetBinContent(375,7.49006e-07); h11->SetBinContent(376,7.49007e-08); h11->SetBinContent(377,8.98808e-07); h11->SetBinContent(378,3.74503e-07); h11->SetBinContent(379,6.74106e-07); h11->SetBinContent(380,3.74503e-07); h11->SetBinContent(381,7.49006e-07); h11->SetBinContent(382,-1.49801e-07); h11->SetBinContent(383,1.49801e-07); h11->SetBinContent(384,3.74503e-07); h11->SetBinContent(385,8.23907e-07); h11->SetBinContent(386,8.23907e-07); h11->SetBinContent(387,7.49007e-08); h11->SetBinContent(388,3.74503e-07); h11->SetBinContent(389,4.49404e-07); h11->SetBinContent(390,5.99205e-07); h11->SetBinContent(391,8.23907e-07); h11->SetBinContent(393,3.74503e-07); h11->SetBinContent(394,5.99205e-07); h11->SetBinContent(395,2.99603e-07); h11->SetBinContent(396,5.24305e-07); h11->SetBinContent(397,1.49801e-07); h11->SetBinContent(398,7.49006e-07); h11->SetBinContent(399,5.99205e-07); h11->SetBinContent(401,1.49801e-07); h11->SetBinContent(402,6.74106e-07); h11->SetBinContent(404,4.49404e-07); h11->SetBinContent(405,2.24702e-07); h11->SetBinContent(406,8.23907e-07); h11->SetBinContent(407,1.49801e-07); h11->SetBinContent(408,2.24702e-07); h11->SetBinContent(409,6.74106e-07); h11->SetBinContent(411,7.49006e-07); h11->SetBinContent(412,3.74503e-07); h11->SetBinContent(413,4.49404e-07); h11->SetBinContent(414,-2.24702e-07); h11->SetBinContent(415,2.24702e-07); h11->SetBinContent(416,4.49404e-07); h11->SetBinContent(417,5.24305e-07); h11->SetBinContent(418,2.99603e-07); h11->SetBinContent(419,2.99603e-07); h11->SetBinContent(420,2.99603e-07); h11->SetBinContent(421,3.74503e-07); h11->SetBinContent(422,3.74503e-07); h11->SetBinContent(423,4.49404e-07); h11->SetBinContent(424,1.49801e-07); h11->SetBinContent(425,7.49007e-08); h11->SetBinContent(426,7.49007e-08); h11->SetBinContent(427,3.74503e-07); h11->SetBinContent(428,6.74106e-07); h11->SetBinContent(429,5.24305e-07); h11->SetBinContent(430,-1.49801e-07); h11->SetBinContent(431,5.99205e-07); h11->SetBinContent(432,3.74503e-07); h11->SetBinContent(433,7.49007e-08); h11->SetBinContent(434,4.49404e-07); h11->SetBinContent(435,2.24702e-07); h11->SetBinContent(437,-7.49007e-08); h11->SetBinContent(438,7.49007e-08); h11->SetBinContent(439,3.74503e-07); h11->SetBinContent(440,2.24702e-07); h11->SetBinContent(441,1.49801e-07); h11->SetBinContent(442,2.99603e-07); h11->SetBinContent(444,4.49404e-07); h11->SetBinContent(445,2.24702e-07); h11->SetBinContent(446,2.99603e-07); h11->SetBinContent(447,2.99603e-07); h11->SetBinContent(448,3.74503e-07); h11->SetBinContent(449,6.74106e-07); h11->SetBinContent(450,1.49801e-07); h11->SetBinContent(451,1.49801e-07); h11->SetBinContent(452,7.49007e-08); h11->SetBinContent(453,2.24702e-07); h11->SetBinContent(454,2.24702e-07); h11->SetBinContent(455,7.49007e-08); h11->SetBinContent(456,2.24702e-07); h11->SetBinContent(458,6.74106e-07); h11->SetBinContent(459,2.24702e-07); h11->SetBinContent(460,7.49007e-08); h11->SetBinContent(461,-1.49801e-07); h11->SetBinContent(462,-2.99603e-07); h11->SetBinContent(463,1.49801e-07); h11->SetBinContent(465,-7.49007e-08); h11->SetBinContent(466,2.24702e-07); h11->SetBinContent(467,2.99603e-07); h11->SetBinContent(468,7.49007e-08); h11->SetBinContent(469,2.24702e-07); h11->SetBinContent(470,2.99603e-07); h11->SetBinContent(472,2.99603e-07); h11->SetBinContent(473,1.49801e-07); h11->SetBinContent(475,2.99603e-07); h11->SetBinContent(476,2.24702e-07); h11->SetBinContent(477,3.74503e-07); h11->SetBinContent(478,2.99603e-07); h11->SetBinContent(479,1.49801e-07); h11->SetBinContent(481,2.99603e-07); h11->SetBinContent(482,1.49801e-07); h11->SetBinContent(483,-7.49007e-08); h11->SetBinContent(484,7.49007e-08); h11->SetBinContent(486,-7.49007e-08); h11->SetBinContent(487,1.49801e-07); h11->SetBinContent(488,2.99603e-07); h11->SetBinContent(489,7.49007e-08); h11->SetBinContent(490,7.49007e-08); h11->SetBinContent(491,4.49404e-07); h11->SetBinContent(493,2.99603e-07); h11->SetBinContent(494,7.49007e-08); h11->SetBinContent(495,1.49801e-07); h11->SetBinContent(496,3.74503e-07); h11->SetBinContent(497,1.49801e-07); h11->SetBinContent(498,7.49007e-08); h11->SetBinContent(499,7.49007e-08); h11->SetBinContent(500,1.49801e-07); h11->SetBinContent(501,5.31795e-06); h11->SetBinError(1,1.16773e-05); h11->SetBinError(2,1.94462e-05); h11->SetBinError(3,2.34236e-05); h11->SetBinError(4,2.52918e-05); h11->SetBinError(5,2.58022e-05); h11->SetBinError(6,2.56526e-05); h11->SetBinError(7,2.52681e-05); h11->SetBinError(8,2.46734e-05); h11->SetBinError(9,2.3991e-05); h11->SetBinError(10,2.33053e-05); h11->SetBinError(11,2.26188e-05); h11->SetBinError(12,2.19792e-05); h11->SetBinError(13,2.12817e-05); h11->SetBinError(14,2.07621e-05); h11->SetBinError(15,2.01215e-05); h11->SetBinError(16,1.9568e-05); h11->SetBinError(17,1.90165e-05); h11->SetBinError(18,1.85359e-05); h11->SetBinError(19,1.80705e-05); h11->SetBinError(20,1.76214e-05); h11->SetBinError(21,1.72475e-05); h11->SetBinError(22,1.68428e-05); h11->SetBinError(23,1.64659e-05); h11->SetBinError(24,1.61463e-05); h11->SetBinError(25,1.57737e-05); h11->SetBinError(26,1.55361e-05); h11->SetBinError(27,1.52325e-05); h11->SetBinError(28,1.49379e-05); h11->SetBinError(29,1.46212e-05); h11->SetBinError(30,1.44319e-05); h11->SetBinError(31,1.42007e-05); h11->SetBinError(32,1.40534e-05); h11->SetBinError(33,1.37491e-05); h11->SetBinError(34,1.34838e-05); h11->SetBinError(35,1.32623e-05); h11->SetBinError(36,1.30295e-05); h11->SetBinError(37,1.27957e-05); h11->SetBinError(38,1.26251e-05); h11->SetBinError(39,1.24504e-05); h11->SetBinError(40,1.2105e-05); h11->SetBinError(41,1.19487e-05); h11->SetBinError(42,1.17809e-05); h11->SetBinError(43,1.15279e-05); h11->SetBinError(44,1.1309e-05); h11->SetBinError(45,1.11239e-05); h11->SetBinError(46,1.0813e-05); h11->SetBinError(47,1.07087e-05); h11->SetBinError(48,1.04981e-05); h11->SetBinError(49,1.02417e-05); h11->SetBinError(50,1.01191e-05); h11->SetBinError(51,9.86729e-06); h11->SetBinError(52,9.75234e-06); h11->SetBinError(53,9.48876e-06); h11->SetBinError(54,9.28496e-06); h11->SetBinError(55,9.14739e-06); h11->SetBinError(56,8.98558e-06); h11->SetBinError(57,8.81062e-06); h11->SetBinError(58,8.63699e-06); h11->SetBinError(59,8.50972e-06); h11->SetBinError(60,8.38252e-06); h11->SetBinError(61,8.18545e-06); h11->SetBinError(62,8.09204e-06); h11->SetBinError(63,7.92108e-06); h11->SetBinError(64,7.70203e-06); h11->SetBinError(65,7.66882e-06); h11->SetBinError(66,7.45177e-06); h11->SetBinError(67,7.3242e-06); h11->SetBinError(68,7.26845e-06); h11->SetBinError(69,7.04265e-06); h11->SetBinError(70,6.90022e-06); h11->SetBinError(71,6.79453e-06); h11->SetBinError(72,6.66111e-06); h11->SetBinError(73,6.60529e-06); h11->SetBinError(74,6.43056e-06); h11->SetBinError(75,6.33697e-06); h11->SetBinError(76,6.20998e-06); h11->SetBinError(77,6.10796e-06); h11->SetBinError(78,5.98643e-06); h11->SetBinError(79,5.89768e-06); h11->SetBinError(80,5.83312e-06); h11->SetBinError(81,5.75225e-06); h11->SetBinError(82,5.57041e-06); h11->SetBinError(83,5.57192e-06); h11->SetBinError(84,5.40584e-06); h11->SetBinError(85,5.32638e-06); h11->SetBinError(86,5.24625e-06); h11->SetBinError(87,5.08994e-06); h11->SetBinError(88,5.04065e-06); h11->SetBinError(89,4.96496e-06); h11->SetBinError(90,4.88063e-06); h11->SetBinError(91,4.74719e-06); h11->SetBinError(92,4.76253e-06); h11->SetBinError(93,4.66554e-06); h11->SetBinError(94,4.62629e-06); h11->SetBinError(95,4.47465e-06); h11->SetBinError(96,4.44004e-06); h11->SetBinError(97,4.39304e-06); h11->SetBinError(98,4.32028e-06); h11->SetBinError(99,4.16356e-06); h11->SetBinError(100,4.17096e-06); h11->SetBinError(101,4.03422e-06); h11->SetBinError(102,4.01121e-06); h11->SetBinError(103,4.0161e-06); h11->SetBinError(104,3.88257e-06); h11->SetBinError(105,3.786e-06); h11->SetBinError(106,3.73754e-06); h11->SetBinError(107,3.78823e-06); h11->SetBinError(108,3.77487e-06); h11->SetBinError(109,3.68995e-06); h11->SetBinError(110,3.64251e-06); h11->SetBinError(111,3.50436e-06); h11->SetBinError(112,3.54415e-06); h11->SetBinError(113,3.47784e-06); h11->SetBinError(114,3.41106e-06); h11->SetBinError(115,3.42829e-06); h11->SetBinError(116,3.33875e-06); h11->SetBinError(117,3.28113e-06); h11->SetBinError(118,3.24675e-06); h11->SetBinError(119,3.15028e-06); h11->SetBinError(120,3.11086e-06); h11->SetBinError(121,3.11806e-06); h11->SetBinError(122,3.05628e-06); h11->SetBinError(123,2.9904e-06); h11->SetBinError(124,3.02769e-06); h11->SetBinError(125,2.89702e-06); h11->SetBinError(126,2.93931e-06); h11->SetBinError(127,2.84622e-06); h11->SetBinError(128,2.82347e-06); h11->SetBinError(129,2.79752e-06); h11->SetBinError(130,2.84327e-06); h11->SetBinError(131,2.78546e-06); h11->SetBinError(132,2.67029e-06); h11->SetBinError(133,2.62794e-06); h11->SetBinError(134,2.55761e-06); h11->SetBinError(135,2.61295e-06); h11->SetBinError(136,2.53005e-06); h11->SetBinError(137,2.43629e-06); h11->SetBinError(138,2.53337e-06); h11->SetBinError(139,2.46149e-06); h11->SetBinError(140,2.47286e-06); h11->SetBinError(141,2.44433e-06); h11->SetBinError(142,2.32916e-06); h11->SetBinError(143,2.29885e-06); h11->SetBinError(144,2.29763e-06); h11->SetBinError(145,2.28907e-06); h11->SetBinError(146,2.23701e-06); h11->SetBinError(147,2.27555e-06); h11->SetBinError(148,2.23073e-06); h11->SetBinError(149,2.27925e-06); h11->SetBinError(150,2.20035e-06); h11->SetBinError(151,2.10789e-06); h11->SetBinError(152,2.17212e-06); h11->SetBinError(153,2.08649e-06); h11->SetBinError(154,2.04027e-06); h11->SetBinError(155,2.05124e-06); h11->SetBinError(156,2.02232e-06); h11->SetBinError(157,2.0028e-06); h11->SetBinError(158,2.0098e-06); h11->SetBinError(159,1.95173e-06); h11->SetBinError(160,1.94742e-06); h11->SetBinError(161,1.95891e-06); h11->SetBinError(162,1.84687e-06); h11->SetBinError(163,1.85143e-06); h11->SetBinError(164,1.91547e-06); h11->SetBinError(165,1.76136e-06); h11->SetBinError(166,1.87999e-06); h11->SetBinError(167,1.69149e-06); h11->SetBinError(168,1.79136e-06); h11->SetBinError(169,1.80229e-06); h11->SetBinError(170,1.71292e-06); h11->SetBinError(171,1.62381e-06); h11->SetBinError(172,1.64781e-06); h11->SetBinError(173,1.61688e-06); h11->SetBinError(174,1.67315e-06); h11->SetBinError(175,1.63757e-06); h11->SetBinError(176,1.58888e-06); h11->SetBinError(177,1.60294e-06); h11->SetBinError(178,1.53318e-06); h11->SetBinError(179,1.61341e-06); h11->SetBinError(180,1.60119e-06); h11->SetBinError(181,1.54048e-06); h11->SetBinError(182,1.50735e-06); h11->SetBinError(183,1.51292e-06); h11->SetBinError(184,1.51292e-06); h11->SetBinError(185,1.46392e-06); h11->SetBinError(186,1.50175e-06); h11->SetBinError(187,1.41322e-06); h11->SetBinError(188,1.41521e-06); h11->SetBinError(189,1.43684e-06); h11->SetBinError(190,1.46583e-06); h11->SetBinError(191,1.42901e-06); h11->SetBinError(192,1.37295e-06); h11->SetBinError(193,1.42311e-06); h11->SetBinError(194,1.35651e-06); h11->SetBinError(195,1.2578e-06); h11->SetBinError(196,1.38718e-06); h11->SetBinError(197,1.24884e-06); h11->SetBinError(198,1.35444e-06); h11->SetBinError(199,1.29948e-06); h11->SetBinError(200,1.2578e-06); h11->SetBinError(201,1.25333e-06); h11->SetBinError(202,1.21929e-06); h11->SetBinError(203,1.22846e-06); h11->SetBinError(204,1.23983e-06); h11->SetBinError(205,1.15551e-06); h11->SetBinError(206,1.25109e-06); h11->SetBinError(207,1.23302e-06); h11->SetBinError(208,1.14576e-06); h11->SetBinError(209,1.14331e-06); h11->SetBinError(210,1.18428e-06); h11->SetBinError(211,1.12101e-06); h11->SetBinError(212,1.11096e-06); h11->SetBinError(213,1.08283e-06); h11->SetBinError(214,1.14331e-06); h11->SetBinError(215,1.08283e-06); h11->SetBinError(216,1.14576e-06); h11->SetBinError(217,1.016e-06); h11->SetBinError(218,1.126e-06); h11->SetBinError(219,1.03243e-06); h11->SetBinError(220,9.50383e-07); h11->SetBinError(221,1.03243e-06); h11->SetBinError(222,1.08541e-06); h11->SetBinError(223,9.99299e-07); h11->SetBinError(224,9.88007e-07); h11->SetBinError(225,9.62116e-07); h11->SetBinError(226,9.82313e-07); h11->SetBinError(227,9.70823e-07); h11->SetBinError(228,9.99299e-07); h11->SetBinError(229,9.88007e-07); h11->SetBinError(230,9.29493e-07); h11->SetBinError(231,9.5333e-07); h11->SetBinError(232,9.08122e-07); h11->SetBinError(233,8.53999e-07); h11->SetBinError(234,9.41487e-07); h11->SetBinError(235,9.29493e-07); h11->SetBinError(236,9.17342e-07); h11->SetBinError(237,8.67038e-07); h11->SetBinError(238,9.05028e-07); h11->SetBinError(239,8.50708e-07); h11->SetBinError(240,8.83066e-07); h11->SetBinError(241,8.63796e-07); h11->SetBinError(242,8.40758e-07); h11->SetBinError(243,8.70267e-07); h11->SetBinError(244,8.1707e-07); h11->SetBinError(245,8.23907e-07); h11->SetBinError(246,8.40758e-07); h11->SetBinError(247,8.13629e-07); h11->SetBinError(248,8.50708e-07); h11->SetBinError(249,8.06705e-07); h11->SetBinError(250,7.96205e-07); h11->SetBinError(251,7.92674e-07); h11->SetBinError(252,7.5646e-07); h11->SetBinError(253,7.18422e-07); h11->SetBinError(254,7.49007e-07); h11->SetBinError(255,7.60159e-07); h11->SetBinError(256,7.5646e-07); h11->SetBinError(257,7.96205e-07); h11->SetBinError(258,7.0263e-07); h11->SetBinError(259,7.33874e-07); h11->SetBinError(260,6.52969e-07); h11->SetBinError(261,7.18422e-07); h11->SetBinError(262,7.49007e-07); h11->SetBinError(263,6.98627e-07); h11->SetBinError(264,6.03868e-07); h11->SetBinError(265,6.4432e-07); h11->SetBinError(266,7.14507e-07); h11->SetBinError(267,7.0263e-07); h11->SetBinError(268,7.26189e-07); h11->SetBinError(269,7.18422e-07); h11->SetBinError(270,6.82377e-07); h11->SetBinError(271,6.74106e-07); h11->SetBinError(272,6.65732e-07); h11->SetBinError(273,6.61505e-07); h11->SetBinError(274,6.03868e-07); h11->SetBinError(275,6.35553e-07); h11->SetBinError(276,6.26664e-07); h11->SetBinError(277,6.52969e-07); h11->SetBinError(278,5.75323e-07); h11->SetBinError(279,6.31124e-07); h11->SetBinError(280,6.98627e-07); h11->SetBinError(281,6.13088e-07); h11->SetBinError(282,6.4432e-07); h11->SetBinError(283,5.65488e-07); h11->SetBinError(284,5.50405e-07); h11->SetBinError(285,6.17647e-07); h11->SetBinError(286,5.89768e-07); h11->SetBinError(287,6.08496e-07); h11->SetBinError(288,6.13088e-07); h11->SetBinError(289,5.40116e-07); h11->SetBinError(290,5.55478e-07); h11->SetBinError(291,5.29628e-07); h11->SetBinError(292,6.57251e-07); h11->SetBinError(293,5.75323e-07); h11->SetBinError(294,5.02449e-07); h11->SetBinError(295,5.08001e-07); h11->SetBinError(296,5.65488e-07); h11->SetBinError(297,5.55478e-07); h11->SetBinError(298,5.60505e-07); h11->SetBinError(299,5.40116e-07); h11->SetBinError(300,5.55478e-07); h11->SetBinError(301,5.34898e-07); h11->SetBinError(302,4.85412e-07); h11->SetBinError(303,6.03868e-07); h11->SetBinError(304,5.18927e-07); h11->SetBinError(305,5.02449e-07); h11->SetBinError(306,5.02449e-07); h11->SetBinError(307,4.03352e-07); h11->SetBinError(308,4.96835e-07); h11->SetBinError(309,5.02449e-07); h11->SetBinError(310,5.50405e-07); h11->SetBinError(311,4.79598e-07); h11->SetBinError(312,4.67754e-07); h11->SetBinError(313,5.13493e-07); h11->SetBinError(314,4.36742e-07); h11->SetBinError(315,4.43118e-07); h11->SetBinError(316,4.55603e-07); h11->SetBinError(317,5.13493e-07); h11->SetBinError(318,5.34898e-07); h11->SetBinError(319,4.61719e-07); h11->SetBinError(320,4.49404e-07); h11->SetBinError(321,3.89195e-07); h11->SetBinError(322,3.89195e-07); h11->SetBinError(323,3.8192e-07); h11->SetBinError(324,4.67754e-07); h11->SetBinError(325,4.30272e-07); h11->SetBinError(326,4.10248e-07); h11->SetBinError(327,5.18927e-07); h11->SetBinError(328,4.03352e-07); h11->SetBinError(329,4.17029e-07); h11->SetBinError(330,3.51315e-07); h11->SetBinError(331,3.96337e-07); h11->SetBinError(332,4.61719e-07); h11->SetBinError(333,4.91156e-07); h11->SetBinError(334,3.66937e-07); h11->SetBinError(335,4.23702e-07); h11->SetBinError(336,4.10248e-07); h11->SetBinError(337,3.96337e-07); h11->SetBinError(338,3.59211e-07); h11->SetBinError(339,3.8192e-07); h11->SetBinError(340,3.8192e-07); h11->SetBinError(341,4.49404e-07); h11->SetBinError(342,3.66937e-07); h11->SetBinError(343,4.10248e-07); h11->SetBinError(344,3.17777e-07); h11->SetBinError(345,3.43238e-07); h11->SetBinError(346,4.23702e-07); h11->SetBinError(347,3.66937e-07); h11->SetBinError(348,4.17029e-07); h11->SetBinError(349,3.43238e-07); h11->SetBinError(350,3.96337e-07); h11->SetBinError(351,3.08823e-07); h11->SetBinError(352,4.03352e-07); h11->SetBinError(353,3.26484e-07); h11->SetBinError(354,3.43238e-07); h11->SetBinError(355,4.30272e-07); h11->SetBinError(356,2.70058e-07); h11->SetBinError(357,3.34966e-07); h11->SetBinError(358,2.80253e-07); h11->SetBinError(359,3.59211e-07); h11->SetBinError(360,3.66937e-07); h11->SetBinError(361,3.34966e-07); h11->SetBinError(362,3.34966e-07); h11->SetBinError(363,3.26484e-07); h11->SetBinError(364,3.59211e-07); h11->SetBinError(365,3.59211e-07); h11->SetBinError(366,3.51315e-07); h11->SetBinError(367,3.74503e-07); h11->SetBinError(368,3.17777e-07); h11->SetBinError(369,3.17777e-07); h11->SetBinError(370,3.17777e-07); h11->SetBinError(371,2.90089e-07); h11->SetBinError(372,2.59463e-07); h11->SetBinError(373,3.43238e-07); h11->SetBinError(374,3.17777e-07); h11->SetBinError(375,2.80253e-07); h11->SetBinError(376,2.24702e-07); h11->SetBinError(377,3.51315e-07); h11->SetBinError(378,2.24702e-07); h11->SetBinError(379,2.70058e-07); h11->SetBinError(380,2.90089e-07); h11->SetBinError(381,3.34966e-07); h11->SetBinError(382,2.59463e-07); h11->SetBinError(383,1.49801e-07); h11->SetBinError(384,3.26484e-07); h11->SetBinError(385,3.43238e-07); h11->SetBinError(386,3.26484e-07); h11->SetBinError(387,2.70058e-07); h11->SetBinError(388,2.90089e-07); h11->SetBinError(389,2.99603e-07); h11->SetBinError(390,2.99603e-07); h11->SetBinError(391,3.26484e-07); h11->SetBinError(392,3.17777e-07); h11->SetBinError(393,2.48417e-07); h11->SetBinError(394,2.80253e-07); h11->SetBinError(395,3.17777e-07); h11->SetBinError(396,3.08823e-07); h11->SetBinError(397,3.17777e-07); h11->SetBinError(398,2.80253e-07); h11->SetBinError(399,2.80253e-07); h11->SetBinError(400,2.80253e-07); h11->SetBinError(401,2.99603e-07); h11->SetBinError(402,3.08823e-07); h11->SetBinError(403,2.11851e-07); h11->SetBinError(404,2.59463e-07); h11->SetBinError(405,1.98169e-07); h11->SetBinError(406,3.08823e-07); h11->SetBinError(407,2.11851e-07); h11->SetBinError(408,2.24702e-07); h11->SetBinError(409,2.70058e-07); h11->SetBinError(410,2.11851e-07); h11->SetBinError(411,2.99603e-07); h11->SetBinError(412,2.90089e-07); h11->SetBinError(413,2.59463e-07); h11->SetBinError(414,2.24702e-07); h11->SetBinError(415,1.98169e-07); h11->SetBinError(416,3.34966e-07); h11->SetBinError(417,2.48417e-07); h11->SetBinError(418,2.11851e-07); h11->SetBinError(419,1.83468e-07); h11->SetBinError(420,2.36857e-07); h11->SetBinError(421,2.70058e-07); h11->SetBinError(422,1.98169e-07); h11->SetBinError(423,2.59463e-07); h11->SetBinError(424,2.36857e-07); h11->SetBinError(425,1.67483e-07); h11->SetBinError(426,2.24702e-07); h11->SetBinError(427,3.08823e-07); h11->SetBinError(428,2.24702e-07); h11->SetBinError(429,2.48417e-07); h11->SetBinError(430,2.36857e-07); h11->SetBinError(431,2.59463e-07); h11->SetBinError(432,2.48417e-07); h11->SetBinError(433,2.24702e-07); h11->SetBinError(434,1.83468e-07); h11->SetBinError(435,1.98169e-07); h11->SetBinError(437,1.29732e-07); h11->SetBinError(438,2.24702e-07); h11->SetBinError(439,2.24702e-07); h11->SetBinError(440,2.24702e-07); h11->SetBinError(441,2.36857e-07); h11->SetBinError(442,2.59463e-07); h11->SetBinError(443,1.05926e-07); h11->SetBinError(444,2.36857e-07); h11->SetBinError(445,1.98169e-07); h11->SetBinError(446,1.83468e-07); h11->SetBinError(447,2.36857e-07); h11->SetBinError(448,2.90089e-07); h11->SetBinError(449,2.48417e-07); h11->SetBinError(450,2.11851e-07); h11->SetBinError(451,1.49801e-07); h11->SetBinError(452,1.29732e-07); h11->SetBinError(453,1.67483e-07); h11->SetBinError(454,1.98169e-07); h11->SetBinError(455,1.67483e-07); h11->SetBinError(456,1.67483e-07); h11->SetBinError(457,1.05926e-07); h11->SetBinError(458,2.70058e-07); h11->SetBinError(459,1.98169e-07); h11->SetBinError(460,1.98169e-07); h11->SetBinError(461,1.49801e-07); h11->SetBinError(462,1.83468e-07); h11->SetBinError(463,1.05926e-07); h11->SetBinError(464,1.49801e-07); h11->SetBinError(465,1.67483e-07); h11->SetBinError(466,1.98169e-07); h11->SetBinError(467,1.83468e-07); h11->SetBinError(468,1.29732e-07); h11->SetBinError(469,1.67483e-07); h11->SetBinError(470,2.36857e-07); h11->SetBinError(471,2.11851e-07); h11->SetBinError(472,2.11851e-07); h11->SetBinError(473,1.49801e-07); h11->SetBinError(474,2.11851e-07); h11->SetBinError(475,1.83468e-07); h11->SetBinError(476,1.98169e-07); h11->SetBinError(477,1.67483e-07); h11->SetBinError(478,1.49801e-07); h11->SetBinError(479,1.83468e-07); h11->SetBinError(480,1.83468e-07); h11->SetBinError(481,1.83468e-07); h11->SetBinError(482,1.49801e-07); h11->SetBinError(483,1.98169e-07); h11->SetBinError(484,1.29732e-07); h11->SetBinError(485,1.83468e-07); h11->SetBinError(486,7.49007e-08); h11->SetBinError(487,1.49801e-07); h11->SetBinError(488,1.49801e-07); h11->SetBinError(489,1.67483e-07); h11->SetBinError(490,1.67483e-07); h11->SetBinError(491,2.11851e-07); h11->SetBinError(492,1.83468e-07); h11->SetBinError(493,1.83468e-07); h11->SetBinError(494,1.29732e-07); h11->SetBinError(495,1.49801e-07); h11->SetBinError(496,1.98169e-07); h11->SetBinError(497,1.05926e-07); h11->SetBinError(498,1.67483e-07); h11->SetBinError(499,1.29732e-07); h11->SetBinError(500,2.11851e-07); h11->SetBinError(501,1.38718e-06); h11->SetEntries(3.17523e+06); TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *AText = ptstats->AddText("h1"); AText->SetTextSize(0.0368); AText = ptstats->AddText("Entries = 3175226"); AText = ptstats->AddText("Mean = 22.48"); AText = ptstats->AddText("RMS = 27.23"); ptstats->SetOptStat(1111); ptstats->SetOptFit(0); // ptstats->Draw(); h11->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(h11); /* Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); h11->SetLineColor(ci); h11->GetXaxis()->SetLabelFont(42); h11->GetXaxis()->SetLabelSize(0.035); h11->GetXaxis()->SetTitleSize(0.035); h11->GetXaxis()->SetTitleFont(42); h11->GetYaxis()->SetLabelFont(42); h11->GetYaxis()->SetLabelSize(0.035); h11->GetYaxis()->SetTitleSize(0.035); h11->GetYaxis()->SetTitleFont(42); h11->GetZaxis()->SetLabelFont(42); h11->GetZaxis()->SetLabelSize(0.035); h11->GetZaxis()->SetTitleSize(0.035); h11->GetZaxis()->SetTitleFont(42); h11->Draw(""); */ h_ptSpectrum = h11; }