#include #include #include #include #include "functions_hadcalib.h" #include "TMath.h" using namespace std; ////////////////////////////////////////////// // Function file for hadronic calibration // // using the numeric method // ////////////////////////////////////////////// void printvector(double N_vector[], TString ttext, const int N) { cout<, ) Double_t Emax = -100000., Ecluster; Int_t seedcluster, s; for(int i=0;i Emax) { Emax = Ecluster; seedcluster = i; } } s=seedcluster; return s; } Double_t make_cone(Int_t Nclusters, Float_t* cluster_energy, Float_t* eta_cl, Float_t* phi_cl, Double_t coneR, Int_t* coneclusters, Int_t* cellcluster_topo, Int_t* Nclusters_in_cone) { //Make the cone and return the cone energy (energy of clusters within the cone) Int_t seedcluster = find_seedcluster(Nclusters, cluster_energy); Double_t eta0=eta_cl[seedcluster]; //eta and phi for the seed cluster Double_t phi0=phi_cl[seedcluster]; Double_t eta, phi, e, p, testR; Double_t Econe=0., Ecluster; Int_t n=0; for(int i=0;i Emax) { Emax = Ecluster; seedcluster = ncl; } }//end if(coneveto!=0) }//end for(int ncl=0;nclGetBinContent(binl); }//end if(E_dens>=y_low...) }//end for(int i=0;i=x_low && EconeGetXaxis()->GetNbins(); nbinsy = weights_table->GetYaxis()->GetNbins(); TAxis *xaxis = weights_table->GetXaxis(); TAxis *yaxis = weights_table->GetYaxis(); for(int i=1;iGetBinLowEdge(i); xbins[i-1] = xlow; } for(int i=1;iGetBinLowEdge(i); ybins[i-1] = ylow; } //Find weight Double_t w=0., weight=0.; Int_t binl; Double_t x_low, x_up, y_low, y_up; for(int nx=0; nx=x_low && Econe=y_low && E_densGetBin(nx+1, ny+1); // "global" bin no w=weights_table->GetBinContent(binl); }//end if(E_dens>=y_low...) }//end for(int i=0;i=x_low && Econe 1000 MeV //Double_t par_r2[2] = {13.92, -7.15}; //Double_t par_lc[2] = {160.97, -148.63}; Double_t par_l2[2] = {82.29, -72.72}; //Et_cluster cut > 2000 MeV Double_t par_r2[2] = {15.02, -8.76}; Double_t par_lc[2] = {163.00, -150.15}; //Double_t par_l2[2] = {84.79, -75.38};//Et_cluster cut > 2500 MeV //Double_t par_r2[2] = {15.36, -9.32}; //Double_t par_lc[2] = {159.07, -146.69}; Double_t Ecluster,Etcluster, Ecllog, lambda2, r2, lambdac; Double_t EMest, EMestm, EMl2, EMr2, EMlc; //Double_t c[3]={0.186,0.151,0.663};//lc, l2, r2 for(int ncl=0;nclEcl_cut) { Double_t l2E = sqrt(lambda2)/Ecllog; Double_t r2E = sqrt(r2)/Ecllog; Double_t lcE = lambdac/Ecllog; EMl2 = (l2E - par_l2[0])/par_l2[1]; EMr2 = (r2E - par_r2[0])/par_r2[1]; EMlc = (lcE - par_lc[0])/par_lc[1]; EMest = c[0]*EMlc + c[1]*EMl2 + c[2]*EMr2; cl_EM_frac[ncl] = EMest; //EMest_vs_EMfrac->Fill(Eemfrac,EMest); //EMest_vs_EMfrac_mean->Fill(Eemfrac,EMestm); } }//end for(int ncl=0;nclGetXaxis()->GetNbins(); nbinsy = EM_histo->GetYaxis()->GetNbins(); TAxis *xaxis = EM_histo->GetXaxis(); TAxis *yaxis = EM_histo->GetYaxis(); for(int i=1;iGetBinLowEdge(i); xbins[i-1] = xlow; } for(int i=1;iGetBinLowEdge(i); ybins[i-1] = ylow; } //Find EM fraction //Double_t EMf=0., EMfrac=0., sEMf=0., mEMf; Double_t EMf=-0.15, EMfrac=0., sEMf=0., mEMf; Int_t binl; Double_t x_low, x_up, y_low, y_up; for(int nx=0; nx=x_low && log_densmom=y_low && log_lambdacGetBin(nx+1, ny+1); // "global" bin no EMf=EM_histo->GetBinContent(binl); EM_histo->SetErrorOption("s"); sEMf=EM_histo->GetBinError(binl); }//end if(log_lambdac>=y_low...) }//end for(int i=0;i=x_low && log_densmomGetXaxis()->GetNbins(); nbinsy = EM_histo->GetYaxis()->GetNbins(); TAxis *xaxis = EM_histo->GetXaxis(); TAxis *yaxis = EM_histo->GetYaxis(); for(int i=1;iGetBinLowEdge(i); xbins[i-1] = xlow; } for(int i=1;iGetBinLowEdge(i); ybins[i-1] = ylow; } //Find EM fraction Double_t EMf=0., EMfrac=0., sEMf=0.; Int_t binl; Double_t x_low, x_up, y_low, y_up; for(int nx=0; nx=x_low && log_densmom=y_low && log_lambdacGetBin(nx+1, ny+1);// "global" bin no EMf=EM_histo->GetBinContent(binl); EM_histo->SetErrorOption("s"); sEMf=EM_histo->GetBinError(binl); }//end if(log_lambdac>=y_low...) }//end for(int i=0;i=x_low && log_densmom