Index: examples/Validation.cpp
===================================================================
--- examples/Validation.cpp	(revision 7d8363633177b762d8293d313bd4ce0cbbc397e8)
+++ examples/Validation.cpp	(revision 84d319341e5bd9626821faba6ba2999da9443c84)
@@ -1456,9 +1456,12 @@
   TLegend *leg_trkpi_eff_eta = (TLegend*)leg_trkpi_res_eta->Clone();
 
-
-  TGraphErrors gr_trkpi_res_pt[n_etabins], gr_trkpi_eff_pt[n_etabins], gr_trkpi_res_eta[n_ptbins], gr_trkpi_eff_eta[n_ptbins];
+  TGraphErrors *gr_trkpi_res_pt  = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_trkpi_eff_pt  = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_trkpi_res_eta = new TGraphErrors[n_ptbins];
+  TGraphErrors *gr_trkpi_eff_eta = new TGraphErrors[n_ptbins];
   TH1D* h_trkpi_eff_pt, *h_trkpi_eff_eta;
 
-  std::vector<resolPlot> plots_trkpi_res_pt[n_etabins], plots_trkpi_res_eta[n_ptbins];
+  std::vector<resolPlot> *plots_trkpi_res_pt   = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_trkpi_res_eta  = new std::vector<resolPlot>[n_ptbins];
 
   // loop over eta bins
@@ -1559,8 +1562,13 @@
   TLegend *leg_trkele_eff_eta = (TLegend*)leg_trkele_res_eta->Clone();
 
-  TGraphErrors gr_trkele_res_pt[n_etabins], gr_trkele_eff_pt[n_etabins], gr_trkele_res_eta[n_ptbins], gr_trkele_eff_eta[n_ptbins];
+  TGraphErrors *gr_trkele_res_pt  = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_trkele_eff_pt  = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_trkele_res_eta = new TGraphErrors[n_ptbins];
+  TGraphErrors *gr_trkele_eff_eta = new TGraphErrors[n_ptbins];
+
   TH1D* h_trkele_eff_pt, *h_trkele_eff_eta;
 
-  std::vector<resolPlot> plots_trkele_res_pt[n_etabins], plots_trkele_res_eta[n_ptbins];
+  std::vector<resolPlot> *plots_trkele_res_pt   = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_trkele_res_eta  = new std::vector<resolPlot>[n_ptbins];
 
   // loop over eta bins
@@ -1663,8 +1671,13 @@
 
 
-  TGraphErrors gr_trkmu_res_pt[n_etabins], gr_trkmu_eff_pt[n_etabins], gr_trkmu_res_eta[n_ptbins], gr_trkmu_eff_eta[n_ptbins];
+  TGraphErrors *gr_trkmu_res_pt  = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_trkmu_eff_pt  = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_trkmu_res_eta = new TGraphErrors[n_ptbins];
+  TGraphErrors *gr_trkmu_eff_eta = new TGraphErrors[n_ptbins];
+
   TH1D* h_trkmu_eff_pt, *h_trkmu_eff_eta;
 
-  std::vector<resolPlot> plots_trkmu_res_pt[n_etabins], plots_trkmu_res_eta[n_ptbins];
+  std::vector<resolPlot> *plots_trkmu_res_pt   = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_trkmu_res_eta  = new std::vector<resolPlot>[n_ptbins];
 
   // loop over eta bins
@@ -1764,7 +1777,9 @@
   TLegend *leg_ecal_res_eta = new TLegend(0.60,0.59,0.95,0.90);
 
-  TGraphErrors gr_ecal_res_e[n_etabins], gr_ecal_res_eta[n_ptbins];
-
-  std::vector<resolPlot> plots_ecal_res_e[n_etabins], plots_ecal_res_eta[n_ptbins];
+  TGraphErrors *gr_ecal_res_e    = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_ecal_res_eta  = new TGraphErrors[n_ptbins];
+
+  std::vector<resolPlot> *plots_ecal_res_e   = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_ecal_res_eta = new std::vector<resolPlot>[n_ptbins];
 
   // loop over eta bins
@@ -1833,7 +1848,9 @@
   TLegend *leg_hcal_res_eta = new TLegend(0.60,0.59,0.95,0.90);
 
-  TGraphErrors gr_hcal_res_e[n_etabins], gr_hcal_res_eta[n_ptbins];
-
-  std::vector<resolPlot> plots_hcal_res_e[n_etabins], plots_hcal_res_eta[n_ptbins];
+  TGraphErrors *gr_hcal_res_e   = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_hcal_res_eta = new TGraphErrors[n_ptbins];
+
+  std::vector<resolPlot> *plots_hcal_res_e   = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_hcal_res_eta = new std::vector<resolPlot>[n_ptbins];
 
   // loop over eta bins
@@ -1903,12 +1920,13 @@
   TLegend *leg_pfele_res_eta[n_ptbins];
 
-  TGraphErrors gr_pfele_res_e[n_etabins];
-  TGraphErrors gr_pfele_res_eta[n_ptbins];
-
-  TGraphErrors gr_trkele_res_e[n_etabins];
-  TGraphErrors gr_trkele_res_eeta[n_ptbins];
-
-  std::vector<resolPlot> plots_pfele_res_e[n_etabins], plots_pfele_res_eta[n_ptbins];
-  std::vector<resolPlot> plots_trkele_res_e[n_etabins], plots_trkele_res_eeta[n_ptbins];
+  TGraphErrors *gr_pfele_res_e = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_pfele_res_eta = new TGraphErrors[n_ptbins];
+  TGraphErrors *gr_trkele_res_e = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_trkele_res_eeta = new TGraphErrors[n_ptbins];
+
+  std::vector<resolPlot> *plots_pfele_res_e     = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_pfele_res_eta   = new std::vector<resolPlot>[n_ptbins];
+  std::vector<resolPlot> *plots_trkele_res_e    = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_trkele_res_eeta = new std::vector<resolPlot>[n_ptbins];
 
   TCanvas *c_pfele_res_e[n_etabins];
@@ -2010,12 +2028,14 @@
   TLegend *leg_pfpi_res_eta[n_ptbins];
 
-  TGraphErrors gr_pfpi_res_e[n_etabins];
-  TGraphErrors gr_pfpi_res_eta[n_ptbins];
-
-  TGraphErrors gr_trkpi_res_e[n_etabins];
-  TGraphErrors gr_trkpi_res_eeta[n_ptbins];
-
-  std::vector<resolPlot> plots_pfpi_res_e[n_etabins], plots_pfpi_res_eta[n_ptbins];
-  std::vector<resolPlot> plots_trkpi_res_e[n_etabins], plots_trkpi_res_eeta[n_ptbins];
+  TGraphErrors *gr_pfpi_res_e     = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_pfpi_res_eta   = new TGraphErrors[n_ptbins];
+
+  TGraphErrors *gr_trkpi_res_e    = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_trkpi_res_eeta = new TGraphErrors[n_ptbins];
+
+  std::vector<resolPlot> *plots_pfpi_res_e     = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_pfpi_res_eta   = new std::vector<resolPlot>[n_ptbins];
+  std::vector<resolPlot> *plots_trkpi_res_e    = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_trkpi_res_eeta = new std::vector<resolPlot>[n_ptbins];
 
   TCanvas *c_pfpi_res_e[n_etabins];
@@ -2119,12 +2139,14 @@
   TLegend *leg_pfjet_res_eta[n_ptbins];
 
-  TGraphErrors gr_pfjet_res_e[n_etabins];
-  TGraphErrors gr_pfjet_res_eta[n_ptbins];
-
-  TGraphErrors gr_cajet_res_e[n_etabins];
-  TGraphErrors gr_cajet_res_eta[n_ptbins];
-
-  std::vector<resolPlot> plots_pfjet_res_e[n_etabins], plots_pfjet_res_eta[n_ptbins];
-  std::vector<resolPlot> plots_cajet_res_e[n_etabins], plots_cajet_res_eta[n_ptbins];
+  TGraphErrors *gr_pfjet_res_e   = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_pfjet_res_eta = new TGraphErrors[n_ptbins];
+
+  TGraphErrors *gr_cajet_res_e   = new TGraphErrors[n_etabins];
+  TGraphErrors *gr_cajet_res_eta = new TGraphErrors[n_ptbins];
+
+  std::vector<resolPlot> *plots_pfjet_res_e   = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_pfjet_res_eta = new std::vector<resolPlot>[n_ptbins];
+  std::vector<resolPlot> *plots_cajet_res_e   = new std::vector<resolPlot>[n_etabins];
+  std::vector<resolPlot> *plots_cajet_res_eta = new std::vector<resolPlot>[n_ptbins];
 
   TCanvas *c_pfjet_res_e[n_etabins];
@@ -2260,5 +2282,6 @@
     TLegend *leg_recele_eff_eta = new TLegend(0.55,0.22,0.90,0.48);
 
-    TGraphErrors gr_recele_eff_pt[n_etabins], gr_recele_eff_eta[n_ptbins];
+    TGraphErrors *gr_recele_eff_pt  = new TGraphErrors[n_etabins];
+    TGraphErrors *gr_recele_eff_eta = new TGraphErrors[n_ptbins];
     TH1D* h_recele_eff_pt, *h_recele_eff_eta;
 
@@ -2325,5 +2348,6 @@
     TLegend *leg_recmu_eff_eta = new TLegend(0.55,0.22,0.90,0.48);
 
-    TGraphErrors gr_recmu_eff_pt[n_etabins], gr_recmu_eff_eta[n_ptbins];
+    TGraphErrors *gr_recmu_eff_pt  = new TGraphErrors[n_etabins];
+    TGraphErrors *gr_recmu_eff_eta = new TGraphErrors[n_ptbins];
     TH1D* h_recmu_eff_pt, *h_recmu_eff_eta;
 
@@ -2390,5 +2414,6 @@
     TLegend *leg_recpho_eff_eta = new TLegend(0.55,0.22,0.90,0.48);
 
-    TGraphErrors gr_recpho_eff_pt[n_etabins], gr_recpho_eff_eta[n_ptbins];
+    TGraphErrors *gr_recpho_eff_pt  = new TGraphErrors[n_etabins];
+    TGraphErrors *gr_recpho_eff_eta = new TGraphErrors[n_ptbins];
     TH1D* h_recpho_eff_pt, *h_recpho_eff_eta;
 
@@ -2455,5 +2480,6 @@
     TLegend *leg_recbjet_eff_eta = new TLegend(0.50,0.22,0.90,0.48);
 
-    TGraphErrors gr_recbjet_eff_pt[n_etabins], gr_recbjet_eff_eta[n_ptbins];
+    TGraphErrors *gr_recbjet_eff_pt  = new TGraphErrors[n_etabins];
+    TGraphErrors *gr_recbjet_eff_eta = new TGraphErrors[n_ptbins];
     TH1D* h_recbjet_eff_pt, *h_recbjet_eff_eta;
 
@@ -2517,5 +2543,6 @@
     TLegend *leg_recbjet_cmis_eta = new TLegend(0.50,0.64,0.90,0.90);
 
-    TGraphErrors gr_recbjet_cmis_pt[n_etabins], gr_recbjet_cmis_eta[n_ptbins];
+    TGraphErrors *gr_recbjet_cmis_pt  = new TGraphErrors[n_etabins];
+    TGraphErrors *gr_recbjet_cmis_eta = new TGraphErrors[n_ptbins];
     TH1D* h_recbjet_cmis_pt, *h_recbjet_cmis_eta;
 
@@ -2579,5 +2606,6 @@
     TLegend *leg_recbjet_lmis_eta = new TLegend(0.50,0.64,0.90,0.90);
 
-    TGraphErrors gr_recbjet_lmis_pt[n_etabins], gr_recbjet_lmis_eta[n_ptbins];
+    TGraphErrors *gr_recbjet_lmis_pt  = new TGraphErrors[n_etabins];
+    TGraphErrors *gr_recbjet_lmis_eta = new TGraphErrors[n_ptbins];
     TH1D* h_recbjet_lmis_pt, *h_recbjet_lmis_eta;
 
@@ -2644,5 +2672,6 @@
     TLegend *leg_rectaujet_eff_eta = new TLegend(0.50,0.22,0.90,0.48);
 
-    TGraphErrors gr_rectaujet_eff_pt[n_etabins], gr_rectaujet_eff_eta[n_ptbins];
+    TGraphErrors *gr_rectaujet_eff_pt  = new TGraphErrors[n_etabins];
+    TGraphErrors *gr_rectaujet_eff_eta = new TGraphErrors[n_ptbins];
     TH1D* h_rectaujet_eff_pt, *h_rectaujet_eff_eta;
 
@@ -2708,5 +2737,6 @@
     TLegend *leg_rectaujet_mis_eta = new TLegend(0.50,0.64,0.90,0.90);
 
-    TGraphErrors gr_rectaujet_mis_pt[n_etabins], gr_rectaujet_mis_eta[n_ptbins];
+    TGraphErrors *gr_rectaujet_mis_pt  = new TGraphErrors[n_etabins];
+    TGraphErrors *gr_rectaujet_mis_eta = new TGraphErrors[n_ptbins];
     TH1D* h_rectaujet_mis_pt, *h_rectaujet_mis_eta;
 
