Index: /trunk/CHANGELOG
===================================================================
--- /trunk/CHANGELOG	(revision 566)
+++ /trunk/CHANGELOG	(revision 567)
@@ -1,5 +1,6 @@
-* Changes relative to V.1.8  -- last changes: 02/03/2010
-   - a muon/electron is not reconstructed if its track is not existing
-   - new warning when LHE files are read as input in Delphes
+* Changes relative to V.1.8  -- last changes: 07/06/2010
+   - New entry available in JET and TAUJET: the number of calotower that are contained in the jet
+   - LHE warning: the file should already be hadronised by an external software
+   - ETmis now take into account the presence of muons
    - new: b-(mis)tag algorithms
        * pt/eta dependence for b-(mis)tagging ; 
Index: /trunk/Delphes.cpp
===================================================================
--- /trunk/Delphes.cpp	(revision 566)
+++ /trunk/Delphes.cpp	(revision 567)
@@ -305,5 +305,7 @@
   vector<D_Particle> gamma;
  
-  vector<int> NTrackJet;
+  vector<int> NTrackJet; //for number of tracks
+  vector<float> EHADEEM; //for energyHad over energyEm
+  vector<int> NCALO; //nombre de tours calorimetriques utilisee
 
   TSimpleArray<TRootC::GenParticle> NFCentralQ;
@@ -369,4 +371,6 @@
       input_particles.clear();
       NTrackJet.clear();     
+      NCALO.clear();     
+      EHADEEM.clear();     
       
       // 'list_of_active_towers' contains the exact list of calorimetric towers which have some deposits inside (E>0).
@@ -705,7 +709,4 @@
       
       // 2.2.3 ************* jets, B-tag, tau jets
-      vector<int> NTrackJet; //for number of tracks
-      vector<float> EHADEEM; //for energyHad over energyEm
-      vector<int> NCALO; //nombre de tours calorimetriques utilisee
       sorted_jets=JETRUN->RunJets(input_particles, TrackCentral,NTrackJet,EHADEEM,list_of_active_towers,NCALO);
       JETRUN->RunJetBtagging(treeWriter, branchJet,sorted_jets,NFCentralQ,NTrackJet,EHADEEM,NCALO);
Index: /trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h
===================================================================
--- /trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h	(revision 566)
+++ /trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h	(revision 567)
@@ -423,4 +423,5 @@
   float Charge; // normally, using the charge of the track ; here using gen-level tau charge
   int NTracks;
+  int NCalo;
 
   float EHoverEE;
@@ -453,4 +454,5 @@
   bool Btag;
   int NTracks;
+  int NCalo;
   
   float EHoverEE;
Index: /trunk/VERSION
===================================================================
--- /trunk/VERSION	(revision 566)
+++ /trunk/VERSION	(revision 567)
@@ -1,1 +1,1 @@
-1.8
+1.9
Index: /trunk/data/DetectorCard.dat
===================================================================
--- /trunk/data/DetectorCard.dat	(revision 566)
+++ /trunk/data/DetectorCard.dat	(revision 567)
@@ -86,5 +86,5 @@
 # General jet variable
 JET_coneradius   0.7            // generic jet radius ; not for tau's !!!
-JET_jetalgo      4              // Jet algorithms: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
+JET_jetalgo      2              // Jet algorithms: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
 JET_seed         1.0            // minimum seed to start jet reconstruction, in GeV
 JET_Eflow        0              // Perfect energy assumed in the tracker coverage
@@ -98,5 +98,5 @@
 # put 'x' for pt ; range: [0, 9E6 GeV/c]
 # put 'y' for eta ; range [-CEN_max_tracker ; CEN_max_tracker ]
-# never put any blank in the formula
+# e.g. (x<300)?(0.2+0*x+0*y):(0.6+0*x+y*0)
 BTAG_func_b	 0.4+0*x+0*y	        // formula for Pt dependence of the b-tag efficiency (b-jets)
 BTAG_func_c      0.1+0*x+0*y            // formula for Pt dependence of the mistag efficiency (c-jets)
@@ -145,5 +145,5 @@
 NEvents_Frog      100
 # Number of events to process 
-NEvents           10000                    // -1 means 'all'
+NEvents           -1                   // -1 means 'all'
 
 # input PDG tables
Index: /trunk/data/DetectorCard_ATLAS.dat
===================================================================
--- /trunk/data/DetectorCard_ATLAS.dat	(revision 566)
+++ /trunk/data/DetectorCard_ATLAS.dat	(revision 567)
@@ -88,5 +88,5 @@
 JET_jetalgo      6              // Jet algorithms: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
 JET_seed         1.0            // minimum seed to start jet reconstruction, in GeV
-JET_Eflow        1              // Perfect energy assumed in the tracker coverage
+JET_Eflow        0              // Perfect energy assumed in the tracker coverage
 
 # b-(mis)tagging efficiencies
@@ -98,5 +98,5 @@
 # put 'x' for pt ; range: [0, 9E6 GeV/c]
 # put 'y' for eta ; range [-CEN_max_tracker ; CEN_max_tracker ]
-# never put any blank in the formula
+# e.g. (x<300)?(0.2+0*x+0*y):(0.6+0*x+y*0)
 BTAG_func_b      0.4+0*x+0*y            // formula for Pt dependence of the b-tag efficiency (b-jets)
 BTAG_func_c      0.1+0*x+0*y            // formula for Pt dependence of the mistag efficiency (c-jets)
Index: /trunk/data/DetectorCard_CMS.dat
===================================================================
--- /trunk/data/DetectorCard_CMS.dat	(revision 566)
+++ /trunk/data/DetectorCard_CMS.dat	(revision 567)
@@ -88,5 +88,5 @@
 JET_jetalgo      6              // Jet algorithms: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt
 JET_seed         1.0            // minimum seed to start jet reconstruction, in GeV
-JET_Eflow        1              // Perfect energy assumed in the tracker coverage
+JET_Eflow        0              // Perfect energy assumed in the tracker coverage
 
 # b-(mis)tagging efficiencies
@@ -98,7 +98,7 @@
 # put 'x' for pt ; range: [0, 9E6 GeV/c]
 # put 'y' for eta ; range [-CEN_max_tracker ; CEN_max_tracker ]
-# never put any blank in the formula
-BTAG_func_b      (x<300)?(0.2+0*x+0*y):(0.6+0*x+y*0)            // formula for Pt dependence of the b-tag efficiency (b-jets)
-BTAG_func_c      (x<300)?(0.01+0*x+0*y):(0.15+0*x+0*y)            // formula for Pt dependence of the mistag efficiency (c-jets)
+# e.g. (x<300)?(0.2+0*x+0*y):(0.6+0*x+y*0)
+BTAG_func_b      0.4+0*x+0*y            // formula for Pt dependence of the b-tag efficiency (b-jets)
+BTAG_func_c      0.1+0*x+0*y            // formula for Pt dependence of the mistag efficiency (c-jets)
 BTAG_func_g      0.01+0*x+0*y           // (gluon-jets)
 BTAG_func_l      0.01+0*x+0*y           // (light-jets)
Index: /trunk/interface/JetsUtil.h
===================================================================
--- /trunk/interface/JetsUtil.h	(revision 566)
+++ /trunk/interface/JetsUtil.h	(revision 567)
@@ -80,11 +80,11 @@
   void init(); // for constructors
 
-  vector<fastjet::PseudoJet> RunJets(const vector<fastjet::PseudoJet>&  input_particles, const vector<TRootTracks> & TrackCentral, vector<int> &NTrackJet, vector<float> &EHADEEM, D_CaloTowerList list_of_active_towers);
+  vector<fastjet::PseudoJet> RunJets(const vector<fastjet::PseudoJet>&  input_particles, const vector<TRootTracks> & TrackCentral, vector<int> &NTrackJet, vector<float> &EHADEEM, D_CaloTowerList list_of_active_towers, vector<int> &NCALO);
 
   vector<fastjet::PseudoJet> RunJetsResol(const vector<fastjet::PseudoJet>&  input_particles);
   
-  void RunJetBtagging(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchJet,const vector<fastjet::PseudoJet> & sorted_jets,const TSimpleArray<TRootC::GenParticle> & NFCentralQ, const vector<int> &NTrackJet, const vector<float> &EHADEEM);
+  void RunJetBtagging(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchJet,const vector<fastjet::PseudoJet> & sorted_jets,const TSimpleArray<TRootC::GenParticle> & NFCentralQ, const vector<int> &NTrackJet, const vector<float> &EHADEEM, const vector<int> &NCALO);
   
-  void RunTauJets(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchTauJet,const vector<fastjet::PseudoJet> & sorted_jets,const vector<PhysicsTower> & towers, const vector<TRootTracks> & TrackCentral, const vector<int> &NTrackJet, const vector<float> &EHADEEM);
+  void RunTauJets(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchTauJet,const vector<fastjet::PseudoJet> & sorted_jets,const vector<PhysicsTower> & towers, const vector<TRootTracks> & TrackCentral, const vector<int> &NTrackJet, const vector<float> &EHADEEM,const vector<int> &NCALO);
 
  private:
Index: /trunk/src/JetsUtil.cc
===================================================================
--- /trunk/src/JetsUtil.cc	(revision 566)
+++ /trunk/src/JetsUtil.cc	(revision 567)
@@ -122,5 +122,5 @@
 }
 
-vector<fastjet::PseudoJet> JetsUtil::RunJets(const vector<fastjet::PseudoJet>&  input_particles,  const vector<TRootTracks> & TrackCentral,  vector<int> &NTrackJet, vector<float> &EHADEEM,D_CaloTowerList list_of_active_towers)
+vector<fastjet::PseudoJet> JetsUtil::RunJets(const vector<fastjet::PseudoJet>&  input_particles,  const vector<TRootTracks> & TrackCentral,  vector<int> &NTrackJet, vector<float> &EHADEEM,D_CaloTowerList list_of_active_towers, vector<int> &NCALO)
 {
   inclusive_jets.clear();
@@ -144,5 +144,5 @@
             DET->BinEtaPhi(TrackCentral[t].PhiOuter,TrackCentral[t].EtaOuter,iPhiTrack[t],iEtaTrack[t]); 
           else {
-	    iPhiTrack[t] = TrackCentral[t].PhiOuter;    iEtaTrack[t] = TrackCentral[t].EtaOuter; 
+	    iPhiTrack[t] = TrackCentral[t].Phi;    iEtaTrack[t] = TrackCentral[t].Eta;  // should NOT be PhiOuter and EtaOuter
           }
         }
@@ -163,4 +163,5 @@
             //now, get EHad over EEm
             float EmVal=0,HadVal=0;
+            NCALO.push_back(constituents.size());
             for (unsigned int j = 0; j < constituents.size(); j++)
                 {
@@ -197,5 +198,5 @@
 
 
-void JetsUtil::RunJetBtagging(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchJet,const vector<fastjet::PseudoJet> & sorted_jets,const TSimpleArray<TRootC::GenParticle>& NFCentralQ, const vector<int> &NTrackJet, const vector<float> &EHADEEM)
+void JetsUtil::RunJetBtagging(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchJet,const vector<fastjet::PseudoJet> & sorted_jets,const TSimpleArray<TRootC::GenParticle>& NFCentralQ, const vector<int> &NTrackJet, const vector<float> &EHADEEM,  const vector<int> &NCALO)
 {
   TRootJet *elementJet;
@@ -209,4 +210,5 @@
 	elementJet->NTracks = NTrackJet[i];
         elementJet->EHoverEE = EHADEEM[i];
+        elementJet->NCalo = NCALO[i];
 
 	// b-jets
@@ -218,5 +220,5 @@
 }
 
-void JetsUtil::RunTauJets(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchTauJet,const vector<fastjet::PseudoJet> & sorted_jets,const vector<PhysicsTower> & towers, const vector<TRootTracks> & TrackCentral, const vector<int> &NTrackJet, const vector<float> &EHADEEM)
+void JetsUtil::RunTauJets(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchTauJet,const vector<fastjet::PseudoJet> & sorted_jets,const vector<PhysicsTower> & towers, const vector<TRootTracks> & TrackCentral, const vector<int> &NTrackJet, const vector<float> &EHADEEM,const vector<int> &NCALO)
 {
   TRootTauJet *elementTauJet;
@@ -240,4 +242,5 @@
 	elementTauJet->Charge = charge;
         elementTauJet->EHoverEE = EHADEEM[i];
+        elementTauJet->NCalo = NCALO[i];
       } // if tau jet
     } // if JET.eta < tracker - tau_cone : Tau jet identification
Index: /trunk/src/SmearUtil.cc
===================================================================
--- /trunk/src/SmearUtil.cc	(revision 566)
+++ /trunk/src/SmearUtil.cc	(revision 567)
@@ -27,5 +27,5 @@
 **                     Louvain-la-Neuve, Belgium                      **
 **                                                                    **
-**                      Copyright (C) 2008-2009,                      **
+**                      Copyright (C) 2008-2010,                      **
 **                        All rights reserved.                        **
 **                                                                    **
@@ -138,7 +138,7 @@
   // General jet variable
   JET_coneradius   = 0.7;	     // generic jet radius ; not for tau's !!!
-  JET_jetalgo      = 1;              // 1 for Cone algorithm, 2 for MidPoint algorithm, 3 for SIScone algorithm, 4 for kt algorithm
+  JET_jetalgo      = 2;              // 1 for Cone algorithm, 2 for MidPoint algorithm, 3 for SIScone algorithm, 4 for kt algorithm
   JET_seed         = 1.0;            // minimum seed to start jet reconstruction
-  JET_Eflow        = 1;		     // 1 for Energy flow in jets reco ; 0 if not
+  JET_Eflow        = 0;		     // 1 for Energy flow in jets reco ; 0 if not
 
   // Tagging definition
@@ -774,6 +774,6 @@
   f_out <<"**                 of a  generic collider experiment                **"<< endl;
   f_out <<"**                                                                  **"<< endl;
-  f_out <<"**                --- Version 1.8 of Delphes ---                    **"<< endl;
-  f_out <<"**               Last date of change: 16 August 2009                **"<< endl;
+  f_out <<"**                --- Version 1.9 of Delphes ---                    **"<< endl;
+  f_out <<"**               Last date of change: 7 May 2010                    **"<< endl;
   f_out <<"**                                                                  **"<< endl;
   f_out <<"**                                                                  **"<< endl;
@@ -1767,6 +1767,6 @@
   cout <<"**                    arXiv:0903.2225v1 [hep-ph]                   **"<< endl;
   cout <<"**                                                                 **"<< endl;
-  cout <<"**                  --- Version 1.8 of Delphes ---                 **"<< endl;
-  cout <<"**                Last date of change:   16 August 2009            **"<< endl;
+  cout <<"**                  --- Version 1.9 of Delphes ---                 **"<< endl;
+  cout <<"**                Last date of change:   7 May 2010                **"<< endl;
   cout <<"**                                                                 **"<< endl;
   cout <<"**                                                                 **"<< endl;
