#include "PndLmdLumiFit.h" using namespace RooFit; PndLmdLumiFit::PndLmdLumiFit(double inPlab, double insigtot, double inrho, double inb, double insigma_th): Plab(inPlab), sigtot(insigtot), rho(inrho), b(inb), sigma_th(insigma_th) { } PndLmdLumiFit::~PndLmdLumiFit() { } double PndLmdLumiFit::momt(double theta) { const double M=0.938; const double Elab=sqrt(M*M+Plab*Plab); const double S=2*M*M+2*M*Elab; const double pcm2=S/4.-M*M; const double gamma=(Elab+M)/sqrt(S); double thetacm = 2*TMath::ATan(gamma*TMath::Tan(theta/1000.)); double tcm = 2*pcm2*(1-cos(thetacm)); return tcm; } double PndLmdLumiFit::doppelgaus(Double_t* x, Double_t *par) { return 1./par[0]/2.506631205*exp(-0.5*pow((x[0])/par[0],2))+0./par[1]/2.506631205*exp(-0.5*pow((x[0])/par[1],2)); } double PndLmdLumiFit::mythInt(cs_th& mycs, Double_t min=3., Double_t max=8.){ const unsigned int N=100000; Double_t result=0, step=(max-min)/((double)N); for(Double_t i=min; iAddEntry(frame2->findObject("thsCS"),"DPM elastic CS","L"); myEntr->SetLineColor(kBlue); myEntr->SetLineStyle(kDashed); // Fit gxlx to data RooFitResult* resultths = csxgth.fitTo(thdatan, Range(thmin, thmax), Save()); // Plot data, cs pdf, cs (X) gauss pdf RooPlot* framethn = th.frame(Title("CS")); thdatan.plotOn(framethn); //thdatan.statOn(framethn, Layout(0.5, 0.9, 0.4)); thsCS.plotOn(framethn);//,Normalization(1.0,RooAbsReal::RelativeExpected)); //teCSn.plotOn(framethn,Components(thnCS),LineStyle(kDashed),LineColor(kGreen)); //teCSn.plotOn(framethn,Components(bkgdn),LineStyle(kDotted),LineColor(kRed)); // thnCS.plotOn(framethn,LineStyle(kDashed), LineColor(kGreen), Range(thmin, thmax)); // bkgdn.plotOn(framethn,LineStyle(kDashed), LineColor(kRed), Range(thmin, thmax)); thsCS.paramOn(framethn, Layout(0.5, 0.9, posbox), ShowConstants(true)); // Draw frame on canvas TCanvas *can1 = new TCanvas("Lumi_convolution","Lumi fitted with convolution of cs+gaus",700,500) ; // can1->Divide(1,3); can1->cd(1); gPad->SetLeftMargin(0.15) ; framethn->GetYaxis()->SetTitleOffset(1.4) ; framethn->Draw() ; can1->Print("results/Conv.pdf"); can1->Print("results/Conv.eps"); Double_t int2 = mythInt(thsCS); //.createIntegral(th,th) ; std::cout.precision(10); if(resultths){ resultths->Print(); std::cout << std::endl << "Norm CS: " << thsCS.getNorm(th)<< std::endl<correlationMatrix() ; //const TMatrixDSym& cov1 = resultthn->covarianceMatrix() ; // Print correlation, covariance matrix //cout << "correlation matrix" << endl ; //cor1.Print() ; //cout << "covariance matrix" << endl ; //cov1.Print() ; } //delete dpmfill; delete can1; delete frame; delete frameth; //delete t_MC_all; delete t_MC_lmdrange; delete t_MC_lmdrange_smeared; delete t_MC_lmdrange_triples; delete th_normal; delete th_smeared; delete th_tripled; return 0; }