Index: examples/Validation.cpp
===================================================================
--- examples/Validation.cpp	(revision 96abea4e50a617ebdd31b99a58cf267412214a5f)
+++ examples/Validation.cpp	(revision 933e560cfcc5151883f21a7237cc5e5000a71f5a)
@@ -1265,4 +1265,5 @@
   if(logy) gPad->SetLogy();
 
+
   //gPad->SetGridx();
   //gPad->SetGridy();
@@ -1275,5 +1276,15 @@
 
 
-void Validation(const char *inputFilePion, const char *inputFileElectron, const char *inputFileMuon, const char *inputFilePhoton, const char *inputFileNeutralHadron, const char *inputFileJet, const char *inputFileBJet, const char *inputFileCJet, const char *inputFileTauJet, const char *outputFile)
+void Validation(const char *inputFilePion,
+                const char *inputFileElectron,
+                const char *inputFileMuon,
+                const char *inputFilePhoton,
+                const char *inputFileNeutralHadron,
+                const char *inputFileJet,
+                const char *inputFileBJet,
+                const char *inputFileCJet,
+                const char *inputFileTauJet,
+                const char *outputFile,
+                const char *version)
 {
 
@@ -1379,4 +1390,22 @@
   figPath.Remove(lastSlash+1,sizePath);
 
+  TString header = pdfOutput;
+  header.ReplaceAll(".pdf", "");
+  header.ReplaceAll("validation_", "");
+  lastSlash = header.Last('/');
+  sizePath = header.Length();
+  header.Remove(0,lastSlash+1);
+
+  TString vrs(version);
+
+  TPaveText *pave = new TPaveText(0.0, 0.89, 0.94, 0.94,"NDC");
+  pave->SetTextAlign(kHAlignRight);
+  pave->SetTextFont(132);
+  pave->SetBorderSize(0);
+  pave->SetShadowColor(0);
+  pave->SetFillColor(0);
+  pave->SetFillStyle(0);
+  pave->AddText("Delphes "+vrs+" - "+header);
+
   TString s_etaMin, s_etaMax, s_eta, s_pt, s_e;
 
@@ -1474,4 +1503,5 @@
   DrawAxis(mg_trkpi_res_pt, leg_trkpi_res_pt, ptMin, ptMax, 0.01, 100, "p_{T} [GeV]", "(track resolution in p_{T})/p_{T} (%)", true, true);
   leg_trkpi_res_pt->Draw();
+  pave->Draw();
 
   c_trkpi_res_pt->Print(pdfOutput+"(","pdf");
@@ -1484,4 +1514,5 @@
   DrawAxis(mg_trkpi_res_eta, leg_trkpi_res_eta, etaMin, etaMax, 0.01, 100, " #eta ", "(track resolution in p_{T})/p_{T} (%)", false, true);
   leg_trkpi_res_eta->Draw();
+  pave->Draw();
 
   c_trkpi_res_eta->Print(pdfOutput,"pdf");
@@ -1494,4 +1525,5 @@
   DrawAxis(mg_trkpi_eff_pt, leg_trkpi_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "tracking efficiency (%)", true, false);
   leg_trkpi_eff_pt->Draw();
+  pave->Draw();
 
   c_trkpi_eff_pt->Print(pdfOutput,"pdf");
@@ -1504,4 +1536,6 @@
   DrawAxis(mg_trkpi_eff_eta, leg_trkpi_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "tracking efficiency (%)", false, false);
   leg_trkpi_eff_eta->Draw();
+  pave->Draw();
+
 
   c_trkpi_eff_eta->Print(pdfOutput,"pdf");
@@ -1571,4 +1605,5 @@
   DrawAxis(mg_trkele_res_pt, leg_trkele_res_pt, ptMin, ptMax, 0.01, 100, "p_{T} [GeV]", "(track resolution in p_{T})/p_{T} (%)", true, true);
   leg_trkele_res_pt->Draw();
+  pave->Draw();
 
   c_trkele_res_pt->Print(pdfOutput,"pdf");
@@ -1581,4 +1616,5 @@
   DrawAxis(mg_trkele_res_eta, leg_trkele_res_eta, etaMin, etaMax, 0.01, 100, " #eta ", "(track resolution in p_{T})/p_{T} (%)", false, true);
   leg_trkele_res_eta->Draw();
+  pave->Draw();
 
   c_trkele_res_eta->Print(pdfOutput,"pdf");
@@ -1591,4 +1627,5 @@
   DrawAxis(mg_trkele_eff_pt, leg_trkele_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "tracking efficiency (%)", true, false);
   leg_trkele_eff_pt->Draw();
+  pave->Draw();
 
   c_trkele_eff_pt->Print(pdfOutput,"pdf");
@@ -1601,4 +1638,5 @@
   DrawAxis(mg_trkele_eff_eta, leg_trkele_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "tracking efficiency (%)", false, false);
   leg_trkele_eff_eta->Draw();
+  pave->Draw();
 
   c_trkele_eff_eta->Print(pdfOutput,"pdf");
@@ -1671,4 +1709,5 @@
   DrawAxis(mg_trkmu_res_pt, leg_trkmu_res_pt, ptMin, ptMax, 0.01, 100, "p_{T} [GeV]", "(track resolution in p_{T})/p_{T} (%)", true, true);
   leg_trkmu_res_pt->Draw();
+  pave->Draw();
 
   c_trkmu_res_pt->Print(pdfOutput,"pdf");
@@ -1681,4 +1720,5 @@
   DrawAxis(mg_trkmu_res_eta, leg_trkmu_res_eta, etaMin, etaMax, 0.01, 100, " #eta ", "(track resolution in p_{T})/p_{T} (%)", false, true);
   leg_trkmu_res_eta->Draw();
+  pave->Draw();
 
   c_trkmu_res_eta->Print(pdfOutput,"pdf");
@@ -1691,4 +1731,5 @@
   DrawAxis(mg_trkmu_eff_pt, leg_trkmu_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "tracking efficiency (%)", true, false);
   leg_trkmu_eff_pt->Draw();
+  pave->Draw();
 
   c_trkmu_eff_pt->Print(pdfOutput,"pdf");
@@ -1701,4 +1742,5 @@
   DrawAxis(mg_trkmu_eff_eta, leg_trkmu_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "tracking efficiency (%)", false, false);
   leg_trkmu_eff_eta->Draw();
+  pave->Draw();
 
   c_trkmu_eff_eta->Print(pdfOutput,"pdf");
@@ -1758,4 +1800,5 @@
   DrawAxis(mg_ecal_res_e, leg_ecal_res_e, ptMin, ptMax, 0.0, 20, "E [GeV]", "(ECAL resolution in E)/E (%)", true, false);
   leg_ecal_res_e->Draw();
+  pave->Draw();
 
   c_ecal_res_e->Print(pdfOutput,"pdf");
@@ -1769,4 +1812,5 @@
   DrawAxis(mg_ecal_res_eta, leg_ecal_res_eta, etaMin, etaMax, 0.0, 20, " #eta ", "(ECAL resolution in E)/E (%)", false, false);
   leg_ecal_res_eta->Draw();
+  pave->Draw();
 
   c_ecal_res_eta->Print(pdfOutput,"pdf");
@@ -1827,4 +1871,5 @@
   DrawAxis(mg_hcal_res_e, leg_hcal_res_e, ptMin, ptMax, 0.0, 50, "E [GeV]", "(HCAL resolution in E)/E (%)", true, false);
   leg_hcal_res_e->Draw();
+  pave->Draw();
 
   c_hcal_res_e->Print(pdfOutput,"pdf");
@@ -1838,4 +1883,5 @@
   DrawAxis(mg_hcal_res_eta, leg_hcal_res_eta, etaMin, etaMax, 0.0, 50, " #eta ", "(HCAL resolution in E)/E (%)", false, false);
   leg_hcal_res_eta->Draw();
+  pave->Draw();
 
   c_hcal_res_eta->Print(pdfOutput,"pdf");
@@ -1889,4 +1935,5 @@
      DrawAxis(mg_pfele_res_e[k], leg_pfele_res_e[k], ptMin, ptMax, 0.0, 20, "E [GeV]", "(resolution in E)/E (%)", true, false);
      leg_pfele_res_e[k]->Draw();
+     pave->Draw();
 
      TString s_etarange = "eta_"+s_etaMin+"_"+s_etaMax+"_";
@@ -1927,4 +1974,5 @@
      DrawAxis(mg_pfele_res_eta[k], leg_pfele_res_eta[k], etaMin, etaMax, 0.0, 50, "#eta", "(resolution in E)/E (%)", false, false);
      leg_pfele_res_eta[k]->Draw();
+     pave->Draw();
 
      TString s_ptrange = Form("pt_%.0f_",ptVals.at(k));
@@ -1982,4 +2030,5 @@
      DrawAxis(mg_pfpi_res_e[k], leg_pfpi_res_e[k], ptMin, ptMax, 0.1, 50, "E [GeV]", "(resolution in E)/E (%)", true, false);
      leg_pfpi_res_e[k]->Draw();
+     pave->Draw();
 
      TString s_etarange = "eta_"+s_etaMin+"_"+s_etaMax+"_";
@@ -2019,4 +2068,5 @@
      DrawAxis(mg_pfpi_res_eta[k], leg_pfpi_res_eta[k], etaMin, etaMax, 0.0, 50, "#eta", "(resolution in E)/E (%)", false, false);
      leg_pfpi_res_eta[k]->Draw();
+     pave->Draw();
 
      TString s_ptrange = Form("pt_%.0f_",ptVals.at(k));
@@ -2084,4 +2134,5 @@
      DrawAxis(mg_pfjet_res_e[k], leg_pfjet_res_e[k], 10, ptMax, 0.0, 30, "E [GeV]", "(resolution in E)/E (%)", true, false);
      leg_pfjet_res_e[k]->Draw();
+     pave->Draw();
 
      TString s_etarange = "eta_"+s_etaMin+"_"+s_etaMax+"_";
@@ -2125,4 +2176,5 @@
      DrawAxis(mg_pfjet_res_eta[k], leg_pfjet_res_eta[k], etaMin, etaMax, 0.0, 50, "#eta", "(resolution in E)/E (%)", false, false);
      leg_pfjet_res_eta[k]->Draw();
+     pave->Draw();
 
      TString s_ptrange = Form("pt_%.0f_",ptVals.at(k));
@@ -2162,5 +2214,5 @@
 
     leg_met_res_ht->Draw();
-
+    pave->Draw();
     c_met_res_ht->Print(pdfOutput,"pdf");
     c_met_res_ht->Print(figPath+"img_met_res_ht.pdf","pdf");
@@ -2215,4 +2267,5 @@
     DrawAxis(mg_recele_eff_pt, leg_recele_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "reconstruction efficiency (%)", true, false);
     leg_recele_eff_pt->Draw();
+    pave->Draw();
 
     c_recele_eff_pt->Print(pdfOutput,"pdf");
@@ -2225,4 +2278,5 @@
     DrawAxis(mg_recele_eff_eta, leg_recele_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "reconstruction efficiency (%)", false, false);
     leg_recele_eff_eta->Draw();
+    pave->Draw();
 
     c_recele_eff_eta->Print(pdfOutput,"pdf");
@@ -2278,4 +2332,5 @@
     DrawAxis(mg_recmu_eff_pt, leg_recmu_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "reconstruction efficiency (%)", true, false);
     leg_recmu_eff_pt->Draw();
+    pave->Draw();
 
     c_recmu_eff_pt->Print(pdfOutput,"pdf");
@@ -2288,4 +2343,5 @@
     DrawAxis(mg_recmu_eff_eta, leg_recmu_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "reconstruction efficiency (%)", false, false);
     leg_recmu_eff_eta->Draw();
+    pave->Draw();
 
     c_recmu_eff_eta->Print(pdfOutput,"pdf");
@@ -2341,4 +2397,5 @@
     DrawAxis(mg_recpho_eff_pt, leg_recpho_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "reconstruction efficiency (%)", true, false);
     leg_recpho_eff_pt->Draw();
+    pave->Draw();
 
     c_recpho_eff_pt->Print(pdfOutput,"pdf");
@@ -2351,4 +2408,5 @@
     DrawAxis(mg_recpho_eff_eta, leg_recpho_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "reconstruction efficiency (%)", false, false);
     leg_recpho_eff_eta->Draw();
+    pave->Draw();
 
     c_recpho_eff_eta->Print(pdfOutput,"pdf");
@@ -2403,4 +2461,5 @@
     DrawAxis(mg_recbjet_eff_pt, leg_recbjet_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "b - tag efficiency (%)", true, false);
     leg_recbjet_eff_pt->Draw();
+    pave->Draw();
 
     c_recbjet_eff_pt->Print(pdfOutput,"pdf");
@@ -2413,4 +2472,5 @@
     DrawAxis(mg_recbjet_eff_eta, leg_recbjet_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "b - tag efficiency (%)", false, false);
     leg_recbjet_eff_eta->Draw();
+    pave->Draw();
 
     c_recbjet_eff_eta->Print(pdfOutput,"pdf");
@@ -2465,4 +2525,5 @@
     DrawAxis(mg_recbjet_cmis_pt, leg_recbjet_cmis_pt, ptMin, ptMax, 0.0, 20, "p_{T} [GeV]", "c - mistag rate (%)", true, false);
     leg_recbjet_cmis_pt->Draw();
+    pave->Draw();
 
     c_recbjet_cmis_pt->Print(pdfOutput,"pdf");
@@ -2475,4 +2536,5 @@
     DrawAxis(mg_recbjet_cmis_eta, leg_recbjet_cmis_eta, etaMin, etaMax, 0.0, 20, " #eta ", "c - mistag rate (%)", false, false);
     leg_recbjet_cmis_eta->Draw();
+    pave->Draw();
 
     c_recbjet_cmis_eta->Print(pdfOutput,"pdf");
@@ -2525,4 +2587,5 @@
     DrawAxis(mg_recbjet_lmis_pt, leg_recbjet_lmis_pt, ptMin, ptMax, 0.0, 0.1, "p_{T} [GeV]", "light - mistag rate (%)", true, false);
     leg_recbjet_lmis_pt->Draw();
+    pave->Draw();
 
     c_recbjet_lmis_pt->Print(pdfOutput,"pdf");
@@ -2535,4 +2598,5 @@
     DrawAxis(mg_recbjet_lmis_eta, leg_recbjet_lmis_eta, etaMin, etaMax, 0.0, 0.1, " #eta ", "light - mistag rate (%)", false, false);
     leg_recbjet_lmis_eta->Draw();
+    pave->Draw();
 
     c_recbjet_lmis_eta->Print(pdfOutput,"pdf");
@@ -2589,4 +2653,5 @@
     DrawAxis(mg_rectaujet_eff_pt, leg_rectaujet_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "#tau - tag efficiency (%)", true, false);
     leg_rectaujet_eff_pt->Draw();
+    pave->Draw();
 
     c_rectaujet_eff_pt->Print(pdfOutput,"pdf");
@@ -2599,4 +2664,5 @@
     DrawAxis(mg_rectaujet_eff_eta, leg_rectaujet_eff_eta, etaMin, etaMax, 0.0000001, 100, " #eta ", "#tau - tag efficiency (%)", false, true);
     leg_rectaujet_eff_eta->Draw();
+    pave->Draw();
 
     c_rectaujet_eff_eta->Print(pdfOutput,"pdf");
@@ -2650,4 +2716,5 @@
     DrawAxis(mg_rectaujet_mis_pt, leg_rectaujet_mis_pt, ptMin, ptMax, 0.0, 10., "p_{T} [GeV]", "#tau - mistag(%)", true, false);
     leg_rectaujet_mis_pt->Draw();
+    pave->Draw();
 
     c_rectaujet_mis_pt->Print(pdfOutput,"pdf");
@@ -2660,4 +2727,5 @@
     DrawAxis(mg_rectaujet_mis_eta, leg_rectaujet_mis_eta, etaMin, etaMax, 0.0, 5., " #eta ", "#tau - mistag (%)", false, false);
     leg_rectaujet_mis_eta->Draw();
+    pave->Draw();
 
     c_rectaujet_mis_eta->Print(pdfOutput+")","pdf");
@@ -2731,5 +2799,5 @@
   char *appName = "Validation";
 
-  if(argc != 11)
+  if(argc != 12)
   {
     cout << " Usage: " << appName << " input_file_electron input_file_muon input_file_photon input_file_jet input_file_bjet input_file_taujet output_file" << endl;
@@ -2744,4 +2812,6 @@
     cout << " input_file_taujet - input file in ROOT format ('Delphes' tree)," << endl;
     cout << " output_file - output file in ROOT format" << endl;
+    cout << " delphes version" << endl;
+
     return 1;
   }
@@ -2753,5 +2823,5 @@
   TApplication app(appName, &appargc, appargv);
 
-  Validation(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]);
+  Validation(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], argv[10], argv[11]);
 }
 
Index: examples/validation.sh
===================================================================
--- examples/validation.sh	(revision 96abea4e50a617ebdd31b99a58cf267412214a5f)
+++ examples/validation.sh	(revision 933e560cfcc5151883f21a7237cc5e5000a71f5a)
@@ -16,4 +16,5 @@
 #
 # Note that the more events you specify, the more accurate the controls plots will be ...
+# This said, 500k events should be ok for most cases. 
 #
 ############################################################################################
@@ -31,16 +32,20 @@
 fi
 
-card=$(basename $1)
+cardbase=$(basename $1)
+carddir=$(dirname $1)
 nEvents=$2
-validationCard=cards/validation_$card
-output=validation_${card%.*}.root
-mainoutputdir=report_${card%.*}
-outputroot=report_${card%.*}/root
-cardlabel=${card%.*}
+validationCard=$carddir/validation_$cardbase
+output=validation_${cardbase%.*}.root
+mainoutputdir=report_${cardbase%.*}
+outputroot=report_${cardbase%.*}/root
+cardlabel=${cardbase%.*}
+version=$(cat VERSION)
+outpdf=$mainoutputdir/${output%.*}.pdf
+
 
 mkdir -p $outputroot
 mkdir -p $mainoutputdir/www/fig
 
-sed 's/delphes_card_CMS.tcl/'$card'/g' cards/validation_card.tcl  > $validationCard
+sed 's/delphes_card_CMS.tcl/'$cardbase'/g' cards/validation_card.tcl  > $validationCard
 
 function runParticleGun {
@@ -65,3 +70,24 @@
 runParticleGun taujet 15
 
-./Validation $outputroot/particleGun_pion_$cardlabel.root $outputroot/particleGun_electron_$cardlabel.root $outputroot/particleGun_muon_$cardlabel.root $outputroot/particleGun_photon_$cardlabel.root $outputroot/particleGun_neutron_$cardlabel.root $outputroot/particleGun_jet_$cardlabel.root $outputroot/particleGun_bjet_$cardlabel.root $outputroot/particleGun_cjet_$cardlabel.root $outputroot/particleGun_taujet_$cardlabel.root $mainoutputdir/$output
+./Validation $outputroot/particleGun_pion_$cardlabel.root $outputroot/particleGun_electron_$cardlabel.root $outputroot/particleGun_muon_$cardlabel.root $outputroot/particleGun_photon_$cardlabel.root $outputroot/particleGun_neutron_$cardlabel.root $outputroot/particleGun_jet_$cardlabel.root $outputroot/particleGun_bjet_$cardlabel.root $outputroot/particleGun_cjet_$cardlabel.root $outputroot/particleGun_taujet_$cardlabel.root $mainoutputdir/$output $version
+
+echo $outpdf
+if grep -q SimpleCalorimeter "$1"; then
+  ./CaloGrid $1 ECal
+  ./CaloGrid $1 HCal
+  gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=tmp/tmp1.pdf $outpdf ECal.pdf  
+  gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$outpdf tmp/tmp1.pdf HCal.pdf
+  mv ECal.pdf $mainoutputdir/www/fig/img_ecal.pdf 
+  mv ECal.png $mainoutputdir/www/fig/img_ecal.png 
+  mv HCal.pdf $mainoutputdir/www/fig/img_hcal.pdf
+  mv HCal.png $mainoutputdir/www/fig/img_hcal.png
+else 
+  ./CaloGrid $1 Calorimeter
+  gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=tmp/tmp1.pdf $outpdf Calorimeter.pdf
+  mv Calorimeter.pdf $mainoutputdir/www/fig/img_ecal.pdf
+  mv Calorimeter.png $mainoutputdir/www/fig/img_ecal.png
+fi
+
+
+
+
