/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-06-17 19:51:16.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()
@@ -268,6 +272,10 @@
     ./tools/MappingGenerator/MappingGenerator.cpp
 )
 
+ADD_MARLINTPC_TOOL( DummyMappingGenerator
+    ./tools/MappingGenerator/DummyMappingGenerator.cc
+)
+
 ADD_MARLINTPC_TOOL( ChannelCorrectionGenerator
     ./tools/ChannelCorrectionGenerator/ChannelCorrectionGenerator.cpp
 )
diff -uNr v01-06.ORIG/tools/MappingGenerator/DummyMappingGenerator.cc v01-06/tools/MappingGenerator/DummyMappingGenerator.cc
--- v01-06.ORIG/tools/MappingGenerator/DummyMappingGenerator.cc	2022-06-18 19:39:18.000000000 +0900
+++ v01-06/tools/MappingGenerator/DummyMappingGenerator.cc	2022-06-17 20:08:39.000000000 +0900
@@ -0,0 +1,113 @@
+//LCIO
+#include "lcio.h"
+#include "IO/LCWriter.h"
+#include "EVENT/LCIO.h"
+#include "IMPL/LCEventImpl.h"
+#include "IMPL/LCGenericObjectImpl.h"
+#include "IMPL/LCCollectionVec.h"
+#include "IMPL/LCTOOLS.h"
+#include "UTIL/LCTime.h"
+//LCCD
+#include "lccd.h"
+#include "lccd/DBInterface.hh"
+//GEAR
+#include "gear/TPCParameters.h"
+#include "gear/TPCModule.h"
+#include "gearxml/GearXML.h"
+#include "gear/GearMgr.h"
+#include "gear/GEAR.h"
+//TPCCONDDATA
+#include "ADCChannelMapping.h"
+
+//C++
+#include <iostream>
+#include <string>
+
+void printUsage()
+{
+    std::cout<<"Usage:"<<std::endl;
+    std::cout<<"To write data to a lcio simple file:"<<std::endl;
+    std::cout<<"  DummyMappingGenerator gearfile.xml [outfile.slcio]" <<std::endl;
+    std::cout<<"  (outfile name is optional, default is TPCChannelMapping.slcio)"<< std::endl;
+}
+
+
+
+int main(int argc, char **argv)
+{
+    std::string outFileName;
+    lcio::LCWriter* lcWrt=nullptr;
+    lcio::LCEventImpl*  evt=nullptr;
+    if (argc != 2 && argc != 3 )
+    {
+        printUsage();
+        return(1);
+    }
+    
+    //DEBUG
+    for (int i=0; i< argc ; ++i)
+    {
+        std::cout<<"DEBUG: argument ["<<i<<"]: "<<argv[i]<<std::endl;
+    } 
+    
+    // read pad layout from gear
+    gear::GearXML gearXML( argv[1] ) ;
+    gear::GearMgr* gearMgr = gearXML.createGearMgr() ;
+    gear::TPCParameters const &tpcParams=gearMgr->getTPCParameters();
+
+    // get outfile name
+    if (argc==3)
+        outFileName=argv[2];
+    else
+        outFileName="TPCChannelMapping.slcio";
+    // open outfile
+    lcWrt = lcio::LCFactory::getInstance()->createLCWriter() ;
+    lcWrt->open( outFileName, lcio::LCIO::WRITE_NEW ) ;
+    // create new lcio event
+    evt = new lcio::LCEventImpl() ;
+
+    // create the collection we want to store the data in
+    lcio::LCCollectionVec* mappingCol = new lcio::LCCollectionVec( lcio::LCIO::LCGENERICOBJECT );
+    
+    auto modules = tpcParams.getModules();
+    // loop over modules
+    for (auto module : modules) {
+	auto moduleID = module->getModuleID();
+        auto nrows = module->getNRows();
+	// loop over rows
+        for (int row=0; row<nrows; row++) {
+            auto padsInRow = module->getPadsInRow(row); 
+	    // loop over pads
+	    for (auto pad_index : padsInRow) {
+                auto pad = module->getPadNumber(pad_index);
+                tpcconddata::ADCChannelMapping * channelmapping
+#if 0
+                    = new tpcconddata::ADCChannelMapping(hw_channel,  pad_index , -1, moduleID, hw_group);
+#else
+                    = new tpcconddata::ADCChannelMapping(pad_index,  pad_index , -1, moduleID, moduleID);
+#endif
+                std::cout << "(module,row,pad,id0)=(" 
+	 	          << moduleID << ", "
+	 	          << row << ", "
+	 	          << pad << ", "
+			  << pad_index <<")" << std::endl;
+                mappingCol->addElement( channelmapping );
+	    }
+	}
+    }
+
+    // add the mapping collection to the event
+    evt->addCollection( mappingCol , "TPCChannelMapping" ) ;
+    // write the event to the file
+    lcWrt->writeEvent( evt ) ;
+    // dump the event to the screen
+    lcio::LCTOOLS::dumpEvent( evt ) ;
+    lcWrt->close() ;
+    // ------------ IMPORTANT ------------- !
+    // we created the event so we need to delete it ...
+    delete evt ;
+    // -------------------------------------
+
+    // That's it
+    return 0;
+}
