Index: examples/Validation.cpp
===================================================================
--- examples/Validation.cpp	(revision 06a83b3d8a3b27169b8510861b936f1e717eec98)
+++ examples/Validation.cpp	(revision 44b481dff141442683a3f74291e701b35d8d4e14)
@@ -250,6 +250,8 @@
       eta = TMath::Abs(genMomentum.Eta());
 
+
       if(eta > etamax || eta < etamin ) continue;
 
+      //cout<<"b parton: "<<pt<<endl;
       if (particle->PID == pdgID && genMomentum.Pt() > ptmin && genMomentum.Pt() < ptmax )
       {
@@ -279,6 +281,6 @@
             if( !(jet->BTag & (1 << 0)) ) continue;
           }
-        
-	  if(TMath::Abs(pdgID) == 1)
+
+	    if(TMath::Abs(pdgID) == 1)
           {
             Jet *jet = (Jet *)recoObj;
@@ -299,7 +301,6 @@
           }
         }
-
         histGenPt->Fill(pt);
-        if(deltaR < 0.3) { histRecoPt->Fill(pt); }
+        if(deltaR < 0.3 && bestRecoMomentum.Pt()> 0.20*pt ) { histRecoPt->Fill(pt);}
 
       }
@@ -1352,5 +1353,5 @@
   TClonesArray *branchCaloJet = treeReaderJet->UseBranch("CaloJet");
   TClonesArray *branchJet = treeReaderJet->UseBranch("Jet");
-  
+
   TClonesArray *branchParticleBJet = treeReaderBJet->UseBranch("Particle");
   TClonesArray *branchPFBJet = treeReaderBJet->UseBranch("Jet");
@@ -1439,5 +1440,4 @@
   const int n_ptbins = ptVals.size();
 
-
   //////////////////////////
   // Tracking performance //
@@ -1906,5 +1906,9 @@
   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];
 
   TCanvas *c_pfele_res_e[n_etabins];
@@ -1922,4 +1926,8 @@
      gr_pfele_res_e[k] = EresGraph(&plots_pfele_res_e[k]);
 
+     HistogramsCollection(&plots_trkele_res_e[k], TMath::Log10(ptMin), TMath::Log10(ptMax), "trkele");
+     GetEres<Track>(&plots_trkele_res_e[k], branchTrackElectron, branchParticleElectron, 11, etaVals.at(k), etaVals.at(k+1), treeReaderElectron);
+     gr_trkele_res_e[k] = EresGraph(&plots_trkele_res_e[k]);
+
      s_etaMin = Form("%.1f",etaVals.at(k));
      s_etaMax = Form("%.1f",etaVals.at(k+1));
@@ -1930,5 +1938,5 @@
 
      addResoGraph(mg_pfele_res_e[k], &gr_ecal_res_e[k], leg_pfele_res_e[k], markerStyles.at(0), colors.at(0), "ECAL");
-     addResoGraph(mg_pfele_res_e[k], &gr_trkele_res_pt[k], leg_pfele_res_e[k], markerStyles.at(1), colors.at(1), "Track");
+     addResoGraph(mg_pfele_res_e[k], &gr_trkele_res_e[k], leg_pfele_res_e[k], markerStyles.at(1), colors.at(1), "Track");
      addResoGraph(mg_pfele_res_e[k], &gr_pfele_res_e[k], leg_pfele_res_e[k], markerStyles.at(2), colors.at(2), "Particle-flow");
 
@@ -1961,4 +1969,8 @@
      gr_pfele_res_eta[k] = EresGraphVsEta(&plots_pfele_res_eta[k]);
 
+     HistogramsCollectionVsEta(&plots_trkele_res_eeta[k], etaMin, etaMax, 0.5*ptVals.at(k), 2.0*ptVals.at(k), "trkele", 0.0, 2.0);
+     GetEresVsEta<Track>(&plots_trkele_res_eeta[k], branchTrackElectron, branchParticleElectron, 11, 0.5*ptVals.at(k), 2.0*ptVals.at(k), treeReaderElectron);
+     gr_trkele_res_eeta[k] = EresGraphVsEta(&plots_trkele_res_eeta[k]);
+
      s_e = Form("e^{ #pm}, E = %.0f GeV",ptVals.at(k));
      if(ptVals.at(k) >= 1000.) s_e = Form("e^{ #pm}, E = %.0f TeV",ptVals.at(k)/1000.);
@@ -1969,5 +1981,5 @@
 
      addResoGraph(mg_pfele_res_eta[k], &gr_ecal_res_eta[k], leg_pfele_res_eta[k], markerStyles.at(0), colors.at(0), "ECAL");
-     addResoGraph(mg_pfele_res_eta[k], &gr_trkele_res_eta[k], leg_pfele_res_eta[k], markerStyles.at(1), colors.at(1), "Track");
+     addResoGraph(mg_pfele_res_eta[k], &gr_trkele_res_eeta[k], leg_pfele_res_eta[k], markerStyles.at(1), colors.at(1), "Track");
      addResoGraph(mg_pfele_res_eta[k], &gr_pfele_res_eta[k], leg_pfele_res_eta[k], markerStyles.at(2), colors.at(2), "Particle-flow");
 
@@ -2001,5 +2013,9 @@
   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];
 
   TCanvas *c_pfpi_res_e[n_etabins];
@@ -2017,4 +2033,9 @@
      gr_pfpi_res_e[k] = EresGraph(&plots_pfpi_res_e[k]);
 
+     HistogramsCollection(&plots_trkpi_res_e[k], TMath::Log10(ptMin), TMath::Log10(ptMax), "trkpi");
+     GetEres<Track>(&plots_trkpi_res_e[k], branchTrackPion, branchParticlePion, 211, etaVals.at(k), etaVals.at(k+1), treeReaderPion);
+     gr_trkpi_res_e[k] = EresGraph(&plots_trkpi_res_e[k]);
+
+
      s_etaMin = Form("%.1f",etaVals.at(k));
      s_etaMax = Form("%.1f",etaVals.at(k+1));
@@ -2025,5 +2046,5 @@
 
      addResoGraph(mg_pfpi_res_e[k], &gr_hcal_res_e[k], leg_pfpi_res_e[k], markerStyles.at(0), colors.at(0), "HCAL");
-     addResoGraph(mg_pfpi_res_e[k], &gr_trkpi_res_pt[k], leg_pfpi_res_e[k], markerStyles.at(1), colors.at(1), "Track");
+     addResoGraph(mg_pfpi_res_e[k], &gr_trkpi_res_e[k], leg_pfpi_res_e[k], markerStyles.at(1), colors.at(1), "Track");
      addResoGraph(mg_pfpi_res_e[k], &gr_pfpi_res_e[k], leg_pfpi_res_e[k], markerStyles.at(2), colors.at(2), "Particle-flow");
 
@@ -2056,4 +2077,9 @@
      gr_pfpi_res_eta[k] = EresGraphVsEta(&plots_pfpi_res_eta[k]);
 
+     HistogramsCollectionVsEta(&plots_trkpi_res_eeta[k], etaMin, etaMax, 0.5*ptVals.at(k), 2.0*ptVals.at(k), "trkpi", 0.0, 2.0);
+     GetEresVsEta<Track>(&plots_trkpi_res_eeta[k], branchPion, branchParticlePion, 211, 0.5*ptVals.at(k), 2.0*ptVals.at(k), treeReaderPion);
+     gr_trkpi_res_eeta[k] = EresGraphVsEta(&plots_trkpi_res_eeta[k]);
+
+
      s_e = Form("#pi^{ #pm}, E = %.0f GeV",ptVals.at(k));
      if(ptVals.at(k) >= 1000.) s_e = Form("#pi^{ #pm}, E = %.0f TeV",ptVals.at(k)/1000.);
@@ -2063,5 +2089,5 @@
 
      addResoGraph(mg_pfpi_res_eta[k], &gr_hcal_res_eta[k], leg_pfpi_res_eta[k], markerStyles.at(0), colors.at(0), "HCAL");
-     addResoGraph(mg_pfpi_res_eta[k], &gr_trkpi_res_eta[k], leg_pfpi_res_eta[k], markerStyles.at(1), colors.at(1), "Track");
+     addResoGraph(mg_pfpi_res_eta[k], &gr_trkpi_res_eeta[k], leg_pfpi_res_eta[k], markerStyles.at(1), colors.at(1), "Track");
      addResoGraph(mg_pfpi_res_eta[k], &gr_pfpi_res_eta[k], leg_pfpi_res_eta[k], markerStyles.at(2), colors.at(2), "Particle-flow");
 
@@ -2418,4 +2444,5 @@
     c_recpho_eff_eta->Print(figPath+"img_recpho_eff_eta.png","png");
 
+
     /////////////////////////////////////////
     // B-jets  Efficiency/ mistag rates   ///
@@ -2482,6 +2509,4 @@
     c_recbjet_eff_eta->Print(figPath+"img_recbjet_eff_eta.png","png");
 
-
-
     // ------ c - mistag  ------
 
@@ -2560,5 +2585,5 @@
     for (k = 0; k < etaVals.size()-1; k++)
     {
-       
+
        h_recbjet_lmis_pt = GetEffPt<Jet>(branchJet, branchParticleJet, "Jet", 1, ptMin, ptMax, etaVals.at(k), etaVals.at(k+1), treeReaderJet);
        gr_recbjet_lmis_pt[k] = TGraphErrors(h_recbjet_lmis_pt);
@@ -2589,5 +2614,5 @@
 
     mg_recbjet_lmis_pt->Draw("APE");
-    DrawAxis(mg_recbjet_lmis_pt, leg_recbjet_lmis_pt, ptMin, ptMax, 0.0, 0.005, "p_{T} [GeV]", "light - mistag rate (%)", true, false);
+    DrawAxis(mg_recbjet_lmis_pt, leg_recbjet_lmis_pt, ptMin, ptMax, 0.0, 0.5, "p_{T} [GeV]", "light - mistag rate (%)", true, false);
     leg_recbjet_lmis_pt->Draw();
     pave->Draw();
@@ -2600,5 +2625,5 @@
 
     mg_recbjet_lmis_eta->Draw("APE");
-    DrawAxis(mg_recbjet_lmis_eta, leg_recbjet_lmis_eta, etaMin, etaMax, 0.0, 0.005, " #eta ", "light - mistag rate (%)", false, false);
+    DrawAxis(mg_recbjet_lmis_eta, leg_recbjet_lmis_eta, etaMin, etaMax, 0.0, 0.5, " #eta ", "light - mistag rate (%)", false, false);
     leg_recbjet_lmis_eta->Draw();
     pave->Draw();
@@ -2718,5 +2743,5 @@
 
     mg_rectaujet_mis_pt->Draw("APE");
-    DrawAxis(mg_rectaujet_mis_pt, leg_rectaujet_mis_pt, ptMin, ptMax, 0.0, 10., "p_{T} [GeV]", "#tau - mistag(%)", true, false);
+    DrawAxis(mg_rectaujet_mis_pt, leg_rectaujet_mis_pt, ptMin, ptMax, 0.0, 5., "p_{T} [GeV]", "#tau - mistag(%)", true, false);
     leg_rectaujet_mis_pt->Draw();
     pave->Draw();
@@ -2750,5 +2775,5 @@
        plots_trkpi_res_pt[k].at(bin).resolHist->Write();
        plots_trkele_res_pt[k].at(bin).resolHist->Write();
-	   plots_trkmu_res_pt[k].at(bin).resolHist->Write();
+       plots_trkmu_res_pt[k].at(bin).resolHist->Write();
        plots_ecal_res_e[k].at(bin).resolHist->Write();
        plots_hcal_res_e[k].at(bin).resolHist->Write();
@@ -2780,4 +2805,7 @@
 
   fout->Write();
+
+
+
 
   cout << "** Exiting..." << endl;
