From fb9fadfffe19e89acad330c7242216f11199a9ba Mon Sep 17 00:00:00 2001
From: "jihee.kim" <jihee.kim@anl.gov>
Date: Tue, 20 Oct 2020 13:54:15 -0500
Subject: [PATCH] Debugging

---
 ecal/emcal_electrons.sh |  3 ++-
 ecal/scripts/makeplot.C | 13 +++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/ecal/emcal_electrons.sh b/ecal/emcal_electrons.sh
index 56a1339c..e7763185 100644
--- a/ecal/emcal_electrons.sh
+++ b/ecal/emcal_electrons.sh
@@ -50,7 +50,8 @@ popd
 
 pwd
 mkdir -p results
-root -b -q "ecal/scripts/makeplot.C(${E_start}, ${E_end}, \"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\", \"results/${JUGGLER_FILE_NAME_TAG}.txt\")"
+root -b -q "ecal/scripts/makeplot.C(${E_start}, ${E_end}, \"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")"
+#root -b -q "ecal/scripts/makeplot.C(${E_start}, ${E_end}, \"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\", \"results/${JUGGLER_FILE_NAME_TAG}.txt\")"
 
 #mkdir -p sim_output
 #cp "${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}" sim_output/.
diff --git a/ecal/scripts/makeplot.C b/ecal/scripts/makeplot.C
index 86ed5128..f3772d26 100644
--- a/ecal/scripts/makeplot.C
+++ b/ecal/scripts/makeplot.C
@@ -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;
 }
-- 
GitLab