Index: /trunk/examples/Example3.C
===================================================================
--- /trunk/examples/Example3.C	(revision 1356)
+++ /trunk/examples/Example3.C	(revision 1357)
@@ -20,7 +20,4 @@
   TH1 *fTrackDeltaEta;
 
-  TH1 *fTowerDeltaEem;
-  TH1 *fTowerDeltaEhad;
-
   TH1 *fJetDeltaPT;
 };
@@ -82,14 +79,4 @@
     "(#eta^{particle} - #eta^{track})/#eta^{particle}", "number of tracks",
     100, -0.1, 0.1);
-
-  plots->fTowerDeltaEem = result->AddHist1D(
-    "tower delta Eem", "(Eem^{particles} - Eem^{tower})/Eem^{particles}",
-    "(Eem^{particles} - Eem^{tower})/Eem^{particles}", "number of tower",
-    100, -0.5, 0.5);
-
-  plots->fTowerDeltaEhad = result->AddHist1D(
-    "tower delta Ehad", "(Ehad^{particles} - Ehad^{tower})/Ehad^{particles}",
-    "(Ehad^{particles} - Ehad^{tower})/Ehad^{particles}", "number of tower",
-    100, -5.0, 5.0);
 
   plots->fJetDeltaPT = result->AddHist1D(
@@ -110,5 +97,6 @@
 
   TClonesArray *branchEFlowTrack = treeReader->UseBranch("EFlowTrack");
-  TClonesArray *branchEFlowTower = treeReader->UseBranch("EFlowTower");
+  TClonesArray *branchEFlowPhoton = treeReader->UseBranch("EFlowPhoton");
+  TClonesArray *branchEFlowNeutralHadron = treeReader->UseBranch("EFlowNeutralHadron");
   TClonesArray *branchJet = treeReader->UseBranch("Jet");
 
@@ -188,42 +176,5 @@
     }
 
-    // Loop over all towers in event
-    for(i = 0; i < branchEFlowTower->GetEntriesFast(); ++i)
-    {
-      tower = (Tower*) branchEFlowTower->At(i);
-
-      Eem = 0.0;
-      Ehad = 0.0;
-      skip = kFALSE;
-      for(j = 0; j < tower->Particles.GetEntriesFast(); ++j)
-      {
-        particle = (GenParticle*) tower->Particles.At(j);
-        pdgCode = TMath::Abs(particle->PID);
-
-        // skip muons and neutrinos
-        if(pdgCode == 12 || pdgCode == 13 || pdgCode == 14 || pdgCode == 16)
-        {
-          continue;
-        }
-
-        // skip K0short and Lambda
-        if(pdgCode == 310 || pdgCode == 3122)
-        {
-          skip = kTRUE;
-        }
-
-        if(pdgCode == 11 || pdgCode == 22)
-        {
-          Eem += particle->E;
-        }
-        else
-        {
-          Ehad += particle->E;
-        }
-      }
-      if(skip) continue;
-      if(Eem > 0.0 && tower->Eem > 0.0) plots->fTowerDeltaEem->Fill((Eem - tower->Eem)/Eem);
-      if(Ehad > 0.0 && tower->Ehad > 0.0) plots->fTowerDeltaEhad->Fill((Ehad - tower->Ehad)/Ehad);
-    }
+    cout<<"--  New event -- "<<endl;
 
     // Loop over all jets in event
@@ -233,4 +184,6 @@
 
       momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
+
+      cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl;      
 
       // Loop over all jet's constituents
@@ -244,16 +197,20 @@
         if(object->IsA() == GenParticle::Class())
         {
+          cout<<"    GenPart pt: "<<((GenParticle*) object)->PT<<", eta: "<<((GenParticle*) object)->Eta<<", phi: "<<((GenParticle*) object)->Phi<<endl;
           momentum += ((GenParticle*) object)->P4();
         }
         else if(object->IsA() == Track::Class())
         {
+          cout<<"    Track pt: "<<((Track*) object)->PT<<", eta: "<<((Track*) object)->Eta<<", phi: "<<((Track*) object)->Phi<<endl;
           momentum += ((Track*) object)->P4();
         }
         else if(object->IsA() == Tower::Class())
         {
+          cout<<"    Tower pt: "<<((Tower*) object)->ET<<", eta: "<<((Tower*) object)->Eta<<", phi: "<<((Tower*) object)->Phi<<endl;
           momentum += ((Tower*) object)->P4();
         }
         else if(object->IsA() == Muon::Class())
         {
+          cout<<"    Muon pt: "<<((Muon*) object)->PT<<", eta: "<<((Muon*) object)->Eta<<", phi: "<<((Muon*) object)->Phi<<endl;
           momentum += ((Muon*) object)->P4();
         }
Index: /trunk/examples/delphes_card_ATLAS.tcl
===================================================================
--- /trunk/examples/delphes_card_ATLAS.tcl	(revision 1356)
+++ /trunk/examples/delphes_card_ATLAS.tcl	(revision 1357)
@@ -207,5 +207,6 @@
 
   set EFlowTrackOutputArray eflowTracks
-  set EFlowTowerOutputArray eflowTowers
+  set EFlowPhotonOutputArray eflowPhotons
+  set EFlowNeutralHadronOutputArray eflowNeutralHadrons
 
   set pi [expr {acos(-1)}]
@@ -275,5 +276,6 @@
 # add InputArray InputArray
   add InputArray Calorimeter/eflowTracks
-  add InputArray Calorimeter/eflowTowers
+  add InputArray Calorimeter/eflowPhotons
+  add InputArray Calorimeter/eflowNeutralHadrons
   set OutputArray eflow
 }
@@ -387,6 +389,5 @@
 module Merger MissingET {
 # add InputArray InputArray
-  add InputArray Calorimeter/eflowTracks
-  add InputArray Calorimeter/eflowTowers
+  add InputArray EFlowMerger/eflow
   set MomentumOutputArray momentum
 }
@@ -446,5 +447,5 @@
 
  # scale formula for jets
-  set ScaleFormula {1.08}
+  set ScaleFormula {1.00}
 }
 
@@ -521,11 +522,20 @@
 ##################
 
+
+# tracks, towers and eflow objects are not stored by default in the output.
+# if needed (for jet constituent or other studies), uncomment the relevant 
+# "add Branch ..." lines. 
+
+
 module TreeWriter TreeWriter {
 # add Branch InputArray BranchName BranchClass
   add Branch Delphes/allParticles Particle GenParticle
-  add Branch TrackMerger/tracks Track Track
-  add Branch Calorimeter/towers Tower Tower
+
+#  add Branch TrackMerger/tracks Track Track
+#  add Branch Calorimeter/towers Tower Tower
 #  add Branch Calorimeter/eflowTracks EFlowTrack Track
-#  add Branch Calorimeter/eflowTowers EFlowTower Tower
+#  add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
+#  add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
+ 
   add Branch GenJetFinder/jets GenJet Jet
   add Branch UniqueObjectFinder/jets Jet Jet
Index: /trunk/examples/delphes_card_ATLAS_PileUp.tcl
===================================================================
--- /trunk/examples/delphes_card_ATLAS_PileUp.tcl	(revision 1356)
+++ /trunk/examples/delphes_card_ATLAS_PileUp.tcl	(revision 1357)
@@ -19,4 +19,5 @@
   Calorimeter
   TrackPileUpSubtractor
+  NeutralTowerMerger
   EFlowMerger
 
@@ -247,6 +248,7 @@
 
   set EFlowTrackOutputArray eflowTracks
-  set EFlowTowerOutputArray eflowTowers
-
+  set EFlowPhotonOutputArray eflowPhotons
+  set EFlowNeutralHadronOutputArray eflowNeutralHadrons
+  
   set pi [expr {acos(-1)}]
 
@@ -324,13 +326,27 @@
 
 ####################
+# Neutral tower merger
+####################
+
+module Merger NeutralTowerMerger {
+# add InputArray InputArray
+  add InputArray Calorimeter/eflowPhotons
+  add InputArray Calorimeter/eflowNeutralHadrons
+  set OutputArray eflowTowers
+} 
+
+
+####################
 # Energy flow merger
 ####################
-
+  
 module Merger EFlowMerger {
 # add InputArray InputArray
-  add InputArray TrackPileUpSubtractor/eflowTracks
-  add InputArray Calorimeter/eflowTowers
+  add InputArray Calorimeter/eflowTracks
+  add InputArray Calorimeter/eflowPhotons
+  add InputArray Calorimeter/eflowNeutralHadrons
   set OutputArray eflow
-}
+} 
+
 
 #############
@@ -529,8 +545,8 @@
 module Merger MissingET {
 # add InputArray InputArray
-  add InputArray Calorimeter/eflowTracks
-  add InputArray Calorimeter/eflowTowers
+  add InputArray EFlowMerger/eflow
   set MomentumOutputArray momentum
 }
+
 
 ##################
@@ -619,11 +635,20 @@
 ##################
 
+
+# tracks, towers and eflow objects are not stored by default in the output.
+# if needed (for jet constituent or other studies), uncomment the relevant 
+# "add Branch ..." lines. 
+
+
 module TreeWriter TreeWriter {
 # add Branch InputArray BranchName BranchClass
   add Branch Delphes/allParticles Particle GenParticle
-  add Branch TrackMerger/tracks Track Track
-  add Branch Calorimeter/towers Tower Tower
+
+#  add Branch TrackMerger/tracks Track Track
+#  add Branch Calorimeter/towers Tower Tower
 #  add Branch Calorimeter/eflowTracks EFlowTrack Track
-#  add Branch Calorimeter/eflowTowers EFlowTower Tower
+#  add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
+#  add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
+
   add Branch GenJetFinder/jets GenJet Jet
   add Branch UniqueObjectFinder/jets Jet Jet
@@ -635,4 +660,7 @@
   add Branch Rho/rho Rho Rho
   add Branch PileUpMerger/vertices Vertex Vertex
-}
-
+
+}
+
+
+
Index: /trunk/examples/delphes_card_CMS.tcl
===================================================================
--- /trunk/examples/delphes_card_CMS.tcl	(revision 1356)
+++ /trunk/examples/delphes_card_CMS.tcl	(revision 1357)
@@ -212,5 +212,6 @@
 
   set EFlowTrackOutputArray eflowTracks
-  set EFlowTowerOutputArray eflowTowers
+  set EFlowPhotonOutputArray eflowPhotons
+  set EFlowNeutralHadronOutputArray eflowNeutralHadrons
 
   set pi [expr {acos(-1)}]
@@ -283,5 +284,6 @@
 # add InputArray InputArray
   add InputArray Calorimeter/eflowTracks
-  add InputArray Calorimeter/eflowTowers
+  add InputArray Calorimeter/eflowPhotons
+  add InputArray Calorimeter/eflowNeutralHadrons
   set OutputArray eflow
 }
@@ -292,5 +294,5 @@
 
 module Efficiency PhotonEfficiency {
-  set InputArray Calorimeter/photons
+  set InputArray Calorimeter/eflowPhotons
   set OutputArray photons
 
@@ -397,6 +399,5 @@
 module Merger MissingET {
 # add InputArray InputArray
-  add InputArray Calorimeter/eflowTracks
-  add InputArray Calorimeter/eflowTowers
+  add InputArray EFlowMerger/eflow
   set MomentumOutputArray momentum
 }
@@ -457,5 +458,5 @@
 
  # scale formula for jets
-  set ScaleFormula {1.08}
+  set ScaleFormula {1.00}
 }
 
@@ -533,11 +534,19 @@
 ##################
 
+# tracks, towers and eflow objects are not stored by default in the output.
+# if needed (for jet constituent or other studies), uncomment the relevant 
+# "add Branch ..." lines. 
+
 module TreeWriter TreeWriter {
 # add Branch InputArray BranchName BranchClass
+ 
   add Branch Delphes/allParticles Particle GenParticle
-  add Branch TrackMerger/tracks Track Track
-  add Branch Calorimeter/towers Tower Tower
+
+#  add Branch TrackMerger/tracks Track Track
+#  add Branch Calorimeter/towers Tower Tower
   add Branch Calorimeter/eflowTracks EFlowTrack Track
-  add Branch Calorimeter/eflowTowers EFlowTower Tower
+  add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
+  add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
+ 
   add Branch GenJetFinder/jets GenJet Jet
   add Branch UniqueObjectFinder/jets Jet Jet
Index: /trunk/examples/delphes_card_CMS_PileUp.tcl
===================================================================
--- /trunk/examples/delphes_card_CMS_PileUp.tcl	(revision 1356)
+++ /trunk/examples/delphes_card_CMS_PileUp.tcl	(revision 1357)
@@ -1,2 +1,3 @@
+
 #######################################
 # Order of execution of various modules
@@ -19,4 +20,5 @@
   Calorimeter
   TrackPileUpSubtractor
+  NeutralTowerMerger
   EFlowMerger
 
@@ -253,5 +255,6 @@
 
   set EFlowTrackOutputArray eflowTracks
-  set EFlowTowerOutputArray eflowTowers
+  set EFlowPhotonOutputArray eflowPhotons
+  set EFlowNeutralHadronOutputArray eflowNeutralHadrons
 
   set pi [expr {acos(-1)}]
@@ -334,4 +337,16 @@
 
 ####################
+# Neutral tower merger
+####################
+
+module Merger NeutralTowerMerger {
+# add InputArray InputArray
+  add InputArray Calorimeter/eflowPhotons
+  add InputArray Calorimeter/eflowNeutralHadrons
+  set OutputArray eflowTowers
+}
+
+
+####################
 # Energy flow merger
 ####################
@@ -340,7 +355,9 @@
 # add InputArray InputArray
   add InputArray TrackPileUpSubtractor/eflowTracks
-  add InputArray Calorimeter/eflowTowers
+  add InputArray Calorimeter/eflowPhotons
+  add InputArray Calorimeter/eflowNeutralHadrons
   set OutputArray eflow
 }
+
 
 #############
@@ -412,5 +429,5 @@
   set JetInputArray FastJetFinder/jets
   set TrackInputArray Calorimeter/eflowTracks
-  set NeutralInputArray Calorimeter/eflowTowers
+  set NeutralInputArray NeutralTowerMerger/eflowTowers
 
   set VertexInputArray PileUpMerger/vertices
@@ -457,5 +474,5 @@
 
 module Efficiency PhotonEfficiency {
-  set InputArray Calorimeter/photons
+  set InputArray Calorimeter/eflowPhotons
   set OutputArray photons
 
@@ -468,4 +485,5 @@
                          (abs(eta) > 2.5)                                   * (0.00)}
 }
+
 
 ##################
@@ -565,8 +583,9 @@
 module Merger MissingET {
 # add InputArray InputArray
-  add InputArray Calorimeter/eflowTracks
-  add InputArray Calorimeter/eflowTowers
+  add InputArray EFlowMerger/eflow
   set MomentumOutputArray momentum
 }
+
+
 
 ##################
@@ -656,11 +675,20 @@
 ##################
 
+# tracks, towers and eflow objects are not stored by default in the output.
+# if needed (for jet constituent or other studies), uncomment the relevant 
+# "add Branch ..." lines. 
+
+
 module TreeWriter TreeWriter {
 # add Branch InputArray BranchName BranchClass
+  
   add Branch Delphes/allParticles Particle GenParticle
-  add Branch TrackMerger/tracks Track Track
-  add Branch Calorimeter/towers Tower Tower
-  add Branch Calorimeter/eflowTracks EFlowTrack Track
-  add Branch Calorimeter/eflowTowers EFlowTower Tower
+
+#  add Branch TrackMerger/tracks Track Track
+#  add Branch Calorimeter/towers Tower Tower
+#  add Branch Calorimeter/eflowTracks EFlowTrack Track
+#  add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
+#  add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
+
   add Branch GenJetFinder/jets GenJet Jet
   add Branch UniqueObjectFinder/jets Jet Jet
