/* Simple macro showing how to access branches from the delphes output root file, loop over events, and plot simple quantities such as the jet pt and the di-electron invariant mass. root -l examples/Example1.C'("delphes_output.root")' */ /* #ifdef __CLING__ R__LOAD_LIBRARY(libDelphes) #include "classes/DelphesClasses.h" #include "external/ExRootAnalysis/ExRootTreeReader.h" //#include "external/Math/Vector4Dfwd.h" #endif*/ /* // DISCRIMINATING FUNCTION FOR "TGC" //------------------------------------------------------------------------------ bool TGC(int instance, double tau, double r, double tauPrimo){ return true; } //------------------------------------------------------------------------------ */ #include "TLegend.h" #include "TGraphAsymmErrors.h" #include "TGraph.h" #include "TGraphErrors.h" //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void Analysis_eff_jets_1() { //gSystem->Load("libDelphes"); TCanvas *c1 = new TCanvas("c1","Effb",1600,800); //TCanvas *c2 = new TCanvas("c2","Effc",1600,800); //TCanvas *c3 = new TCanvas("c3","Effl",1600,800); TF1 *efficiency = new TF1("efficiency", " 0.80*TMath::TanH(0.003*x[0])*(30/(1+0.086*x[0]))", 10, 600); TF1 *efficiency_var = new TF1("efficiency_var", " [0]*TMath::TanH([1]*x)*(30/(1+[2]*x))", 10, 600); //efficiency->SetMaximum(1); //efficiency->SetMinimum(1e-2); //efficiency_var->SetMaximum(1); //efficiency_var->SetMinimum(1e-2); TGraphErrors* gr = new TGraphErrors("examples/dati_eff_bjets_MV2c10.txt"); double x; double x1; double x2; double y; double y1; double y2; const Int_t NBINS = 7; //const Int_t NBINS = 6; Double_t edges[NBINS + 1] = {20, 30.0, 60.0, 90.0, 140.0, 200.0, 300.0, 500}; //Double_t edges[NBINS + 1] = {140, 160, 180, 200, 260, 300, 1000}; // Bin 1 corresponds to range [0.0, 0.2] // Bin 2 corresponds to range [0.2, 0.3] etc... TH1* h = new TH1D( "h", " ", NBINS, edges ); h->Sumw2(); for (int i=0; i<7; i++){ x=0; y=0; gr->GetPoint(i, x, y); if (x>20 && x<=30){ gr->SetPointError(i, 0, y*0.159); h->SetBinContent(i+1, y); h->SetBinError(i+1, gr->GetErrorY(i)); } if (x>30 && x<=60){ gr->SetPointError(i, 0, y*0.075); h->SetBinContent(i+1, y); h->SetBinError(i+1, gr->GetErrorY(i)); } if (x>60 && x<=90){ gr->SetPointError(i, 0, y*0.058); h->SetBinContent(i+1, y); h->SetBinError(i+1, gr->GetErrorY(i)); } if (x>90 && x<=140){ gr->SetPointError(i, 0, y*0.06); h->SetBinContent(i+1, y); h->SetBinError(i+1, gr->GetErrorY(i)); } if (x>140 && x<=200){ gr->SetPointError(i, 0, y*0.051); h->SetBinContent(i+1, y); h->SetBinError(i+1, gr->GetErrorY(i)); } if (x>200 && x<=300){ gr->SetPointError(i, 0, y*0.051); h->SetBinContent(i+1, y); h->SetBinError(i+1, gr->GetErrorY(i)); } if (x>300 && x<=500){ gr->SetPointError(i, 0, y*0.055); h->SetBinContent(i+1, y); h->SetBinError(i+1, gr->GetErrorY(i)); } cout<<"point: "<GetBinContent(i+1)<GetErrorY(i)<<", binerror: "<GetBinError(i+1)<cd(); gr->SetMaximum(1); gr->SetMinimum(0); gr->SetMarkerStyle(8); gr->SetMarkerSize(0.9); h->SetFillColor(8); h->Draw("L E2"); gr->Draw("P"); }