Index: trunk/Delphes.cpp
===================================================================
--- trunk/Delphes.cpp	(revision 16)
+++ trunk/Delphes.cpp	(revision 19)
@@ -197,7 +197,56 @@
   beamline2->add(rp420_2);
 
-  
+  // we will have four jet definitions, and the first three will be
+  // plugins
+  fastjet::JetDefinition jet_def;
+  fastjet::JetDefinition::Plugin * plugins;
+
+  switch(DET->JETALGO) {
+  default:
+  case 1: {
+
+   // set up a CDF midpoint jet definition
+   #ifdef ENABLE_PLUGIN_CDFCONES
+   plugins = new fastjet::CDFJetCluPlugin(DET->C_SEEDTHRESHOLD,DET->CONERADIUS,DET->C_ADJACENCYCUT,DET->C_MAXITERATIONS,DET->C_IRATCH,DET->C_OVERLAPTHRESHOLD);
+   jet_def = fastjet::JetDefinition(plugins);
+   #else
+   plugins = NULL;
+   #endif
+   }
+   break;
+
+   case 2: {
+
+   // set up a CDF midpoint jet definition
+   #ifdef ENABLE_PLUGIN_CDFCONES
+   plugins = new fastjet::CDFMidPointPlugin (DET->M_SEEDTHRESHOLD,DET->CONERADIUS,DET->M_CONEAREAFRACTION,DET->M_MAXPAIRSIZE,DET->M_MAXPAIRSIZE,DET->C_OVERLAPTHRESHOLD);
+   jet_def = fastjet::JetDefinition(plugins);
+   #else
+   plugins = NULL;
+   #endif
+   }
+   break;
+   case 3: {
+   // set up a siscone jet definition
+   #ifdef ENABLE_PLUGIN_SISCONE
+   int npass = 0;               // do infinite number of passes
+   double protojet_ptmin = 0.0; // use all protojets
+   plugins = new fastjet::SISConePlugin (DET->CONERADIUS,DET->C_OVERLAPTHRESHOLD,npass, protojet_ptmin);
+   jet_def = fastjet::JetDefinition(plugins);
+   #else
+   plugins = NULL;
+   #endif
+   }
+   break;
+
+  case 4: {
+  jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, DET->CONERADIUS);
+  //jet_defs[4] = fastjet::JetDefinition(fastjet::cambridge_algorithm,jet_radius);
+  //jet_defs[5] = fastjet::JetDefinition(fastjet::antikt_algorithm,jet_radius);
+  }
+  break;
+  }
  
-  // Loop over all events
+   // Loop over all events
   Long64_t entry, allEntries = treeReader->GetEntries();
   cout << "** Chain contains " << allEntries << " events" << endl;
@@ -409,56 +458,4 @@
       //*****************************
 
-      // we will have four jet definitions, and the first three will be
-      // plugins
-      fastjet::JetDefinition jet_def;
-      fastjet::JetDefinition::Plugin * plugins;
-      
-      switch(DET->JETALGO) {
-      default:
-      case 1: {
-	
-	// set up a CDF midpoint jet definition
-        #ifdef ENABLE_PLUGIN_CDFCONES
-	plugins = new fastjet::CDFJetCluPlugin(DET->C_SEEDTHRESHOLD,DET->CONERADIUS,DET->C_ADJACENCYCUT,DET->C_MAXITERATIONS,DET->C_IRATCH,DET->C_OVERLAPTHRESHOLD);
-	jet_def = fastjet::JetDefinition(plugins);
-        #else
-	plugins = NULL;
-        #endif
-	
-      } 
-	break;
-	
-      case 2: {
-	
-        // set up a CDF midpoint jet definition
-        #ifdef ENABLE_PLUGIN_CDFCONES
-        plugins = new fastjet::CDFMidPointPlugin (DET->M_SEEDTHRESHOLD,DET->CONERADIUS,DET->M_CONEAREAFRACTION,DET->M_MAXPAIRSIZE,DET->M_MAXPAIRSIZE,DET->C_OVERLAPTHRESHOLD);
-	jet_def = fastjet::JetDefinition(plugins);
-        #else
-	plugins = NULL;
-        #endif
-      }
-	break;
-	
-      case 3: {
-	// set up a siscone jet definition
-        #ifdef ENABLE_PLUGIN_SISCONE
-	int npass = 0;               // do infinite number of passes
-	double protojet_ptmin = 0.0; // use all protojets
-	plugins = new fastjet::SISConePlugin (DET->CONERADIUS,DET->C_OVERLAPTHRESHOLD,npass, protojet_ptmin);
-	jet_def = fastjet::JetDefinition(plugins);
-        #else
-        plugins = NULL;
-        #endif
-      }
-        break; 
-	
-      case 4: {
-        jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, DET->CONERADIUS);
-        //jet_defs[4] = fastjet::JetDefinition(fastjet::cambridge_algorithm,jet_radius);
-        //jet_defs[5] = fastjet::JetDefinition(fastjet::antikt_algorithm,jet_radius);
-      }
-        break;
-      }
       // run the jet clustering with the above jet definition
       if(input_particles.size()!=0)
@@ -478,4 +475,5 @@
 	TLorentzVector JET;
 	JET.SetPxPyPzE(sorted_jets[i].px(),sorted_jets[i].py(),sorted_jets[i].pz(),sorted_jets[i].E());
+        cout<<"Jet.Pt() "<<JET.Pt()<<endl;
 	elementJet->Set(JET);
 	// b-jets
