diff -uNr r1980.ORIG/ILCSoft.cmake r1980/ILCSoft.cmake --- r1980.ORIG/ILCSoft.cmake 2010-03-22 05:21:41.000000000 +0900 +++ r1980/ILCSoft.cmake 2010-03-22 05:39:42.000000000 +0900 @@ -0,0 +1,33 @@ +################################################################################ +# Environment script generated by ilcsoft-install on Mon Mar 22 05:18:57 2010 +# for the installation located at [ /proj/soft/ilcsoft/v01-08 ] +################################################################################ + +SET( ILC_HOME "/proj/soft/ilcsoft/v01-08" CACHE PATH "Path to ILC Software" FORCE) + +SET( Marlin_HOME "${ILC_HOME}/Marlin/v00-11" CACHE PATH "Path to Marlin" FORCE) +SET( MarlinUtil_HOME "${ILC_HOME}/MarlinUtil/v00-14-01" CACHE PATH "Path to MarlinUtil" FORCE) +SET( MarlinReco_HOME "${ILC_HOME}/MarlinReco/v00-17-02" CACHE PATH "Path to MarlinReco" FORCE) +SET( PandoraPFA_HOME "${ILC_HOME}/PandoraPFA/v03-02-01" CACHE PATH "Path to PandoraPFA" FORCE) +SET( LCFIVertex_HOME "${ILC_HOME}/LCFIVertex/v00-03" CACHE PATH "Path to LCFIVertex" FORCE) +SET( CEDViewer_HOME "${ILC_HOME}/CEDViewer/v00-07-02" CACHE PATH "Path to CEDViewer" FORCE) +SET( Eutelescope_HOME "${ILC_HOME}/Eutelescope/v00-00-07" CACHE PATH "Path to Eutelescope" FORCE) +SET( MarlinTPC_HOME "/proj/cdc/soft/MarlinTPC/r1980" CACHE PATH "Path to MarlinTPC" FORCE) +SET( Overlay_HOME "${ILC_HOME}/Overlay/v00-07-01" CACHE PATH "Path to Overlay" FORCE) +SET( SiliconDigi_HOME "${ILC_HOME}/SiliconDigi/v00-04-02" CACHE PATH "Path to SiliconDigi" FORCE) +SET( LCCD_HOME "${ILC_HOME}/lccd/v00-06-01" CACHE PATH "Path to LCCD" FORCE) +SET( RAIDA_HOME "${ILC_HOME}/RAIDA/v01-04-03" CACHE PATH "Path to RAIDA" FORCE) +SET( AIDA_HOME "${RAIDA_HOME}" CACHE PATH "Path to AIDA" FORCE) +SET( CED_HOME "${ILC_HOME}/CED/v00-07" CACHE PATH "Path to CED" FORCE) +SET( GEAR_HOME "${ILC_HOME}/gear/v00-13" CACHE PATH "Path to GEAR" FORCE) +SET( LCIO_HOME "${ILC_HOME}/lcio/lcio-v01.12.2-macosx10.6-i386" CACHE PATH "Path to LCIO" FORCE) +SET( CondDBMySQL_HOME "${ILC_HOME}/CondDBMySQL/osxws" CACHE PATH "Path to CondDBMySQL" FORCE) +SET( ROOT_HOME "/opt/root/root_v5.26.00-macosx10.6-i386" CACHE PATH "Path to ROOT" FORCE) +SET( CLHEP_HOME "${ILC_HOME}/CLHEP/osxws" CACHE PATH "Path to CLHEP" FORCE) +SET( GSL_HOME "${ILC_HOME}/gsl/osxws" CACHE PATH "Path to GSL" FORCE) +SET( MySQL_HOME "${ILC_HOME}/mysql/osxws" CACHE PATH "Path to MySQL" FORCE) +SET( CERNLIB_HOME "${ILC_HOME}/cernlib/2006" CACHE PATH "Path to CERNLIB" FORCE) +SET( JAVA_HOME "${ILC_HOME}/java/Home" CACHE PATH "Path to JAVA" FORCE) + +SET( CMAKE_MODULE_PATH "${ILC_HOME}/CMakeModules/v01-08-01" CACHE PATH "Path to CMakeModules" FORCE) + diff -uNr r1980.ORIG/build_env.sh r1980/build_env.sh --- r1980.ORIG/build_env.sh 2010-03-22 05:21:41.000000000 +0900 +++ r1980/build_env.sh 2010-03-22 05:38:09.000000000 +0900 @@ -0,0 +1,127 @@ +################################################################################ +# Environment script generated by ilcsoft-install on Thu Mar 11 02:28:01 2010 +# for MarlinTPC located at [ /proj/soft/ilcsoft/v01-08/MarlinTPC/v00-03-01 ] +################################################################################ + + +#-------------------------------------------------------------------------------- +# Global Environment Variables +#-------------------------------------------------------------------------------- +export MAKEOPTS="-j2" +export LDFLAGS="-g -m32" +export CXX="g++" +export FFLAGS="-g -m32" +export CXXFLAGS="-g -m32" +export CC="gcc" +export FC="gfortran" +export CFLAGS="-g -m32" + +export PATH="$HOME/bin:/usr/osxws/bin:/usr/osxws/sbin:/usr/X11/bin:/bin:/sbin:/usr/bin:/usr/sbin" +#-------------------------------------------------------------------------------- +# ROOT +#-------------------------------------------------------------------------------- +export ROOTSYS="/opt/root/root_v5.26.00-macosx10.6-i386" +export PATH="$ROOTSYS/bin:$PATH" +export LD_LIBRARY_PATH="$ROOTSYS/lib" + +#-------------------------------------------------------------------------------- +# MarlinTPC +#-------------------------------------------------------------------------------- +export PATH="/proj/cdc/soft/MarlinTPC/r1980/bin:$PATH" +export KALTESTROOT="/proj/cdc/soft/MarlinTPC/KalTest" +export KALDETROOT="/proj/cdc/soft/MarlinTPC/KalDet" +export MARLINTPC_HOME="/proj/cdc/soft/MarlinTPC/r1980" +export LD_LIBRARY_PATH="$KALTESTROOT/lib:$LD_LIBRARY_PATH" +export LD_LIBRARY_PATH="$KALDETROOT/lib:$LD_LIBRARY_PATH" + +#-------------------------------------------------------------------------------- +# LCIO +#-------------------------------------------------------------------------------- +export LCIO="/proj/soft/ilcsoft/v01-08/lcio/lcio-v01.12.2-macosx10.6-i386" +export PATH="$LCIO/tools:$LCIO/bin:$PATH" +export LD_LIBRARY_PATH="$LCIO/lib:$LD_LIBRARY_PATH" + + +#-------------------------------------------------------------------------------- +# GEAR +#-------------------------------------------------------------------------------- +export GEAR="/proj/soft/ilcsoft/v01-08/gear/v00-13" +export PATH="$GEAR/tools:$GEAR/bin:$PATH" +export LD_LIBRARY_PATH="$GEAR/lib:$LD_LIBRARY_PATH" + + +#-------------------------------------------------------------------------------- +# GSL +#-------------------------------------------------------------------------------- +export GSL_HOME="/proj/soft/ilcsoft/v01-08/gsl/osxws" +export PATH="$GSL_HOME/bin:$PATH" +export LD_LIBRARY_PATH="$GSL_HOME/lib:$LD_LIBRARY_PATH" + + +#-------------------------------------------------------------------------------- +# Marlin +#-------------------------------------------------------------------------------- +export MARLIN="/proj/soft/ilcsoft/v01-08/Marlin/v00-11" +export PATH="$MARLIN/bin:$PATH" +export MARLIN_DLL="/proj/soft/ilcsoft/v01-08/MarlinReco/v00-17-02/lib/libMarlinReco.dylib:/proj/soft/ilcsoft/v01-08/PandoraPFA/v03-02-01/lib/libPandoraPFA.dylib:/proj/soft/ilcsoft/v01-08/LCFIVertex/v00-03/lib/libLCFIVertex.dylib:/proj/soft/ilcsoft/v01-08/CEDViewer/v00-07-02/lib/libCEDViewer.dylib:/proj/soft/ilcsoft/v01-08/Eutelescope/v00-00-07/lib/libEutelescope.dylib:/proj/soft/ilcsoft/v01-08/Overlay/v00-07-01/lib/libOverlay.dylib:/proj/soft/ilcsoft/v01-08/SiliconDigi/v00-04-02/lib/libSiliconDigi.dylib" + + +#-------------------------------------------------------------------------------- +# CLHEP +#-------------------------------------------------------------------------------- +export CLHEP="/proj/soft/ilcsoft/v01-08/CLHEP/osxws" +export CLHEP_BASE_DIR="$CLHEP" +export CLHEP_INCLUDE_DIR="$CLHEP/include" +export PATH="$CLHEP_BASE_DIR/bin:$PATH" +export LD_LIBRARY_PATH="$CLHEP_BASE_DIR/lib:$LD_LIBRARY_PATH" + + +#-------------------------------------------------------------------------------- +# LCCD +#-------------------------------------------------------------------------------- +export LCCD="/proj/soft/ilcsoft/v01-08/lccd/v00-06-01" + + +#-------------------------------------------------------------------------------- +# CondDBMySQL +#-------------------------------------------------------------------------------- +export CondDBMySQL="/proj/soft/ilcsoft/v01-08/CondDBMySQL/osxws" +export LD_LIBRARY_PATH="$CondDBMySQL/lib:$LD_LIBRARY_PATH" + + +#-------------------------------------------------------------------------------- +# MySQL +#-------------------------------------------------------------------------------- +export MYSQL_PATH="/proj/soft/ilcsoft/v01-08/mysql/osxws" +export LD_LIBRARY_PATH="$MYSQL_PATH/lib/mysql:$MYSQL_PATH/lib:$LD_LIBRARY_PATH" + + +#-------------------------------------------------------------------------------- +# RAIDA +#-------------------------------------------------------------------------------- +export RAIDA_HOME="/proj/soft/ilcsoft/v01-08/RAIDA/v01-04-03" +export PATH="$RAIDA_HOME/bin:$PATH" + + +export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH + +#-------------------------------------------------------------------------------- +# CMake +#-------------------------------------------------------------------------------- +export PATH="/usr/osxws/bin:$PATH" + +export MARLIN_DLL="/proj/cdc/soft/MarlinTPC/r1980/lib/libMarlinTPC.dylib:$MARLIN_DLL" + +#export MARLIN_DLL="$KALDETROOT/lib/libKalDetToyTpc.so:$MARLIN_DLL" +export MARLIN_DLL="$KALDETROOT/lib/libKalDetLP1JGEM.so:$MARLIN_DLL" +export MARLIN_DLL="$KALDETROOT/lib/libEXGen.so:$MARLIN_DLL" +export MARLIN_DLL="$KALDETROOT/lib/libKalDetKern.so:$MARLIN_DLL" +export MARLIN_DLL="$KALTESTROOT/lib/libS4KalTrack.so:$MARLIN_DLL" +export MARLIN_DLL="$KALTESTROOT/lib/libS4Geom.so:$MARLIN_DLL" +export MARLIN_DLL="$KALTESTROOT/lib/libS4Kalman.so:$MARLIN_DLL" +export MARLIN_DLL="$KALTESTROOT/lib/libS4Utils.so:$MARLIN_DLL" + +#-------------------------------------------------------------------------------- +# CMakeModules +#-------------------------------------------------------------------------------- +# --- additional comands ------- diff -uNr r1980.ORIG/reconstruction/CMakeLists.txt r1980/reconstruction/CMakeLists.txt --- r1980.ORIG/reconstruction/CMakeLists.txt 2010-03-17 22:43:37.000000000 +0900 +++ r1980/reconstruction/CMakeLists.txt 2010-03-23 00:03:45.000000000 +0900 @@ -15,10 +15,50 @@ ${MarlinTPC_SOURCE_DIR}/tools/LCObjectCopier/include ${MarlinTPC_SOURCE_DIR}/tools/IntersectionCalculator/include ${MarlinTPC_SOURCE_DIR}/tools/processors/include - ${MarlinTPC_SOURCE_DIR}/simulation/TPCCloudSimulation/include -/afs/desy.de/user/k/katoy/MarlinTPC/KalTest/include -/afs/desy.de/user/k/katoy/MarlinTPC/KalDet/include -) + ${MarlinTPC_SOURCE_DIR}/simulation/TPCCloudSimulation/include) + ADD_MARLINTPC_LIBRARY( ${library_sources} ) TARGET_LINK_LIBRARIES( lib_MarlinTPCReconstruction lib_tpcconddata -lib_LCObjectCopier lib_IntersectionCalculator lib_MarlinTPCToolProcessors lib_MarlinTPCCloudSimulation) +lib_LCObjectCopier lib_IntersectionCalculator lib_MarlinTPCToolProcessors lib_MarlinTPCCloudSimulation ) + +IF( DEFINED ENV{KALTESTROOT} AND DEFINED ENV{KALDETROOT} ) + + MESSAGE( STATUS "Using KALTESTROOT in: $ENV{KALTESTROOT}") + MESSAGE( STATUS "Using KALDETROOT in: $ENV{KALDETROOT}") + + # activate the relevant source code fractions. + ADD_DEFINITIONS( -DUSE_TRACK_FITTER_KALMAN ) + + # include KalTest + KalDet header files + INCLUDE_DIRECTORIES( $ENV{KALTESTROOT}/include ) + INCLUDE_DIRECTORIES( $ENV{KALDETROOT}/include ) + + # find and link with KalTest + KalDet libraries + SET( KALTEST_LIB_NAMES S4Utils S4Kalman S4Geom S4KalTrack ) + SET( KALDET_LIB_NAMES KalDetKern EXGen KalDetLP1JGEM ) + #SET( KALDET_LIB_NAMES KalDetKern EXGen KalDetToyTpc ) + MARK_AS_ADVANCED( KALTEST_LIB_NAMES KALDET_LIB_NAMES ) + + FOREACH( libname ${KALTEST_LIB_NAMES} ${KALDET_LIB_NAMES} ) + + FIND_LIBRARY( LIB_${libname} NAMES ${libname} PATHS + $ENV{KALTESTROOT}/lib + $ENV{KALDETROOT}/lib + ) + + IF( NOT LIB_${libname} ) + MESSAGE( FATAL_ERROR "Failed to find library: ${libname}" ) + ELSE() + MESSAGE( STATUS "Link with library: ${LIB_${libname}}" ) + TARGET_LINK_LIBRARIES( lib_MarlinTPCReconstruction lib_tpcconddata ${LIB_${libname}} ) + ENDIF() + + ENDFOREACH() + +ELSE() + + # MESSAGE( FATAL_ERROR "To use the TrackFitterKalmanProcessor please set + # KALTESTROOT and KALDETROOT") + MESSAGE( STATUS "TrackFitterKalman will not be available!" ) + +ENDIF() diff -uNr r1980.ORIG/reconstruction/src/TrackFitterKalman.cc r1980/reconstruction/src/TrackFitterKalman.cc --- r1980.ORIG/reconstruction/src/TrackFitterKalman.cc 2010-03-22 06:58:31.000000000 +0900 +++ r1980/reconstruction/src/TrackFitterKalman.cc 2010-03-22 23:33:09.000000000 +0900 @@ -1,3 +1,4 @@ +#ifdef USE_TRACK_FITTER_KALMAN #define __DEBUG__ #include "TrackFitterKalman.h" @@ -114,9 +115,20 @@ #else if (! _kaldetPtr) { +#if 0 // _kaldetPtr = new EXTPCKalDetector(); - _kaldetPtr = EXTPCKalDetector::GetInstance(); + ///// Very temporary -- TKalDetCradle should be constructed for all sub-tracking systems + TKalDetCradle & lp1 = * new TKalDetCradle; + ///// Very temporary + + lp1.Install(*_kaldetPtr); + + ///// Very temporary -- TKalDetCradle should be closed after all sub-traking systems are installed + lp1.Close(); ///// Very temporary +#else + _kaldetPtr = EXTPCKalDetector::GetInstance(); +#endif } #endif @@ -284,7 +296,7 @@ TIter nexthittemp(&kalhits); - std::cerr << "# of TObjArray kalhits elements = " << kalhits.GetEntries() << std::endl; + streamlog_out(DEBUG2) << "# of TObjArray kalhits elements = " << kalhits.GetEntries() << std::endl; // ----------------------------------------- // Eliminate double-hits in the same layer @@ -304,8 +316,8 @@ Int_t layerserial = superlayer * modules[module]->getNRows() + layer; ////// VERY TEMPORARY //////////////////////////////////////// - std::cerr << "TrackFitterKalman: Before hit elimination (module, layer) = (" << module << ", " - << layer << ")" << std::endl; + streamlog_out(DEBUG2) << "TrackFitterKalman: Before hit elimination (module, layer) = (" << module << ", " + << layer << ")" << std::endl; if (layerserial == prevlayerserial) { kalhits.Remove(prevhitPtr); @@ -319,12 +331,12 @@ prevlayerserial = layerserial; prevhitPtr = tempHitPtr; - std::cerr << "TrackFitterKalman: After hit elimination (module, layer) = (" << module << ", " - << layer << ")" << std::endl; + streamlog_out(DEBUG2) << "TrackFitterKalman: After hit elimination (module, layer) = (" << module << ", " + << layer << ")" << std::endl; } kalhits.Compress(); - std::cerr << "# of TObjArray kalhits elements after the deletion = " << kalhits.GetEntries() << std::endl; + streamlog_out(DEBUG2) << "# of TObjArray kalhits elements after the deletion = " << kalhits.GetEntries() << std::endl; ///// Very temporary ///// //-- @@ -479,10 +491,11 @@ // Double_t philst = - (x3 - x1).Perp()/rho; #if 1 + streamlog_out(MESSAGE0) << "==================== Next event ====================" << std::endl; #if 0 kaltrack.GetCurSite().GetCurState().DebugPrint(); #endif - streamlog_out(DEBUG2) << "TrackFitterKalman: (chi2, ndf) = (" << chi2 << "," << ndf << ")" << std::endl; + streamlog_out(MESSAGE2) << "TrackFitterKalman: (chi2, ndf) = (" << chi2 << "," << ndf << ")" << std::endl; #endif // --------------------------- @@ -615,7 +628,9 @@ sitep->InvFilter(); dxot = sitep->GetResVec(TVKalSite::kInvFiltered)(0,0); data[kOffset+2*index ] = dxin; + _kalmantuple2 -> fill(kOffset+2*index, dxin); data[kOffset+2*index+1] = dxot; + _kalmantuple2 -> fill(kOffset+2*index+1, dxot); #if 0 Double_t charge = hp->GetCharge(); @@ -701,3 +716,35 @@ } } // namespace marlintpc +#else + +#include "TrackFitterBase.h" +#include + +namespace marlintpc { + /** A dummy Kalman filter track fitter + * + */ + class TrackFitterKalman : public TrackFitterBase { + private: + /** + * This is a dummy implementation. + */ + TrackFitterKalman() {} + + public: + static TrackFitterBase * getInstance(LCParameters const * parameters = 0) + { + streamlog_out(MESSAGE) + << " TrackFitterKalman::getInstace() ============" << std::endl + << " Set KALTESTROOT and KALDETROOT appropriately" + << " to use the Kalman filter track fitter!" << std::endl + << " Will throw exception!" << std::endl; + std::stringstream message; + message << "TrackFitterKalman: not loaded!" << std::ends; + throw EVENT::Exception(message.str()); + } + virtual std::string getRevision() { return std::string("dummy"); } + }; +} // namespace marlintpc +#endif diff -uNr r1980.ORIG/reconstruction/src/TrackFitterKalmanProcessor.cc r1980/reconstruction/src/TrackFitterKalmanProcessor.cc --- r1980.ORIG/reconstruction/src/TrackFitterKalmanProcessor.cc 2010-03-19 01:08:01.000000000 +0900 +++ r1980/reconstruction/src/TrackFitterKalmanProcessor.cc 2010-03-22 23:33:22.000000000 +0900 @@ -1,3 +1,4 @@ +#ifdef USE_TRACK_FITTER_KALMAN // STL #include #include @@ -376,6 +377,5 @@ #endif } - - } // namespace marlintpc +#endif diff -uNr r1980.ORIG/simulation/CMakeLists.txt r1980/simulation/CMakeLists.txt --- r1980.ORIG/simulation/CMakeLists.txt 2010-03-17 22:30:56.000000000 +0900 +++ r1980/simulation/CMakeLists.txt 2010-03-22 20:42:00.000000000 +0900 @@ -6,6 +6,9 @@ LIST(APPEND ${PROJECT_NAME}_DEPENDS LCIO) LIST(APPEND ${PROJECT_NAME}_DEPENDS CLHEP) LIST(APPEND ${PROJECT_NAME}_DEPENDS GSL) +IF ( APPLE ) + LIST(APPEND ${PROJECT_NAME}_DEPENDS ROOT) +ENDIF() Check_Deps() diff -uNr r1980.ORIG/tools/Field/CMakeLists.txt r1980/tools/Field/CMakeLists.txt --- r1980.ORIG/tools/Field/CMakeLists.txt 2010-03-17 22:30:51.000000000 +0900 +++ r1980/tools/Field/CMakeLists.txt 2010-03-22 20:42:40.000000000 +0900 @@ -3,6 +3,9 @@ LIST(APPEND ${PROJECT_NAME}_DEPENDS CLHEP) LIST(APPEND ${PROJECT_NAME}_DEPENDS LCIO) LIST(APPEND ${PROJECT_NAME}_DEPENDS LCCD) +IF ( APPLE ) + LIST(APPEND ${PROJECT_NAME}_DEPENDS ROOT) +ENDIF() Check_Deps() @@ -10,4 +13,4 @@ aux_source_directory(src library_sources) -ADD_MARLINTPC_LIBRARY( ${library_sources} ) \ No newline at end of file +ADD_MARLINTPC_LIBRARY( ${library_sources} ) diff -uNr r1980.ORIG/tools/HepRepOutput/CMakeLists.txt r1980/tools/HepRepOutput/CMakeLists.txt --- r1980.ORIG/tools/HepRepOutput/CMakeLists.txt 2010-03-17 22:44:12.000000000 +0900 +++ r1980/tools/HepRepOutput/CMakeLists.txt 2010-03-22 20:43:02.000000000 +0900 @@ -4,6 +4,9 @@ LIST(APPEND ${PROJECT_NAME}_DEPENDS GEAR) LIST(APPEND ${PROJECT_NAME}_DEPENDS CLHEP) LIST(APPEND ${PROJECT_NAME}_DEPENDS AIDA) +IF ( APPLE ) + LIST(APPEND ${PROJECT_NAME}_DEPENDS ROOT) +ENDIF() Check_Deps() diff -uNr r1980.ORIG/tools/IntersectionCalculator/CMakeLists.txt r1980/tools/IntersectionCalculator/CMakeLists.txt --- r1980.ORIG/tools/IntersectionCalculator/CMakeLists.txt 2010-03-17 22:30:51.000000000 +0900 +++ r1980/tools/IntersectionCalculator/CMakeLists.txt 2010-03-22 20:43:42.000000000 +0900 @@ -1,6 +1,9 @@ project(IntersectionCalculator) LIST(APPEND ${PROJECT_NAME}_DEPENDS LCIO) +IF ( APPLE ) + LIST(APPEND ${PROJECT_NAME}_DEPENDS ROOT) +ENDIF() Check_Deps() diff -uNr r1980.ORIG/tools/LCObjectCopier/CMakeLists.txt r1980/tools/LCObjectCopier/CMakeLists.txt --- r1980.ORIG/tools/LCObjectCopier/CMakeLists.txt 2010-03-17 22:30:52.000000000 +0900 +++ r1980/tools/LCObjectCopier/CMakeLists.txt 2010-03-22 20:43:59.000000000 +0900 @@ -1,6 +1,9 @@ project(LCObjectCopier) LIST(APPEND ${PROJECT_NAME}_DEPENDS LCIO) +IF ( APPLE ) + LIST(APPEND ${PROJECT_NAME}_DEPENDS ROOT) +ENDIF() Check_Deps() diff -uNr r1980.ORIG/tools/PadGeometryChecker/CMakeLists.txt r1980/tools/PadGeometryChecker/CMakeLists.txt --- r1980.ORIG/tools/PadGeometryChecker/CMakeLists.txt 2010-03-17 22:30:52.000000000 +0900 +++ r1980/tools/PadGeometryChecker/CMakeLists.txt 2010-03-22 20:44:21.000000000 +0900 @@ -3,6 +3,9 @@ LIST(APPEND ${PROJECT_NAME}_DEPENDS LCIO) LIST(APPEND ${PROJECT_NAME}_DEPENDS GEAR) LIST(APPEND ${PROJECT_NAME}_DEPENDS CLHEP) +IF ( APPLE ) + LIST(APPEND ${PROJECT_NAME}_DEPENDS ROOT) +ENDIF() Check_Deps() diff -uNr r1980.ORIG/tpcconddata/CMakeLists.txt r1980/tpcconddata/CMakeLists.txt --- r1980.ORIG/tpcconddata/CMakeLists.txt 2010-03-17 22:30:57.000000000 +0900 +++ r1980/tpcconddata/CMakeLists.txt 2010-03-22 20:44:55.000000000 +0900 @@ -3,6 +3,9 @@ LIST(APPEND ${PROJECT_NAME}_DEPENDS Marlin) LIST(APPEND ${PROJECT_NAME}_DEPENDS LCIO) LIST(APPEND ${PROJECT_NAME}_DEPENDS LCCD) +IF ( APPLE ) + LIST(APPEND ${PROJECT_NAME}_DEPENDS ROOT) +ENDIF() Check_Deps() AUX_SOURCE_DIRECTORY(src library_sources) diff -uNr r1980.ORIG/validation/generateRawData/CMakeLists.txt r1980/validation/generateRawData/CMakeLists.txt --- r1980.ORIG/validation/generateRawData/CMakeLists.txt 2010-03-17 22:30:59.000000000 +0900 +++ r1980/validation/generateRawData/CMakeLists.txt 2010-03-23 00:01:30.000000000 +0900 @@ -1,10 +1,13 @@ project(MarlinTPC_validation_generateRawData) LIST(APPEND ${PROJECT_NAME}_DEPENDS LCIO) +LIST(APPEND ${PROJECT_NAME}_DEPENDS CLHEP) +LIST(APPEND ${PROJECT_NAME}_DEPENDS ROOT) Check_Deps() -INCLUDE_DIRECTORIES(include ${MarlinTPC_SOURCE_DIR}/tpcconddata/include) +INCLUDE_DIRECTORIES(include ${MarlinTPC_SOURCE_DIR}/tpcconddata/include ) +INCLUDE_DIRECTORIES(include $ENV{ROOTSYS}/include ) LINK_DIRECTORIES( ${LIBRARY_OUTPUT_PATH} ) @@ -13,5 +16,53 @@ INSTALL(TARGETS generateRawData DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL(TARGETS generateRawData2 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -TARGET_LINK_LIBRARIES(generateRawData lib_tpcconddata) -TARGET_LINK_LIBRARIES(generateRawData2 lib_tpcconddata) +TARGET_LINK_LIBRARIES(generateRawData tpcconddata) +TARGET_LINK_LIBRARIES(generateRawData2 tpcconddata) + +IF( DEFINED ENV{KALTESTROOT} AND DEFINED ENV{KALDETROOT}) + + MESSAGE( STATUS "Using KALTESTROOT in: $ENV{KALTESTROOT}") + MESSAGE( STATUS "Using KALDETROOT in: $ENV{KALDETROOT}") + + # activate the relevant source code fractions. + ADD_DEFINITIONS( -DUSE_HELIX_GENERATOR ) + + ADD_EXECUTABLE(generateHelix generateHelix.cpp) + INSTALL(TARGETS generateHelix DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + TARGET_LINK_LIBRARIES(generateHelix tpcconddata) + + # include KalTest + KalDet header files + INCLUDE_DIRECTORIES( $ENV{KALTESTROOT}/include ) + INCLUDE_DIRECTORIES( $ENV{KALDETROOT}/include ) + + + # find and link with KalTest + KalDet libraries + SET( KALTEST_LIB_NAMES S4Utils S4Kalman S4Geom S4KalTrack ) + SET( KALDET_LIB_NAMES KalDetKern EXGen KalDetLP1JGEM ) + #SET( KALDET_LIB_NAMES KalDetKern EXGen KalDetToyTpc ) + MARK_AS_ADVANCED( KALTEST_LIB_NAMES KALDET_LIB_NAMES ) + + FOREACH( libname ${KALTEST_LIB_NAMES} ${KALDET_LIB_NAMES} ) + + FIND_LIBRARY( LIB_${libname} NAMES ${libname} PATHS + $ENV{KALTESTROOT}/lib + $ENV{KALDETROOT}/lib + ) + + IF( NOT LIB_${libname} ) + MESSAGE( FATAL_ERROR "Failed to find library: ${libname}" ) + ELSE() + MESSAGE( STATUS "Link with library: ${LIB_${libname}}" ) + TARGET_LINK_LIBRARIES( generateHelix ${LIB_${libname}} ) + ENDIF() + + ENDFOREACH() + +ELSE() + + # MESSAGE( FATAL_ERROR "To use the TrackFitterKalmanProcessor please set + # KALTESTROOT and KALDETROOT") + MESSAGE( STATUS "Helix generator will not be available!" ) + +ENDIF() + diff -uNr r1980.ORIG/validation/generateRawData/generateHelix.cpp r1980/validation/generateRawData/generateHelix.cpp --- r1980.ORIG/validation/generateRawData/generateHelix.cpp 2010-03-22 05:51:06.000000000 +0900 +++ r1980/validation/generateRawData/generateHelix.cpp 2010-03-22 23:30:04.000000000 +0900 @@ -0,0 +1,418 @@ +#ifdef USE_HELIX_GENERATOR +#include "lcio.h" + +#include "IO/LCWriter.h" +#include "EVENT/LCIO.h" + +#include "IMPL/LCEventImpl.h" +#include "IMPL/LCRunHeaderImpl.h" +#include "IMPL/LCCollectionVec.h" +#include "IMPL/LCTOOLS.h" +#include "IMPL/TrackerRawDataImpl.h" + +#include "gearimpl/RectangularPadRowLayout.h" + +#include "gearimpl/Util.h" +#include "gearxml/GearXML.h" +#include "gear/GearMgr.h" +#include "gear/GEAR.h" + +#include "ADCChannelMapping.h" +#include "Pedestal.h" + +#include +#include +#include +#include +#include +#include + +#include "TRandom1.h" + +#include "TKalDetCradle.h" +#include "TKalTrackState.h" +#include "TKalTrackSite.h" +#include "TVTrackHit.h" +#include "EXTPCKalDetector.h" +#include "EXTPCHit.h" +#include "EXEventGen.h" +#include "TObjArray.h" + + + +using namespace std ; +using namespace lcio ; +using namespace gear; +using namespace tpcconddata; + +void printUsage() +{ + cout << "generateHelix gearfile.xml [outfile.slcio]" <( TPCParams.getModules()[0]->getLocalPadLayout() ); + } + catch(std::bad_cast& e){ + std::cout << " wrong type of layout - expected RectangularPadRowLayout ! " << std::endl ; + return false; + } + + // assume rectangular charge distribution + // with width=padPitch and charge = 100 + // charge is distributed onto (max) two pads + int padNr; // the pseudo hardware channel number, continuous numbering within plane + int padIndex; // the gear pad index + try + { + padIndex=padLayout->getNearestPad(x,y); + // getPadsInRow(0) assumes that the number of pads per row is the same for all rows + padNr=(padLayout->getRowNumber(padIndex)*padLayout->getPadsInRow(0).size() + + padLayout->getPadNumber(padIndex) ); + } + catch(exception& e) + { + // pad not on the pad plane + // break the loop + cout << "Track left pad plane" << endl; + return false; + } + + Vector2D padCenter= padLayout->getPadCenter(padIndex); + + TrackerRawDataImpl* rawData = new TrackerRawDataImpl; + rawData->setCellID0(padNr); + +#if 1 + float charge=(255. *(1.- fabs(x-padCenter[0])/padPitch) ); +#else + float charge=255.*Qfun(x-padCenter[0], 0, padPitch); +#endif + EVENT::ShortVec ADCValues; +#if 0 + ADCValues.push_back(static_cast(charge*0.1)); + ADCValues.push_back(static_cast(charge*0.7)); + ADCValues.push_back(static_cast(charge*0.2)); +#else + double tee = z*TPCParams.getReadoutFrequency()/TPCParams.getDriftVelocity(); + int tslot = static_cast(tee); + + ADCValues.push_back(static_cast(charge*Qfun(tee-tslot,-1,1.,1.))); + ADCValues.push_back(static_cast(charge*Qfun(tee-tslot, 0,1.,1.))); + ADCValues.push_back(static_cast(charge*Qfun(tee-tslot,+1,1.,1.))); +#endif + rawData->setADCValues(ADCValues); + rawData->setTime(static_cast(z*TPCParams.getReadoutFrequency()/TPCParams.getDriftVelocity())); + + // debug: + cout << "padIndex: " << padIndex + << "\t x/y: "<< x<<"/"<push_back(rawData); + + // in case of a central hit these is almost no charge + // on the neighbouring pad, skip it +#if 1 + if (charge>253.) + return true; +#endif + // try to find neighbour which also gets charge + int neighbouringPadNr; + int neighbouringPadIndex; + try + { + if (x-padCenter[0] < 0) + { + neighbouringPadIndex = padLayout->getLeftNeighbour(padIndex); + } + else + { + neighbouringPadIndex = padLayout->getRightNeighbour(padIndex); + } + neighbouringPadNr = (padLayout->getRowNumber(neighbouringPadIndex)*padLayout->getPadsInRow(0).size() + + padLayout->getPadNumber(neighbouringPadIndex) ); + } + catch(exception& e) + { + //no neighbour found, must be edge pad + return true; + } + + // if there is a neighbour calculate charge and add it to collection + padCenter= padLayout->getPadCenter(neighbouringPadIndex); + + rawData = new TrackerRawDataImpl; + rawData->setCellID0(neighbouringPadNr); +#if 1 + charge=(255. *(1.- fabs(x-padCenter[0])/padPitch) ); +#else + charge=255.*Qfun(x-padCenter[0], 0, padPitch); +#endif + EVENT::ShortVec ADCValues2; +#if 0 + ADCValues2.push_back(static_cast(charge*0.1)); + ADCValues2.push_back(static_cast(charge*0.7)); + ADCValues2.push_back(static_cast(charge*0.2)); +#else + tee = z*TPCParams.getReadoutFrequency()/TPCParams.getDriftVelocity(); + tslot = static_cast(tee); + + ADCValues2.push_back(static_cast(charge*Qfun(tee-tslot,-1,1.,1.))); + ADCValues2.push_back(static_cast(charge*Qfun(tee-tslot, 0,1.,1.))); + ADCValues2.push_back(static_cast(charge*Qfun(tee-tslot,+1,1.,1.))); +#endif + rawData->setADCValues(ADCValues2); + rawData->setTime(static_cast(z*TPCParams.getReadoutFrequency()/TPCParams.getDriftVelocity())); + + // debug: + cout << " nb: " << neighbouringPadNr + << "\t x/y: "<< x<<"/"<createLCWriter() ; + + try{ lcWrt->open( outFileName, LCIO::WRITE_NEW ) ; + } + catch( IOException& e ){ + cout << e.what() << endl ; + return 0 ; + } + + // create runheader and write it + // the information should come from a file + // or be given interactively in a future version + LCRunHeaderImpl* runHdr = new LCRunHeaderImpl ; + int runNr=0; + runHdr->setRunNumber( runNr) ; + + string detName("toytpc") ; + runHdr->setDetectorName( detName ) ; + + stringstream description ; + description << "toy tpc rawData along straight line"; + runHdr->setDescription( description.str() ) ; + + string tpcName("toytpc") ; + runHdr->addActiveSubdetector( tpcName ) ; + + lcWrt->writeRunHeader( runHdr ) ; + + + TKalDetCradle toytpc; // toy GLD detector + EXTPCKalDetector &tpcdet=*EXTPCKalDetector::GetInstance(); // TPC (tpc) + + toytpc.Install(tpcdet); // install tpc into its toygld + toytpc.Close(); // close the cradle + toytpc.Sort(); // sort meas. layers from inside to outside + TObjArray kalhits; // array to store hits + EXEventGen gen(toytpc, kalhits); // create event generator + + /////////FIXME////////////////// + double pt=-0.1; + //double pt=-1.; + //double pt=-0.3; + double cosmin=+0.1; + double cosmax=+0.3; + double phimin=-0.05; + double phimax=+0.05; + /////////FIXME////////////////// + + // loop the events, generate 11 events + int maxEvents=1; + for (int eventNr=0; eventNrsetRunNumber( runNr ) ; + evt->setEventNumber( eventNr ) ; + evt->setDetectorName( detName ) ; + + // we want to store a collection of trackerRawData + LCCollectionVec* trackerRawDataVec = new LCCollectionVec( LCIO::TRACKERRAWDATA ) ; + + const std::vector< RectangularPadRowLayout::Row> theRows= padLayout->rows(); + + kalhits.Delete(); // clear hit data + +#if 0 + for (int ntk=0; ntk<4; ntk++) { + THelicalTrack hel = gen.GenerateHelix(pt, cosmin, cosmax, phimin, phimax); + gen.Swim(hel); +#else + THelicalTrack hel = gen.GenerateHelix(pt, cosmin, cosmin, + phimin, phimin, + TVector3(0.0,-5.,15.)); + gen.Swim(hel); +#if 1 + THelicalTrack hel2 = gen.GenerateHelix(-pt, cosmax, cosmax, + phimax+TMath::Pi(), phimax+TMath::Pi(), + TVector3(0.5,-5., 5.)); + gen.Swim(hel2); +#if 1 + THelicalTrack hel3 = gen.GenerateHelix(-pt, cosmax-0.1, cosmax-0.1, + phimax+TMath::Pi()+0.01, phimax+TMath::Pi()+0.01, + TVector3(0.6,-5., 10.)); + //TVector3(0.6,-5., 7.)); + gen.Swim(hel3); +#if 1 + THelicalTrack hel4 = gen.GenerateHelix(pt, cosmin-0.1, cosmin-0.1, + phimin, phimin, + TVector3(0.0,-5.,13.)); + gen.Swim(hel4); +#endif +#endif +#endif +#endif + + int nhit = 0; + TVTrackHit * thp=0; + TIter next(&kalhits); + while((thp=static_cast(next()))) + { + static const double kcm2mm=10; + const TVMeasLayer & ml=thp->GetMeasLayer(); + TVector3 xv=kcm2mm*ml.HitToXv(*thp); + int row=ml.GetIndex(); + int module=0; + placeHit(xv.X(), xv.Y(), xv.Z(), TPCParams, theRows[row].WidthPerPad, trackerRawDataVec, module); + cerr << ++nhit + << " (" << xv.X() << "," + << xv.Y() << "," + << xv.Z() << ")" << endl; + } +#if 0 + } +#endif + // add the rawData collection to the event + evt->addCollection( trackerRawDataVec , "TPCRawData" ) ; + + // in the first event: write the mapping and the pedestals + if (eventNr==0) + { + // create a collections of generic objects + LCCollectionVec* mappingCol = new LCCollectionVec( LCIO::LCGENERICOBJECT ) ; + LCCollectionVec* pedestalCol = new LCCollectionVec( LCIO::LCGENERICOBJECT ) ; + + //loop all pads and create a conditions objects for it + + //outer loop: the rows + for (int row = 0; row < padLayout->getNRows(); row++) + { + // vector of the pad indices in this row + std::vector padsInRowVector = padLayout->getPadsInRow(row); + + // nnow loop all pads in row + for (vector::iterator padIndex=padsInRowVector.begin(); + padIndex < padsInRowVector.end(); padIndex++ ) + { + int padNr=(row*padsInRowVector.size() + padLayout->getPadNumber(*padIndex)); + mappingCol->push_back( new ADCChannelMapping(padNr, *padIndex ) ); + // create pedestal with 0 as value and width, data are already zero-suppressed + pedestalCol->push_back( new Pedestal(std::make_pair(padNr,0))) ; + } + } + + // add the pe collection to the event + evt->addCollection( mappingCol , "TPCChannelMapping" ) ; + evt->addCollection( pedestalCol , "TPCPedestal" ) ; + + + } + + // write the event to the file + lcWrt->writeEvent( evt ) ; + + // dump the event to the screen + LCTOOLS::dumpEvent( evt ) ; + + // ------------ IMPORTANT ------------- ! + // we created the event so we need to delete it ... + delete evt ; + // ------------------------------------- + + } // for eventNr + + delete runHdr ; + + lcWrt->close() ; + + } catch( std::exception& ex){ + + cout << " an excpetion occured: " << endl ; + cout << " " << ex.what() << endl ; + return 1 ; + } + +return 0; + +} +#endif