Index: classes/DelphesClasses.cc
===================================================================
--- classes/DelphesClasses.cc	(revision 666d7956227a7de702863f32a3d79046f190a264)
+++ classes/DelphesClasses.cc	(revision de6d698e6d53b2d96cd7ccf120327db54ee5c205)
@@ -129,4 +129,7 @@
   NCharged(0),
   NNeutrals(0),
+  NSubJetsTrimmed(0),
+  NSubJetsPruned(0), 
+  NSubJetsSoftDropped(0), 
   Beta(0),
   BetaStar(0),
@@ -157,4 +160,19 @@
   Tau[3] = 0.0;
   Tau[4] = 0.0;
+  TrimmedP4[0] = 0.0;
+  TrimmedP4[1] = 0.0;
+  TrimmedP4[2] = 0.0;
+  TrimmedP4[3] = 0.0;
+  TrimmedP4[4] = 0.0;
+  PrunedP4[0] = 0.0;
+  PrunedP4[1] = 0.0;
+  PrunedP4[2] = 0.0;
+  PrunedP4[3] = 0.0;
+  PrunedP4[4] = 0.0;
+  SoftDroppedP4[0] = 0.0;
+  SoftDroppedP4[1] = 0.0;
+  SoftDroppedP4[2] = 0.0;
+  SoftDroppedP4[3] = 0.0;
+  SoftDroppedP4[4] = 0.0;
 }
 
@@ -274,8 +292,27 @@
   object.Tau[3] = Tau[3];
   object.Tau[4] = Tau[4];
+  
+  object.TrimmedP4[0] = TrimmedP4[0];
+  object.TrimmedP4[1] = TrimmedP4[1];
+  object.TrimmedP4[2] = TrimmedP4[2];
+  object.TrimmedP4[3] = TrimmedP4[3];
+  object.TrimmedP4[4] = TrimmedP4[4];
+  object.PrunedP4[0] = PrunedP4[0];
+  object.PrunedP4[1] = PrunedP4[1];
+  object.PrunedP4[2] = PrunedP4[2];
+  object.PrunedP4[3] = PrunedP4[3];
+  object.PrunedP4[4] = PrunedP4[4];
+  object.SoftDroppedP4[0] = SoftDroppedP4[0];
+  object.SoftDroppedP4[1] = SoftDroppedP4[1];
+  object.SoftDroppedP4[2] = SoftDroppedP4[2];
+  object.SoftDroppedP4[3] = SoftDroppedP4[3];
+  object.SoftDroppedP4[4] = SoftDroppedP4[4];
+
+  object.NSubJetsTrimmed     = NSubJetsTrimmed;
+  object.NSubJetsPruned      = NSubJetsPruned;
+  object.NSubJetsSoftDropped = NSubJetsSoftDropped;
 
   object.fFactory = fFactory;
   object.fArray = 0;
-
 
   // Copy cluster timing info
@@ -351,5 +388,24 @@
   Tau[3] = 0.0;
   Tau[4] = 0.0;
-
+  
+  TrimmedP4[0]= 0.0;
+  TrimmedP4[1]= 0.0;
+  TrimmedP4[2]= 0.0;
+  TrimmedP4[3]= 0.0;
+  TrimmedP4[4]= 0.0;
+  PrunedP4[0]= 0.0;
+  PrunedP4[1]= 0.0;
+  PrunedP4[2]= 0.0;
+  PrunedP4[3]= 0.0;
+  PrunedP4[4]= 0.0;
+  SoftDroppedP4[0]= 0.0;
+  SoftDroppedP4[1]= 0.0;
+  SoftDroppedP4[2]= 0.0;
+  SoftDroppedP4[3]= 0.0;
+  SoftDroppedP4[4]= 0.0;
+  NSubJetsTrimmed     = 0;
+  NSubJetsPruned      = 0;
+  NSubJetsSoftDropped = 0;
+  
   fArray = 0;
 }
Index: classes/DelphesClasses.h
===================================================================
--- classes/DelphesClasses.h	(revision 666d7956227a7de702863f32a3d79046f190a264)
+++ classes/DelphesClasses.h	(revision de6d698e6d53b2d96cd7ccf120327db54ee5c205)
@@ -349,5 +349,13 @@
 
   Float_t Tau[5]; // N-subjettiness
- 
+  
+  TLorentzVector TrimmedP4[5]; //first entry (i = 0) is the total Trimmed Jet 4-momenta and from i = 1 to 4 are the trimmed subjets 4-momenta
+  TLorentzVector PrunedP4[5]; //first entry (i = 0) is the total Pruned Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
+  TLorentzVector SoftDroppedP4[5]; //first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
+  
+  Int_t    NSubJetsTrimmed; // number of subjets trimmed 
+  Int_t    NSubJetsPruned; // number of subjets pruned 
+  Int_t    NSubJetsSoftDropped; // number of subjets soft-dropped 
+   
   TRefArray Constituents; // references to constituents
   TRefArray Particles; // references to generated particles
@@ -527,6 +535,14 @@
   Float_t Tau[5];
   
-  
-  
+  // Other Substructure variables
+  
+  TLorentzVector TrimmedP4[5]; //first entry (i = 0) is the total Trimmed Jet 4-momenta and from i = 1 to 4 are the trimmed subjets 4-momenta
+  TLorentzVector PrunedP4[5]; //first entry (i = 0) is the total Pruned Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
+  TLorentzVector SoftDroppedP4[5]; //first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
+ 
+  Int_t    NSubJetsTrimmed; // number of subjets trimmed 
+  Int_t    NSubJetsPruned; // number of subjets pruned 
+  Int_t    NSubJetsSoftDropped; // number of subjets soft-dropped 
+
 
   static CompBase *fgCompare; //!
@@ -548,5 +564,5 @@
   void SetFactory(DelphesFactory *factory) { fFactory = factory; }
 
-  ClassDef(Candidate, 2)
+  ClassDef(Candidate, 3)
 };
 
Index: modules/FastJetFinder.cc
===================================================================
--- modules/FastJetFinder.cc	(revision 666d7956227a7de702863f32a3d79046f190a264)
+++ modules/FastJetFinder.cc	(revision de6d698e6d53b2d96cd7ccf120327db54ee5c205)
@@ -66,4 +66,8 @@
 #include "fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.hh"
 
+#include "fastjet/tools/Filter.hh"
+#include "fastjet/tools/Pruner.hh"
+#include "fastjet/contribs/RecursiveTools/SoftDrop.hh"
+
 using namespace std;
 using namespace fastjet;
@@ -121,4 +125,26 @@
   fN = GetInt("N", 2);                  // used only if Njettiness is used as jet clustering algo (case 8)
 
+  //-- Trimming parameters --
+  
+  fComputeTrimming = GetBool("ComputeTrimming", false);
+  fRTrim = GetDouble("RTrim", 0.2);
+  fPtFracTrim = GetDouble("PtFracTrim", 0.05);
+  
+
+  //-- Pruning parameters --
+  
+  fComputePruning = GetBool("ComputePruning", false);
+  fZcutPrun = GetDouble("ZcutPrun", 0.1);
+  fRcutPrun = GetDouble("RcutPrun", 0.5);
+  fRPrun = GetDouble("RPrun", 0.8);
+ 
+  //-- SoftDrop parameters --
+  
+  fComputeSoftDrop     = GetBool("ComputeSoftDrop", false);
+  fBetaSoftDrop        = GetDouble("BetaSoftDrop", 0.0);
+  fSymmetryCutSoftDrop = GetDouble("SymmetryCutSoftDrop", 0.1);
+  fR0SoftDrop= GetDouble("R0SoftDrop=", 0.8);
+  
+
   // ---  Jet Area Parameters ---
   fAreaAlgorithm = GetInt("AreaAlgorithm", 0);
@@ -260,5 +286,5 @@
   PseudoJet jet, area;
   ClusterSequence *sequence;
-  vector< PseudoJet > inputList, outputList;
+  vector< PseudoJet > inputList, outputList, subjets;
   vector< PseudoJet >::iterator itInputList, itOutputList;
   vector< TEstimatorStruct >::iterator itEstimators;
@@ -352,5 +378,85 @@
     candidate->DeltaEta = detaMax;
     candidate->DeltaPhi = dphiMax;
-
+       
+    //------------------------------------
+    // Trimming
+    //------------------------------------
+
+     if(fComputeTrimming)
+    {
+
+      fastjet::Filter    trimmer(fastjet::JetDefinition(fastjet::kt_algorithm,fRTrim),fastjet::SelectorPtFractionMin(fPtFracTrim));
+      fastjet::PseudoJet trimmed_jet = trimmer(*itOutputList);
+      
+      trimmed_jet = join(trimmed_jet.constituents());
+     
+      candidate->TrimmedP4[0].SetPtEtaPhiM(trimmed_jet.pt(), trimmed_jet.eta(), trimmed_jet.phi(), trimmed_jet.m());
+        
+      // four hardest subjets 
+      subjets.clear();
+      subjets = trimmed_jet.pieces();
+      subjets = sorted_by_pt(subjets);
+      
+      candidate->NSubJetsTrimmed = subjets.size();
+
+      for (size_t i = 0; i < subjets.size() and i < 4; i++){
+	if(subjets.at(i).pt() < 0) continue ; 
+ 	candidate->TrimmedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
+      }
+    }
+    
+    
+    //------------------------------------
+    // Pruning
+    //------------------------------------
+    
+    
+    if(fComputePruning)
+    {
+
+      fastjet::Pruner    pruner(fastjet::JetDefinition(fastjet::cambridge_algorithm,fRPrun),fZcutPrun,fRcutPrun);
+      fastjet::PseudoJet pruned_jet = pruner(*itOutputList);
+
+      candidate->PrunedP4[0].SetPtEtaPhiM(pruned_jet.pt(), pruned_jet.eta(), pruned_jet.phi(), pruned_jet.m());
+         
+      // four hardest subjet 
+      subjets.clear();
+      subjets = pruned_jet.pieces();
+      subjets = sorted_by_pt(subjets);
+      
+      candidate->NSubJetsPruned = subjets.size();
+
+      for (size_t i = 0; i < subjets.size() and i < 4; i++){
+	if(subjets.at(i).pt() < 0) continue ; 
+  	candidate->PrunedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
+      }
+
+    } 
+     
+    //------------------------------------
+    // SoftDrop
+    //------------------------------------
+   
+    if(fComputeSoftDrop)
+    {
+    
+      contrib::SoftDrop  softDrop(fBetaSoftDrop,fSymmetryCutSoftDrop,fR0SoftDrop);
+      fastjet::PseudoJet softdrop_jet = softDrop(*itOutputList);
+      
+      candidate->SoftDroppedP4[0].SetPtEtaPhiM(softdrop_jet.pt(), softdrop_jet.eta(), softdrop_jet.phi(), softdrop_jet.m());
+        
+      // four hardest subjet 
+      
+      subjets.clear();
+      subjets    = softdrop_jet.pieces();
+      subjets    = sorted_by_pt(subjets);
+      candidate->NSubJetsSoftDropped = softdrop_jet.pieces().size();
+
+      for (size_t i = 0; i < subjets.size()  and i < 4; i++){
+	if(subjets.at(i).pt() < 0) continue ; 
+  	candidate->SoftDroppedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
+      }
+    }
+  
     // --- compute N-subjettiness with N = 1,2,3,4,5 ----
 
Index: modules/FastJetFinder.h
===================================================================
--- modules/FastJetFinder.h	(revision 666d7956227a7de702863f32a3d79046f190a264)
+++ modules/FastJetFinder.h	(revision de6d698e6d53b2d96cd7ccf120327db54ee5c205)
@@ -83,4 +83,24 @@
   Int_t fN ;
 
+  //-- Trimming parameters --
+  
+  Bool_t fComputeTrimming;
+  Double_t fRTrim;
+  Double_t fPtFracTrim;
+  
+  //-- Pruning parameters --
+
+  Bool_t fComputePruning;
+  Double_t fZcutPrun;
+  Double_t fRcutPrun;
+  Double_t fRPrun;
+
+  //-- SoftDrop parameters --
+
+  Bool_t fComputeSoftDrop;
+  Double_t fBetaSoftDrop;
+  Double_t fSymmetryCutSoftDrop;
+  Double_t fR0SoftDrop;
+
   // --- FastJet Area method --------
 
Index: modules/TreeWriter.cc
===================================================================
--- modules/TreeWriter.cc	(revision 666d7956227a7de702863f32a3d79046f190a264)
+++ modules/TreeWriter.cc	(revision de6d698e6d53b2d96cd7ccf120327db54ee5c205)
@@ -533,4 +533,5 @@
   Double_t ecalEnergy, hcalEnergy;
   const Double_t c_light = 2.99792458E8;
+  Int_t i;
 
   array->Sort();
@@ -592,17 +593,19 @@
     entry->MeanSqDeltaR = candidate->MeanSqDeltaR;
     entry->PTD = candidate->PTD;
-    entry->FracPt[0] = candidate->FracPt[0];
-    entry->FracPt[1] = candidate->FracPt[1];
-    entry->FracPt[2] = candidate->FracPt[2];
-    entry->FracPt[3] = candidate->FracPt[3];
-    entry->FracPt[4] = candidate->FracPt[4];
-   
-    //--- N-subjettiness variables ----
     
-    entry->Tau[0] = candidate->Tau[0];
-    entry->Tau[1] = candidate->Tau[1];
-    entry->Tau[2] = candidate->Tau[2];
-    entry->Tau[3] = candidate->Tau[3];
-    entry->Tau[4] = candidate->Tau[4];
+    //--- Sub-structure variables ----
+    
+    entry->NSubJetsTrimmed     = candidate->NSubJetsTrimmed;
+    entry->NSubJetsPruned      = candidate->NSubJetsPruned; 
+    entry->NSubJetsSoftDropped = candidate->NSubJetsSoftDropped;
+    
+    for(i = 0; i < 5; i++)
+    {
+      entry->FracPt[i]        = candidate -> FracPt[i];
+      entry->Tau[i]           = candidate -> Tau[i];
+      entry->TrimmedP4[i]     = candidate -> TrimmedP4[i];
+      entry->PrunedP4[i]      = candidate -> PrunedP4[i];
+      entry->SoftDroppedP4[i] = candidate -> SoftDroppedP4[i];
+    }
    
     FillParticles(candidate, &entry->Particles);
