Index: /trunk/interface/FrogUtil.h
===================================================================
--- /trunk/interface/FrogUtil.h	(revision 97)
+++ /trunk/interface/FrogUtil.h	(revision 97)
@@ -0,0 +1,69 @@
+#ifndef _FROGUTIL_H_
+#define _FROGUTIL_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 SmearUtil.h
+/// \brief RESOLution class, and some generic definitions
+
+#include <iostream>
+#include <fstream>
+#include <utility>
+#include <vector>
+#include <math.h>
+
+#include "TStyle.h"
+#include "TPad.h"
+#include "TCanvas.h"
+#include "TSystem.h"
+#include "TArrow.h"
+#include "TROOT.h"
+#include "TApplication.h"
+#include "THStack.h"
+#include "stdio.h"
+#include "TChain.h"
+#include "TString.h"
+#include "TGraphErrors.h"
+#include "TClonesArray.h"
+#include "TFile.h"
+#include "TH2.h"
+#include "THStack.h"
+#include "TLegend.h"
+#include "TPaveText.h"
+#include "TLorentzVector.h"
+#include "TTree.h"
+#include "TBranch.h"
+#include "TRandom.h"
+
+#include "interface/SmearUtil.h"
+#include "Utilities/ExRootAnalysis/interface/BlockClasses.h"
+
+#include "Utilities/ExRootAnalysis/interface/ExRootTreeReader.h"
+#include "Utilities/ExRootAnalysis/interface/ExRootTreeWriter.h"
+#include "Utilities/ExRootAnalysis/interface/ExRootTreeBranch.h"
+
+#include "Utilities/FROG/Includes/FROG/FROG_Events.h"
+
+
+using namespace std;
+class FrogDisplay 
+{
+ public:
+  /// Constructor
+  FrogDisplay();
+
+  void Build_1Event(FROG_Element_Event* event1);
+  void BuidEvents(string outputfilename,int nEntryFrog);
+  void BuildGeom(string DetDatacard);
+
+};
+
+#endif
Index: /trunk/src/FrogUtil.cc
===================================================================
--- /trunk/src/FrogUtil.cc	(revision 97)
+++ /trunk/src/FrogUtil.cc	(revision 97)
@@ -0,0 +1,576 @@
+/*
+ *   ---- 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
+ *             */
+
+// \brief Trigger class, and some generic definitions
+
+#include "interface/FrogUtil.h"
+#include "TRandom.h"
+
+#include "Utilities/FROG/Includes/FROG/FROG_DetId.h"
+#include "Utilities/FROG/Includes/FROG/FROG_Geometry.h"
+#include "Utilities/FROG/Includes/FROG/FROG_Geometry.cpp"
+#include "Utilities/FROG/Includes/FROG/FROG_Events.h"
+#include "Utilities/FROG/Includes/FROG/FROG_Events.cpp"
+#include "Utilities/FROG/Includes/FROG/FROG_Element_Tools.h"
+#include "Utilities/FROG/Includes/FROG/FROG_Element_Tools.cpp"
+#include "Utilities/FROG/Includes/FROG/FROG_Net_Tools.h"
+#include "Utilities/FROG/Includes/FROG/FROG_Net_Tools.cpp"
+#include "Utilities/FROG/Includes/FROG/FROG_Path.h"
+#include "Utilities/FROG/Includes/FROG/FROG_Path.cpp"
+#include "Utilities/FROG/Includes/FROG/FROG_Coord.h"
+#include "Utilities/FROG/Includes/FROG/FROG_Coord.cpp"
+#include "Utilities/FROG/Includes/FROG/FROG_ReadCards.h"
+#include "Utilities/FROG/Includes/FROG/FROG_ReadCards.cpp"
+#include "Utilities/FROG/Includes/FROG/FROG_ZLib.h"
+#include "Utilities/FROG/Includes/FROG/FROG_ZLib.cpp"
+
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include <iomanip>
+#include <cstring>
+
+using namespace std;
+using namespace FROG_COORD;
+
+
+FrogDisplay::FrogDisplay() {}
+
+//PROTON 1
+void FrogDisplay::Build_1Event(FROG_Element_Event* event1)
+{
+  double posp_x = 0.0299923*1000;
+  double posp_y = 0.00602767*1000;
+  double posp_z = 0;
+  FROG_Element_Event_Hit* hitp = new FROG_Element_Event_Hit(500000001 + ((int)posp_z)/50, posp_x, posp_y, posp_z, -1);
+  double dirp_x = 0*1000;
+  double dirp_y = 0*1000;
+  double dirp_z = -1*1000;
+  float Pp =  sqrt(dirp_x*dirp_x + dirp_y*dirp_y + dirp_z*dirp_z);
+  float Ptp =  sqrt(dirp_x*dirp_x + dirp_y*dirp_y);
+  FROG_Element_Base_With_DetId_And_Name* trackCollectionP = new FROG_Element_Base_With_DetId_And_Name(EVTID_TRK+1000, "Tracks: protons");
+  FROG_Element_Event_Track* trackp= new FROG_Element_Event_Track(0,Pp,Ptp,0);
+  trackp->addDaughter(hitp);
+  double pos2p_x = 0.0299923*1000+0*1000*0.4;
+  double pos2p_y = 0.00602767*1000+0*1000*0.4;
+  double pos2p_z = -1*1000*0.4;
+  FROG_Element_Event_Hit* hit2p = new FROG_Element_Event_Hit(500000001 + ((int)pos2p_z)/50, pos2p_x, pos2p_y, pos2p_z, -1);
+  trackp->addDaughter(hit2p);
+  trackCollectionP->addDaughter(trackp);
+  
+  // photon 1
+  FROG_Element_Base_With_DetId_And_Name* trackCollection = new FROG_Element_Base_With_DetId_And_Name(EVTID_TRK,"Tracks: Photons");
+  FROG_Element_Event_Track* track1 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos0_x = 0.0299923*1000;
+  double pos0_y = 0.00602767*1000;
+  double pos0_z = -0.309438*1000;
+  FROG_Element_Event_Hit* hit0 = new FROG_Element_Event_Hit(400000001 + ((int)pos0_z)/50, pos0_x, pos0_y, pos0_z, -1);
+  track1->addDaughter(hit0);
+  double pos1_x = 0.03*1000;
+  double pos1_y = 0.00602856*1000;
+  double pos1_z = -0.309567*1000;
+  FROG_Element_Event_Hit* hit1 = new FROG_Element_Event_Hit(400000001 + ((int)pos1_z)/50, pos1_x, pos1_y, pos1_z, -1);
+  track1->addDaughter(hit1);
+  trackCollection->addDaughter(track1);
+  // photon 2
+  FROG_Element_Event_Track* track2 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos2_x = 0.0299923*1000;
+  double pos2_y = 0.00602767*1000;
+  double pos2_z = -0.312795*1000;
+  FROG_Element_Event_Hit* hit2 = new FROG_Element_Event_Hit(400000001 + ((int)pos2_z)/50, pos2_x, pos2_y, pos2_z, -1);
+  track2->addDaughter(hit2);
+  double pos3_x = 0.0291312*1000;
+  double pos3_y = 0.00599684*1000;
+  double pos3_z = -0.326865*1000;
+  FROG_Element_Event_Hit* hit3 = new FROG_Element_Event_Hit(400000001 + ((int)pos3_z)/50, pos3_x, pos3_y, pos3_z, -1);
+  track2->addDaughter(hit3);
+  double pos4_x = 0.0272812*1000;
+  double pos4_y = 0*1000;
+  double pos4_z = -0.325133*1000;
+  FROG_Element_Event_Hit* hit4 = new FROG_Element_Event_Hit(400000001 + ((int)pos4_z)/50, pos4_x, pos4_y, pos4_z, -1);
+  track2->addDaughter(hit4);
+  double pos5_x = 0.0147219*1000;
+  double pos5_y = -0.04071*1000;
+  double pos5_z = -0.313375*1000;
+  FROG_Element_Event_Hit* hit5 = new FROG_Element_Event_Hit(400000001 + ((int)pos5_z)/50, pos5_x, pos5_y, pos5_z, -1);
+  track2->addDaughter(hit5);
+  trackCollection->addDaughter(track2);
+  
+  // photon 3
+  FROG_Element_Event_Track* track3 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos6_x = 0.0299923*1000;
+  double pos6_y = 0.00602767*1000;
+  double pos6_z = -0.241733*1000;
+  FROG_Element_Event_Hit* hit6 = new FROG_Element_Event_Hit(400000001 + ((int)pos6_z)/50, pos6_x, pos6_y, pos6_z, -1);
+  track3->addDaughter(hit6);
+  double pos7_x = 0.0247239*1000;
+  double pos7_y = 0.00635725*1000;
+  double pos7_z = -0.327258*1000;
+  FROG_Element_Event_Hit* hit7 = new FROG_Element_Event_Hit(400000001 + ((int)pos7_z)/50, pos7_x, pos7_y, pos7_z, -1);
+  track3->addDaughter(hit7);
+  double pos8_x = 0.023245*1000;
+  double pos8_y = 0*1000;
+  double pos8_z = -0.325292*1000;
+  FROG_Element_Event_Hit* hit8 = new FROG_Element_Event_Hit(400000001 + ((int)pos8_z)/50, pos8_x, pos8_y, pos8_z, -1);
+  track3->addDaughter(hit8);
+  double pos9_x = 0.0137742*1000;
+  double pos9_y = -0.04071*1000;
+  double pos9_z = -0.312698*1000;
+  FROG_Element_Event_Hit* hit9 = new FROG_Element_Event_Hit(400000001 + ((int)pos9_z)/50, pos9_x, pos9_y, pos9_z, -1);
+  track3->addDaughter(hit9);
+  trackCollection->addDaughter(track3);
+  
+  // photon 4
+  FROG_Element_Event_Track* track4 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos10_x = 0.0299923*1000;
+  double pos10_y = 0.00602767*1000;
+  double pos10_z = -0.103114*1000;
+  FROG_Element_Event_Hit* hit10 = new FROG_Element_Event_Hit(400000001 + ((int)pos10_z)/50, pos10_x, pos10_y, pos10_z, -1);
+  track4->addDaughter(hit10);
+  double pos11_x = 0.0169713*1000;
+  double pos11_y = 0.0106604*1000;
+  double pos11_z = -0.324528*1000;
+  FROG_Element_Event_Hit* hit11 = new FROG_Element_Event_Hit(400000001 + ((int)pos11_z)/50, pos11_x, pos11_y, pos11_z, -1);
+  track4->addDaughter(hit11);
+  double pos12_x = 0.0159847*1000;
+  double pos12_y = 0*1000;
+  double pos12_z = -0.322034*1000;
+  FROG_Element_Event_Hit* hit12 = new FROG_Element_Event_Hit(400000001 + ((int)pos12_z)/50, pos12_x, pos12_y, pos12_z, -1);
+  track4->addDaughter(hit12);
+  double pos13_x = 0.00925296*1000;
+  double pos13_y = -0.0727334*1000;
+  double pos13_z = -0.305018*1000;
+  FROG_Element_Event_Hit* hit13 = new FROG_Element_Event_Hit(400000001 + ((int)pos13_z)/50, pos13_x, pos13_y, pos13_z, -1);
+  track4->addDaughter(hit13);
+  trackCollection->addDaughter(track4);
+  
+  // photon 5
+  FROG_Element_Event_Track* track5 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos14_x = 0.0299923*1000;
+  double pos14_y = 0.00602767*1000;
+  double pos14_z = -0.0550703*1000;
+  FROG_Element_Event_Hit* hit14 = new FROG_Element_Event_Hit(400000001 + ((int)pos14_z)/50, pos14_x, pos14_y, pos14_z, -1);
+  track5->addDaughter(hit14);
+  double pos15_x = 0.03*1000;
+  double pos15_y = 0.00597767*1000;
+  double pos15_z = -0.0558923*1000;
+  FROG_Element_Event_Hit* hit15 = new FROG_Element_Event_Hit(400000001 + ((int)pos15_z)/50, pos15_x, pos15_y, pos15_z, -1);
+  track5->addDaughter(hit15);
+  trackCollection->addDaughter(track5);
+  
+  // photon 6
+  FROG_Element_Event_Track* track6 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos16_x = 0.0299923*1000;
+  double pos16_y = 0.00602767*1000;
+  double pos16_z = -0.0724158*1000;
+  FROG_Element_Event_Hit* hit16 = new FROG_Element_Event_Hit(400000001 + ((int)pos16_z)/50, pos16_x, pos16_y, pos16_z, -1);
+  track6->addDaughter(hit16);
+  double pos17_x = 0.03*1000;
+  double pos17_y = 0.00602949*1000;
+  double pos17_z = -0.0725471*1000;
+  FROG_Element_Event_Hit* hit17 = new FROG_Element_Event_Hit(400000001 + ((int)pos17_z)/50, pos17_x, pos17_y, pos17_z, -1);
+  track6->addDaughter(hit17);
+  trackCollection->addDaughter(track6);
+  
+  // photon 7
+  FROG_Element_Event_Track* track7 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos18_x = 0.0299923*1000;
+  double pos18_y = 0.00602767*1000;
+  double pos18_z = -0.108963*1000;
+  FROG_Element_Event_Hit* hit18 = new FROG_Element_Event_Hit(400000001 + ((int)pos18_z)/50, pos18_x, pos18_y, pos18_z, -1);
+  track7->addDaughter(hit18);
+  double pos19_x = 0.03*1000;
+  double pos19_y = 0.0060305*1000;
+  double pos19_z = -0.109102*1000;
+  FROG_Element_Event_Hit* hit19 = new FROG_Element_Event_Hit(400000001 + ((int)pos19_z)/50, pos19_x, pos19_y, pos19_z, -1);
+  track7->addDaughter(hit19);
+  trackCollection->addDaughter(track7);
+  
+  // photon 8
+  FROG_Element_Event_Track* track8 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos20_x = 0.0299923*1000;
+  double pos20_y = 0.00602767*1000;
+  double pos20_z = -0.189456*1000;
+  FROG_Element_Event_Hit* hit20 = new FROG_Element_Event_Hit(400000001 + ((int)pos20_z)/50, pos20_x, pos20_y, pos20_z, -1);
+  track8->addDaughter(hit20);
+  double pos21_x = 0.0248364*1000;
+  double pos21_y = 0.0129674*1000;
+  double pos21_z = -0.321989*1000;
+  FROG_Element_Event_Hit* hit21 = new FROG_Element_Event_Hit(400000001 + ((int)pos21_z)/50, pos21_x, pos21_y, pos21_z, -1);
+  track8->addDaughter(hit21);
+  double pos22_x = 0.0222521*1000;
+  double pos22_y = 0*1000;
+  double pos22_z = -0.319622*1000;
+  FROG_Element_Event_Hit* hit22 = new FROG_Element_Event_Hit(400000001 + ((int)pos22_z)/50, pos22_x, pos22_y, pos22_z, -1);
+  track8->addDaughter(hit22);
+  double pos23_x = 0.0141387*1000;
+  double pos23_y = -0.04071*1000;
+  double pos23_z = -0.312192*1000;
+  FROG_Element_Event_Hit* hit23 = new FROG_Element_Event_Hit(400000001 + ((int)pos23_z)/50, pos23_x, pos23_y, pos23_z, -1);
+  track8->addDaughter(hit23);
+  trackCollection->addDaughter(track8);
+  
+  // photon 9
+  FROG_Element_Event_Track* track9 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos24_x = 0.0299923*1000;
+  double pos24_y = 0.00602767*1000;
+  double pos24_z = -0.162889*1000;
+  FROG_Element_Event_Hit* hit24 = new FROG_Element_Event_Hit(400000001 + ((int)pos24_z)/50, pos24_x, pos24_y, pos24_z, -1);
+  track9->addDaughter(hit24);
+  double pos25_x = 0.0275782*1000;
+  double pos25_y = 0*1000;
+  double pos25_z = -0.266817*1000;
+  FROG_Element_Event_Hit* hit25 = new FROG_Element_Event_Hit(400000001 + ((int)pos25_z)/50, pos25_x, pos25_y, pos25_z, -1);
+  track9->addDaughter(hit25);
+  trackCollection->addDaughter(track9);
+  
+  // photon 10
+  FROG_Element_Event_Track* track10 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos26_x = 0.0299923*1000;
+  double pos26_y = 0.00602767*1000;
+  double pos26_z = -0.0968708*1000;
+  FROG_Element_Event_Hit* hit26 = new FROG_Element_Event_Hit(400000001 + ((int)pos26_z)/50, pos26_x, pos26_y, pos26_z, -1);
+  track10->addDaughter(hit26);
+  double pos27_x = 0.03*1000;
+  double pos27_y = 0.00603619*1000;
+  double pos27_z = -0.0970637*1000;
+  FROG_Element_Event_Hit* hit27 = new FROG_Element_Event_Hit(400000001 + ((int)pos27_z)/50, pos27_x, pos27_y, pos27_z, -1);
+  track10->addDaughter(hit27);
+  trackCollection->addDaughter(track10);
+  
+  // photon 11
+  FROG_Element_Event_Track* track11 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos28_x = 0.0299923*1000;
+  double pos28_y = 0.00602767*1000;
+  double pos28_z = -0.211734*1000;
+  FROG_Element_Event_Hit* hit28 = new FROG_Element_Event_Hit(400000001 + ((int)pos28_z)/50, pos28_x, pos28_y, pos28_z, -1);
+  track11->addDaughter(hit28);
+  double pos29_x = 0.0231748*1000;
+  double pos29_y = 0.00496626*1000;
+  double pos29_z = -0.328422*1000;
+  FROG_Element_Event_Hit* hit29 = new FROG_Element_Event_Hit(400000001 + ((int)pos29_z)/50, pos29_x, pos29_y, pos29_z, -1);
+  track11->addDaughter(hit29);
+  double pos30_x = 0.0221601*1000;
+  double pos30_y = 0*1000;
+  double pos30_z = -0.326734*1000;
+  FROG_Element_Event_Hit* hit30 = new FROG_Element_Event_Hit(400000001 + ((int)pos30_z)/50, pos30_x, pos30_y, pos30_z, -1);
+  track11->addDaughter(hit30);
+  double pos31_x = 0.0138423*1000;
+  double pos31_y = -0.04071*1000;
+  double pos31_z = -0.312897*1000;
+  FROG_Element_Event_Hit* hit31 = new FROG_Element_Event_Hit(400000001 + ((int)pos31_z)/50, pos31_x, pos31_y, pos31_z, -1);
+  track11->addDaughter(hit31);
+  trackCollection->addDaughter(track11);
+  
+  // photon 12
+  FROG_Element_Event_Track* track12 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos32_x = 0.0299923*1000;
+  double pos32_y = 0.00602767*1000;
+  double pos32_z = -0.233216*1000;
+  FROG_Element_Event_Hit* hit32 = new FROG_Element_Event_Hit(400000001 + ((int)pos32_z)/50, pos32_x, pos32_y, pos32_z, -1);
+  track12->addDaughter(hit32);
+  double pos33_x = 0.03*1000;
+  double pos33_y = 0.00603839*1000;
+  double pos33_z = -0.233429*1000;
+  FROG_Element_Event_Hit* hit33 = new FROG_Element_Event_Hit(400000001 + ((int)pos33_z)/50, pos33_x, pos33_y, pos33_z, -1);
+  track12->addDaughter(hit33);
+  trackCollection->addDaughter(track12);
+  
+  // photon 13
+  FROG_Element_Event_Track* track13 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos34_x = 0.0299923*1000;
+  double pos34_y = 0.00602767*1000;
+  double pos34_z = -0.0352209*1000;
+  FROG_Element_Event_Hit* hit34 = new FROG_Element_Event_Hit(400000001 + ((int)pos34_z)/50, pos34_x, pos34_y, pos34_z, -1);
+  track13->addDaughter(hit34);
+  double pos35_x = 0.03*1000;
+  double pos35_y = 0.00603501*1000;
+  double pos35_z = -0.0353909*1000;
+  FROG_Element_Event_Hit* hit35 = new FROG_Element_Event_Hit(400000001 + ((int)pos35_z)/50, pos35_x, pos35_y, pos35_z, -1);
+  track13->addDaughter(hit35);
+  trackCollection->addDaughter(track13);
+  
+  // photon 14
+  FROG_Element_Event_Track* track14 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos36_x = 0.0299923*1000;
+  double pos36_y = 0.00602767*1000;
+  double pos36_z = -0.0678788*1000;
+  FROG_Element_Event_Hit* hit36 = new FROG_Element_Event_Hit(400000001 + ((int)pos36_z)/50, pos36_x, pos36_y, pos36_z, -1);
+  track14->addDaughter(hit36);
+  double pos37_x = 0.03*1000;
+  double pos37_y = 0.00602573*1000;
+  double pos37_z = -0.0680089*1000;
+  FROG_Element_Event_Hit* hit37 = new FROG_Element_Event_Hit(400000001 + ((int)pos37_z)/50, pos37_x, pos37_y, pos37_z, -1);
+  track14->addDaughter(hit37);
+  trackCollection->addDaughter(track14);
+  
+  // photon 15
+  FROG_Element_Event_Track* track15 = new FROG_Element_Event_Track(0,1,1,0);
+  double pos38_x = 0.0299923*1000;
+  double pos38_y = 0.00602767*1000;
+  double pos38_z = -0.0418564*1000;
+  FROG_Element_Event_Hit* hit38 = new FROG_Element_Event_Hit(400000001 + ((int)pos38_z)/50, pos38_x, pos38_y, pos38_z, -1);
+  track15->addDaughter(hit38);
+  double pos39_x = 0.0281432*1000;
+  double pos39_y = 0*1000;
+  double pos39_z = -0.148365*1000;
+  FROG_Element_Event_Hit* hit39 = new FROG_Element_Event_Hit(400000001 + ((int)pos39_z)/50, pos39_x, pos39_y, pos39_z, -1);
+  track15->addDaughter(hit39);
+  trackCollection->addDaughter(track15);
+  event1->addDaughter(trackCollectionP);
+  event1->addDaughter(trackCollection);
+
+}
+
+void FrogDisplay::BuidEvents(string outputfilename,int nEntryFrog)
+{
+  const Font_t kExRootFont = 42;
+  const Float_t kExRootFontSize = 0.07;
+  gROOT->SetStyle("Plain");
+  gROOT->cd();
+  gStyle->SetCanvasColor(10);
+  gStyle->SetPadColor(10);
+  gStyle->SetFillColor(-1);
+  gStyle->SetPaperSize(20, 24);
+  gStyle->SetStatFont(kExRootFont);
+  gStyle->SetTextFont(kExRootFont);
+  gStyle->SetTextSize(kExRootFontSize);
+  gStyle->SetLegendBorderSize(0);
+  gStyle->SetOptStat(0);
+  
+  TChain* chain    = new TChain("Analysis");
+  TChain* chainGen = new TChain("GEN");
+  chain   ->Add(outputfilename.c_str());
+  chainGen->Add(outputfilename.c_str());
+  
+  ExRootTreeReader *treeReader    = new ExRootTreeReader(chain);
+  ExRootTreeReader *treeReaderGen = new ExRootTreeReader(chainGen);
+  
+  const TClonesArray* branchElectron = treeReader   ->UseBranch("Electron");
+  const TClonesArray* branchMuon     = treeReader   ->UseBranch("Muon");
+  const TClonesArray* branchTau      = treeReader   ->UseBranch("TauJet");
+  const TClonesArray* branchPhoton   = treeReader   ->UseBranch("Photon");
+  const TClonesArray* branchJet      = treeReader   ->UseBranch("Jet");
+  const TClonesArray* branchMET      = treeReader   ->UseBranch("ETmis");
+  const TClonesArray* branchTracks   = treeReader   ->UseBranch("Tracks");
+  const TClonesArray* particles      = treeReaderGen->UseBranch("Particle");
+  
+  TRootElectron* elec;
+  TRootMuon*     muon;
+  TRootTauJet*   tau;
+  TRootPhoton*   photon;
+  TRootJet*      jet;
+  TRootETmis*    met;
+  
+  Long64_t allEntries;
+  allEntries=treeReader->GetEntries();
+  
+  FROG_Events* frog_events = new FROG_Events();
+  if(nEntryFrog > allEntries)
+    {
+      cout<<"nEntry to display by frog greater than number of available events... Exit"<<endl;
+      return;
+    }
+  for(Int_t entry = 0; entry < nEntryFrog; ++entry){
+    cout<<"Event nÂ° "<<entry<<endl;
+    treeReader   ->ReadEntry(entry);
+    treeReaderGen->ReadEntry(entry);
+    
+    //Create a new event
+    FROG_Element_Event* frog_event =  new FROG_Element_Event(1,entry);
+    frog_events->AddEvent(frog_event);
+    
+    //Create a new branch in the event with name SIM and ID = EVTID_SIM
+    FROG_Element_Base_With_DetId_And_Name* frog_branchSIM = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM,"SIM");
+    frog_event->addDaughter(frog_branchSIM);
+    
+    //SIM ELEC
+    //Create a new sub-branch in the SIM branch with name Electrons: this sub branch will contais all the electrons
+    FROG_Element_Base_With_DetId_And_Name* frog_branchElectrons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+1000,"Electrons");
+    frog_branchSIM->addDaughter(frog_branchElectrons);
+    
+    for(int p=0;p<branchElectron->GetEntriesFast();p++){
+      elec = (TRootElectron*) branchElectron->At(p);
+      cout<<"Elec nO "<<p<<" PT: "<<elec->PT<<" Eta "<<elec->Eta<<" Phi"<<elec->Phi<<endl;
+      FROG_Element_Event_Candidate* frog_elec = new FROG_Element_Event_Candidate(11,elec->E,elec->Eta,elec->Phi);
+      
+      frog_branchElectrons->addDaughter(frog_elec);
+    }
+    
+    //SIM MUONS
+    //Create a new sub-branch in the SIM branch with name Muons: this sub branch will contais all the muons
+    FROG_Element_Base_With_DetId_And_Name* frog_branchMuons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+2000,"Muons");
+    frog_branchSIM->addDaughter(frog_branchMuons);
+    for(int p=0;p<branchMuon->GetEntriesFast();p++){
+      muon = (TRootMuon*) branchMuon->At(p);
+      cout<<"Muon nO"<<p<<" PT: "<<muon->PT<<"Eta "<<muon->Eta<<" Phi"<<muon->Phi<<endl;
+      FROG_Element_Event_Candidate* frog_muon = new FROG_Element_Event_Candidate(13,muon->E,muon->Eta,muon->Phi);
+      frog_branchMuons->addDaughter(frog_muon);
+    }
+    
+    //SIM TAUS
+    //Create a new sub-branch in the SIM branch with name Taus: this sub branch will contais all the Taus
+    FROG_Element_Base_With_DetId_And_Name* frog_branchTaus = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+3000,"Taus");
+    frog_branchSIM->addDaughter(frog_branchTaus);
+    for(int p=0;p<branchTau->GetEntriesFast();p++){
+      tau = (TRootTauJet*) branchTau->At(p);
+      cout<<"Tau nO"<<p<<" PT: "<<tau->PT<<"Eta "<<tau->Eta<<" Phi"<<tau->Phi<<endl;
+      FROG_Element_Event_Candidate* frog_tau = new FROG_Element_Event_Candidate(15,tau->E,tau->Eta,tau->Phi);
+      frog_branchTaus->addDaughter(frog_tau);
+    }
+    
+    //SIM PHOTONS
+    //Create a new sub-branch in the SIM branch with name Photons: this sub branch will contais all the Photons
+    FROG_Element_Base_With_DetId_And_Name* frog_branchPhotons = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+4000,"Photons");
+    frog_branchSIM->addDaughter(frog_branchPhotons);
+    for(int p=0;p<branchPhoton->GetEntriesFast();p++){
+      photon = (TRootPhoton*) branchPhoton->At(p);
+      cout<<"Photon nO"<<p<<" PT: "<<photon->PT<<"Eta "<<photon->Eta<<" Phi"<<photon->Phi<<endl;
+      FROG_Element_Event_Candidate* frog_photon = new FROG_Element_Event_Candidate(15,photon->E,photon->Eta,photon->Phi);
+      frog_branchPhotons->addDaughter(frog_photon);
+    }
+    
+    //SIM JETS
+    //Create a new sub-branch in the SIM branch with name Jets: this sub branch will contais all the Jets
+    FROG_Element_Base_With_DetId_And_Name* frog_branchJets = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+5000,"Jets");
+    frog_branchSIM->addDaughter(frog_branchJets);
+    for(int p=0;p<branchJet->GetEntriesFast();p++){
+      jet = (TRootJet*) branchJet->At(p);
+      cout<<"Jet nO"<<p<<" PT: "<<jet->PT<<"Eta "<<jet->Eta<<" Phi"<<jet->Phi<<endl;
+      FROG_Element_Event_Jet* frog_jet = new FROG_Element_Event_Jet(jet->E,jet->Eta,jet->Phi);
+      frog_branchJets->addDaughter(frog_jet);
+    }
+    
+    //SIM MET
+    //Create a new sub-branch in the SIM branch with name MET: this sub branch will contais all the METs
+    FROG_Element_Base_With_DetId_And_Name* frog_branchMET = new FROG_Element_Base_With_DetId_And_Name(EVTID_SIM+6000,"MET");
+    frog_branchSIM->addDaughter(frog_branchMET);
+    for(int p=0;p<branchMET->GetEntriesFast();p++){
+      met = (TRootETmis*) branchMET->At(p);
+      cout<<"MET nO"<<p<<" ET: "<<met->ET<<"Eta "<<0<<" Phi"<<met->Phi<<endl;
+      FROG_Element_Event_MET* frog_met = new FROG_Element_Event_MET(0,met->ET,0,met->Phi, met->ET);
+      frog_branchMET->addDaughter(frog_met);
+    }
+    
+    //Save the event in the .vis file
+    frog_events->SaveInLive("DelphesToFrog.vis",false,false,(unsigned int)-1);
+  }
+  
+  delete treeReader;
+  delete treeReaderGen;
+  delete frog_events;
+}
+
+void FrogDisplay::BuildGeom(string DetDatacard)
+{
+  //Smearing information
+  RESOLution *DET = new RESOLution();
+  DET->ReadDataCard(DetDatacard);
+ 
+  // This element is the root of the "file" tree.  (don't change this line)
+  FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY);
+  
+  FROG_Element_Base* mygeom = new FROG_Element_Base(C_GEOMETRY);
+  prim->addDaughter(mygeom);
+  
+  FROG_Element_Base_With_DetId_And_Name* detector = new FROG_Element_Base_With_DetId_And_Name(900000000,"Delphes");
+  mygeom->addDaughter(detector);
+  
+  double Rayon_Tracker=50;
+  double Rayon_Calo = Rayon_Tracker*2;
+  double Lenght_Tracker=120;
+  double Lenght_Calo=Lenght_Tracker+Lenght_Tracker/2;
+  double Lenght_FWCalo=Lenght_Tracker+Lenght_Tracker;
+  
+  int NumPhi=10;
+  
+  //************************************************Tracker*************************************************
+  //********************************************************************************************************
+  
+  FROG_Element_Base_With_DetId_And_Name* Tracker = new FROG_Element_Base_With_DetId_And_Name(910000000,"Tracker");
+  detector->addDaughter(Tracker);
+  unsigned int DetIdCountTracker = 1;
+  for(double ray=0;ray <= Rayon_Tracker;ray +=5){
+    double length = ray/tan(EtaToTheta(DET->CEN_max_tracker));
+    if(length >= Lenght_Tracker)
+      {
+	FROG_Element_Primitive_Cylinder* tracker = new FROG_Element_Primitive_Cylinder(9100000+DetIdCountTracker*10,ray,0,0,0,0,0,Lenght_Tracker,NumPhi,0);
+	Tracker->addDaughter(tracker);   DetIdCountTracker++;
+      }
+    else {
+      FROG_Element_Primitive_Cylinder* tracker = new FROG_Element_Primitive_Cylinder(9100000+DetIdCountTracker*10,ray,0,0,0,0,0,length,NumPhi,0);                                  
+      Tracker->addDaughter(tracker);   DetIdCountTracker++;         
+    }
+  }
+  
+  //******************************************Central calorimeters******************************************
+  //********************************************************************************************************
+  
+  FROG_Element_Base_With_DetId_And_Name* CALO = new FROG_Element_Base_With_DetId_And_Name(920000000,"Calo");
+  detector->addDaughter(CALO);
+  unsigned int DetIdCountCalo = 1;
+  
+  for(double ray=Rayon_Tracker;ray <= Rayon_Calo ;ray +=5){
+    double length = ray/tan(EtaToTheta(DET->CEN_max_calo_cen));
+    double add;
+    if(length >= Lenght_Calo)add=Lenght_Calo;
+    else add=ray/tan(EtaToTheta(DET->CEN_max_calo_cen));
+    if(add > 0)
+      {
+	FROG_Element_Primitive_Cylinder* calo = new FROG_Element_Primitive_Cylinder(9200000+DetIdCountCalo*10,ray,0,0,0,0,0,add,NumPhi,0);
+	CALO->addDaughter(calo);   DetIdCountCalo++;
+      }
+  }
+  for(double ray=0;ray <= Rayon_Tracker;ray +=5){
+    double length = ray/tan(EtaToTheta(DET->CEN_max_calo_cen));
+    double add;
+    if(length >= Lenght_Calo)add=(Lenght_Calo-Lenght_Tracker)/2;
+    else add=(length-Lenght_Tracker)/2;
+    if(add > 0)
+      {
+	FROG_Element_Primitive_Cylinder* caloP = new FROG_Element_Primitive_Cylinder(9200000+DetIdCountCalo*10,ray,0,0,(Lenght_Tracker+add)/2,0,0,add,NumPhi,0);
+	CALO->addDaughter(caloP);   DetIdCountCalo++;
+	FROG_Element_Primitive_Cylinder* caloM = new FROG_Element_Primitive_Cylinder(9200000+DetIdCountCalo*10,ray,0,0,-(Lenght_Tracker+add)/2,0,0,add,NumPhi,0);
+	CALO->addDaughter(caloM);   DetIdCountCalo++;
+      }        
+  }
+  
+  //******************************************Forward calorimeters******************************************
+  //********************************************************************************************************
+  
+  FROG_Element_Base_With_DetId_And_Name* FWCALO = new FROG_Element_Base_With_DetId_And_Name(930000000,"FWCalo");
+  detector->addDaughter(FWCALO);
+  unsigned int DetIdCountFwCalo = 1;
+  
+  double eta_Max=DET->CEN_max_calo_fwd,eta_Min=DET->CEN_max_calo_cen;
+  
+  for(double ray=0;ray <= 50;ray +=5){
+    double length = ray/tan(EtaToTheta(eta_Max));
+    double add;
+    if(length >= Lenght_FWCalo)add=(Lenght_FWCalo-Lenght_Calo)/2;
+    else add=(length-Lenght_Calo)/2;
+    
+    if(add > 0 && ray < Lenght_FWCalo*tan(EtaToTheta(eta_Min)))
+      {
+	FROG_Element_Primitive_Cylinder* caloFW1 = new FROG_Element_Primitive_Cylinder(9300000+DetIdCountFwCalo*10,ray,0,0,(Lenght_Calo+add)/2,0,0,add,NumPhi,0);
+	FWCALO->addDaughter(caloFW1);   DetIdCountFwCalo++;
+	FROG_Element_Primitive_Cylinder* caloFW2 = new FROG_Element_Primitive_Cylinder(9300000+DetIdCountFwCalo*10,ray,0,0,-(Lenght_Calo+add)/2,0,0,add,NumPhi,0);
+	FWCALO->addDaughter(caloFW2);   DetIdCountFwCalo++;
+      }
+  }
+    
+  FROG_Geometry* CustomGeom = new FROG_Geometry(prim);
+  CustomGeom->Save("DelphesToFrog.geom");
+  
+  FROG_ELEMENT::PrintTree(prim);
+  return;
+
+}
+
