Index: trunk/classes/DelphesClasses.cc
===================================================================
--- trunk/classes/DelphesClasses.cc	(revision 1371)
+++ trunk/classes/DelphesClasses.cc	(revision 1372)
@@ -112,5 +112,5 @@
   Position(0.0, 0.0, 0.0, 0.0),
   Dxy(0),SDxy(0),Xd(0),Yd(0),Zd(0),
-  Tau1(0.0), Tau2(0.0), Tau3(0.0), Tau4(0.0), Tau5(0.0), 
+  Tau1(0.0), Tau2(0.0), Tau3(0.0), Tau4(0.0), Tau5(0.0),
   Area(0.0, 0.0, 0.0, 0.0),
   NCharged(0),
@@ -241,5 +241,5 @@
   object.Tau4 = Tau4;
   object.Tau5 = Tau5;
- 
+
   object.fFactory = fFactory;
   object.fArray = 0;
@@ -303,5 +303,5 @@
   Tau4 = 0.0;
   Tau5 = 0.0;
- 
+
   fArray = 0;
 }
Index: trunk/classes/DelphesClasses.h
===================================================================
--- trunk/classes/DelphesClasses.h	(revision 1371)
+++ trunk/classes/DelphesClasses.h	(revision 1372)
@@ -107,5 +107,4 @@
   Int_t IsPU; // 0 or 1 for particles from pile-up interactions
 
-
   Int_t M1; // particle 1st mother | hepevt.jmohep[number][0] - 1
   Int_t M2; // particle 2nd mother | hepevt.jmohep[number][1] - 1
@@ -299,12 +298,4 @@
 
   Float_t EhadOverEem; // ratio of the hadronic versus electromagnetic energy deposited in the calorimeter
-
-  TRefArray Constituents; // references to constituents
-  TRefArray Particles; // references to generated particles
-
-  static CompBase *fgCompare; //!
-  const CompBase *GetCompare() const { return fgCompare; }
-
-  TLorentzVector P4();
 
   // -- PileUpJetID variables ---
@@ -319,10 +310,18 @@
 
  // -- Nsubjettiness variables ---
-  
-  Float_t Tau1; 
-  Float_t Tau2; 
-  Float_t Tau3; 
-  Float_t Tau4; 
-  Float_t Tau5; 
+
+  Float_t Tau1;
+  Float_t Tau2;
+  Float_t Tau3;
+  Float_t Tau4;
+  Float_t Tau5;
+
+  TRefArray Constituents; // references to constituents
+  TRefArray Particles; // references to generated particles
+
+  static CompBase *fgCompare; //!
+  const CompBase *GetCompare() const { return fgCompare; }
+
+  TLorentzVector P4();
 
   ClassDef(Jet, 2)
@@ -355,5 +354,5 @@
   Float_t ZOuter; // track position (z component) at the tracker edge
   Float_t TOuter; // track position (z component) at the tracker edge
-  
+
   Float_t Dxy;     // track signed transverse impact parameter
   Float_t SDxy;    // signed error on the track signed transverse impact parameter
@@ -369,5 +368,5 @@
   TLorentzVector P4();
 
-  ClassDef(Track, 1)
+  ClassDef(Track, 2)
 };
 
@@ -456,10 +455,10 @@
 
   TLorentzVector Momentum, Position, Area;
-  
-  Float_t  Dxy;    
-  Float_t  SDxy;   
-  Float_t  Xd;     
-  Float_t  Yd;     
-  Float_t  Zd;     
+
+  Float_t  Dxy;
+  Float_t  SDxy;
+  Float_t  Xd;
+  Float_t  Yd;
+  Float_t  Zd;
 
   // PileUpJetID variables
@@ -472,13 +471,9 @@
   Float_t  PTD;
   Float_t  FracPt[5];
- 
+
   // -- Nsubjettiness variables ---
- 
-  Float_t Tau1;
-  Float_t Tau2;
-  Float_t Tau3;
-  Float_t Tau4;
-  Float_t Tau5;
- 
+
+  Float_t Tau[5];
+
   static CompBase *fgCompare; //!
   const CompBase *GetCompare() const { return fgCompare; }
@@ -499,5 +494,5 @@
   void SetFactory(DelphesFactory *factory) { fFactory = factory; }
 
-  ClassDef(Candidate, 1)
+  ClassDef(Candidate, 2)
 };
 
Index: trunk/modules/FastJetFinder.cc
===================================================================
--- trunk/modules/FastJetFinder.cc	(revision 1371)
+++ trunk/modules/FastJetFinder.cc	(revision 1372)
@@ -47,5 +47,5 @@
 #include "fastjet/plugins/CDFCones/fastjet/CDFJetCluPlugin.hh"
 
-#include "fastjet/contribs/Nsubjettiness/Nsubjettiness.hh" 
+#include "fastjet/contribs/Nsubjettiness/Nsubjettiness.hh"
 #include "fastjet/contribs/Nsubjettiness/Njettiness.hh"
 #include "fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh"
@@ -76,9 +76,9 @@
 void FastJetFinder::Init()
 {
-  
+
   JetDefinition::Plugin *plugin = NULL;
   JetDefinition::Recombiner *recomb = NULL;
   NjettinessPlugin *njet_plugin = NULL;
-  
+
   // read eta ranges
 
@@ -110,15 +110,15 @@
 
   //-- N(sub)jettiness parameters --
-  
+
   fComputeNsubjettiness = GetBool("ComputeNsubjettiness", false);
   fBeta = GetDouble("Beta", 1.0);
   fAxisMode = GetInt("AxisMode", 1);
-  fRcutOff = GetDouble("RcutOff", 0.8); //used only if Njettiness is used as jet clustering algo (case 8)
-  fN = GetInt("N", 2);                  //used only if Njettiness is used as jet clustering algo (case 8)
-  
+  fRcutOff = GetDouble("RcutOff", 0.8); // used only if Njettiness is used as jet clustering algo (case 8)
+  fN = GetInt("N", 2);                  // used only if Njettiness is used as jet clustering algo (case 8)
+
   // ---  Jet Area Parameters ---
   fAreaAlgorithm = GetInt("AreaAlgorithm", 0);
   fComputeRho = GetBool("ComputeRho", false);
-  
+
   // - ghost based areas -
   fGhostEtaMax = GetDouble("GhostEtaMax", 5.0);
@@ -128,5 +128,5 @@
   fPtScatter = GetDouble("PtScatter", 0.1);
   fMeanGhostPt = GetDouble("MeanGhostPt", 1.0E-100);
-  
+
   // - voronoi based areas -
   fEffectiveRfact = GetDouble("EffectiveRfact", 1.0);
@@ -188,10 +188,9 @@
       break;
   }
- 
 
   fPlugin = plugin;
   fRecomb = recomb;
   fNjettinessPlugin = njet_plugin;
-  
+
   ClusterSequence::print_banner();
 
@@ -299,5 +298,5 @@
     inputList.clear();
     inputList = sequence->constituents(*itOutputList);
-      
+
     for(itInputList = inputList.begin(); itInputList != inputList.end(); ++itInputList)
     {
@@ -308,11 +307,11 @@
       if(deta > detaMax) detaMax = deta;
       if(dphi > dphiMax) dphiMax = dphi;
-      
+
       time += TMath::Sqrt(constituent->Momentum.E())*(constituent->Position.T());
       weightTime += TMath::Sqrt(constituent->Momentum.E());
-    
+
       candidate->AddCandidate(constituent);
     }
-   
+
     avTime = time/weightTime;
 
@@ -325,27 +324,39 @@
 
     // --- compute N-subjettiness with N = 1,2,3,4,5 ----
-    
+
     if(fComputeNsubjettiness)
     {
       Njettiness::AxesMode axisMode;
-     
-      if (fAxisMode == 1) axisMode = Njettiness::wta_kt_axes;
-      if (fAxisMode == 2) axisMode = Njettiness::onepass_wta_kt_axes;
-      if (fAxisMode == 3) axisMode = Njettiness::kt_axes;
-      if (fAxisMode == 4) axisMode = Njettiness::onepass_kt_axes;
-       
+
+      switch(fAxisMode)
+      {
+        default:
+        case 1:
+          axisMode = Njettiness::wta_kt_axes;
+          break;
+        case 2:
+          axisMode = Njettiness::onepass_wta_kt_axes;
+          break;
+        case 3:
+          axisMode = Njettiness::kt_axes;
+          break;
+        case 4:
+          axisMode = Njettiness::onepass_kt_axes;
+          break;
+      }
+
       Njettiness::MeasureMode measureMode = Njettiness::unnormalized_measure;
-      
+
       Nsubjettiness nSub1(1, axisMode, measureMode, fBeta);
       Nsubjettiness nSub2(2, axisMode, measureMode, fBeta);
-      Nsubjettiness nSub3(3, axisMode, measureMode, fBeta); 
-      Nsubjettiness nSub4(4, axisMode, measureMode, fBeta); 
-      Nsubjettiness nSub5(5, axisMode, measureMode, fBeta); 
-    
-      candidate -> Tau1 = nSub1(*itOutputList);
-      candidate -> Tau2 = nSub2(*itOutputList);
-      candidate -> Tau3 = nSub3(*itOutputList);
-      candidate -> Tau4 = nSub4(*itOutputList);
-      candidate -> Tau5 = nSub5(*itOutputList);
+      Nsubjettiness nSub3(3, axisMode, measureMode, fBeta);
+      Nsubjettiness nSub4(4, axisMode, measureMode, fBeta);
+      Nsubjettiness nSub5(5, axisMode, measureMode, fBeta);
+
+      candidate->Tau[0] = nSub1(*itOutputList);
+      candidate->Tau[1] = nSub2(*itOutputList);
+      candidate->Tau[2] = nSub3(*itOutputList);
+      candidate->Tau[3] = nSub4(*itOutputList);
+      candidate->Tau[4] = nSub5(*itOutputList);
     }
 
Index: trunk/modules/FastJetFinder.h
===================================================================
--- trunk/modules/FastJetFinder.h	(revision 1371)
+++ trunk/modules/FastJetFinder.h	(revision 1372)
@@ -43,5 +43,5 @@
   void *fRecomb; //!
   void *fNjettinessPlugin; //!
-  
+
   fastjet::JetDefinition *fDefinition; //!
 
@@ -59,11 +59,11 @@
 
   //-- N (sub)jettiness parameters --
-  
+
   Bool_t fComputeNsubjettiness;
   Double_t fBeta;
   Int_t fAxisMode;
-  Double_t fRcutOff; 
+  Double_t fRcutOff;
   Int_t fN ;
-  
+
   // --- FastJet Area method --------
 
Index: trunk/modules/ImpactParameterSmearing.cc
===================================================================
--- trunk/modules/ImpactParameterSmearing.cc	(revision 1371)
+++ trunk/modules/ImpactParameterSmearing.cc	(revision 1372)
@@ -121,5 +121,5 @@
   
     ddxy = gRandom->Gaus(0,fFormula->Eval(pt, eta));
-    ddz  = gRandom->Gaus(0,fFormula->Eval(pt, eta));
+    ddz = gRandom->Gaus(0,fFormula->Eval(pt, eta));
   
     //fill smeared values in candidate
@@ -127,16 +127,13 @@
     
     candidate = static_cast<Candidate*>(candidate->Clone());
-    candidate -> Xd = xd;
-    candidate -> Yd = yd;
-    candidate -> Zd = zd;
+    candidate->Xd = xd;
+    candidate->Yd = yd;
+    candidate->Zd = zd;
     
-    candidate -> Dxy = dxy;
-    candidate -> SDxy = ddxy;
+    candidate->Dxy = dxy;
+    candidate->SDxy = ddxy;
       
     candidate->AddCandidate(mother);
     fOutputArray->Add(candidate);
-    
-    
-    
   }
 }
Index: trunk/modules/TrackCountingBTagging.cc
===================================================================
--- trunk/modules/TrackCountingBTagging.cc	(revision 1371)
+++ trunk/modules/TrackCountingBTagging.cc	(revision 1372)
@@ -2,5 +2,5 @@
 /** \class TrackCountingBTagging
  *
- *  btagging algorithm based on counting tracks with large impact parameterDetermines origin of jet,
+ *  b-tagging algorithm based on counting tracks with large impact parameter
  *
  *  $Date: 2014-03-27 12:39:14 +0200 (Fri, 27 March 2014) $
@@ -25,5 +25,5 @@
 #include "TLorentzVector.h"
 
-#include <algorithm> 
+#include <algorithm>
 #include <stdexcept>
 #include <iostream>
@@ -31,5 +31,4 @@
 
 using namespace std;
-
 
 //------------------------------------------------------------------------------
@@ -50,19 +49,18 @@
 void TrackCountingBTagging::Init()
 {
- 
   fBitNumber = GetInt("BitNumber", 0);
-  
+
   fPtMin     = GetDouble("TrackPtMin", 1.0);
   fDeltaR    = GetDouble("DeltaR", 0.3);
   fIPmax     = GetDouble("TrackIPMax", 2.0);
-  
+
   fSigMin    = GetDouble("SigMin", 6.5);
-  fNtracks   = GetInt("Ntracks", 3); 
-   
+  fNtracks   = GetInt("Ntracks", 3);
+
   // import input array(s)
 
   fTrackInputArray = ImportArray(GetString("TrackInputArray", "Calorimeter/eflowTracks"));
   fItTrackInputArray = fTrackInputArray->MakeIterator();
-  
+
   fJetInputArray = ImportArray(GetString("JetInputArray", "FastJetFinder/jets"));
   fItJetInputArray = fJetInputArray->MakeIterator();
@@ -82,13 +80,13 @@
 {
   Candidate *jet, *track;
-  
+
   Double_t jpx, jpy;
   Double_t dr, tpx, tpy, tpt;
   Double_t xd, yd, dxy, ddxy, ip, sip;
- 
+
   Int_t sign;
- 
+
   Int_t count;
- 
+
   // loop over all input jets
   fItJetInputArray->Reset();
@@ -98,5 +96,5 @@
     jpx = jetMomentum.Px();
     jpy = jetMomentum.Py();
-    
+
     // loop over all input tracks
     fItTrackInputArray->Reset();
@@ -104,32 +102,31 @@
     while((track = static_cast<Candidate*>(fItTrackInputArray->Next())))
     {
-     const TLorentzVector &trkMomentum = track->Momentum;
-     
-     dr = jetMomentum.DeltaR(trkMomentum);
-     
-     tpt = trkMomentum.Pt();
-     tpx = trkMomentum.Px();
-     tpy = trkMomentum.Py();
-    
-     xd   = track->Xd;
-     yd   = track->Yd;
-     dxy  = TMath::Abs(track->Dxy);
-     ddxy = track->SDxy;
-     
-     if( tpt < fPtMin ) continue;
-     if( dr  > fDeltaR ) continue;
-     if( dxy > fIPmax ) continue;
-        
-     sign  = ( jpx*xd + jpy*yd > 0.0 ) ? 1 : -1;
-	
-     ip  = sign*dxy;
-     sip = ip / TMath::Abs(ddxy);
-     
-     if( sip > fSigMin ) count++;
-     
+      const TLorentzVector &trkMomentum = track->Momentum;
+
+      dr = jetMomentum.DeltaR(trkMomentum);
+
+      tpt = trkMomentum.Pt();
+      tpx = trkMomentum.Px();
+      tpy = trkMomentum.Py();
+
+      xd   = track->Xd;
+      yd   = track->Yd;
+      dxy  = TMath::Abs(track->Dxy);
+      ddxy = track->SDxy;
+
+      if(tpt < fPtMin) continue;
+      if(dr  > fDeltaR) continue;
+      if(dxy > fIPmax) continue;
+
+      sign  = (jpx*xd + jpy*yd > 0.0) ? 1 : -1;
+
+      ip  = sign*dxy;
+      sip = ip / TMath::Abs(ddxy);
+
+      if(sip > fSigMin) count++;
     }
-     
+
     // set BTag flag to true if count >= Ntracks
-    jet->BTag |= ( count >= fNtracks ) << fBitNumber;
+    jet->BTag |= (count >= fNtracks) << fBitNumber;
   }
 }
Index: trunk/modules/TrackCountingBTagging.h
===================================================================
--- trunk/modules/TrackCountingBTagging.h	(revision 1371)
+++ trunk/modules/TrackCountingBTagging.h	(revision 1372)
@@ -4,5 +4,5 @@
 /** \class TrackCountingBTagging
  *
- *  btagging algorithm based on counting tracks with large impact parameter
+ *  b-tagging algorithm based on counting tracks with large impact parameter
  *
  *  $Date: 2014-03-27 12:39:14 +0200 (Fri, 27 March 2014) $
@@ -35,5 +35,5 @@
 
   Int_t fBitNumber;
-  
+
   Double_t fPtMin;
   Double_t fDeltaR;
@@ -41,5 +41,5 @@
   Double_t fSigMin;
   Int_t    fNtracks;
-  
+
   TIterator *fItTrackInputArray; //!
   TIterator *fItJetInputArray; //!
@@ -47,5 +47,5 @@
   const TObjArray *fTrackInputArray; //!
   const TObjArray *fJetInputArray; //!
-  
+
   ClassDef(TrackCountingBTagging, 1)
 };
Index: trunk/modules/TreeWriter.cc
===================================================================
--- trunk/modules/TreeWriter.cc	(revision 1371)
+++ trunk/modules/TreeWriter.cc	(revision 1372)
@@ -280,7 +280,7 @@
     entry->Dxy = candidate->Dxy;
     entry->SDxy = candidate->SDxy ;
-    entry->Xd = candidate -> Xd;
-    entry->Yd = candidate -> Yd;
-    entry->Zd = candidate -> Zd;
+    entry->Xd = candidate->Xd;
+    entry->Yd = candidate->Yd;
+    entry->Zd = candidate->Zd;
    
     const TLorentzVector &momentum = candidate->Momentum;
@@ -473,6 +473,4 @@
 
     entry->T = position.T()*1.0E-3/c_light;
-
-   // cout<<entry->PT<<","<<entry->T<<endl;
 
     entry->Charge = candidate->Charge;
@@ -557,9 +555,9 @@
     //--- N-subjettiness variables ----
     
-    entry->Tau1 = candidate->Tau1;
-    entry->Tau2 = candidate->Tau2;
-    entry->Tau3 = candidate->Tau3;
-    entry->Tau4 = candidate->Tau4;
-    entry->Tau5 = candidate->Tau5;
+    entry->Tau1 = candidate->Tau[0];
+    entry->Tau2 = candidate->Tau[1];
+    entry->Tau3 = candidate->Tau[2];
+    entry->Tau4 = candidate->Tau[3];
+    entry->Tau5 = candidate->Tau[4];
    
     FillParticles(candidate, &entry->Particles);
