Index: classes/DelphesClasses.cc
===================================================================
--- classes/DelphesClasses.cc	(revision 56fb0be1c672a3faaa3d6bad4ec4e462817c7b66)
+++ classes/DelphesClasses.cc	(revision 3a105e5968948572e68704454c96e1ef779e8003)
@@ -230,4 +230,5 @@
   Phi(0), ErrorPhi(0),
   Xd(0), Yd(0), Zd(0),
+  XFirstHit(0), YFirstHit(0), ZFirstHit(0),
   Nclusters(0.0),
   dNdx(0.0),
@@ -409,4 +410,7 @@
   object.Yd = Yd;
   object.Zd = Zd;
+  object.XFirstHit = XFirstHit;
+  object.YFirstHit = YFirstHit;
+  object.ZFirstHit = ZFirstHit;
   object.Nclusters = Nclusters;
   object.dNdx = dNdx;
@@ -544,4 +548,7 @@
   Yd = 0.0;
   Zd = 0.0;
+  XFirstHit = 0.0;
+  YFirstHit = 0.0;
+  ZFirstHit = 0.0;
   Nclusters = 0.0;
   dNdx = 0.0;
Index: classes/DelphesClasses.h
===================================================================
--- classes/DelphesClasses.h	(revision 56fb0be1c672a3faaa3d6bad4ec4e462817c7b66)
+++ classes/DelphesClasses.h	(revision 3a105e5968948572e68704454c96e1ef779e8003)
@@ -458,4 +458,8 @@
   Float_t Zd; // Z coordinate of point of closest approach to vertex
 
+  Float_t XFirstHit; // X coordinate of point of closest approach to vertex
+  Float_t YFirstHit; // Y coordinate of point of closest approach to vertex
+  Float_t ZFirstHit; // Z coordinate of point of closest approach to vertex
+
   Float_t L; // track path length
   Float_t D0; // track transverse impact parameter
@@ -564,4 +568,8 @@
   Float_t Yd; // Y coordinate of point of closest approach to vertex
   Float_t Zd; // Z coordinate of point of closest approach to vertex
+
+  Float_t XFirstHit; // X coordinate of point of closest approach to vertex
+  Float_t YFirstHit; // Y coordinate of point of closest approach to vertex
+  Float_t ZFirstHit; // Z coordinate of point of closest approach to vertex
 
   Float_t L; // track path length
@@ -708,4 +716,8 @@
   Float_t Zd;
 
+  Float_t XFirstHit;
+  Float_t YFirstHit;
+  Float_t ZFirstHit;
+
   // tracking resolution
 
Index: external/TrackCovariance/ObsTrk.cc
===================================================================
--- external/TrackCovariance/ObsTrk.cc	(revision 56fb0be1c672a3faaa3d6bad4ec4e462817c7b66)
+++ external/TrackCovariance/ObsTrk.cc	(revision 3a105e5968948572e68704454c96e1ef779e8003)
@@ -120,5 +120,5 @@
 	//if (pt > maxPt) std::cout << "Warning ObsTrk::GenToObsPar: pt " << pt << " is above grid range of " << maxPt << std::endl;
 	Double_t minAn = fGC->GetMinAng();
-	//if (angd < minAn) std::cout << "Warning ObsTrk::GenToObsPar: angle " << angd 
+	//if (angd < minAn) std::cout << "Warning ObsTrk::GenToObsPar: angle " << angd
 	//	<< " is below grid range of " << minAn << std::endl;
 	Double_t maxAn = fGC->GetMaxAng();
@@ -137,5 +137,7 @@
 	Double_t Xfirst, Yfirst, Zfirst;
 	Int_t iLay = trk->FirstHit(Xfirst, Yfirst, Zfirst);
-	TVector3 fXfirst(Xfirst, Yfirst, Zfirst);
+	fXfirst = TVector3(Xfirst, Yfirst, Zfirst);
+  //std::cout<<"obs trk: "<<Xfirst<<","<<Yfirst<<","<<Zfirst<<std::endl;
+
 	if (inside)
 	{
Index: external/TrackCovariance/SolTrack.cc
===================================================================
--- external/TrackCovariance/SolTrack.cc	(revision 56fb0be1c672a3faaa3d6bad4ec4e462817c7b66)
+++ external/TrackCovariance/SolTrack.cc	(revision 3a105e5968948572e68704454c96e1ef779e8003)
@@ -176,5 +176,5 @@
 {
 	//
-	// Return lists of hits associated to a track including all scattering layers. 
+	// Return lists of hits associated to a track including all scattering layers.
 	// Return value is the total number of measurement hits
 	// kmh = total number of measurement layers hit for given type
@@ -190,5 +190,5 @@
 	{
 		Double_t R; Double_t phi; Double_t zz;
-		if (HitLayer(i, R, phi, zz)) 
+		if (HitLayer(i, R, phi, zz))
 		{
 			zhh[kh] = zz;
@@ -207,5 +207,5 @@
 {
 	//
-	// Return lists of hits associated to a track for all measurement layers. 
+	// Return lists of hits associated to a track for all measurement layers.
 	// Return value is the total number of measurement hits
 	// kmh = total number of measurement layers hit for given type
@@ -236,5 +236,5 @@
 Int_t SolTrack::FirstHit(Double_t &Xfirst, Double_t &Yfirst, Double_t &Zfirst)
 {
-	Int_t iFirst = -1;	
+	Int_t iFirst = -1;
 	Int_t iFirstLay = -1;	// Default return with no hits
 	Xfirst = 0.;
@@ -249,8 +249,8 @@
 		Double_t *dh = new Double_t[Nmh];
 		//
-		Int_t n = HitListXYZ(ih, Xh, Yh, Zh);	
+		Int_t n = HitListXYZ(ih, Xh, Yh, Zh);
 		//
 		for(Int_t i=0; i<Nmh; i++){
-			Double_t rr = TMath::Sqrt(Xh[i]*Xh[i]+Yh[i]*Yh[i]);	// Hit radius		
+			Double_t rr = TMath::Sqrt(Xh[i]*Xh[i]+Yh[i]*Yh[i]);	// Hit radius
 			dh[i] = TMath::ASin(C() * TMath::Sqrt((rr * rr - D() * D()) / (1. + 2 * C() * D()))) / C();	// Arc length traveled
 		}
@@ -327,5 +327,5 @@
 	//
 	//
-	// Input flags: 
+	// Input flags:
 	//				Res = .TRUE. turn on resolution effects/Use standard resolutions
 	//					  .FALSE. set all resolutions to 0
@@ -410,5 +410,5 @@
 			nz = 1.0;
 		}
-		Double_t corr = TMath::Abs(pxi*nx + pyi * ny + pzi * nz) / p(); 
+		Double_t corr = TMath::Abs(pxi*nx + pyi * ny + pzi * nz) / p();
 		Double_t Rlf = fG->lTh(i) / (corr*fG->lX0(i));					// Rad. length fraction
 		thms[ii] = 0.0136*TMath::Sqrt(Rlf)*(1.0 + 0.038*TMath::Log(Rlf)) / p();		// MS angle
@@ -438,5 +438,5 @@
 		Int_t ityp  = fG->lTyp(i);			// Layer type Barrel or Z
 		Int_t nmeai = fG->lND(i);			// # measurements in layer
-		
+
 		if (fG->isMeasure(i))
 		{
@@ -470,5 +470,5 @@
 						Rm(im, 2) = csa * dRphi(2) - ssa * dRz(2);	// C derivative
 						Rm(im, 3) = csa * dRphi(3) - ssa * dRz(3);	// z0 derivative
-						Rm(im, 4) = csa * dRphi(4) - ssa * dRz(4);	// cot(theta) derivative	
+						Rm(im, 4) = csa * dRphi(4) - ssa * dRz(4);	// cot(theta) derivative
 					}
 					if (ityp == 2)		// Z type layer (Measure R-phi at const. Z)
@@ -531,5 +531,5 @@
 						{
 							Double_t strk = 0;
-							if (nmk + 1 == 1) strk = fG->lStU(k);	// Stereo angle upper 
+							if (nmk + 1 == 1) strk = fG->lStU(k);	// Stereo angle upper
 							if (nmk + 1 == 2) strk = fG->lStL(k);	// Stereo angle lower
 							//if (im == km && Res) Sm(im, km) += sig*sig;	// Detector resolution on diagonal
@@ -542,5 +542,5 @@
 							//
 							// Loop on all layers below for MS contributions
-							for (Int_t jj = 0; jj < kk; jj++)		
+							for (Int_t jj = 0; jj < kk; jj++)
 							{
 								Double_t di = dik(ii, jj);
Index: modules/TrackCovariance.cc
===================================================================
--- modules/TrackCovariance.cc	(revision 56fb0be1c672a3faaa3d6bad4ec4e462817c7b66)
+++ modules/TrackCovariance.cc	(revision 3a105e5968948572e68704454c96e1ef779e8003)
@@ -121,4 +121,5 @@
     const TLorentzVector &candidateMomentum = particle->Momentum;
 
+
     Bool_t inside = TrkUtil::IsInside(candidatePosition.Vect(), Rin, ZinNeg, ZinPos); // Check if in inner box
     Bool_t Accept = kTRUE;
@@ -130,4 +131,5 @@
 
     ObsTrk track(candidatePosition.Vect(), candidateMomentum.Vect(), candidate->Charge, fCovariance, fGeometry);
+
 
     mother    = candidate;
@@ -150,4 +152,8 @@
     candidate->Yd = track.GetObsX().Y()*1e03;
     candidate->Zd = track.GetObsX().Z()*1e03;
+
+    candidate->XFirstHit = track.GetFirstHit().X()*1e03;
+    candidate->YFirstHit = track.GetFirstHit().Y()*1e03;
+    candidate->ZFirstHit = track.GetFirstHit().Z()*1e03;
 
     candidate->D0       = track.GetObsPar()[0]*1e03;
Index: modules/TreeWriter.cc
===================================================================
--- modules/TreeWriter.cc	(revision 56fb0be1c672a3faaa3d6bad4ec4e462817c7b66)
+++ modules/TreeWriter.cc	(revision 3a105e5968948572e68704454c96e1ef779e8003)
@@ -384,4 +384,8 @@
     entry->Zd = candidate->Zd;
 
+    entry->XFirstHit = candidate->XFirstHit;
+    entry->YFirstHit = candidate->YFirstHit;
+    entry->ZFirstHit = candidate->ZFirstHit;
+
     const TLorentzVector &momentum = candidate->Momentum;
 
@@ -544,4 +548,8 @@
     entry->Zd = candidate->Zd;
 
+    entry->XFirstHit = candidate->XFirstHit;
+    entry->YFirstHit = candidate->YFirstHit;
+    entry->ZFirstHit = candidate->ZFirstHit;
+
     const TLorentzVector &momentum = candidate->Momentum;
 
