Index: trunk/interface/SmearUtil.h
===================================================================
--- trunk/interface/SmearUtil.h	(revision 286)
+++ trunk/interface/SmearUtil.h	(revision 287)
@@ -217,5 +217,6 @@
 
   /// Number of tracks in tau jet algo
-  unsigned int NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
+  //unsigned int NumTracks(float& charge, const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
+  unsigned int NumTracks(float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi);
 
   /// b-jets
@@ -226,5 +227,6 @@
 
   /// Lepton isolation
-  bool Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
+  //bool Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
+  bool Isolation(const float phi, const float eta,const vector<TRootTracks> &tracks, const float PT_TRACK2);
 
   //********************* returns a segmented value for eta and phi, for calo towers *****
Index: trunk/src/SmearUtil.cc
===================================================================
--- trunk/src/SmearUtil.cc	(revision 286)
+++ trunk/src/SmearUtil.cc	(revision 287)
@@ -985,17 +985,37 @@
 // 	2) be inside a cone with a radius R and the axis defined by (eta,phi)
 // IMPORTANT REMARK !!!!!
-// previously, the argument 'phi' was before the argument 'eta'
-// this has been changed for consistency with the other functions
-// double check your running code that uses NumTracks !
-unsigned int RESOLution::NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi) {
-  unsigned int numtrack=0;
+// NEW : "charge" will contain the sum of all charged tracks in the cone TAU_track_scone
+unsigned int RESOLution::NumTracks(float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi) {
+  unsigned int numbtrack=0; // number of track in the tau-jet cone, which is smaller than R;
+  charge=0;
   for(unsigned int i=0; i < tracks.size(); i++) { 
-      if((tracks[i].Pt() < pt_track )||
-	 (DeltaR(phi,eta,tracks[i].Phi(),tracks[i].Eta()) > TAU_track_scone)
-        )continue;
-      numtrack++;
-  }
-  return numtrack;
-}
+      if(tracks[i].PT < pt_track ) continue;
+      float dr = DeltaR(phi,eta,tracks[i].Phi,tracks[i].Eta);
+      if (dr > TAU_track_scone) continue; 
+	numbtrack++;
+      	charge += tracks[i].Charge; // total charge in the cone for Tau-jet
+  }
+  return numbtrack;
+}
+/*
+unsigned int RESOLution::NumTracks(unsigned int& NumTracksR, float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi, const float R) {
+  unsigned int numbtrack=0; // number of track in the tau-jet cone, which is smaller than R;
+  charge=0;      NumTracksR=0; // total number of tracks
+  if (R<TAU_track_scone) cout << "Warning: jet radius smaller than tau-jet radius in RESOLution::NumTracks\n";
+  for(unsigned int i=0; i < tracks.size(); i++) {
+      if(tracks[i].PT < pt_track ) continue;
+      float dr = DeltaR(phi,eta,tracks[i].Phi,tracks[i].Eta);
+      if (dr > R) continue;
+
+      NumTracksR++;
+      if(dr < TAU_track_scone) {// previously R==TAU_track_scone, for tau-jets only
+        numbtrack++;
+        charge += tracks[i].Charge; // total charge in the cone for Tau-jet
+      }
+
+  }
+  return numbtrack;
+}
+*/
 
 
@@ -1029,5 +1049,6 @@
 //***********************Isolation criteria***********************
 //****************************************************************
-bool RESOLution::Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks, const float pt_second_track)
+//bool RESOLution::Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks, const float pt_second_track)
+bool RESOLution::Isolation(const float phi, const float eta,const vector<TRootTracks> &tracks, const float pt_second_track)
 {
    bool isolated = false;
@@ -1036,6 +1057,6 @@
    for(unsigned int i=0; i < tracks.size(); i++) 
       {
-       if(tracks[i].Pt() < pt_second_track)continue;
-       float genDeltaR = DeltaR(phi,eta,tracks[i].Phi(),tracks[i].Eta()); 
+       if(tracks[i].PT < pt_second_track)continue;
+       float genDeltaR = DeltaR(phi,eta,tracks[i].Phi,tracks[i].Eta); 
          if(
              (genDeltaR > deltar) ||
