Index: trunk/interface/BFieldProp.h
===================================================================
--- trunk/interface/BFieldProp.h	(revision 260)
+++ trunk/interface/BFieldProp.h	(revision 264)
@@ -53,7 +53,7 @@
 
     // Propagation and bfield are very similar. At the end, after code cleaning,
-    // onle bfield will remain in this class 
+    // only bfield will remain in this class 
     void Propagation(const TRootGenParticle *Part,TLorentzVector &genMomentum);
-    void bfield(const TRootGenParticle *Part, float& etacalo, float& phicalo);
+    void bfield(TRootGenParticle *Part); // fills in Part->EtaCalo and Part->PhiCalo
 
 
Index: trunk/interface/CaloUtil.h
===================================================================
--- trunk/interface/CaloUtil.h	(revision 264)
+++ trunk/interface/CaloUtil.h	(revision 264)
@@ -0,0 +1,143 @@
+#ifndef _CALOUTIL_H_
+#define _CALOUTIL_H_
+
+/*
+  ---- Delphes ----
+  A Fast Simulator for general purpose LHC detector
+  S. Ovyn ~~~~ severine.ovyn@uclouvain.be
+  
+  Center for Particle Physics and Phenomenology (CP3)
+  Universite Catholique de Louvain (UCL)
+  Louvain-la-Neuve, Belgium
+*/
+
+/// \file D_CaloUtil.h
+/// \brief D_CaloElement, D_CaloResolution and D_CaloList classes
+
+#include <iostream>
+#include <vector>
+#include <string>
+#include <cmath>
+#include "D_Constants.h"
+using namespace std;
+
+
+class D_CaloResolution {
+ public:
+   D_CaloResolution(const float cterm, const float nterm, const float sterm) : _c(cterm), _n(nterm), _s(sterm) {};
+   D_CaloResolution(const D_CaloResolution& resolution) : _c(resolution._c), _n(resolution._n), _s(resolution._s) {};
+   D_CaloResolution& operator=(const D_CaloResolution& resolution);
+   const float getC() const {return _c;}
+   const float getN() const {return _n;}
+   const float getS() const {return _s;}
+   const float Smear(const float energy) const;
+   void print() const;
+ private:
+   float _c, _n, _s;
+};
+
+
+
+class D_CaloElement {
+ public:
+   D_CaloElement(const string& name, const float etamin, const float etamax, const float c_em, const float n_em, const float s_em, const float c_had, const float n_had, const float s_had) : _name(name), _etamin(min(etamin,etamax)), _etamax(max(etamin,etamax)), _resol_em(c_em,n_em,s_em), _resol_had(c_had,n_had,s_had) {};
+   D_CaloElement(const D_CaloElement& calo) : _name(calo._name), _etamin(calo._etamin), _etamax(calo._etamax), _resol_em(calo._resol_em), _resol_had(calo._resol_had) {};
+   D_CaloElement& operator=(const D_CaloElement& calo);
+   const D_CaloResolution& getElectromagneticResolution() const {return _resol_em;}
+   const D_CaloResolution& getHadronicResolution() const {return _resol_had;}
+   const string& getName() const {return _name;}
+   const float getEtamin() const {return _etamin;}
+   const float getEtamax() const {return _etamax;}
+   ///     Ordering operator acting on eta
+   inline const bool operator>(const D_CaloElement& tocomp) const {if(_etamin > tocomp._etamin) { return true; } else { return false; }};
+   ///     Ordering operator acting on eta
+   inline const bool operator<(const D_CaloElement& tocomp) const {if(_etamin < tocomp._etamin) { return true; } else { return false; }};
+
+ private:
+   string _name;
+   float _etamin, _etamax;
+   D_CaloResolution _resol_em; 
+   D_CaloResolution _resol_had;
+};
+
+
+
+class D_CaloList {
+ public:
+   D_CaloList() : _calorimeters(), _etamin(UNDEFINED), _etamax(UNDEFINED), _sorted(false) {};
+   D_CaloList(const D_CaloList& list) : 
+        _calorimeters(list._calorimeters), _etamin(list._etamin), _etamax(list._etamax), _sorted(list._sorted) {};
+   D_CaloList& operator=(const D_CaloList& list);
+   const D_CaloElement& getElement(const float eta) const; // returns the pointer to the calorimeter lying in eta
+   void  addElement(const D_CaloElement & calo);
+   void  sortElements(); // sorts the list with respect to the eta
+   const float getEtamax() {if(!_sorted) sortElements(); return _etamax;}
+   const float getEtamin() {if(!_sorted) sortElements(); return _etamin;}
+   void print() const;
+ private:
+   vector<D_CaloElement> _calorimeters;
+   float _etamin; 
+   float _etamax;
+   bool _sorted; 
+   struct ordering{ bool operator()(const D_CaloElement& el1, const D_CaloElement& el2) const { return (el1 < el2);}};
+};
+
+const D_CaloElement dummyCalo("not found calo",UNDEFINED,UNDEFINED+1,1,0,0,1,0,0);
+
+
+
+class D_CaloTower {
+ public:
+    //D_CaloTower(); risk that _eta and _phi not initialised before using Set_Eem_Ehad_E_ET!
+    D_CaloTower(const float iEta, const float iPhi);
+    D_CaloTower(const D_CaloTower& tower);
+    D_CaloTower& operator=(const D_CaloTower& tower);
+    void Set_Eta_Phi(const float iEta, const float iPhi) {_eta=iEta; _phi=iPhi;}
+    void Set_Eem_Ehad_E_ET(const float eem, const float ehad) { _Eem = eem ; _Ehad = ehad; _E = _Eem + _Ehad; _ET = _E/cosh(_eta);}
+    const float getEta() const {return _eta;}
+    const float getPhi() const {return _phi;}
+    const float getE() const {return _E;}
+    const float getET() const {return _ET;}
+    const float getEem() const {return _Eem;}
+    const float getEhad() const {return _Ehad;}
+    ///     Ordering operator acting on eta
+    const bool operator>(const D_CaloTower& tocomp) const;
+    ///     Ordering operator acting on eta
+    const bool operator<(const D_CaloTower& tocomp) const;
+    ///	Egality testing if eta/phi are equal
+    const bool operator==(const D_CaloTower& el) const;
+
+ private:
+    float _eta, _phi;    // segmented eta, phi
+    float _Eem, _Ehad; // electromagnetic and hadronic components of the tower energy
+    float _E, _ET;       // total tower energy and transverse energy
+};
+
+const D_CaloTower dummyTower(UNDEFINED,UNDEFINED);
+
+
+
+class D_CaloTowerList {
+ public:
+    D_CaloTowerList() : _calotowers(), _sorted(true), _merged(true) {}
+    D_CaloTowerList(const D_CaloTowerList& list) : _calotowers(list._calotowers), _sorted(list._sorted), _merged(list._merged) {}
+    D_CaloTowerList& operator=(const D_CaloTowerList& list);
+    D_CaloTower& operator[](const unsigned int i) {return _calotowers[i];}
+    const D_CaloTower& getElement(const float eta, const float phi) ;
+    void addTower(const D_CaloTower& tower);
+    // sorts the elements with respect to their eta
+    void sortElements();
+    // merges the CaloTowers with the same eta and the same phi
+    void mergeDuplicates();
+    void smearTowers(const D_CaloList& list_of_calorimeters);
+    void print() const;
+    const unsigned int size() const {return _calotowers.size();}
+    //void pop_back() {_calotowers.pop_back();}
+ private:
+    vector<D_CaloTower> _calotowers;
+    bool _sorted;
+    bool _merged;
+    struct ordering{ bool operator()(const D_CaloTower& el1, const D_CaloTower& el2) const { return (el1 < el2); }};
+};
+
+#endif
Index: trunk/interface/D_Constants.h
===================================================================
--- trunk/interface/D_Constants.h	(revision 264)
+++ trunk/interface/D_Constants.h	(revision 264)
@@ -0,0 +1,49 @@
+#ifndef _D_CONSTANTS_H_
+#define _D_CONSTANTS_H_
+
+/*
+  ---- Delphes ----
+  A Fast Simulator for general purpose LHC detector
+  S. Ovyn ~~~~ severine.ovyn@uclouvain.be
+  
+  Center for Particle Physics and Phenomenology (CP3)
+  Universite Catholique de Louvain (UCL)
+  Louvain-la-Neuve, Belgium
+*/
+
+/// \file D_Constants.h
+/// \brief List of constants 
+#ifndef __PI__
+#define __PI__
+const float pi = 3.14159265358979312;
+#endif
+
+// particles PID (PDG ID)
+const int pU   = 1;    // c quark
+const int pD   = 2;    // b quark
+const int pS   = 3;    // s quark
+const int pC   = 4;    // c quark
+const int pB   = 5;    // b quark
+const int pE   = 11;   // e
+const int pNU1 = 12;   // nu_e
+const int pMU  = 13;   // mu
+const int pNU2 = 14;   // nu_mu
+const int pTAU = 15;   // tau
+const int pNU3 = 16;   // nu_tau
+const int pGLUON = 21; // gluon
+const int pGAMMA = 22; // gamma
+const int pW   = 24;   // W
+const int pP   = 2212; // proton
+const int pN   = 2112; // neutron
+const int pPI0 = 111;  // pi_0
+const int pK0L = 130;  // K^0_L
+const int pK0S = 310;  // K^0_S
+const int pLAMBDA = 3122; // Lambda
+const int pSIGMA0 = 3212;  // Sigma^0
+const int pDELTA0 = 2114;  // Delta^0
+
+const double speed_of_light = 299792458; // m/s
+const float UNDEFINED=-9999.;
+const int iUNDEFINED=-9999;
+
+#endif
Index: trunk/interface/FrogUtil.h
===================================================================
--- trunk/interface/FrogUtil.h	(revision 260)
+++ trunk/interface/FrogUtil.h	(revision 264)
@@ -34,4 +34,7 @@
 
 
+/// \file FrogUtil.h
+/// \brief FrogDisplay class
+
 #include "SmearUtil.h"
 #include "FROG_Events.h"
Index: trunk/interface/SmearUtil.h
===================================================================
--- trunk/interface/SmearUtil.h	(revision 260)
+++ trunk/interface/SmearUtil.h	(revision 264)
@@ -40,4 +40,6 @@
 #include "TLorentzVector.h"
 
+#include "D_Constants.h"
+#include "CaloUtil.h"
 #include "BlockClasses.h"
 #include "TSimpleArray.h"
@@ -46,30 +48,31 @@
 using namespace std;
 
-class ParticleUtil {
+class D_Particle {
 
  public:
-  ParticleUtil(const TLorentzVector &genMomentum, int pid);
-
-  float E() {return _e;}    // particle energy [GeV]
-  float Px() {return _px;}  // horizontal coordinate of momentum [GeV]
-  float Py() {return _py;}  // vertical coordinate of momentum [GeV]
-  float Pz() {return _pz;}  // longitudinal coordinate of momentum [GeV]
-  float Pt() {return _pt;}  // transverse momentum [GeV]
-  float EtaCalo() {return _etaCalo;}  // pseudorapidity 
-  float Eta() {return _eta;}  // pseudorapidity 
-  float PhiCalo() {return _phiCalo;}  // azimuthal angle 
-  float Phi() {return _phi;}  // azimuthal angle 
-  int PID() {return _pid;}  // particle energy in [GeV]
+  D_Particle(const TLorentzVector & p, const int pid, const float etacalo, const float phicalo) : 
+	_fourmomentum(p), _pid(pid), _etaCalo(etacalo), _phiCalo(phicalo) {}
+  //D_Particle(const float e, const float eta, const float phi, const float pt, const int pid) : 
+  //    _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) { TLorentzVector p; p.SetPtEtaPhiE(pt,eta,phi,e); _fourmomentum = p; }
+  D_Particle(const float px, const float py, const float pz, const float e, const int pid) :
+	_fourmomentum(px,py,pz,e), _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) {}
+
+  const float E() const {return _fourmomentum.E();}    // particle energy [GeV]
+  const float Px() const {return _fourmomentum.Px();}  // horizontal coordinate of momentum [GeV]
+  const float Py() const {return _fourmomentum.Py();}  // vertical coordinate of momentum [GeV]
+  const float Pz() const {return _fourmomentum.Pz();}  // longitudinal coordinate of momentum [GeV]
+  const float Pt() const {return _fourmomentum.Pt();}  // transverse momentum [GeV]
+  const float EtaCalo() const {return _etaCalo;}  // pseudorapidity 
+  const float Eta() const {return _fourmomentum.Eta();}  // pseudorapidity 
+  const float PhiCalo() const {return _phiCalo;}  // azimuthal angle 
+  const float Phi() const  {return _fourmomentum.Phi();}  // azimuthal angle 
+  const int PID() const {return _pid;}  // particle energy in [GeV]
+  const TLorentzVector& getFourMomentum() const {return _fourmomentum;}
 
  private:
-  float _e, _px, _py, _pz, _pt;
-  float _eta, _etaCalo, _phi, _phiCalo; 
+  TLorentzVector _fourmomentum;
   int _pid;
+  float _etaCalo, _phiCalo; 
 };
-
-#ifndef __PI__
-#define __PI__
-extern const float pi = 3.14159265358979312;
-#endif 
 
 class RESOLution
@@ -93,8 +96,8 @@
   float VFD_s_zdc;   // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
 
-  float  RP_220_s; // distance of the RP to the IP, in meters
-  float  RP_220_x; // distance of the RP to the beam, in meters
-  float  RP_420_s; // distance of the RP to the IP, in meters
-  float  RP_420_x; // distance of the RP to the beam, in meters
+  float RP_220_s; // distance of the RP to the IP, in meters
+  float RP_220_x; // distance of the RP to the beam, in meters
+  float RP_420_s; // distance of the RP to the IP, in meters
+  float RP_420_x; // distance of the RP to the beam, in meters
   string RP_beam1Card; // 
   string RP_beam2Card; // 
@@ -186,4 +189,5 @@
  int FLAG_bfield;               //flag for bfield propagation
  int FLAG_vfd;                  //flag for very forward detector
+ int FLAG_zdc;                  //flag for very forward detector
  
  int NEvents_Frog;
@@ -191,5 +195,6 @@
 
   // to sort a vector
-  void SortedVector(vector<ParticleUtil> &vect);
+  //void SortedVector(vector<ParticleUtil> &vect);
+  void SortedVector(vector<D_Particle> &vect);
 
   /// Reads the data card for the initialisation of the parameters 
@@ -227,33 +232,4 @@
 
 };
-
-
-// particles PID (PDG ID)
-const int pU   = 1;    // c quark
-const int pD   = 2;    // b quark
-const int pS   = 3;    // s quark
-const int pC   = 4;    // c quark
-const int pB   = 5;    // b quark
-const int pE   = 11;   // e
-const int pNU1 = 12;   // nu_e
-const int pMU  = 13;   // mu
-const int pNU2 = 14;   // nu_mu
-const int pTAU = 15;   // tau
-const int pNU3 = 16;   // nu_tau
-const int pGLUON = 21; // gluon
-const int pGAMMA = 22; // gamma
-const int pW   = 24;   // W
-const int pP   = 2212; // proton
-const int pN   = 2112; // neutron
-const int pPI0 = 111;  // pi_0
-const int pK0L = 130;  // K^0_L
-const int pK0S = 310;  // K^0_S
-const int pLAMBDA = 3122; // Lambda
-const int pSIGMA0 = 3212;  // Sigma^0
-const int pDELTA0 = 2114;  // Delta^0
-
-const double speed_of_light = 299792458; // m/s
-const float UNDEFINED=-9999.;
-
 
 // ** returns the sign (+1 or -1) or an integer
Index: trunk/interface/TreeClasses.h
===================================================================
--- trunk/interface/TreeClasses.h	(revision 260)
+++ trunk/interface/TreeClasses.h	(revision 264)
@@ -1,4 +1,36 @@
 #ifndef TreeClasses_h
 #define TreeClasses_h
+
+/***********************************************************************
+**                                                                    **
+**          /----------------------------------------------\          **
+**         |  Delphes, a framework for the fast simulation  |         **
+**         |       of a  generic collider experiment        |         **
+**          \----------------------------------------------/          **
+**                                                                    **
+**                                                                    **
+**   This package uses:                                               **
+**   ------------------                                               **
+**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      ** 
+**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       ** 
+**   FROG: [hep-ex/0901.2718v1]                                       **
+**                                                                    **
+** ------------------------------------------------------------------ **
+**                                                                    **
+**   Main authors:                                                    **
+**   -------------                                                    **
+**                                                                    **
+**                Severine Ovyn                Xavier Rouby           ** 
+**          severine.ovyn@uclouvain.be      xavier.rouby@cern         ** 
+**                                                                    ** 
+**         Center for Particle Physics and Phenomenology (CP3)        ** 
+**                Universite catholique de Louvain (UCL)              **       
+**                     Louvain-la-Neuve, Belgium                      **            
+**                                                                    **
+**                      Copyright (C) 2008-2009,                      **
+**                        All rights reserved.                        **  
+**                                                                    **
+***********************************************************************/
+
 
 #include "TObject.h"
Index: trunk/interface/TriggerUtil.h
===================================================================
--- trunk/interface/TriggerUtil.h	(revision 260)
+++ trunk/interface/TriggerUtil.h	(revision 264)
@@ -47,5 +47,5 @@
  public:
 
-  TriggerBit(){}; 
+  TriggerBit(); 
   TriggerBit(const TriggerBit& tb);
   TriggerBit& operator=(const TriggerBit& tb);
@@ -87,5 +87,12 @@
 
   void TriggerCardReader(const string& filename="data/trigger.dat");
+  // avant, Ã§a s'appellait TriggerReader
+  // appelle la mÃ©thode TriggerBit::GetTrigCondition
+
+  
   void PrintTriggerTable(const string& LogName);
+  // fait un cout des triggers bits, c'est toujours pratique
+  // appelle la mÃ©thode TriggerBit::PriniTrigCondition
+  
   bool GetGlobalResult(TClonesArray *branchElecTrig, TClonesArray *branchMuonTrig,
       TClonesArray *branchJetTrig, TClonesArray *branchTauJetTrig,
@@ -93,10 +100,19 @@
 
   void WriteResult();
+    // sauve dans le TTree
+    // ce nom est stupide, faut le changer
     
  private:
+  //bool Evaluate( int event_i );
+  // boucle sur list_of_trigger_bits, comme on a dit
+  // appelle la methode TriggerBit::Evaluate ou TriggerBit::GetResult (Ã  voir)
+  // renvoie la rÃ©ponse globale du trigger
+  // Ã  la fin, mettre has_been_evaluated = true;
+  // voir le NB ci-dessous
   
   vector<TriggerBit> list_of_trigger_bits;
   bool has_been_evaluated;
   bool GlobalResult;
+  int event_i;
 
 };
