/Users/proj/cdc/soft/MarlinTPC/tmp
diff -uNr v01-06.ORIG/CMakeLists.txt v01-06/CMakeLists.txt
--- v01-06.ORIG/CMakeLists.txt	2020-03-28 10:29:13.000000000 +0900
+++ v01-06/CMakeLists.txt	2022-03-03 10:47:40.000000000 +0900
@@ -125,17 +125,21 @@
        STRING(REGEX REPLACE ".*so[.]([0-9]+[.][0-9]+[.][0-9]+)" "\\1" GBLLIBVERSION "${GBLLIBS}")
        MESSAGE(STATUS "GBL library version " ${GBLLIBVERSION})
     ELSE()
+       #	    /Users/proj/soft/ilcsoft/v02-02-03/GBL/V02-02-00/lib/libGBL.dylib
        file(GLOB GBLLIBS "${GBL_DIR}/lib/libGBL.*dylib")
-       STRING(REGEX REPLACE "[^.]*[.]([0-9]+).*" "\\1" GBLVERSIONMAJOR "${GBLLIBS}")
+       #STRING(REGEX REPLACE "[^.]*[.]([0-9]+).*" "\\1" GBLVERSIONMAJOR "${GBLLIBS}")
+       STRING(REGEX REPLACE "[^.]*V([0-9]+)-*" "\\1" GBLVERSIONMAJOR "${GBLLIBS}")
        STRING(REGEX REPLACE "[^.]*[.]([0-9]+[.][0-9]+[.][0-9]+)[.]dylib" "\\1" GBLLIBVERSION "${GBLLIBS}")
        MESSAGE(STATUS "GBL library version " ${GBLLIBVERSION})
     ENDIF()
+    MESSAGE( STATUS "GBLVERSIONMAJOR = ${GBLVERSIONMAJOR}" )
     if ( GBLVERSIONMAJOR GREATER "1" )
         MESSAGE(STATUS "Use FindEigen3.cmake from this GBL_DIR: " ${GBL_DIR}/cmake)
         LIST( APPEND CMAKE_MODULE_PATH ${GBL_DIR}/cmake )
         FIND_PACKAGE(Eigen3 REQUIRED)
         ADD_DEFINITIONS( "-DGBL_EIGEN_SUPPORT_ROOT" )
-        INCLUDE_DIRECTORIES( BEFORE ${ROOT_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR} )
+	INCLUDE_DIRECTORIES( BEFORE ${ROOT_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR} )
+	MESSAGE( STATUS "EIGEN3_INCLUDE_DIR = ${EIGEN3_INCLUDE_DIR}" )
     ELSE()
         MESSAGE(STATUS "GBL version < 2.x, will use ROOT instead of Eigen3.")
     ENDIF()
diff -uNr v01-06.ORIG/analysis/src/RootFileProcessor.cc v01-06/analysis/src/RootFileProcessor.cc
--- v01-06.ORIG/analysis/src/RootFileProcessor.cc	2020-03-28 10:29:20.000000000 +0900
+++ v01-06/analysis/src/RootFileProcessor.cc	2021-02-01 12:38:30.000000000 +0900
@@ -284,6 +284,25 @@
       const TrackerHit* hp 
         = static_cast<const TrackerHit* >(static_cast<const EXTPCHit& >(sitep->GetHit()).GetHitPtr() ) ;
       double fi0loc  = sitep->GetCurState()(1, 0); 
+#if 1
+      int modID = getModuleID( const_cast< EVENT::TrackerHit* >( hp ) ) ; 
+      int rowID = getRowID( const_cast< EVENT::TrackerHit* >( hp ) ,
+		            static_cast< const gear::TPCModule* >( moduleVec[ modID ]) ) ;
+      const double* hpos = hp->getPosition() ;
+      TVector3 xv( hpos[0], hpos[1], hpos[2] ) ;
+      float rc     = xv.Perp() ;
+      float phic   = TMath::ATan2( xv.X() , xv.Y() ) ;
+
+      THelicalTrack helix = static_cast<TKalTrackState &>(sitep->GetCurState()).GetHelix();
+      TMatrixD tm = helix.CalcDxDphi(0.);
+      TVector2 tv(tm(0,0),tm(1,0));
+      if (cpa > 0) tv *= -1.;
+      tv.Unit();
+      TVector2 xvunit = (xv.XYvector()).Unit();
+      // FIXME
+      // Should do this in the local frame.
+      double fiinc = tv.DeltaPhi(xvunit);
+#endif
       int index = sitep->GetHit().GetMeasLayer().GetIndex();
       double dxin = sitep->GetResVec()(0,0);
       double dzin = sitep->GetResVec()(1,0);
@@ -307,16 +326,9 @@
       _hits->fill( 11, nhits[index] ) ;
       _hits->fill( 12, nTrks ) ;
       _hits->fill( 13, fi0loc) ;
+      _hits->fill( 14, fiinc ) ;
       _hits->addRow() ;
      
-       
-      int modID = getModuleID( const_cast< EVENT::TrackerHit* >( hp ) ) ; 
-      int rowID = getRowID( const_cast< EVENT::TrackerHit* >( hp ) ,
-		            static_cast< const gear::TPCModule* >( moduleVec[ modID ]) ) ;
-      const double* hpos = hp->getPosition() ;
-      TVector3 xv( hpos[0], hpos[1], hpos[2] ) ;
-      float rc     = xv.Perp() ;
-      float phic   = TMath::ATan2( xv.X() , xv.Y() ) ;
       const EVENT::LCObjectVec& pulseVec = hp->getRawHits() ;
       for ( std::vector< EVENT::LCObject* >::const_iterator i_pls  = pulseVec.begin() ;
                                                             i_pls != pulseVec.end() ;
@@ -348,6 +360,7 @@
         _clrs->fill(10 , tnl     ) ;
         _clrs->fill(11 , nTrks   ) ;
         _clrs->fill(12 , fi0loc  ) ;
+        _clrs->fill(13 , fiinc   ) ;
 
 	_clrs->addRow() ;
 
@@ -434,6 +447,9 @@
   _clrsItemNames.push_back("fi0loc");
   _clrsItemType.push_back("double");
 
+  _clrsItemNames.push_back("fiinc");
+  _clrsItemType.push_back("double");
+
   _hitsItemNames.push_back("serialrow");
   _hitsItemType.push_back("int");
 
@@ -476,6 +492,9 @@
   _hitsItemNames.push_back("fi0loc");
   _hitsItemType.push_back("double");
 
+  _hitsItemNames.push_back("fiinc");
+  _hitsItemType.push_back("double");
+
   _trksItemNames.push_back("ndf");
   _trksItemType.push_back("int");
 
