void plot2DSignalAnalytisch( TString filename, TString histogramName, TString xtitle = "x", TString ytitle = "y", double rebinx = 1, double rebiny = 1, double xtitleOffset = 1.1, double ytitleOffset = 1.3 ) { // {{{ InitgStyle(); //gStyle->SetOptStat(0); //gCanvas = new TCanvas("gCanvas", "gCanvas", 0, 0, 800, 600); LoadHistogramTH2D(histogramName , filename, 1.0, histogram);// Summe (SM //gCanvas->Clear(); histogram->GetXaxis()->SetTitle(xtitle); histogram->GetXaxis()->SetTitleOffset(xtitleOffset); histogram->GetYaxis()->SetTitle(ytitle); histogram->GetYaxis()->SetTitleOffset(ytitleOffset); //histogram->GetZaxis()->SetTitle("d^{2}#sigma / dM_{#bar{t}}dM_{t} [pb]"); //histogram->GetZaxis()->SetTitleOffset(ytitleOffset); // gCanvas->Update(); //TF2 *fitFunction = new TF2("fitFunction", HistoSum, -1, 1, -1, 1, 4); //allgemeine "return"-Varianten //fitFunction->SetParameters(0.9,0.,0.); TF2 *fitFunction = new TF2("fitFunction", HistoSum, -1, 1, -1, 1, 2); histogram->Fit(fitFunction, "N"); // for(int i =1; i<=5;i++){ // for(int j=1;j<=5;j++){ // cout << "Bininhalt("<<i<<","<<j<<"): " << histogram->GetBinContent(i,j) << endl; // } // } histogram->RebinX(rebinx); histogram->RebinY(rebiny); histogram->Draw("lego"); fitFunction->SetLineColor(kRed); fitFunction->SetLineWidth(0.5); fitFunction->Draw("same"); cout << fitFunction->GetChisquare()/fitFunction->GetNDF() << endl; //gCanvas->Print(epsFilename(filename, histogramName)+".eps"); //cout << histogram[0]->Integral() << endl; // }}} };
Int_t VisualizeSurface() { std::string rfname = GetROOTFile(); TFile *fle = new TFile(rfname.data()); if (!fle->IsOpen()) return -1; Eta2C eta(fle); AngMarginalEta2C marg_eta(eta); fle->Close(); ParamFunctorAdapter *pfa = new ParamFunctorAdapter(marg_eta); ROOT::Math::ParamFunctor pf; pf.SetFunction(pfa); TF2* f = new TF2("f", pf, -1, 1, -1.0*CLHEP::pi,CLHEP::pi,0); f->SetNpx(50); f->SetNpy(50); // TPaveText* pt = new TPaveText(0.5, 0.75, 0.8, 0.95); // std::ostringstream os(std::ios::out | std::ios::app); // os << "a = " << params[0]->GetValue(); // pt->InsertText(os.str().data()); // os.str("b = "); // os << params[1]->GetValue(); // pt->InsertText(os.str().data()); // os.str("c = "); // os << params[2]->GetValue(); // pt->InsertText(os.str().data()); // os.str("d = "); // os << params[3]->GetValue(); // pt->InsertText(os.str().data()); TCanvas* c = new TCanvas("c"); c->Divide(2,1,0.001,0.001); c->cd(1); f->Draw("cont1 z"); c->cd(2); f->DrawCopy("surf1 z"); // pt->Draw(); return 0; }
// Render a TF2 looking like a rose. // Author: Timur Pocheptsov void glrose() { //Define and set user's palette, //use polar system. const Int_t paletteSize = 10; Float_t rgb[paletteSize * 3] = {0.80f, 0.55f, 0.40f, 0.85f, 0.60f, 0.45f, 0.90f, 0.65f, 0.50f, 0.95f, 0.70f, 0.55f, 1.f, 0.75f, 0.60f, 1.f, 0.80f, 0.65f, 1.f, 0.85f, 0.70f, 1.f, 0.90f, 0.75f, 1.f, 0.95f, 0.80f, 1.f, 1.f, 0.85f}; Int_t palette[paletteSize] = {0}; for (Int_t i = 0; i < paletteSize; ++i) palette[i] = TColor::GetColor(rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]); gStyle->SetPalette(paletteSize, palette); gStyle->SetCanvasPreferGL(1); TCanvas *cnv = new TCanvas("glc", "Surface sample", 200, 10, 600, 550); TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98, "\"glsurf2pol\" option + user defined palette."); title->SetFillColor(32); title->Draw(); TPad *rosePad = new TPad("box", "box", 0.04, 0.04, 0.96, 0.8); rosePad->Draw(); TF2 *fun = new TF2("a", "cos(y)*sin(x)+cos(x)*sin(y)", -6, 6, -6, 6); fun->SetContour(paletteSize); fun->SetNpx(30); fun->SetNpy(30); rosePad->cd(); fun->Draw("glsurf2pol"); }
int TwoHistoFit2D(bool global = true) { // create two histograms int nbx1 = 50; int nby1 = 50; int nbx2 = 50; int nby2 = 50; double xlow1 = 0.; double ylow1 = 0.; double xup1 = 10.; double yup1 = 10.; double xlow2 = 5.; double ylow2 = 5.; double xup2 = 20.; double yup2 = 20.; TH2D * h1 = new TH2D("h1","core",nbx1,xlow1,xup1,nby1,ylow1,yup1); TH2D * h2 = new TH2D("h2","tails",nbx2,xlow2,xup2,nby2,ylow2,yup2); double iniParams[10] = { 100, 6., 2., 7., 3, 100, 12., 3., 11., 2. }; // create fit function TF2 * func = new TF2("func",my2Dfunc,xlow2,xup2,ylow2,yup2, 10); func->SetParameters(iniParams); // fill Histos int n1 = 50000; int n2 = 50000; // h1->FillRandom("func", n1); //h2->FillRandom("func",n2); FillHisto(h1,n1,iniParams); FillHisto(h2,n2,iniParams); // scale histograms to same heights (for fitting) double dx1 = (xup1-xlow1)/double(nbx1); double dy1 = (yup1-ylow1)/double(nby1); double dx2 = (xup2-xlow2)/double(nbx2); double dy2 = (yup2-ylow2)/double(nby2); // h1->Sumw2(); // h1->Scale( 1.0 / ( n1 * dx1 * dy1 ) ); // scale histo 2 to scale of 1 h2->Sumw2(); h2->Scale( ( double(n1) * dx1 * dy1 ) / ( double(n2) * dx2 * dy2 ) ); if (global) { // fill data structure for fit (coordinates + values + errors) std::cout << "Do global fit" << std::endl; // fit now all the function together // fill data structure for fit (coordinates + values + errors) TAxis *xaxis1 = h1->GetXaxis(); TAxis *yaxis1 = h1->GetYaxis(); TAxis *xaxis2 = h2->GetXaxis(); TAxis *yaxis2 = h2->GetYaxis(); int nbinX1 = h1->GetNbinsX(); int nbinY1 = h1->GetNbinsY(); int nbinX2 = h2->GetNbinsX(); int nbinY2 = h2->GetNbinsY(); /// reset data structure coords = std::vector<std::pair<double,double> >(); values = std::vector<double>(); errors = std::vector<double>(); for (int ix = 1; ix <= nbinX1; ++ix) { for (int iy = 1; iy <= nbinY1; ++iy) { if ( h1->GetBinContent(ix,iy) > 0 ) { coords.push_back( std::make_pair(xaxis1->GetBinCenter(ix), yaxis1->GetBinCenter(iy) ) ); values.push_back( h1->GetBinContent(ix,iy) ); errors.push_back( h1->GetBinError(ix,iy) ); } } } for (int ix = 1; ix <= nbinX2; ++ix) { for (int iy = 1; iy <= nbinY2; ++iy) { if ( h2->GetBinContent(ix,iy) > 0 ) { coords.push_back( std::make_pair(xaxis2->GetBinCenter(ix), yaxis2->GetBinCenter(iy) ) ); values.push_back( h2->GetBinContent(ix,iy) ); errors.push_back( h2->GetBinError(ix,iy) ); } } } TVirtualFitter::SetDefaultFitter("Minuit"); TVirtualFitter * minuit = TVirtualFitter::Fitter(0,10); for (int i = 0; i < 10; ++i) { minuit->SetParameter(i, func->GetParName(i), func->GetParameter(i), 0.01, 0,0); } minuit->SetFCN(myFcn); double arglist[100]; arglist[0] = 0; // set print level minuit->ExecuteCommand("SET PRINT",arglist,2); // minimize arglist[0] = 5000; // number of function calls arglist[1] = 0.01; // tolerance minuit->ExecuteCommand("MIGRAD",arglist,2); //get result double minParams[10]; double parErrors[10]; for (int i = 0; i < 10; ++i) { minParams[i] = minuit->GetParameter(i); parErrors[i] = minuit->GetParError(i); } double chi2, edm, errdef; int nvpar, nparx; minuit->GetStats(chi2,edm,errdef,nvpar,nparx); func->SetParameters(minParams); func->SetParErrors(parErrors); func->SetChisquare(chi2); int ndf = coords.size()-nvpar; func->SetNDF(ndf); std::cout << "Chi2 Fit = " << chi2 << " ndf = " << ndf << " " << func->GetNDF() << std::endl; // add to list of functions h1->GetListOfFunctions()->Add(func); h2->GetListOfFunctions()->Add(func); } else { // fit independently h1->Fit(func); h2->Fit(func); } // Create a new canvas. TCanvas * c1 = new TCanvas("c1","Two HIstogram Fit example",100,10,900,800); c1->Divide(2,2); gStyle->SetOptFit(); gStyle->SetStatY(0.6); c1->cd(1); h1->Draw(); func->SetRange(xlow1,ylow1,xup1,yup1); func->DrawCopy("cont1 same"); c1->cd(2); h1->Draw("lego"); func->DrawCopy("surf1 same"); c1->cd(3); func->SetRange(xlow2,ylow2,xup2,yup2); h2->Draw(); func->DrawCopy("cont1 same"); c1->cd(4); h2->Draw("lego"); gPad->SetLogz(); func->Draw("surf1 same"); return 0; }
void PlotPhaseVelocityFunctions( const TString &opt="") { #ifdef __CINT__ gSystem->Load("libplasma.so"); #endif PlasmaGlob::Initialize(); // Palettes! gROOT->Macro("PlasmaPalettes.C"); gStyle->SetPadTopMargin(0.06); gStyle->SetPadGridY(0); gStyle->SetPadGridX(0); gStyle->SetFrameLineWidth(2); gStyle->SetLabelSize(0.04, "xyz"); gStyle->SetTitleOffset(1.2,"y"); gStyle->SetTitleOffset(1.2,"z"); gStyle->SetNdivisions(505,"xyz"); PUnits::UnitsTable::Get(); // // SPS parameters from Pukhov, Kumar et al. PRL107,145003(2011) // Double_t n0 = 7.76e14 / PUnits::cm3; // Double_t nb = 1.5e12 / PUnits::cm3; // Double_t lambda = PFunc::PlasmaWavelength(n0); // Double_t kp = PFunc::PlasmaWavenumber(n0); // Double_t skindepth = PFunc::PlasmaSkindepth(n0); // Double_t r0 = 0.19 * PUnits::mm; // Double_t z = 2.5 * PUnits::m; // Double_t zg = -28.6 * PUnits::mm; // Double_t E = 450 * PUnits::GeV; // Double_t gamma = E / PConst::ProtonMassE ; // SPS parameters from Schroeder et al. PRL107,145002(2011) // Double_t n0 = 1.0; // Double_t nb = 0.002; // Double_t lambda = TMath::TwoPi(); // Double_t kp = 1.0; // Double_t r0 = 1.0; // Double_t z = 13105; // Double_t E = 450 * PUnits::GeV; // Double_t gamma = E / PConst::ProtonMassE ; // PITZ parameters Double_t n0 = 1.0e15 / PUnits::cm3; Double_t nb = 1.05e13 / PUnits::cm3; Double_t lambda = PFunc::PlasmaWavelength(n0); Double_t kp = PFunc::PlasmaWavenumber(n0); Double_t skindepth = PFunc::PlasmaSkindepth(n0); Double_t r0 = 34.259 * PUnits::um; Double_t z = 150. * PUnits::mm; Double_t zg = -5. * PUnits::mm; Double_t E = 25 * PUnits::MeV; Double_t gamma = (E / PConst::ElectronMassE) + 1.0; Double_t vb = TMath::Sqrt(1. - (1./(gamma*gamma))); cout << " n0 = " << n0 * PUnits::cm3 << " e/cc" << endl; cout << " Wavelength = " << PUnits::BestUnit(lambda, "Length") << endl; cout << " Skindepth = " << PUnits::BestUnit(skindepth, "Length") << endl; cout << " Wavenumber = " << kp * PUnits::mm << " mm^-1" << endl; // Normalized variables if(!opt.Contains("units")){ r0 *= kp; nb /= n0; n0 = 1.0; z *= kp; zg *= kp; } Double_t N = PFunc::Nefoldings(z,zg,r0,gamma,nb,n0); Double_t r1 = (TMath::Power(3.,1./4.)/TMath::Power(8.*TMath::Pi()*N,1./2.)) * TMath::Exp(N) ; Double_t Gamma = PFunc::PhaseGamma(z,zg,r0,gamma,nb,n0); Double_t vph = PFunc::PhaseVelocity(z,zg,r0,gamma,nb,n0); Double_t vph2 = PFunc::PhaseVelocity2(z,zg,gamma,nb,n0); cout << " gamma beam = " << gamma << endl; cout << " zeta = " << z << endl; cout << " zeta comov. = " << zg << endl; cout << " r0 = " << r0 << endl; cout << " n_b0/n_0 = " << nb/n0 << endl; cout << " nu constant = " << PFunc::Nu(r0,n0) << endl; cout << " Number e-foldings = " << N << endl; cout << " r1 = " << r1 << endl; cout << " Gamma wake = " << Gamma << endl; cout << " Wake Phase velocity = " << vph << endl; cout << " Wake Phase velocity2 = " << vph2 << endl; cout << " Beam phase velocity = " << vb << endl; const Int_t NPAR = 5; Double_t par[NPAR] = {zg,r0,gamma,nb,n0}; TF1 *fPhaseVsZ2 = new TF1("fPhaseVsZ2",PhaseVelocityVsZ2,0,z,NPAR); fPhaseVsZ2->SetParameters(par); TF1 *fPhaseVsZ = new TF1("fPhaseVsZ",PhaseVelocityVsZ,0,z,NPAR); fPhaseVsZ->SetParameters(par); Double_t par2[NPAR] = {z,r0,gamma,nb,n0}; TF1 *fPhaseVsZg2 = new TF1("fPhaseVsZg2",PhaseVelocityVsZg2,zg,0.,NPAR); fPhaseVsZg2->SetParameters(par2); TF1 *fPhaseVsZg = new TF1("fPhaseVsZg",PhaseVelocityVsZg,zg,0.,NPAR); fPhaseVsZg->SetParameters(par2); const Int_t NPAR2D = 4; Double_t par3[NPAR2D] = {r0,gamma,nb,n0}; TF2 *fPhaseVsZVsZg2 = new TF2("fPhaseVsZVsZg2",PhaseVelocityVsZVsZg2,0.,z,zg,0.,NPAR2D); fPhaseVsZVsZg2->SetParameters(par3); TF2 *fPhaseVsZVsZg = new TF2("fPhaseVsZVsZg",PhaseVelocityVsZVsZg,0.,z,zg,0.,NPAR2D); fPhaseVsZVsZg->SetParameters(par3); char ctext[64]; TPaveText *textZetag = new TPaveText(0.13,0.85,0.38,0.92,"NDC"); PlasmaGlob::SetPaveTextStyle(textZetag,12); textZetag->SetTextColor(kGray+3); if(opt.Contains("units")) sprintf(ctext,"#zeta_{0} = %6.2f mm", zg / PUnits::mm); else sprintf(ctext,"#zeta_{0} = %6.2f c/#omega_{p}", zg); textZetag->AddText(ctext); TPaveText *textZeta = new TPaveText(0.13,0.85,0.38,0.92,"NDC"); PlasmaGlob::SetPaveTextStyle(textZeta,12); textZeta->SetTextColor(kGray+3); if(opt.Contains("units")) sprintf(ctext,"z_{0} = %6.2f mm", z / PUnits::mm); else sprintf(ctext,"z_{0} = %6.2f c/#omega_{p}", z); textZeta->AddText(ctext); // Graph for de-phasing: const Int_t NP = 100; TGraph *gPhase = new TGraph(NP); TGraph *gPhase2 = new TGraph(NP); Float_t phase = zg; Float_t phase2 = zg; Float_t Dz = z / NP; for(Int_t i=0;i<NP;i++) { Float_t zp = (i+1)*Dz; Float_t v = PFunc::PhaseVelocity(zp,phase,r0,gamma,nb,n0); phase += (v - vb) * Dz; // cout << " z = " << zp << " phase = " << phase << endl; if(opt.Contains("units")) gPhase->SetPoint(i,zp,(phase-zg)*kp); else gPhase->SetPoint(i,zp,(phase-zg)); v = PFunc::PhaseVelocity2(zp,phase2,gamma,nb,n0); phase2 += (v - 1) * Dz; // cout << " z = " << zp << " phase = " << phase << endl; if(opt.Contains("units")) gPhase2->SetPoint(i,zp,(phase2-zg)*kp); else gPhase2->SetPoint(i,zp,(phase2-zg)); } TCanvas *C = new TCanvas("C","Wake phase velocity",1000,750); C->Divide(2,2); TLegend *Leg = new TLegend(0.6,0.20,0.85,0.35); PlasmaGlob::SetPaveStyle(Leg); Leg->SetTextAlign(22); Leg->SetTextColor(kGray+3); Leg->SetLineColor(1); Leg->SetBorderSize(1); Leg->SetFillColor(0); Leg->SetFillStyle(1001); //Leg-> SetNColumns(2); Leg->AddEntry(fPhaseVsZ,"PRL 107,145002","L"); Leg->AddEntry(fPhaseVsZ2,"PRL 107,145003","L"); Leg->SetTextColor(kGray+3); C->cd(1); fPhaseVsZ->GetYaxis()->SetTitle("(v_{p} - c)/c"); if(opt.Contains("units")) fPhaseVsZ->GetXaxis()->SetTitle("z [m]"); else fPhaseVsZ->GetXaxis()->SetTitle("z [c/#omega_{p}]"); fPhaseVsZ->GetYaxis()->SetRangeUser(-3e-4,0.); fPhaseVsZ->GetXaxis()->CenterTitle(); fPhaseVsZ->GetYaxis()->CenterTitle(); fPhaseVsZ->SetLineWidth(2); fPhaseVsZ->Draw("C"); fPhaseVsZ2->SetLineWidth(2); fPhaseVsZ2->SetLineStyle(2); fPhaseVsZ2->Draw("C same"); textZetag->Draw(); Leg->Draw(); C->cd(2); fPhaseVsZg->GetYaxis()->SetTitle("(v_{p} - c)/c"); if(opt.Contains("units")) fPhaseVsZg->GetXaxis()->SetTitle("#zeta [m]"); else fPhaseVsZg->GetXaxis()->SetTitle("#zeta [c/#omega_{p}]"); fPhaseVsZg->GetYaxis()->SetRangeUser(-3e-4,0.); fPhaseVsZg->GetYaxis()->SetNdivisions(505); fPhaseVsZg->GetXaxis()->CenterTitle(); fPhaseVsZg->SetLineWidth(2); fPhaseVsZg->GetYaxis()->CenterTitle(); fPhaseVsZg->Draw("C"); fPhaseVsZg2->SetLineWidth(2); fPhaseVsZg2->SetLineStyle(2); fPhaseVsZg2->Draw("C same"); textZeta->Draw(); C->cd(3); gPhase->GetYaxis()->SetTitle("#Delta#zeta [c/#omega_{p}]"); if(opt.Contains("units")) { gPhase->GetXaxis()->SetTitle("z [m]"); gPhase->GetXaxis()->SetNdivisions(510); } else gPhase->GetXaxis()->SetTitle("z [c/#omega_{p}]"); // gPhase->GetXaxis()->SetNdivisions(510); gPhase->GetXaxis()->CenterTitle(); gPhase->GetYaxis()->CenterTitle(); gPhase->GetXaxis()->SetRangeUser(0.,z); gPhase->GetYaxis()->SetNdivisions(505); gPhase->SetLineWidth(2); gPhase->Draw("AC"); gPhase2->SetLineStyle(2); gPhase2->SetLineWidth(2); gPhase2->Draw("C"); textZetag->Draw(); C->cd(4); gPad->SetLeftMargin(0.18); if(opt.Contains("units")) { fPhaseVsZVsZg->GetYaxis()->SetTitle("#zeta [m]"); } else fPhaseVsZVsZg->GetYaxis()->SetTitle("#zeta [c/#omega_{p}]"); if(opt.Contains("units")) { fPhaseVsZVsZg->GetXaxis()->SetTitle("z [m]"); } else fPhaseVsZVsZg->GetXaxis()->SetTitle("z [c/#omega_{p}]"); fPhaseVsZVsZg->GetZaxis()->SetTitle("(v_{p} - c)/c"); fPhaseVsZVsZg->GetYaxis()->SetNdivisions(505); // fPhaseVsZVsZg->GetXaxis()->SetNdivisions(510); fPhaseVsZVsZg->GetXaxis()->CenterTitle(); fPhaseVsZVsZg->GetXaxis()->SetTitleOffset(1.6); fPhaseVsZVsZg->GetYaxis()->CenterTitle(); fPhaseVsZVsZg->GetYaxis()->SetTitleOffset(2.0); fPhaseVsZVsZg->GetZaxis()->CenterTitle(); fPhaseVsZVsZg->GetZaxis()->SetTitleOffset(1.4); fPhaseVsZVsZg->Draw("surf2"); C->cd(); // Print to a file PlasmaGlob::imgconv(C,"./WakePhaseVelocity",opt); // --------------------------------------------------------- }
void annotation3d() { TCanvas *c = new TCanvas("c", "c", 600, 600); c->SetTheta(30); c->SetPhi(50); gStyle->SetOptStat(0); gStyle->SetHistTopMargin(0); gStyle->SetOptTitle(kFALSE); // Define and draw a surface TF2 *f = new TF2("f", "[0]*cos(x)*cos(y)", -1, 1, -1, 1); f->SetParameter(0, 1); double s = 1./f->Integral(-1, 1, -1, 1); f->SetParameter(0, s); f->SetNpx(50); f->SetNpy(50); f->GetXaxis()->SetTitle("x"); f->GetXaxis()->SetTitleOffset(1.4); f->GetXaxis()->SetTitleSize(0.04); f->GetXaxis()->CenterTitle(); f->GetXaxis()->SetNdivisions(505); f->GetXaxis()->SetTitleOffset(1.3); f->GetXaxis()->SetLabelSize(0.03); f->GetXaxis()->ChangeLabel(2,-1,-1,-1,kRed,-1,"X_{0}"); f->GetYaxis()->SetTitle("y"); f->GetYaxis()->CenterTitle(); f->GetYaxis()->SetTitleOffset(1.4); f->GetYaxis()->SetTitleSize(0.04); f->GetYaxis()->SetTitleOffset(1.3); f->GetYaxis()->SetNdivisions(505); f->GetYaxis()->SetLabelSize(0.03); f->GetZaxis()->SetTitle("dP/dx"); f->GetZaxis()->CenterTitle(); f->GetZaxis()->SetTitleOffset(1.3); f->GetZaxis()->SetNdivisions(505); f->GetZaxis()->SetTitleSize(0.04); f->GetZaxis()->SetLabelSize(0.03); f->SetLineWidth(1); f->SetLineColorAlpha(kAzure-2, 0.3); f->Draw("surf1 fb"); // Lines for 3D annotation double x[11] = {-0.500, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.500}; double y[11] = {-0.985, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 0.985}; double z[11]; for (int i = 0; i < 11; ++i) z[i] = s*cos(x[i])*cos(y[i]); TPolyLine3D *g2 = new TPolyLine3D(11, x, y, z); double xx[2] = {-0.5, -0.5}; double yy[2] = {-0.985, -0.985}; double zz[2] = {0.11, s*cos(-0.5)*cos(-0.985)}; TPolyLine3D *l2 = new TPolyLine3D(2, xx, yy, zz); g2->SetLineColor(kRed); g2->SetLineWidth(3); g2->Draw(); l2->SetLineColor(kRed); l2->SetLineStyle(2); l2->SetLineWidth(1); l2->Draw(); // Draw text Annotations TLatex *txt = new TLatex(0.05, 0, "f(y,x_{0})"); txt->SetTextFont(42); txt->SetTextColor(kRed); txt->Draw(); TLatex *txt1 = new TLatex(0.12, 0.52, "f(x,y)"); txt1->SetTextColor(kBlue); txt1->SetTextFont(42); txt1->Draw(); }
void FitXS (int nminx = 0, int nmaxx = 1509, int nmintest = 0, int nmaxtest = 1509) { //////////////////////////////////////////////////// // ftp://root.cern.ch/root/doc/ROOTUsersGuideHTML/ch09s05.html TStyle *defaultStyle = new TStyle("defaultStyle","Default Style"); //gStyle->SetOptStat(0); // defaultStyle->SetOptStat(0000); // defaultStyle->SetOptFit(000); // defaultStyle->SetPalette(1); //////////////////////// defaultStyle->SetOptStat(0); // remove info box /////// pad //////////// defaultStyle->SetPadBorderMode(0); defaultStyle->SetPadBorderSize(3); defaultStyle->SetPadColor(0); defaultStyle->SetPadTopMargin(0.1); defaultStyle->SetPadBottomMargin(0.16); defaultStyle->SetPadRightMargin(5.5); defaultStyle->SetPadLeftMargin(0.18); /////// canvas ///////// defaultStyle->SetCanvasBorderMode(1); defaultStyle->SetCanvasColor(0); // defaultStyle->SetCanvasDefH(600); // defaultStyle->SetCanvasDefW(600); /////// frame ////////// //defaultStyle->SetFrameBorderMode(1); //defaultStyle->SetFrameBorderSize(1); defaultStyle->SetFrameFillColor(0); defaultStyle->SetFrameLineColor(1); /////// label ////////// // defaultStyle->SetLabelOffset(0.005,"XY"); // defaultStyle->SetLabelSize(0.05,"XY"); //defaultStyle->SetLabelFont(46,"XY"); /////// title ////////// //defaultStyle->SetTitleW(0.6); defaultStyle->SetTitleSize(0.08, "XYZ"); defaultStyle->SetTitleBorderSize(0); defaultStyle->SetTitleX(0.2); // defaultStyle->SetTitleOffset(1.1,"X"); // defaultStyle->SetTitleSize(0.01,"X"); // defaultStyle->SetTitleOffset(1.25,"Y"); // defaultStyle->SetTitleSize(0.05,"Y"); //defaultStyle->SetTitleFont(42, "XYZ"); /////// various //////// defaultStyle->SetNdivisions(303,"Y"); defaultStyle->SetTitleFillColor(0);//SetTitleFillStyle(0, "Z"); //defaultStyle->SetTitleX(0.2); //defaultStyle->SetTitleY(0.1); //defaultStyle->SetTitleBorderSize(-0.1); // For the axis titles: // defaultStyle->SetTitleColor(1, "XYZ"); // defaultStyle->SetTitleFont(42, "XYZ"); // defaultStyle->SetTitleYSize(0.08); //defaultStyle->SetTitleXOffset(0.9); //defaultStyle->SetTitleYOffset(1.05); defaultStyle->SetTitleOffset(1.3, "Y"); // Another way to set the Offset //defaultStyle->SetTitleOffset(1.0, "X"); // Another way to set the Offset // For the axis labels: defaultStyle->SetLabelColor(1, "XYZ"); //defaultStyle->SetLabelFont(46, "XYZ"); defaultStyle->SetLabelOffset(0.03, "XYZ"); defaultStyle->SetLabelSize(0.07, "XYZ"); //defaultStyle->SetLabelY(0.06); // For the axis: // defaultStyle->SetAxisColor(1, "XYZ"); defaultStyle->SetStripDecimals(kTRUE); defaultStyle->SetTickLength(0.03, "XYZ"); defaultStyle->SetNdivisions(7, "XYZ"); // defaultStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame // defaultStyle->SetPadTickY(1); defaultStyle->cd(); /////////////////////////////////////////// nmin=nminx; nmax=nmaxx; if (nmin<0) nmin=0; if (nmax>Npoints) nmax=Npoints; // Read in the cross section values and the parameters space points ifstream XSvals; XSvals.open("list_all_translation_CX.txt");//"14TeV_CX_5k_opositecgw.ascii");// "8TeV_CX_5k_opositecgw.ascii");// for (int i=nmin; i<nmax; i++) { XSvals >> par0[i] >> par1[i] >> par2[i] >> par3[i] >> par4[i] >> cross_section[i] >> cross_sectionerr[i]; cout << "For point i = " << i << "pars are " << par0[i] << " " << par1[i] << " " << par2[i] << " " << par3[i] << " " << par4[i] << " and xs is " << cross_section[i] << endl; } cout << "**********************************************" << endl; // Likelihood maximization // ----------------------- // Minuit routine TMinuit rmin(2); rmin.SetFCN(Likelihood); // Main initialization member function for MINUIT rmin.mninit(5,6,7); // Parameters needed to be unambiguous with MINOS int iflag=0; // You can use this for selection double arglis[4]; //arglis[0]=2; arglis[0]=1; // Sets the strategy to be used in calculating first and second derivatives // and in certain minimization methods. 1 is default rmin.mnexcm("SET STR", arglis, 1, iflag); // Set fit parameters double Start[15];// ={ 0.030642286182762914, 0.1502216514258229, 0.004287943879883482, 0.0016389029559123376, 0.01930407853512356, -0.12540818099961384, -0.02048425705808435, 0.04246248185144494, 0.02590360491719489, -0.05255851386689693, -0.010393610828707423, 0.02770339496466713, 0.005468667874225809, -0.011297300064522649, -0.02261561923548796}; // cx in pb // double Start[15] = {2.2646, 1.102, 0.316898, 16, 192, -3, -1, 1, 7, 15, -8, -23, 4, 9, 200}; // normalized to SM double Step[15];// ={ 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 }; //={0.01}; double Min[15]; // ={-3.1415926}; double Max[15]; // = {3.1415926}; for (int i=0; i<15; i++) { Start[i]=1.; Step[i]=1; Min[i]=-100000; Max[i]=+100000; } TString parnamEj[15]={"A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","A11","A12","A13","A14","A15"}; for (int i=0; i<15; i++) { rmin.mnparm(i, parnamEj[i], Start[i], Step[i], Min[i], Max[i], iflag); } // Instructs Minuit to call subroutine FCN with the value of IFLAG rmin.mnexcm("call fcn", arglis, 1, iflag); // command executed normally // Causes minimization of the function by the method of Migrad rmin.mnexcm("mini", arglis, 0, iflag); // Read results double a[15], err[15], pmin, pmax; int ivar; for (int i=0; i<15; i++) { rmin.mnpout (i, parnamEj[i], a[i], err[i], pmin, pmax, ivar); } // End of program // -------------- gROOT->Time(); cout<<endl<<" Making plots "<<endl; cout<<"$A_1$ = "<<a[0]<<" $\\pm$ "<<err[0]<<" & $A_4$ = "<<a[3]<<" $\\pm$ "<<err[3]<<" & $A_7$ = "<<a[6]<<" $\\pm$ "<<err[6]<<" & $A_{10}$ = "<<a[9]<<" $\\pm$ "<<err[9]<<" & $A_{13}$ = "<<a[12]<<" $\\pm$ "<<err[12]<< " \\\ "<<endl; cout<<"$A_2$ = "<<a[1]<<" $\\pm$ "<<err[1]<<" & $A_5$ = "<<a[4]<<" $\\pm$ "<<err[4]<<" & $A_8$ = "<<a[7]<<" $\\pm$ "<<err[7]<<" & $A_{11}$ = "<<a[10]<<" $\\pm$ "<<err[10]<<" & $A_{14}$ = "<<a[13]<<" $\\pm$ "<<err[13]<< " \\\ "<<endl; cout<<"$A_3$ = "<<a[2]<<" $\\pm$ "<<err[2]<<" & $A_6$ = "<<a[5]<<" $\\pm$ "<<err[5]<<" & $A_9$ = "<<a[8]<<" $\\pm$ "<<err[8]<<" & $A_{12}$ = "<<a[11]<<" $\\pm$ "<<err[11]<<" & $A_{15}$ = "<<a[14]<<" $\\pm$ "<<err[14]<< " \\\ "<<endl; cout<<endl<<" To mathematica: "<<endl; cout<<"{"<<a[0]<<","<<a[1]<<","<<a[2]<<","<<a[3]<<","<<a[4]<<","<<a[5]<<","<<a[6]<<","<<a[7]<<","<<a[8]<<","<<a[9]<<","<<a[10]<<","<<a[11]<<","<<a[12]<<","<<a[13]<<","<<a[14]<<"}"<<endl; cout<<endl<<" To mathematica (errors): "<<endl; cout<<"{"<<err[0]<<","<<err[1]<<","<<err[2]<<","<<err[3]<<","<<err[4]<<","<<err[5]<<","<<err[6]<<","<<err[7]<<","<<err[8]<<","<<err[9]<<","<<err[10]<<","<<err[11]<<","<<err[12]<<","<<err[13]<<","<<err[14]<<"}"<<endl; ///////////////// // plot the CX //////////////// // plane b double norm = 1; //0.013531;// 0.0041758;//1;// 8tev 13 tev 1;// double kt5d=1.0; double kl5d=1.0; double c25d=0.0; double mincg = -2.99, maxcg=2.99; // cg ===> x // c2g ===> y TF2 *fg2 = new TF2("fg2","(([0]*[15]**4 + [1]*[17]**2 + [2]*[15]**2*[16]**2 + [3]*x**2*[16]**2 + [4]*y**2 + [5]*[17]*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*[17] + [8]*x*[16]*[17] + [9]*[17]*y + [10]*x*[16]*[15]**2 + [11]*y*[15]**2 + [12]*[16]*x*[15]*[16] + [13]*y*[15]*[16] + [14]*x*y*[16])/[18])",mincg,maxcg,mincg,maxcg); fg2->SetParameter(0,a[0]); fg2->SetParameter(1,a[1]); fg2->SetParameter(2,a[2]); fg2->SetParameter(3,a[3]); fg2->SetParameter(4,a[4]); fg2->SetParameter(5,a[5]); fg2->SetParameter(6,a[6]); fg2->SetParameter(7,a[7]); fg2->SetParameter(8,a[8]); fg2->SetParameter(9,a[9]); fg2->SetParameter(10,a[10]); fg2->SetParameter(11,a[11]); fg2->SetParameter(12,a[12]); fg2->SetParameter(13,a[13]); fg2->SetParameter(14,a[14]); fg2->SetTitle("kt = #kappa_{#lambda} = 1 , c_{2} = 0 ; c_{g} ; c_{2g}"); fg2->SetParameter(15,kt5d); fg2->SetParameter(16,kl5d); fg2->SetParameter(17,c25d); fg2->SetParameter(18,norm); //0.013531 //fg2->SetMinimum(0); fg2->SetContour(100); // //////////////////////////////// kt5d=1.0; kl5d=10.0; c25d=0.0; // cg ===> x // c2g ===> y TF2 *fg10 = new TF2("fg10","([0]*[15]**4 + [1]*[17]**2 + [2]*[15]**2*[16]**2 + [3]*x**2*[16]**2 + [4]*y**2 + [5]*[17]*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*[17] + [8]*x*[16]*[17] + [9]*[17]*y + [10]*x*[16]*[15]**2 + [11]*y*[15]**2 + [12]*[16]*x*[15]*[16] + [13]*y*[15]*[16] + [14]*x*y*[16])/[18]",mincg,maxcg,mincg,maxcg); fg10->SetParameter(0,a[0]); fg10->SetParameter(1,a[1]); fg10->SetParameter(2,a[2]); fg10->SetParameter(3,a[3]); fg10->SetParameter(4,a[4]); fg10->SetParameter(5,a[5]); fg10->SetParameter(6,a[6]); fg10->SetParameter(7,a[7]); fg10->SetParameter(8,a[8]); fg10->SetParameter(9,a[9]); fg10->SetParameter(10,a[10]); fg10->SetParameter(11,a[11]); fg10->SetParameter(12,a[12]); fg10->SetParameter(13,a[13]); fg10->SetParameter(14,a[14]); fg10->SetTitle(""); fg10->SetParameter(15,kt5d); fg10->SetParameter(16,kl5d); fg10->SetParameter(17,c25d); fg10->SetParameter(18,norm);// 0.013531 fg10->SetMinimum(0); //////////////////////////////// kt5d=1.0; kl5d=-10.0; c25d=0.0; // cg ===> x // c2g ===> y TF2 *fgm10 = new TF2("fgm10","([0]*[15]**4 + [1]*[17]**2 + [2]*[15]**2*[16]**2 + [3]*x**2*[16]**2 + [4]*y**2 + [5]*[17]*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*[17] + [8]*x*[16]*[17] + [9]*[17]*y + [10]*x*[16]*[15]**2 + [11]*y*[15]**2 + [12]*[16]*x*[15]*[16] + [13]*y*[15]*[16] + [14]*x*y*[16])/[18]",mincg,maxcg,mincg,maxcg); fgm10->SetParameter(0,a[0]); fgm10->SetParameter(1,a[1]); fgm10->SetParameter(2,a[2]); fgm10->SetParameter(3,a[3]); fgm10->SetParameter(4,a[4]); fgm10->SetParameter(5,a[5]); fgm10->SetParameter(6,a[6]); fgm10->SetParameter(7,a[7]); fgm10->SetParameter(8,a[8]); fgm10->SetParameter(9,a[9]); fgm10->SetParameter(10,a[10]); fgm10->SetParameter(11,a[11]); fgm10->SetParameter(12,a[12]); fgm10->SetParameter(13,a[13]); fgm10->SetParameter(14,a[14]); fgm10->SetTitle(""); fgm10->SetParameter(15,kt5d); fgm10->SetParameter(16,kl5d); fgm10->SetParameter(17,c25d); fgm10->SetParameter(18,norm);//0.013531 fgm10->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< fg2->Eval(0,0)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< fg2->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< fg2->Eval(-1,1)<<endl; cout<<" "<<endl; //////////////////////////////////////////////////// double cg=0.0; double c2g=0.0; c25d=0.0; // cg ===> x ===> kl // c2g ===> y ===> kt TF2 *SM0 = new TF2("SM0","(([0]*y**4 + [1]*[17]**2 + [2]*y**2*x**2 + [3]*[15]**2*x**2 + [4]*[15]**2 + [5]*[17]*y**2 + [6]*y*x*y**2 + [7]*[15]*x*[17] + [8]*[16]*x*[17] + [9]*[17]*y + [10]*[16]*x*[15]**2 + [11]*[16]*y**2 + [12]*x*[16]*[15]*x + [13]*[15]*[15]*x + [14]*[16]*[15])/[18])+[19]",-15,15,0.5,2.5); SM0->SetParameter(0,a[0]); SM0->SetParameter(1,a[1]); SM0->SetParameter(2,a[2]); SM0->SetParameter(3,a[3]); SM0->SetParameter(4,a[4]); SM0->SetParameter(5,a[5]); SM0->SetParameter(6,a[6]); SM0->SetParameter(7,a[7]); SM0->SetParameter(8,a[8]); SM0->SetParameter(9,a[9]); SM0->SetParameter(10,a[10]); SM0->SetParameter(11,a[11]); SM0->SetParameter(12,a[12]); SM0->SetParameter(13,a[13]); SM0->SetParameter(14,a[14]); SM0->SetParameter(15,cg); //==>y SM0->SetParameter(16,c2g);//==>x SM0->SetParameter(17,c25d); SM0->SetParameter(18,norm);// 0.013531 SM0->SetParameter(19,0.0001);// 0.013531 SM0->SetTitle("c_{2} = c_{2g} = c_{g} = 0 ; #kappa_{#lambda} ; #kappa_{t}"); //SM0->SetMinimum(0); SM0->SetContour(200); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb "<<endl; cout<<"teste funcao kl , kt : 1,1 "<< SM0->Eval(1,1)<<endl; cout<<"teste funcao kl , kt : -10, 1 "<< SM0->Eval(-10,1)<<endl; cout<<"teste funcao kl , kt : 10, 1 "<< SM0->Eval(10,1)<<endl; //////////////////////////////// kt5d=1.0; kl5d=1.0; c25d=0.0; // cg ===> x ==> c2 // c2g ===> y ==> kt TF2 *l1 = new TF2("l1","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 + [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5); l1->SetParameter(0,a[0]); l1->SetParameter(1,a[1]); l1->SetParameter(2,a[2]); l1->SetParameter(3,a[3]); l1->SetParameter(4,a[4]); l1->SetParameter(5,a[5]); l1->SetParameter(6,a[6]); l1->SetParameter(7,a[7]); l1->SetParameter(8,a[8]); l1->SetParameter(9,a[9]); l1->SetParameter(10,a[10]); l1->SetParameter(11,a[11]); l1->SetParameter(12,a[12]); l1->SetParameter(13,a[13]); l1->SetParameter(14,a[14]); l1->SetTitle("#kappa_{#lambda} =1 , c_{2g} = c_{g} = 0 ; c_{2} ; #kappa_{t}"); l1->SetParameter(15,c2g); //==> c2g l1->SetParameter(16,kl5d); l1->SetParameter(17,cg); //==> cg l1->SetParameter(18,norm);//0.013531 //l1->->SetRange(1e1,0.1,1e3,1); //l1->SetMaximum(4e2); //l1->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< l1->Eval(0,1)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< l1->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< l1->Eval(-1,1)<<endl; cout<<" "<<endl; //////////////////////////////// kt5d=1.0; kl5d=0.0; c25d=0.0; // cg ===> x ==> c2 // c2g ===> y ==> kt TF2 *l0 = new TF2("l0","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 + [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5); l0->SetParameter(0,a[0]); l0->SetParameter(1,a[1]); l0->SetParameter(2,a[2]); l0->SetParameter(3,a[3]); l0->SetParameter(4,a[4]); l0->SetParameter(5,a[5]); l0->SetParameter(6,a[6]); l0->SetParameter(7,a[7]); l0->SetParameter(8,a[8]); l0->SetParameter(9,a[9]); l0->SetParameter(10,a[10]); l0->SetParameter(11,a[11]); l0->SetParameter(12,a[12]); l0->SetParameter(13,a[13]); l0->SetParameter(14,a[14]); l0->SetTitle(""); l0->SetParameter(15,c2g); //==> c2g l0->SetParameter(16,kl5d); l0->SetParameter(17,cg); //==> cg l0->SetParameter(18,norm);//0.013531 l0->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< l0->Eval(0,1)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< l0->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< l0->Eval(-1,1)<<endl; cout<<" "<<endl; //////////////////////////////// kt5d=1.0; kl5d=2.4; c25d=0.0; // cg ===> x ==> c2 // c2g ===> y ==> kt TF2 *l24 = new TF2("l24","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 + [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5); l24->SetParameter(0,a[0]); l24->SetParameter(1,a[1]); l24->SetParameter(2,a[2]); l24->SetParameter(3,a[3]); l24->SetParameter(4,a[4]); l24->SetParameter(5,a[5]); l24->SetParameter(6,a[6]); l24->SetParameter(7,a[7]); l24->SetParameter(8,a[8]); l24->SetParameter(9,a[9]); l24->SetParameter(10,a[10]); l24->SetParameter(11,a[11]); l24->SetParameter(12,a[12]); l24->SetParameter(13,a[13]); l24->SetParameter(14,a[14]); l24->SetTitle(""); l24->SetParameter(15,c2g); //==> c2g l24->SetParameter(16,kl5d); l24->SetParameter(17,cg); //==> cg l24->SetParameter(18,norm);//0.013531 l24->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< l24->Eval(0,1)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< l24->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< l24->Eval(-1,1)<<endl; cout<<" "<<endl; //////////////////////////////// kt5d=1.0; kl5d=5.0; c25d=0.0; // cg ===> x ==> c2 // c2g ===> y ==> kt TF2 *l5 = new TF2("l5","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 + [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5); l5->SetParameter(0,a[0]); l5->SetParameter(1,a[1]); l5->SetParameter(2,a[2]); l5->SetParameter(3,a[3]); l5->SetParameter(4,a[4]); l5->SetParameter(5,a[5]); l5->SetParameter(6,a[6]); l5->SetParameter(7,a[7]); l5->SetParameter(8,a[8]); l5->SetParameter(9,a[9]); l5->SetParameter(10,a[10]); l5->SetParameter(11,a[11]); l5->SetParameter(12,a[12]); l5->SetParameter(13,a[13]); l5->SetParameter(14,a[14]); l5->SetTitle(""); l5->SetParameter(15,c2g); //==> c2g l5->SetParameter(16,kl5d); l5->SetParameter(17,cg); //==> cg l5->SetParameter(18,norm);//0.013531 l5->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< l5->Eval(0,1)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< l5->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< l5->Eval(-1,1)<<endl; cout<<" "<<endl; //////////////////////////////// kt5d=1.0; kl5d=10.0; c25d=0.0; // cg ===> x ==> c2 // c2g ===> y ==> kt TF2 *l10 = new TF2("l10","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 + [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5); l10->SetParameter(0,a[0]); l10->SetParameter(1,a[1]); l10->SetParameter(2,a[2]); l10->SetParameter(3,a[3]); l10->SetParameter(4,a[4]); l10->SetParameter(5,a[5]); l10->SetParameter(6,a[6]); l10->SetParameter(7,a[7]); l10->SetParameter(8,a[8]); l10->SetParameter(9,a[9]); l10->SetParameter(10,a[10]); l10->SetParameter(11,a[11]); l10->SetParameter(12,a[12]); l10->SetParameter(13,a[13]); l10->SetParameter(14,a[14]); l10->SetTitle(""); l10->SetParameter(15,c2g); //==> c2g l10->SetParameter(16,kl5d); l10->SetParameter(17,cg); //==> cg l10->SetParameter(18,norm);//0.013531 l10->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< l10->Eval(0,1)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< l10->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< l10->Eval(-1,1)<<endl; cout<<" "<<endl; //////////////////////////////// kt5d=1.0; kl5d=-2.4; c25d=0.0; // cg ===> x ==> c2 // c2g ===> y ==> kt TF2 *lm24 = new TF2("lm24","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 + [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-17,17,0.5,2.5); lm24->SetParameter(0,a[0]); lm24->SetParameter(1,a[1]); lm24->SetParameter(2,a[2]); lm24->SetParameter(3,a[3]); lm24->SetParameter(4,a[4]); lm24->SetParameter(5,a[5]); lm24->SetParameter(6,a[6]); lm24->SetParameter(7,a[7]); lm24->SetParameter(8,a[8]); lm24->SetParameter(9,a[9]); lm24->SetParameter(10,a[10]); lm24->SetParameter(11,a[11]); lm24->SetParameter(12,a[12]); lm24->SetParameter(13,a[13]); lm24->SetParameter(14,a[14]); lm24->SetTitle(""); lm24->SetParameter(15,c2g); //==> c2g lm24->SetParameter(16,kl5d); lm24->SetParameter(17,cg); //==> cg lm24->SetParameter(18,norm);//0.013531 lm24->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< lm24->Eval(0,1)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< lm24->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< lm24->Eval(-1,1)<<endl; cout<<" "<<endl; //////////////////////////////// kt5d=1.0; kl5d=-5.0; c25d=0.0; // cg ===> x ==> c2 // c2g ===> y ==> kt TF2 *lm5 = new TF2("lm5","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 + [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5); lm5->SetParameter(0,a[0]); lm5->SetParameter(1,a[1]); lm5->SetParameter(2,a[2]); lm5->SetParameter(3,a[3]); lm5->SetParameter(4,a[4]); lm5->SetParameter(5,a[5]); lm5->SetParameter(6,a[6]); lm5->SetParameter(7,a[7]); lm5->SetParameter(8,a[8]); lm5->SetParameter(9,a[9]); lm5->SetParameter(10,a[10]); lm5->SetParameter(11,a[11]); lm5->SetParameter(12,a[12]); lm5->SetParameter(13,a[13]); lm5->SetParameter(14,a[14]); lm5->SetTitle(""); lm5->SetParameter(15,c2g); //==> c2g lm5->SetParameter(16,kl5d); lm5->SetParameter(17,cg); //==> cg lm5->SetParameter(18,norm);//0.013531 lm5->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< lm5->Eval(0,1)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< lm5->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< lm5->Eval(-1,1)<<endl; cout<<" "<<endl; //////////////////////////////// kt5d=1.0; kl5d=-10.0; c25d=0.0; // cg ===> x ==> c2 // c2g ===> y ==> kt TF2 *lm10 = new TF2("lm10","([0]*y**4 + [1]*x**2 + [2]*y**2*[16]**2 + [3]*[17]**2*[16]**2 + [4]*[15]**2 + [5]*x*y**2 + [6]*y*[16]*y**2 + [7]*y*[16]*x + [8]*[17]*[16]*x + [9]*x*[15] + [10]*[17]*[16]*y**2 + [11]*[15]*y**2 + [12]*[16]*[17]*y*[16] + [13]*[15]*y*[16] + [14]*[17]*[15]*[16])/[18]",-4,4,0.5,2.5); lm10->SetParameter(0,a[0]); lm10->SetParameter(1,a[1]); lm10->SetParameter(2,a[2]); lm10->SetParameter(3,a[3]); lm10->SetParameter(4,a[4]); lm10->SetParameter(5,a[5]); lm10->SetParameter(6,a[6]); lm10->SetParameter(7,a[7]); lm10->SetParameter(8,a[8]); lm10->SetParameter(9,a[9]); lm10->SetParameter(10,a[10]); lm10->SetParameter(11,a[11]); lm10->SetParameter(12,a[12]); lm10->SetParameter(13,a[13]); lm10->SetParameter(14,a[14]); lm10->SetTitle(""); lm10->SetParameter(15,c2g); //==> c2g lm10->SetParameter(16,kl5d); lm10->SetParameter(17,cg); //==> cg lm10->SetParameter(18,norm);//0.013531 lm10->SetMinimum(0); // cout<<endl<<"Value of the formula in SM point: 0.013531 pb"<<a[0]<<endl; cout<<"teste funcao cg , c2g : 0,0 "<< lm10->Eval(0,1)<<endl; cout<<"teste funcao cg , c2g : -1,1 "<< lm10->Eval(-1,1)<<endl; cout<<"teste funcao cg , c2g : 1,-1 "<< lm10->Eval(-1,1)<<endl; cout<<" "<<endl; /////////////////////////////////////////////////////////////// // Draw this function in pad1 with Gouraud shading option TCanvas *c1 = new TCanvas("c1","Surfaces Drawing Options",1500,2500); const int Number = 3; Double_t Red[Number] = { 1.00, 0.00, 0.00}; Double_t Green[Number] = { 0.00, 1.00, 0.00}; Double_t Blue[Number] = { 1.00, 0.00, 1.00}; Double_t Length[Number] = { 0.00, 0.50, 1.00 }; Int_t nb=30; TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb); //////////////////////////// TLatex* text = new TLatex(); text->SetTextSize(0.09); c1->SetLogz(0); ////////////////////////////////////// /* c1->Divide(3,4); c1->cd(1); //c1_1->SetLogz(); //c1->SetTicks(0,0); //c1->SetRightMargin(0.15); //c1->SetLeftMargin(0.15); //c1->SetBottomMargin(0.02); fg2->Draw("colz1"); text->DrawLatex(-0.85,-0.8,"#kappa_{#lambda} = 1, #kappa_{t} = 1, c_{2} = 0"); //----------------- c1->cd(2); //c1_1->SetLogz(); //c1_2->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); fg10->Draw("colz1"); text->DrawLatex(-0.85,-0.8,"#kappa_{#lambda} = 10, #kappa_{t} = 1, c_{2} = 0"); //----------------- c1->cd(3); //c1_1->SetLogz(); //c1_2->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); fgm10->Draw("colz1"); text->DrawLatex(-0.85,-0.8,"#kappa_{#lambda} = -10, #kappa_{t} = 1, c_{2} = 0"); //text->SetTextSize(0.08); //text->SetTextColor(0); //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1, c_{2} = 0"); c1->cd(4); //c1_1->SetLogz(); //c1_2->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); SM0->Draw("colz1"); text->DrawLatex(-3.,0.7,"c_{2} = c_{g} = c_{2} = 0"); //text->SetTextSize(0.08); //text->SetTextColor(0); //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1, c_{2} = 0"); c1->cd(5); //c1_5->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); l1->Draw("colz1"); text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = 1, c_{g} = c_{2} = 0"); c1->cd(6); //c1_5->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); l0->Draw("colz1"); text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = c_{g} = c_{2} = 0"); //text->SetTextSize(0.08); //text->SetTextColor(0); //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1, c_{2} = 0"); c1->cd(7); //c1_5->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); l24->Draw("colz"); text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = 2.4, c_{g} = c_{2} = 0"); //text->SetTextSize(0.08); //text->SetTextColor(0); //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1, c_{2} = 0"); c1->cd(8); //c1_5->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); l5->Draw("colz1"); text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = 5, c_{g} = c_{2} = 0"); //text->SetTextSize(0.08); //text->SetTextColor(0); //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1, c_{2} = 0"); c1->cd(9); //c1_5->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); l10->Draw("colz1"); text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = 10, c_{g} = c_{2} = 0"); //text->DrawLatex(-3,1,"SM plane in log scale"); //text->SetTextSize(0.08); //text->SetTextColor(0); //text->DrawLatex(-0.85.,-0.8,"#kappa_{#lambda} = 2.4, #kappa_{t} = 1, c_{2} = 0"); c1->cd(10); //c1_5->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); lm24->Draw("colz1"); text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = -2.4, c_{g} = c_{2} = 0"); c1->cd(11); //c1_5->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); lm5->Draw("colz1"); text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = -5, c_{g} = c_{2} = 0"); c1->cd(12); //c1_5->SetTicks(0,0); //c1_2->SetRightMargin(0.15); //c1_2->SetLeftMargin(0.15); //c1_2->SetBottomMargin(0.02); lm10->Draw("colz1"); //text->DrawLatex(-3,1,"SM plane in log scale"); //text->SetTextSize(0.08); //text->SetTextColor(0); text->DrawLatex(-3.,0.7,"#kappa_{#lambda} = -10, c_{g} = c_{2} = 0"); c1->SaveAs("C2Fit.pdf"); c1->Close(); */ ////////////////////////////////////////////////// // // do histrograms with errors // // plot (point - fit)/fit between int nmintest, int nmaxtest // do by the planes ////////////////////////////////////////////////// // take the fit // need to be done by planes //c1->Clear(); // a double SMxs = 0.013531; // 1 0.017278;// 14 0.0041758;// 8tev 0.013531; // 13 tev 0.017278;// 0.0041758; TGraph2D *g2 = new TGraph2D(117);//(118); g2->SetMarkerStyle(20); g2->SetMarkerSize(2); g2->SetTitle("0"); g2->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{2} = 0 ; c_{g} ; c_{2g}"); int j=0; for (unsigned int ij = 0; ij < nmaxx ; ij++) if( par1[ij] ==1 && par0[ij] ==1 && par2[ij]==0 && cross_section[ij] >0.0001) if(ij!=301) { double fit = SMxs*(fg2->Eval(par3[ij], par4[ij])); cout<<j<<" "<< par3[ij]<<" "<< par4[ij]<<" "<<fit <<" "<< cross_section[ij]<<" diff: " <<(fit - cross_section[ij])/fit<< endl; g2->SetPoint(j, par3[ij], par4[ij], 100*(fit - cross_section[ij])/fit); j++; //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); } // b //////////////////////////////// int ktb=1.0; int klb=1.0; // cg ===> x ==> c2 // c2g ===> y ==> kt ==> cg = c2g TF2 *pb = new TF2("pb","([0]*[15]**4 + [1]*x**2 + [2]*[15]**2*[16]**2 + [3]*y**2*[16]**2 + [4]*y**2 + [5]*x*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*x + [8]*y*[16]*x - [9]*x*y + [10]*y*[16]*[15]**2 - [11]*y*[15]**2 + [12]*[16]*y*[15]*[16] - [13]*y*[15]*[16] - [14]*y*y*[16])/[17]",-3,3,-1,1); pb->SetParameter(0,a[0]); pb->SetParameter(1,a[1]); pb->SetParameter(2,a[2]); pb->SetParameter(3,a[3]); pb->SetParameter(4,a[4]); pb->SetParameter(5,a[5]); pb->SetParameter(6,a[6]); pb->SetParameter(7,a[7]); pb->SetParameter(8,a[8]); pb->SetParameter(9,a[9]); pb->SetParameter(10,a[10]); pb->SetParameter(11,a[11]); pb->SetParameter(12,a[12]); pb->SetParameter(13,a[13]); pb->SetParameter(14,a[14]); pb->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{2g} = - c_{g} ; c_{2} ; c_{g}"); pb->SetParameter(15,ktb); //==> c2g ==>kt pb->SetParameter(16,klb); pb->SetContour(200); //l5->SetParameter(17,cg); //==> cg pb->SetParameter(17,norm);//0.013531 //pb->SetMinimum(0); TGraph2D *gb = new TGraph2D(132);//(118); gb->SetMarkerStyle(20); gb->SetMarkerSize(2); //gb->SetTitle("0"); gb->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{2g} = - c_{g} ; c_{2} ; c_{g}"); int jb=0; for (unsigned int ijb = 0; ijb < nmaxx ; ijb++) if( par1[ijb] ==1 && par0[ijb] ==1 && par3[ijb] == -par4[ijb] && cross_section[ijb] >0.0001) { double fitb = SMxs*(pb->Eval(par2[ijb], par3[ijb])); cout<<jb<<" "<<ijb<<" "<< par2[ijb]<<" "<< par4[ijb]<<" "<<fitb <<" "<< cross_section[ijb]<<" diff: " <<(fitb - cross_section[ijb])/fitb<< endl; if (abs((fitb - cross_section[ijb])/fitb) > 0.1) cout<<"here"<<endl; gb->SetPoint(jb, par2[ijb], par4[ijb], 100*((fitb - cross_section[ijb])/fitb)); jb++; //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); } ////////////////////////////////////////////// // c //////////////////////////////// int ktc=1.0; int c2c=0.0;//==>c2 // cg ===> x ==> c2 =//=>kl // c2g ===> y ==> kt ==> c2g = -cg TF2 *pc = new TF2("pb","([0]*[15]**4 + [1]*[16]**2 + [2]*[15]**2*x**2 + [3]*y**2*x**2 + [4]*y**2 + [5]*[16]*[15]**2 + [6]*[15]*x*[15]**2 + [7]*[15]*x*[16] + [8]*y*x*[16] - [9]*[16]*y + [10]*y*x*[15]**2 - [11]*y*[15]**2 + [12]*x*y*[15]*x - [13]*y*[15]*x - [14]*y*y*x)/[17]",-17,17,-1,1); pc->SetParameter(0,a[0]); pc->SetParameter(1,a[1]); pc->SetParameter(2,a[2]); pc->SetParameter(3,a[3]); pc->SetParameter(4,a[4]); pc->SetParameter(5,a[5]); pc->SetParameter(6,a[6]); pc->SetParameter(7,a[7]); pc->SetParameter(8,a[8]); pc->SetParameter(9,a[9]); pc->SetParameter(10,a[10]); pc->SetParameter(11,a[11]); pc->SetParameter(12,a[12]); pc->SetParameter(13,a[13]); pc->SetParameter(14,a[14]); pc->SetTitle("#kappa_{t} = 1 , c2 = 0 , c_{2g} = - c_{g} ; #kappa_{#lambda} ; c_{g}"); pc->SetParameter(15,ktc); //==> c2g ==>kt pc->SetParameter(16,c2c);// ==>c2 //l5->SetParameter(17,cg); //==> cg pc->SetParameter(17,norm);//0.013531 //pc->SetMinimum(0); pc->SetContour(200); TGraph2D *gc = new TGraph2D(125);//(118); gc->SetMarkerStyle(20); gc->SetMarkerSize(2); gc->SetTitle("#kappa_{t} = 1 , c2 = 0 , c_{2g} = - c_{g} ; #kappa_{#lambda} ; c_{g}"); // gc->GetYaxis()->SetTitle("c_{g}"); // gc->GetXaxis()->SetTitle("#kappa_{#lambda}"); int jc=0; for (unsigned int ijb = 0; ijb < nmaxx ; ijb++) if( par1[ijb] ==1 && par2[ijb] ==0 && par3[ijb] == -par4[ijb] && cross_section[ijb] >0.0001 && par3[ijb] >-1.5) { //&& abs(par0[ijb]) <6 double fitc = SMxs*(pc->Eval(par0[ijb], par3[ijb])); //cout<<jb<<" "<<ijb<<" "<< par0[ijb]<<" "<< par4[ijb]<<" "<<fitc <<" "<< cross_section[ijb]<<" diff: " <<(fitc - cross_section[ijb])/fitc<< endl; if (abs((fitc - cross_section[ijb])/fitc) > 0.1) cout<<"here"<<endl; gc->SetPoint(jc, par0[ijb], par3[ijb], 100*((fitc - cross_section[ijb])/fitc)); jc++; //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); } ////////////////////////////////// // d -- SM plane //SM0->Eval(1,1) // cg ===> x ===> kl // c2g ===> y ===> kt TGraph2D *gSM = new TGraph2D(112);//(118); gSM->SetMarkerStyle(20); gSM->SetMarkerSize(2); gSM->SetTitle("0"); gSM->SetTitle("c_{2} = c_{2g} = c_{g} = 0 ; #kappa_{#lambda} ; #kappa_{t}"); int jSM=0; for (unsigned int ii = 0; ii < nmaxx ; ii++) if( par2[ii] ==0 && par3[ii] ==0 && par4[ii]==0 && cross_section[ii] >0.00001 && cross_section[ii] <10000 && par1[ii] >0.3 && ii!=301) { double fitSM = SMxs*(SM0->Eval(par0[ii], par1[ii])); //{ //cout<<" SM plane"<<jSM<<" "<<ii<<" " << par0[ii]<<" "<< par1[ii]<<" "<<fitSM <<" "<< cross_section[ii]<<" diff: " <<(fitSM - cross_section[ii])/fitSM<< endl; if (abs((fitSM - cross_section[ii])/fitSM) > 0.1) cout<<"here"<<endl; gSM->SetPoint(jSM, par0[ii], par1[ii], 100*(fitSM - cross_section[ii])/fitSM); jSM++; //} //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); } ////////////////////////////////// // e -- SM plane //SM0->Eval(1,1) // cg ===> x ===> c2 // c2g ===> y ===> kt TGraph2D *gSMc2 = new TGraph2D(62);//(118);//57 13 tev gSMc2->SetMarkerStyle(20); gSMc2->SetMarkerSize(2); //gSMc2->SetTitle("0"); gSMc2->SetTitle("#kappa_{#lambda} =1 , c_{2g} = c_{g} = 0 ; c_{2} ; #kappa_{t}"); int jSMc2=0; for (unsigned int ii = 0; ii < nmaxx ; ii++) if( par0[ii] ==1 && par3[ii] ==0 && par4[ii]==0 && cross_section[ii] >0.00001 && cross_section[ii] <10000 && par1[ii] >0.25 ) if(ii!=301){ double fitSM = SMxs*(l1->Eval(par2[ii], par1[ii])); //{ cout<<jSMc2<<" "<<ii<<" " << par2[ii]<<" "<< par1[ii]<<" "<<fitSM <<" "<< cross_section[ii]<<" diff: " <<(fitSM - cross_section[ii])/fitSM<< endl; if (abs((fitSM - cross_section[ii])/fitSM) > 0.1) cout<<"here"<<endl; gSMc2->SetPoint(jSMc2, par2[ii], par1[ii], 100*(fitSM - cross_section[ii])/fitSM); jSMc2++; //} //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); } //////////////////////////////// // f = cg =0 int ktf=1.0; int klf=1.0; // cg ===> x ==> c2 // c2g ===> y ==> kt ==> cg = c2g TF2 *pf = new TF2("pf","([0]*[15]**4 + [1]*x**2 + [2]*[15]**2*[16]**2 + [4]*y**2 + [5]*x*[15]**2 + [6]*[15]*[16]*[15]**2 + [7]*[15]*[16]*x + [9]*x*y + [11]*y*[15]**2 + [13]*y*[15]*[16])/[17]",-3,3,-1,1); pf->SetParameter(0,a[0]); pf->SetParameter(1,a[1]); pf->SetParameter(2,a[2]); pf->SetParameter(3,a[3]); pf->SetParameter(4,a[4]); pf->SetParameter(5,a[5]); pf->SetParameter(6,a[6]); pf->SetParameter(7,a[7]); pf->SetParameter(8,a[8]); pf->SetParameter(9,a[9]); pf->SetParameter(10,a[10]); pf->SetParameter(11,a[11]); pf->SetParameter(12,a[12]); pf->SetParameter(13,a[13]); pf->SetParameter(14,a[14]); pf->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{g} = 0 ; c_{2} ; c_{2g}"); //pf->SetTitleSize(0.3); pf->SetParameter(15,ktf); //==> c2g ==>kt pf->SetParameter(16,klf); pf->SetContour(200); //l5->SetParameter(17,cg); //==> cg pf->SetParameter(17,norm);//0.013531 //pb->SetMinimum(0); TGraph2D *gf = new TGraph2D(132);//(118); gf->SetMarkerStyle(20); gf->SetMarkerSize(2); //gb->SetTitle("0"); gf->SetTitle("#kappa_{t} = #kappa_{#lambda} = 1 , c_{g} = 0 ; c_{2} ; c_{2g}"); int jf=0; for (unsigned int ijb = 0; ijb < nmaxx ; ijb++) if( par1[ijb] ==1 && par0[ijb] ==1 && par3[ijb] == 0 && cross_section[ijb] >0.0001) { double fitb = SMxs*(pf->Eval(par2[ijb], par4[ijb])); cout<<jf<<" "<<ijb<<" "<< par2[ijb]<<" "<< par4[ijb]<<" "<<fitb <<" "<< cross_section[ijb]<<" diff: " <<(fitb - cross_section[ijb])/fitb<< endl; if (abs((fitb - cross_section[ijb])/fitb) > 0.1) cout<<"here"<<endl; gf->SetPoint(jf, par2[ijb], par4[ijb], 100*((fitb - cross_section[ijb])/fitb)); jf++; //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); } ////////////////////////////////////////////// // rest square TCanvas *c2 = new TCanvas("c2","Surfaces Drawing Options",700,2200); c2->Divide(2,3); c2->cd(1); c2_1->SetRightMargin(0.17); c2_1->SetLeftMargin(0.21); //c2->cd(); c2_1->SetTheta(90.0-0.001); c2_1->SetPhi(0.0+0.001); gSM->Draw("Pcolz"); //fg2->Draw("cont3SAME"); c2->cd(2); c2_2->SetRightMargin(0.2); c2_2->SetLeftMargin(0.21); c2_2->SetTheta(90.0-0.001); c2_2->SetPhi(0.0+0.001); gSMc2->Draw("Pcolz"); //SM0->Draw("cont3SAME"); c2->cd(3); c2_3->SetRightMargin(0.2); c2_3->SetLeftMargin(0.21); c2_3->SetTheta(90.0-0.001); c2_3->SetPhi(0.0+0.001); gb->Draw("Pcolz"); //pb->Draw("cont3SAME"); c2->cd(4); c2_4->SetRightMargin(0.2); c2_4->SetLeftMargin(0.21); c2_4->SetTheta(90.0-0.001); c2_4->SetPhi(0.0+0.001); gc->Draw("Pcolz"); //pc->Draw("cont3SAME"); c2->cd(5); c2_5->SetRightMargin(0.2); c2_5->SetLeftMargin(0.21); c2_5->SetTheta(90.0-0.001); c2_5->SetPhi(0.0+0.001); g2->Draw("Pcolz"); // c2->cd(6); c2_6->SetRightMargin(0.2); c2_6->SetLeftMargin(0.21); c2_6->SetTheta(90.0-0.001); c2_6->SetPhi(0.0+0.001); gf->Draw("Pcolz"); c2->SaveAs("DiffSMplane_all_orthogonal_13tev.pdf"); ////////////////////////////////////////////// // rest square TCanvas *c3 = new TCanvas("c3","Surfaces Drawing Options",2200,700); c3->Divide(3,2); c3->cd(1); c3_1->SetLogz(1); c3_1->SetLeftMargin(0.19); c3_1->SetBottomMargin(0.19); c3_1->SetRightMargin(0.2); //c2->cd(); //g2->Draw("Pcolz"); SM0->Draw("colz"); c3->cd(2); c3_2->SetLogz(1); c3_2->SetRightMargin(0.19); c3_2->SetBottomMargin(0.19); c3_2->SetLeftMargin(0.21); //gSM->Draw("Pcolz"); l1->Draw("colz"); //c3_2->SetRightMargin(0.2); c3->cd(3); c3_3->SetLogz(1); c3_3->SetRightMargin(0.17); c3_3->SetBottomMargin(0.19); c3_3->SetLeftMargin(0.21); //gb->Draw("Pcolz"); pb->Draw("colz"); c3->cd(4); c3_4->SetLogz(1); c3_4->SetRightMargin(0.16); c3_4->SetBottomMargin(0.19); c3_4->SetLeftMargin(0.21); //gc->Draw("Pcolz"); pc->Draw("colz"); c3->cd(5); c3_5->SetLogz(1); c3_5->SetRightMargin(0.19); c3_5->SetBottomMargin(0.19); c3_5->SetLeftMargin(0.21); //gSMc2->Draw("Pcolz"); fg2->Draw("colz"); c3->cd(6); c3_6->SetLogz(1); c3_6->SetRightMargin(0.19); c3_6->SetBottomMargin(0.19); c3_6->SetLeftMargin(0.21); //gSMc2->Draw("Pcolz"); pf->Draw("colz"); c3->SaveAs("CX_all_orthogonal_13tev.pdf"); ////////////////////////////////////////////// /* TGraph *gall = new TGraph(nmaxx - nminx); gall->SetMarkerStyle(20); gall->SetMarkerSize(2); gall->SetTitle("0"); for (unsigned int i = 0; i < nmaxx - nminx; i++) if( par1[i] ==1 && par0[i] ==1 && par2[i]==0 ) { double fit = fg2->Eval(par3[i], par4[i]); cout<< par3[i]<<" "<< par4[i]<<" "<< (fit - cross_section[i])/fit<< endl; g2->SetPoint(i, par3[i], par4[i], (fit - cross_section[i])/fit); //Differences2->Fill(par3[i], par4[i], (fit - cross_section[i])/fit); }*/ }