Skip to content
Snippets Groups Projects

Electron data set

Merged Jihee Kim requested to merge jihee.kim/reconstruction_benchmarks:electron into master
2 files
+ 9
7
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 7
6
@@ -2,7 +2,8 @@
// Read reconstruction ROOT output file
// Plot variables
////////////////////////////////////////
int makeplot(double e_start = 1.0, double e_end = 1.0, const char* input_fname = "sim_output/sim_emcal_electrons_output.root", const char *fout = "results/rec_1000k_info_1GeV.txt")
//int makeplot(double e_start = 1.0, double e_end = 1.0, const char* input_fname = "sim_output/sim_emcal_electrons_output.root", const char *fout = "results/rec_1000k_info_1GeV.txt")
int makeplot(double e_start = 1.0, double e_end = 1.0, const char* input_fname = "sim_output/sim_emcal_electrons_output.root")
{
// Setting figures
gROOT->SetStyle("Plain");
@@ -16,9 +17,9 @@ int makeplot(double e_start = 1.0, double e_end = 1.0, const char* input_fname =
gStyle->SetPadRightMargin(0.14);
// Output ASCII file
FILE *fp = fopen(fout,"a");
if(!fp)
fprintf(stderr,"error: can't open %s\n", fout);
//FILE *fp = fopen(fout,"a");
//if(!fp)
// fprintf(stderr,"error: can't open %s\n", fout);
// Input ROOT file
TFile *f = new TFile(input_fname,"READ");
@@ -126,7 +127,7 @@ int makeplot(double e_start = 1.0, double e_end = 1.0, const char* input_fname =
total_cluster_e += cluster_e;
}
// Writing into ASCII file
fprintf(fp,"%d\t%d\t%2.4f\n",ievent,ncluster,total_cluster_e);
//fprintf(fp,"%d\t%d\t%2.4f\n",ievent,ncluster,total_cluster_e);
// Select events with one cluster
if(ncluster == 1)
@@ -244,6 +245,6 @@ int makeplot(double e_start = 1.0, double e_end = 1.0, const char* input_fname =
c9->SaveAs("results/electron_hit_pos_all_0GeVto30GeV.png");
c9->SaveAs("results/electron_hit_pos_all_0GeVto30GeV.pdf");
fclose(fp);
//fclose(fp);
return 0;
}
Loading