Index: trunk/Delphes.cpp
===================================================================
--- trunk/Delphes.cpp	(revision 269)
+++ trunk/Delphes.cpp	(revision 270)
@@ -385,9 +385,11 @@
       // 2.1a Loop over all particles in event, to fill the towers
       itGen.Reset();
-      TRootGenParticle *particle; 
-      while( (particle = (TRootGenParticle*) itGen.Next()) ) {
-	  int pid = abs(particle->PID);
-	  particle->Charge=Charge(pid);
-	  particle->setFractions(); // init
+      GenParticle *particleG; 
+      while( (particleG = (GenParticle*) itGen.Next()) ) {
+
+      TRootGenParticle *particle = new TRootGenParticle(particleG);
+      int pid = abs(particle->PID);
+      particle->Charge=ChargeVal(particle->PID);
+      particle->setFractions(); // init
 
 
@@ -407,10 +409,9 @@
             // 2.1a.2.1 Central solenoidal magnetic field 
 	    TRACP->bfield(particle); // fills in particle->EtaCalo et particle->PhiCalo
-
 	    // 2.1a.2.2 Filling the calorimetric towers -- includes also forward detectors ?
 	    // first checks if the charged particles reach the calo!
 	    if( DET->FLAG_bfield || 
-                particle->getCharge()==0 ||
-                (!DET->FLAG_bfield && particle->getCharge()!=0 && particle->PT > DET->TRACK_ptmin)) 
+                particle->Charge==0 ||
+                (!DET->FLAG_bfield && particle->Charge!=0 && particle->PT > DET->TRACK_ptmin)) 
 	    if(
 		(particle->EtaCalo > list_of_calorimeters.getEtamin() ) &&
@@ -434,5 +435,5 @@
 	    // if bfield not simulated, pt should be high enough to be taken into account
 	    // it is supposed here that DET->MAX_calo > DET->CEN_max_tracker > DET->CEN_max_mu > 0
-	    if( particle->getCharge() !=0 &&
+	    if( particle->Charge !=0 &&
 	        fabs(particle->EtaCalo)< DET->CEN_max_tracker && // stays in the tracker -> track available
 	       ( DET->FLAG_bfield || 
@@ -447,5 +448,5 @@
 
 		   // 2.1a.2.3.2 Muons
-		   if (pid == pMU && fabs(particle->EtaCalo)< DET->CEN_max_mu && particle->PT > DET->PTCUT_muon ) {
+		   if (pid == pMU && fabs(particle->EtaCalo)< DET->CEN_max_mu) {
                         TLorentzVector p;
                         float sPT = gRandom->Gaus(particle->PT, DET->MU_SmearPt*particle->PT );
@@ -518,4 +519,5 @@
 
           } // 2.1a.2 : if visible particle
+        delete particle;
       } // loop on all particles 2.1a
 	
@@ -589,6 +591,4 @@
 	elementPhoton = (TRootPhoton*) branchPhoton->NewEntry();
 	elementPhoton->Set(gamma[i].Px(),gamma[i].Py(),gamma[i].Pz(),gamma[i].E());
-        elementPhoton->EtaCalo = gamma[i].EtaCalo();
-        elementPhoton->PhiCalo = gamma[i].PhiCalo();
       }
       
Index: trunk/Examples/src/Analysis_Ex.cc
===================================================================
--- trunk/Examples/src/Analysis_Ex.cc	(revision 269)
+++ trunk/Examples/src/Analysis_Ex.cc	(revision 270)
@@ -145,7 +145,7 @@
       //*****************************************************
       TIter itGen((TCollection*)GEN);
-      TRootGenParticle *gen;
+      GenParticle *gen;
       itGen.Reset();
-      while( (gen = (TRootGenParticle*) itGen.Next()) )
+      while( (gen = (GenParticle*) itGen.Next()) )
 	{
           PID      = gen->PID;      // particle HEP ID number 
@@ -155,5 +155,5 @@
           D1       = gen->D1;       // particle 1st daughter 
           D2       = gen->D2;       // particle 2nd daughter 
-          Charge = gen->getCharge();   // electrical charge
+          Charge = gen->Charge;   // electrical charge
 	  
           T      = gen->T;        // particle vertex position (t component)
Index: trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h
===================================================================
--- trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h	(revision 269)
+++ trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h	(revision 270)
@@ -164,11 +164,7 @@
   float Phi; // particle azimuthal angle in rad 
 
-  float EtaCalo; // particle pseudorapidity when entering the calo, 
-  float PhiCalo; // particle azimuthal angle in rad when entering the calo
-
   void Set(const TLorentzVector& momentum);
   void Set(const float px, const float py, const float pz, const float e);
   void SetEtaPhi(const float eta, const float phi) {Eta=eta; Phi=phi;};
-  void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
   void SetEtaPhiEET(const float eta, const float phi, const float e, const float et);
   static TCompare *fgCompare; //!
@@ -179,11 +175,10 @@
 };
 
-
-//---------------------------------------------------------------------------
-
-class TRootGenParticle: public TRootParticle {
-
-public:
-  TRootGenParticle() {_initialised=false;}
+//--------------------------------------------------------------------------
+
+class GenParticle: public TRootParticle {
+
+public:
+  GenParticle() {};
   int PID; // particle HEP ID number [RawHepEventParticle::pid()]
   int Status; // particle status [RawHepEventParticle::status()]
@@ -193,4 +188,33 @@
   int D2; // particle 2nd daughter [RawHepEventParticle::daughter2() - 1]
 
+  float Charge;
+
+  float T; // particle vertex position (t component) [RawHepEventParticle::t()]
+  float X; // particle vertex position (x component) [RawHepEventParticle::x()]
+  float Y; // particle vertex position (y component) [RawHepEventParticle::y()]
+  float Z; // particle vertex position (z component) [RawHepEventParticle::z()]
+  float M;
+ 
+
+  static TCompare *fgCompare; //!
+  
+  ClassDef(GenParticle, 1)
+};
+
+//---------------------------------------------------------------------------
+
+class TRootGenParticle: public TRootParticle {
+
+public:
+  TRootGenParticle() {_initialised=false;}
+  TRootGenParticle(GenParticle* part);
+
+  int PID; // particle HEP ID number [RawHepEventParticle::pid()]
+  int Status; // particle status [RawHepEventParticle::status()]
+  int M1; // particle 1st mother [RawHepEventParticle::mother1() - 1]
+  int M2; // particle 2nd mother [RawHepEventParticle::mother2() - 1]
+  int D1; // particle 1st daughter [RawHepEventParticle::daughter1() - 1]
+  int D2; // particle 2nd daughter [RawHepEventParticle::daughter2() - 1]
+
   float T; // particle vertex position (t component) [RawHepEventParticle::t()]
   float X; // particle vertex position (x component) [RawHepEventParticle::x()]
@@ -199,11 +223,14 @@
   float M;
   void setFractions();
-  const float getCharge() const {return Charge;};
   const float getFem()  {if(!_initialised) setFractions(); return _Fem;}
   const float getFhad() {if(!_initialised) setFractions(); return _Fhad;}
 
+  float EtaCalo; // particle pseudorapidity when entering the calo, 
+  float PhiCalo; // particle azimuthal angle in rad when entering the calo
+  void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
+
+  static TCompare *fgCompare; //!
+
   float Charge;      // electrical charge
-
-  static TCompare *fgCompare; //!
  protected:
   float _Fem, _Fhad; // fractions of energy deposit
@@ -222,4 +249,8 @@
   static TCompare *fgCompare; //!
 
+  float EtaCalo; // particle pseudorapidity when entering the calo, 
+  float PhiCalo; // particle azimuthal angle in rad when entering the calo
+  void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
+
   bool IsolFlag;
 
@@ -247,4 +278,8 @@
   int Charge; // particle Charge [RawHepEventParticle::pid()]
   bool IsolFlag;
+  float EtaCalo; // particle pseudorapidity when entering the calo, 
+  float PhiCalo; // particle azimuthal angle in rad when entering the calo
+  void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
+
   static TCompare *fgCompare; //!
 
Index: trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc
===================================================================
--- trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc	(revision 269)
+++ trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc	(revision 270)
@@ -36,4 +36,5 @@
 
 TCompare *TRootGenParticle::fgCompare = 0;
+TCompare *GenParticle::fgCompare = 0;
 TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
 TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
@@ -90,4 +91,17 @@
    Px = PT*cos(Phi);
    Py = PT*sin(Phi);
+}
+
+TRootGenParticle::TRootGenParticle(GenParticle* part) :
+PID(part->PID),Status(part->Status),M1(part->M1),M2(part->M2),D1(part->D1),D2(part->D2),
+T(part->T),X(part->X),Y(part->Y),Z(part->Z),M(part->M){
+    E=part->E;
+    Px=part->Px;
+    Py=part->Py;
+    Pz=part->Pz;
+    Eta=part->Eta;
+    Phi=part->Phi;
+    PT=part->PT;
+    _initialised=false;
 }
 
Index: trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h
===================================================================
--- trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h	(revision 269)
+++ trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h	(revision 270)
@@ -42,4 +42,5 @@
 #pragma link C++ class TRootSelectorInfo;
 #pragma link C++ class TRootGenParticle;
+#pragma link C++ class GenParticle;
 #pragma link C++ class TRootElectron;
 #pragma link C++ class TRootMuon;
Index: trunk/interface/SmearUtil.h
===================================================================
--- trunk/interface/SmearUtil.h	(revision 269)
+++ trunk/interface/SmearUtil.h	(revision 270)
@@ -244,5 +244,5 @@
 
 //************* Returns an array of the quarks sitting within the tracker acceptance ***************
-int Charge(const int pid);
+int ChargeVal(const int pid);
 
 #endif
Index: trunk/src/BFieldProp.cc
===================================================================
--- trunk/src/BFieldProp.cc	(revision 269)
+++ trunk/src/BFieldProp.cc	(revision 270)
@@ -118,5 +118,5 @@
 void TrackPropagation::Propagation(const TRootGenParticle *Part,TLorentzVector &momentum) {
 
-  q  = Charge(Part->PID);
+  q  = ChargeVal(Part->PID);
   if(q==0) return;
 
@@ -324,5 +324,5 @@
   if (!DET->FLAG_bfield ) return;
 
-  q  = Charge(Part->PID);
+  q  = ChargeVal(Part->PID);
   if(q==0) return;
   if(R_max ==0) { cout << "ERROR: magnetic field has no lateral extention\n"; return;}
Index: trunk/src/HEPEVTConverter.cc
===================================================================
--- trunk/src/HEPEVTConverter.cc	(revision 269)
+++ trunk/src/HEPEVTConverter.cc	(revision 270)
@@ -176,5 +176,5 @@
 
   ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputFileName, "GEN");
-  ExRootTreeBranch *branchGen = treeWriter->NewBranch("Particle", TRootGenParticle::Class());
+  ExRootTreeBranch *branchGen = treeWriter->NewBranch("Particle", GenParticle::Class());
   
   ifstream infile(inputFileList.c_str());
@@ -211,5 +211,5 @@
       Float_t signEta;
       
-      TRootGenParticle *element;
+      GenParticle *element;
       
       // Loop over all events
@@ -222,5 +222,5 @@
 	  for(particle = 0; particle < event.Nhep; ++particle)
 	    {
-	      element = (TRootGenParticle*) branchGen->NewEntry();
+	      element = (GenParticle*) branchGen->NewEntry();
 	      
 	      element->PID = event.Idhep[particle];	
Index: trunk/src/STDHEPConverter.cc
===================================================================
--- trunk/src/STDHEPConverter.cc	(revision 269)
+++ trunk/src/STDHEPConverter.cc	(revision 270)
@@ -58,5 +58,5 @@
 void STDHEPConverter::AnalyseParticles(ExRootTreeBranch *branch)
 {
-  TRootGenParticle *element;
+  GenParticle *element;
 
   Double_t signPz;
@@ -66,5 +66,5 @@
   for(number = 0; number < myhepevt.nhep; ++number)
   {
-    element = static_cast<TRootGenParticle*>(branch->NewEntry());
+    element = static_cast<GenParticle*>(branch->NewEntry());
 
     element->PID = myhepevt.idhep[number];
@@ -116,5 +116,5 @@
   ExRootTreeBranch *branchGenEvent = treeWriter->NewBranch("Event", TRootGenEvent::Class());
   // generated particles from HEPEVT
-  ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", TRootGenParticle::Class());
+  ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", GenParticle::Class());
   
   // Open a stream connected to an event file:
Index: trunk/src/SmearUtil.cc
===================================================================
--- trunk/src/SmearUtil.cc	(revision 269)
+++ trunk/src/SmearUtil.cc	(revision 270)
@@ -1105,5 +1105,5 @@
 }
 
-int Charge(const int pid)
+int ChargeVal(const int pid)
 {
   int charge;
