Index: trunk/Delphes.cpp
===================================================================
--- trunk/Delphes.cpp	(revision 266)
+++ trunk/Delphes.cpp	(revision 267)
@@ -77,5 +77,4 @@
 int main(int argc, char *argv[])
 {
-unsigned int nnnn=0, mmmm=0;
 
   int appargc = 2;
@@ -292,6 +291,6 @@
   //Output file : contents of the analysis object data
   ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputfilename, "Analysis");
+  ExRootTreeBranch *branchTauJet = treeWriter->NewBranch("TauJet", TRootTauJet::Class());
   ExRootTreeBranch *branchJet = treeWriter->NewBranch("Jet", TRootJet::Class());
-  ExRootTreeBranch *branchTauJet = treeWriter->NewBranch("TauJet", TRootTauJet::Class());
   ExRootTreeBranch *branchElectron = treeWriter->NewBranch("Electron", TRootElectron::Class());
   ExRootTreeBranch *branchMuon = treeWriter->NewBranch("Muon", TRootMuon::Class());
@@ -380,130 +379,5 @@
       input_particles.clear();
 
-
-/*
-if(0) { // OLD SMEARING ALGORITHM without energy flow
-      // 2.1 Loop over all particles in event
-      itGen.Reset();
-      while( (particle = (TRootGenParticle*) itGen.Next()) ) {
-          int pid = abs(particle->PID);
-          float iPhi=0,iEta=0;
-
-	
-	  // 2.1.1********************* preparation for the b-tagging
-	  //// This subarray is needed for the B-jet algorithm
-	  // optimization for speed : put first PID condition, then ETA condition, then either pt or status
-	  if( (pid <= pB || pid == pGLUON) &&// is it a light quark or a gluon, i.e. is it one of these : u,d,c,s,b,g ?
-              fabs(particle->Eta) < DET->CEN_max_tracker &&
-              particle->Status != 1 &&
-              particle->PT > DET->PT_QUARKS_MIN ) {
-            NFCentralQ.Add(particle);
-          }
-	  
-	  // 2.1.2 ********************* central detector: keep only visible particles
-	  // keeps only final particles, visible by the central detector, including the fiducial volume
-	  // the ordering of conditions have been optimised for speed : put first the STATUS condition
-          if( (particle->Status == 1)    &&
-	      (pid != pNU1) && (pid != pNU2) && (pid != pNU3) &&
-              (fabs(particle->Eta) < DET->CEN_max_calo_fwd)
-	      ) 
-            { 
-	      genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E);
-	      genMomentumBfield = genMomentum;
-
-	      // 2.1.2.1 ********************* central detector: magnetic field
-	      // genMomentumBfield is then changed with respect to the magnetic field
-	      if(DET->FLAG_bfield==1)  TRACP->Propagation(particle,genMomentumBfield);
-	      float eta=fabs(genMomentumBfield.Eta());
-	     
- 
-	      // 2.1.2.2 ********************* central detector: smearing (calorimeters, muon chambers)
-	      switch(pid) {
-		
-	      case pE: // all electrons with eta < DET->MAX_CALO_FWD
-		DET->SmearElectron(genMomentumBfield);
-		if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_tracker && genMomentumBfield.Pt() > DET->PTCUT_elec){
-		  electron.push_back(ParticleUtil(genMomentumBfield,particle->PID));
-		}
-		break; // case pE
-	      case pGAMMA: // all photons with eta < DET->MAX_CALO_FWD
-		DET->SmearElectron(genMomentumBfield);
-		if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_tracker && genMomentumBfield.Pt() > DET->PTCUT_gamma) {
-		  gamma.push_back(ParticleUtil(genMomentumBfield,particle->PID));
-		}
-		break; // case pGAMMA
-	      case pMU: // all muons with eta < DET->MAX_MU
-		DET->SmearMu(genMomentumBfield);
-		if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_mu &&  genMomentumBfield.Pt() > DET->PTCUT_muon){
-		  muon.push_back(ParticleUtil(genMomentumBfield,particle->PID));
-		}
-		break; // case pMU
-	      case pLAMBDA: // all lambdas with eta < DET->MAX_CALO_FWD
-	      case pK0S:    // all K0s with eta < DET->MAX_CALO_FWD
-		DET->SmearHadron(genMomentumBfield, 0.7);
-		break; // case hadron
-	      default:   // all other final particles with eta < DET->MAX_CALO_FWD
-		DET->SmearHadron(genMomentumBfield, 1.0);
-		break;
-	      } // 2.1.2.2  switch (pid)
-	     
- 
-	      // 2.1.2.3 ********************* central detector: calotowers
-	      // all final particles but muons and neutrinos	
-	      // for calorimetric towers and missing PT
-	      int charge=Charge(pid); 
-	      if(genMomentumBfield.E() !=0 && pid != pMU) {
-		// in case the Bfield is not simulated, checks that charged particles have enough pt to reach the calos
-		if ( !DET->FLAG_bfield && charge!=0 && genMomentumBfield.Pt() <= DET->TRACK_ptmin ) {}// particules do not reach calos 
-		else { // particles reach calos	
-	  	  // applies the calo segmentation and returns iEta & iPhi
-		  DET->BinEtaPhi(genMomentumBfield.Phi(), genMomentumBfield.Eta(), iPhi, iEta); 
-                  if(iEta != UNDEFINED && iPhi != UNDEFINED) { 
-                      momentumCaloSegmentation.SetPtEtaPhiE(genMomentumBfield.Pt(),iEta,iPhi,genMomentumBfield.E());
-                      elementCalo = (TRootCalo*) branchCalo->NewEntry();
-                      elementCalo->Set(momentumCaloSegmentation);
-		      PhysicsTower Tower(LorentzVector(momentumCaloSegmentation.Px(),momentumCaloSegmentation.Py(),momentumCaloSegmentation.Pz(),momentumCaloSegmentation.E()));
-                      towers.push_back(Tower);
-                  } // if iEta != UNDEFINED
-		} // else : when particles reach the calos
-	      } // 2.1.2.3 calotowers
-
-
-	      // 2.1.2.4 ********************* central detector: tracks
-	      // all final charged particles
-	      if(
-		 (genMomentumBfield.E()!=0) &&
-		 (fabs(genMomentumBfield.Eta()) < DET->CEN_max_tracker) && 
-		 (DET->FLAG_bfield || ( !DET->FLAG_bfield && genMomentum.Pt() > DET->TRACK_ptmin )) &&     
-			// if bfield not simulated, pt should be high enough to be taken into account
-		 ((rand()%100) < DET->TRACK_eff)  &&
-		 (charge!=0)
-		 )
-		{
-		  elementTracks = (TRootTracks*) branchTracks->NewEntry();
-		  elementTracks->Set(genMomentum); // fills px,py,pz,pt,e,eta,phi at vertex
-	 	  elementTracks->Etaout = genMomentumBfield.Eta();
-	 	  elementTracks->Phiout = genMomentumBfield.Phi();
-		  // TODO!!! apply a smearing on the position of the origin of the track
-		  // elementTracks->SetPosition(particle->X,particle->Y,particle->Z);
-		  // uses the output of the bfield computation : Xout=... Yout=... Zout...
-		  // TODO!!! elementTrakcs->SetPositionOut(Xout,Yout,Zout);
-		  TrackCentral.push_back(genMomentum); // tracks at vertex!
-		} // 2.1.2.4 tracks
-	      
-	    } // 2.1.2 central detector
-	  
-	  // 2.1.3 ********************* forward detectors: zdc
-	  if(DET->FLAG_vfd==1) {
-	     VFD->ZDC(treeWriter,branchZDC,particle);
-	     VFD->RomanPots(treeWriter,branchRP220,branchFP420,particle);
-	  }
-} // IF OLD ALGORITHM (= no energy flow )
-
-
-
-
-else // IF NEW ALGORITHM with energy flow              
-*/
-{
+      {
       D_CaloTowerList list_of_active_towers; 
       D_CaloTowerList list_of_towers_with_photon; // to speed up the code: will only look in interesting towers for gamma candidates
@@ -533,5 +407,4 @@
             // 2.1a.2.1 Central solenoidal magnetic field 
 	    TRACP->bfield(particle); // fills in particle->EtaCalo et particle->PhiCalo
-	    particle->SetEtaPhi(particle->EtaCalo,particle->PhiCalo); // ???? check this line
 
 	    // 2.1a.2.2 Filling the calorimetric towers -- includes also forward detectors ?
Index: trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h
===================================================================
--- trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h	(revision 266)
+++ trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h	(revision 267)
@@ -13,6 +13,6 @@
  *  present in the data members of the Block TRoot class.
  *
- *  $Date: 2009-02-11 09:19:14 $
- *  $Revision: 1.12 $
+ *  $Date: 2009-02-13 19:38:03 $
+ *  $Revision: 1.13 $
  *
  *  
@@ -312,7 +312,11 @@
 */
 
-//class TRootCalo: public TSortableObject {
-class TRootCalo: public TRootParticle {
+class TRootCalo: public TSortableObject 
+{
+//class TRootCalo: public TRootParticle {
  public:
+   float Eta;
+   float Phi;
+   float E;
    TRootCalo() ;
    TRootCalo(const TRootCalo& cal);
@@ -320,5 +324,5 @@
    void set(const D_CaloTower&  cal);
    static TCompare *fgCompare; //!
- //  const TCompare *GetCompare() const { return fgCompare; }
+   const TCompare *GetCompare() const { return fgCompare; }
    const float getET() const {return ET;}
  
@@ -345,25 +349,42 @@
 //---------------------------------------------------------------------------
 
-class TRootJet: public TRootParticle
+class TRootTauJet: public TSortableObject
+{
+public:
+  TRootTauJet() {};
+
+  float E;  // particle energy in GeV
+  float Px; // particle momentum vector (x component) in GeV
+  float Py; // particle momentum vector (y component) in GeV
+  float Pz; // particle momentum vector (z component) in GeV
+
+  float Eta; // particle pseudorapidity  
+  float Phi; // particle azimuthal angle in rad 
+
+  void Set(const TLorentzVector& momentum);// { return TRootParticle::Set(momentum); }
+
+  static TCompare *fgCompare; //!
+  const TCompare *GetCompare() const { return fgCompare; }
+  
+  float PT; // particle transverse momentum in GeV
+
+  ClassDef(TRootTauJet, 1)
+};
+
+//---------------------------------------------------------------------------
+
+class TRootJet: public TRootTauJet
 {
 public:
   TRootJet() {};
+
+  static TCompare *fgCompare; //!
+
   bool Btag;
 
-  static TCompare *fgCompare; //!
-  
   ClassDef(TRootJet, 1)
 };
 
-//---------------------------------------------------------------------------
-
-class TRootTauJet: public TRootParticle
-{
-public:
-  TRootTauJet() {};
-  static TCompare *fgCompare; //!
-
-  ClassDef(TRootTauJet, 1)
-};
+//------------------------------------------------------------------------------
 
 class TRootTrigger: public TSortableObject
Index: trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc
===================================================================
--- trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc	(revision 266)
+++ trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc	(revision 267)
@@ -11,6 +11,6 @@
  *  to preserve mother-dautherlinks between particles.
  *
- *  $Date: 2009-02-11 09:19:14 $
- *  $Revision: 1.8 $
+ *  $Date: 2009-02-13 19:38:03 $
+ *  $Revision: 1.9 $
  *
  *  
@@ -25,9 +25,9 @@
 
 TCompare *TRootGenParticle::fgCompare = 0;
-TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
 TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
 TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
 TCompare *TRootPhoton::fgCompare = TComparePT<TRootPhoton>::Instance();
 TCompare *TRootTauJet::fgCompare = TComparePT<TRootTauJet>::Instance();
+TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
 TCompare *TRootTracks::fgCompare = TComparePT<TRootTracks>::Instance();
 TCompare *TRootETmis::fgCompare = 0;
@@ -50,4 +50,16 @@
 	Eta = momentum.Eta();
 	Phi = momentum.Phi();
+}
+
+void TRootTauJet::Set(const TLorentzVector& momentum) {
+
+        E   = momentum.E();
+        Px  = momentum.Px();
+        Py  = momentum.Py();
+        Pz  = momentum.Pz();
+        PT  = momentum.Pt();
+        Eta = momentum.Eta();
+        Phi = momentum.Phi();
+
 }
 
@@ -150,6 +162,6 @@
         E_em=cal.getEem(); E_had=cal.getEhad();
         E   =cal.getE();   ET   =cal.getET();
-	EtaCalo = cal.getEta();
-	PhiCalo = cal.getPhi();
+	//EtaCalo = cal.getEta();
+	//PhiCalo = cal.getPhi();
 }
 
Index: trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h
===================================================================
--- trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h	(revision 266)
+++ trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h	(revision 267)
@@ -4,6 +4,6 @@
  *  Lists classes to be included in cint dicitonary
  *
- *  $Date: 2009-02-11 09:19:14 $
- *  $Revision: 1.3 $
+ *  $Date: 2009-02-13 19:38:03 $
+ *  $Revision: 1.4 $
  *
  *  
@@ -24,9 +24,9 @@
 #pragma link C++ class TRootSelectorInfo;
 #pragma link C++ class TRootGenParticle;
-#pragma link C++ class TRootJet;
 #pragma link C++ class TRootElectron;
 #pragma link C++ class TRootMuon;
 #pragma link C++ class TRootPhoton;
 #pragma link C++ class TRootTauJet;
+#pragma link C++ class TRootJet;
 #pragma link C++ class TRootTracks;
 #pragma link C++ class TRootETmis;
