Index: Makefile
===================================================================
--- Makefile	(revision 437e999e640a98a1e904818fde2111ec3e8a9bbc)
+++ Makefile	(revision 7e227ae16c60893a6c2f0961e63583a79e2759a1)
@@ -325,4 +325,5 @@
 	modules/BTagging.h \
 	modules/TauTagging.h \
+	modules/TrackCountingTauTagging.h \
 	modules/TreeWriter.h \
 	modules/Merger.h \
@@ -816,4 +817,13 @@
 	classes/DelphesFactory.h \
 	classes/DelphesFormula.h
+tmp/modules/TrackCountingTauTagging.$(ObjSuf): \
+	modules/TrackCountingTauTagging.$(SrcSuf) \
+	modules/TrackCountingTauTagging.h \
+	classes/DelphesClasses.h \
+	classes/DelphesFactory.h \
+	classes/DelphesFormula.h \
+	external/ExRootAnalysis/ExRootResult.h \
+	external/ExRootAnalysis/ExRootFilter.h \
+	external/ExRootAnalysis/ExRootClassifier.h
 tmp/modules/TrackPileUpSubtractor.$(ObjSuf): \
 	modules/TrackPileUpSubtractor.$(SrcSuf) \
@@ -933,4 +943,5 @@
 	tmp/modules/TimeSmearing.$(ObjSuf) \
 	tmp/modules/TrackCountingBTagging.$(ObjSuf) \
+	tmp/modules/TrackCountingTauTagging.$(ObjSuf) \
 	tmp/modules/TrackPileUpSubtractor.$(ObjSuf) \
 	tmp/modules/TreeWriter.$(ObjSuf) \
@@ -1292,5 +1303,6 @@
 	external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh \
 	external/fastjet/contribs/Nsubjettiness/Njettiness.hh \
-	external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh
+	external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh \
+	external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.hh
 tmp/modules/RunPUPPI.$(ObjSuf): \
 	modules/RunPUPPI.$(SrcSuf) \
@@ -1696,4 +1708,8 @@
 	@touch $@
 
+modules/TrackCountingTauTagging.h: \
+	classes/DelphesModule.h
+	@touch $@
+
 external/fastjet/RectangularGrid.hh: \
 	external/fastjet/PseudoJet.hh \
Index: cards/delphes_card_ATLAS.tcl
===================================================================
--- cards/delphes_card_ATLAS.tcl	(revision 437e999e640a98a1e904818fde2111ec3e8a9bbc)
+++ cards/delphes_card_ATLAS.tcl	(revision 7e227ae16c60893a6c2f0961e63583a79e2759a1)
@@ -553,6 +553,7 @@
   # -2 - two or more mistag rate
  
+  set BitNumber 0
+ 
   # taken from ATL-PHYS-PUB-2015-045 (medium working point)
-     
   add EfficiencyFormula {1} {0.70}
   add EfficiencyFormula {2} {0.60}
Index: cards/delphes_card_ATLAS_PileUp.tcl
===================================================================
--- cards/delphes_card_ATLAS_PileUp.tcl	(revision 437e999e640a98a1e904818fde2111ec3e8a9bbc)
+++ cards/delphes_card_ATLAS_PileUp.tcl	(revision 7e227ae16c60893a6c2f0961e63583a79e2759a1)
@@ -674,6 +674,7 @@
   # -2 - two or more mistag rate
  
+  set BitNumber 0
+ 
   # taken from ATL-PHYS-PUB-2015-045 (medium working point)
-     
   add EfficiencyFormula {1} {0.70}
   add EfficiencyFormula {2} {0.60}
Index: modules/TauTagging.cc
===================================================================
--- modules/TauTagging.cc	(revision 437e999e640a98a1e904818fde2111ec3e8a9bbc)
+++ modules/TauTagging.cc	(revision 7e227ae16c60893a6c2f0961e63583a79e2759a1)
@@ -126,4 +126,6 @@
   Int_t i, size;
 
+  fBitNumber = GetInt("BitNumber", 0);
+
   fDeltaR = GetDouble("DeltaR", 0.5);
 
@@ -193,5 +195,5 @@
   Candidate *jet, *tau, *daughter;
   TLorentzVector tauMomentum;
-  Double_t pt, eta, phi;
+  Double_t pt, eta, phi, e;
   TObjArray *tauArray;
   map< Int_t, DelphesFormula * >::iterator itEfficiencyMap;
@@ -213,4 +215,5 @@
     phi = jetMomentum.Phi();
     pt = jetMomentum.Pt();
+    e = jetMomentum.E();
 
     // loop over all input taus
@@ -252,5 +255,6 @@
 
     // apply an efficency formula
-    jet->TauTag = gRandom->Uniform() <= formula->Eval(pt, eta);
+    jet->TauTag |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber;
+    
     // set tau charge
     jet->Charge = charge;
Index: modules/TauTagging.h
===================================================================
--- modules/TauTagging.h	(revision 437e999e640a98a1e904818fde2111ec3e8a9bbc)
+++ modules/TauTagging.h	(revision 7e227ae16c60893a6c2f0961e63583a79e2759a1)
@@ -55,5 +55,7 @@
 
 private:
-
+  
+  Int_t fBitNumber;
+  
   Double_t fDeltaR;
 
Index: modules/TrackCountingTauTagging.cc
===================================================================
--- modules/TrackCountingTauTagging.cc	(revision 437e999e640a98a1e904818fde2111ec3e8a9bbc)
+++ modules/TrackCountingTauTagging.cc	(revision 7e227ae16c60893a6c2f0961e63583a79e2759a1)
@@ -130,4 +130,6 @@
   Int_t i, size;
 
+  fBitNumber = GetInt("BitNumber", 0);
+
   fDeltaR = GetDouble("DeltaR", 0.5);
   fDeltaRTrack = GetDouble("DeltaRTrack", 0.2);
@@ -203,5 +205,5 @@
   Candidate *jet, *tau, *track, *daughter;
   TLorentzVector tauMomentum;
-  Double_t pt, eta, phi;
+  Double_t pt, eta, phi, e;
   TObjArray *tauArray;
   map< Int_t, DelphesFormula * >::iterator itEfficiencyMap;
@@ -228,4 +230,6 @@
     phi = jetMomentum.Phi();
     pt = jetMomentum.Pt();
+    e = jetMomentum.E();
+
 
 // loop over all input tracks
@@ -288,5 +292,7 @@
 
     // apply an efficency formula
-    jet->TauTag = gRandom->Uniform() <= formula->Eval(pt, eta);
+    jet->TauTag |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber;
+   
+   
     // set tau charge
     jet->Charge = charge;
Index: modules/TrackCountingTauTagging.h
===================================================================
--- modules/TrackCountingTauTagging.h	(revision 437e999e640a98a1e904818fde2111ec3e8a9bbc)
+++ modules/TrackCountingTauTagging.h	(revision 7e227ae16c60893a6c2f0961e63583a79e2759a1)
@@ -39,4 +39,6 @@
 private:
 
+  Int_t fBitNumber;
+
   Double_t fDeltaR;
   Double_t fDeltaRTrack;
