Index: trunk/src/JetUtils.cc
===================================================================
--- trunk/src/JetUtils.cc	(revision 94)
+++ trunk/src/JetUtils.cc	(revision 100)
@@ -15,13 +15,15 @@
 using namespace std;
 
-JetsUtil::JetsUtil() {
-  
-  switch(JET_jetalgo) {
+JetsUtil::JetsUtil(const string DetDatacard) {
+ 
+ DET = new RESOLution();
+ DET->ReadDataCard(DetDatacard);
+ 
+  switch(DET->JET_jetalgo) {
   default:
   case 1: {
-    
     // set up a CDF midpoint jet definition
 #ifdef ENABLE_PLUGIN_CDFCONES
-    plugins = new fastjet::CDFJetCluPlugin(JET_seed,JET_coneradius,JET_C_adjacencycut,JET_C_maxiterations,JET_C_iratch,JET_overlap);
+    plugins = new fastjet::CDFJetCluPlugin(DET->JET_seed,DET->JET_coneradius,DET->JET_C_adjacencycut,DET->JET_C_maxiterations,DET->JET_C_iratch,DET->JET_overlap);
     jet_def = fastjet::JetDefinition(plugins);
 #else
@@ -34,5 +36,5 @@
     // set up a CDF midpoint jet definition
 #ifdef ENABLE_PLUGIN_CDFCONES
-    plugins = new fastjet::CDFMidPointPlugin (JET_seed,JET_coneradius,JET_M_coneareafraction,JET_M_maxpairsize,JET_M_maxiterations,JET_overlap);
+    plugins = new fastjet::CDFMidPointPlugin (DET->JET_seed,DET->JET_coneradius,DET->JET_M_coneareafraction,DET->JET_M_maxpairsize,DET->JET_M_maxiterations,DET->JET_overlap);
     jet_def = fastjet::JetDefinition(plugins);
 #else
@@ -45,5 +47,5 @@
     // set up a siscone jet definition
 #ifdef ENABLE_PLUGIN_SISCONE
-    plugins = new fastjet::SISConePlugin (JET_coneradius,JET_overlap,JET_S_npass, JET_S_protojet_ptmin);
+    plugins = new fastjet::SISConePlugin (DET->JET_coneradius,DET->JET_overlap,DET->JET_S_npass, DET->JET_S_protojet_ptmin);
     jet_def = fastjet::JetDefinition(plugins);
 #else
@@ -54,15 +56,16 @@
     
   case 4: {
-    jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, JET_coneradius);
+
+    jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, DET->JET_coneradius);
   }
     break;
     
   case 5: {
-    jet_def = fastjet::JetDefinition(fastjet::cambridge_algorithm,JET_coneradius);
+    jet_def = fastjet::JetDefinition(fastjet::cambridge_algorithm,DET->JET_coneradius);
   }
     break;
     
   case 6: {
-    jet_def = fastjet::JetDefinition(fastjet::antikt_algorithm,JET_coneradius);
+    jet_def = fastjet::JetDefinition(fastjet::antikt_algorithm,DET->JET_coneradius);
   }
     break;
@@ -71,9 +74,8 @@
 }
 
-vector<fastjet::PseudoJet> JetsUtil::RunJets(const vector<fastjet::PseudoJet> & input_particles)
+vector<fastjet::PseudoJet> JetsUtil::RunJets(const vector<fastjet::PseudoJet>&  input_particles)
 {
   inclusive_jets.clear();
   sorted_jets.clear();
-  
   // run the jet clustering with the above jet definition
   if(input_particles.size()!=0)
@@ -96,5 +98,5 @@
   for (unsigned int i = 0; i < sorted_jets.size(); i++) {
     JET.SetPxPyPzE(sorted_jets[i].px(),sorted_jets[i].py(),sorted_jets[i].pz(),sorted_jets[i].E());
-    if(JET.Pt() > PTCUT_jet)
+    if(JET.Pt() > DET->PTCUT_jet)
       {
 	elementJet = (TRootJet*) branchJet->NewEntry();
@@ -102,5 +104,5 @@
 	// b-jets
 	bool btag=false;
-	if((fabs(JET.Eta()) < CEN_max_tracker && Btaggedjet(JET, NFCentralQ)))btag=true;
+	if((fabs(JET.Eta()) < DET->CEN_max_tracker && DET->Btaggedjet(JET, NFCentralQ)))btag=true;
 	elementJet->Btag = btag;
       }
@@ -116,10 +118,10 @@
     JET.SetPxPyPzE(sorted_jets[i].px(),sorted_jets[i].py(),sorted_jets[i].pz(),sorted_jets[i].E());
     // Tau jet identification : 1! track and electromagnetic collimation
-    if(fabs(JET.Eta()) < (CEN_max_tracker - TAU_track_scone)) {
-      double Energie_tau_central = EnergySmallCone(towers,JET.Eta(),JET.Phi());
+    if(fabs(JET.Eta()) < (DET->CEN_max_tracker - DET->TAU_track_scone)) {
+      double Energie_tau_central = DET->EnergySmallCone(towers,JET.Eta(),JET.Phi());
       if(
-	 ( Energie_tau_central/JET.E() > TAU_energy_frac ) &&
-	 ( NumTracks(TrackCentral,TAU_track_pt,JET.Eta(),JET.Phi()) == 1 ) &&
-	 ( JET.Pt() > PTCUT_taujet)
+	 ( Energie_tau_central/JET.E() > DET->TAU_energy_frac ) &&
+	 ( DET->NumTracks(TrackCentral,DET->TAU_track_pt,JET.Eta(),JET.Phi()) == 1 ) &&
+	 ( JET.Pt() > DET->PTCUT_taujet)
 	 ) {
 	elementTauJet = (TRootTauJet*) branchTauJet->NewEntry();
