TFile *F = new TFile("4eMassPseudo300.root"); TCanvas *c1 = new TCanvas("c1","Fit",900,700); TH1F *main = (TH1F*)F->Get("main47"); added = new TH1F("added","H->ZZ 4e Mass Smeared Pseudo-Voigt Fit(mH 300,10TeV,L=1fb^{-1},|#eta|<2.4,pT>5)",200,200,400); added->Add(main); gStyle->SetPadLeftMargin(0.15); added->SetMinimum(0); added->GetXaxis()->SetTitle("Mass (GeV)"); added->GetYaxis()->SetTitle("N Events per 1 GeV"); added->GetYaxis()->SetTitleOffset(1.4); //added->GetXaxis()->SetRangeUser(250,350); //added->GetYaxis()->SetRangeUser(0.01,10000.0); //c1->SetLogy(1); // c1->SetLogX(1); added->SetMarkerStyle(20); //added->SetMarkerSize(10); added->SetMarkerColor(55); TF1 *func = new TF1("fitf","[2]*(((1/(TMath::Sqrt(2*3.14159)*[0]))*( ( ( (-.3085)*( ([1]/(TMath::Sqrt(8)*[0])) + 1.2150 )+ (.021)*( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) -1.2359 ) ) / ( TMath::Power( ([1]/(TMath::Sqrt(8)*[0]) ) + 1.2150,2) + ( TMath::Power( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) -1.2359,2) )) )+( ( (.5906)*( ([1]/(TMath::Sqrt(8)*[0])) + 1.3509 )+ (-1.1858)*( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) -.3786) ) / ( TMath::Power( ([1]/(TMath::Sqrt(8)*[0]) ) + 1.3509,2) + ( TMath::Power( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) -.3786,2) )) )+( ( (-.3085)*( ([1]/(TMath::Sqrt(8)*[0])) + 1.2150)+ (-.021)*( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) +1.2359) ) / ( TMath::Power( ([1]/(TMath::Sqrt(8)*[0]) ) + 1.2150,2) + ( TMath::Power( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) +1.2359,2) )) )+( ( (.5906)*( ([1]/(TMath::Sqrt(8)*[0])) + 1.3509)+ (1.1858)*( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) +.3786) ) / ( TMath::Power( ([1]/(TMath::Sqrt(8)*[0]) ) + 1.3509,2) + ( TMath::Power( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) +.3786,2) )) ) ) ) )",300,400); //for(Int_t c = 0; c < 201; c++){ // Int_t u = added->GetBinContent(c); // if( u <= 0 ){ added->SetBinContent(c,.000001);} // }; //c1->SetLogy(1); TF1 *func = new TF1("fitf","[2]*(((1/(TMath::Sqrt(2*3.14159)*[0]))*( ( ( (-.3085)*( ([1]/(TMath::Sqrt(8)*[0])) + 1.2150 )+ (.021)*( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) -1.2359 ) ) / ( TMath::Power( ([1]/(TMath::Sqrt(8)*[0]) ) + 1.2150,2) + ( TMath::Power( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) -1.2359,2) )) )+( ( (.5906)*( ([1]/(TMath::Sqrt(8)*[0])) + 1.3509 )+ (-1.1858)*( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) -.3786) ) / ( TMath::Power( ([1]/(TMath::Sqrt(8)*[0]) ) + 1.3509,2) + ( TMath::Power( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) -.3786,2) )) )+( ( (-.3085)*( ([1]/(TMath::Sqrt(8)*[0])) + 1.2150)+ (-.021)*( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) +1.2359) ) / ( TMath::Power( ([1]/(TMath::Sqrt(8)*[0]) ) + 1.2150,2) + ( TMath::Power( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) +1.2359,2) )) )+( ( (.5906)*( ([1]/(TMath::Sqrt(8)*[0])) + 1.3509)+ (1.1858)*( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) +.3786) ) / ( TMath::Power( ([1]/(TMath::Sqrt(8)*[0]) ) + 1.3509,2) + ( TMath::Power( ( (x-[3])/(TMath::Sqrt(2)*[0]) ) +.3786,2) )) ) ) ) )",300,400); Double_t x = 300; Double_t gammaZ = (.22/( 64*3.14159*TMath::Power(80.4,2) )) * TMath::Power(x,3) * TMath::Sqrt( 1 - ( ( TMath::Power(2*91.2,2) )/(TMath::Power(x,2)) ) ) * ( 1-( (4*TMath::Power(91.2,2))/TMath::Power(x,2) )+( (12*TMath::Power(91.2,4))/TMath::Power(x,4) ) ); Double_t gammaW = (.44/( 64*3.14159*TMath::Power(80.4,2) )) * TMath::Power(x,3) * TMath::Sqrt( 1 - ( ( TMath::Power(2*80.4,2) )/(TMath::Power(x,2)) ) ) * ( 1-( (4*TMath::Power(80.4,2))/TMath::Power(x,2) )+( (12*TMath::Power(80.4,4))/TMath::Power(x,4) ) ); Double_t gammat = (.88/( 64*3.14159*TMath::Power(80.4,2) ))*TMath::Power(175,2)*x*1*(1 - (TMath::Power((2*175/x),2))); Double_t gammab = (.88/( 64*3.14159*TMath::Power(80.4,2) ))*TMath::Power(4.62,2)*x*1*(1 - (TMath::Power((2*4.62/x),2))); Double_t gammaW2 = ( .44/(64*TMath::Pi()*TMath::Power(80.4,2)) ) * TMath::Power(x,3) * TMath::Sqrt(1-.95) * ( 1-.95+(.75*TMath::Power(.95,2)) ); if(gammaZ < 0){gammaZ = 0;} if(gammaW < 0){gammaW = 0;} if(gammaW2 < 0){gammaW2 = 0;} if(gammat < 0){gammat = 0;} if(gammab < 0){gammab = 0;} Double_t gamma =(gammaW2*(1/(1+(TMath::Power(165-x,1.71)/8))))+(gammat/1.2)+(gammab/2); //(gammaW2*(1/(1+(TMath::Power(165-x,1.71)/8))))+(gammat/1.2)+(gammab/2); Double_t gamma2 = gammaW + gammaZ + (gammat/1.2) + (gammab/2); cout << gammaZ << endl; cout << gammaW << endl; cout << gammat << endl; cout << gammab << endl; //cout << gamma << endl; //cout << gamma2 << endl; func->SetParameters(.1,3,.2,150); func->FixParameter(3,300); //func->FixParameter(2,.04); func->FixParameter(1,gamma2); func->FixParameter(0,5.33939355); func->SetParNames("sigma(fixed)","Gamma(fixed)","Scale"); func->SetLineColor(2); added->Fit("fitf","R+"); //Sigmas //130-2.641207166 //150-2.888584638 //200-3.55921916 //300-5.33939355 //added->Draw(); gStyle->SetOptFit(1); gStyle->SetOptStat(""); c1->Update();