@@ -436,7 +436,6 @@ namespace snemo {
436436 DT_LOG_DEBUG (logPrio, " Direction (world) : " << geomtools::to_xyz (direction) );
437437 DT_LOG_DEBUG (logPrio, " Distance ref->end : " << distRef2End / CLHEP::mm << " mm" );
438438 DT_LOG_DEBUG (logPrio, " XY-distance ref->end : " << distRef2End_Xy / CLHEP::mm << " mm" );
439-
440439 for (int iBlockType : blockTypes) {
441440 DT_LOG_DEBUG (logPrio, " Scanning block type=" << iBlockType << " ..." );
442441 const std::vector<geomtools::geom_id> * blockGidsPtr = nullptr ;
@@ -1069,8 +1068,10 @@ namespace snemo {
10691068
10701069 // Optimization for strip scanning:
10711070 if (use_foils or use_calib_src) {
1072- DT_LOG_DEBUG (logPrio, " Searching line intercept on source submodule #" << _sourceSubmoduleGid_ << " ..." );
1073- const geomtools::geom_info & srcSubmodGinfo = geoManager ().get_mapping ().get_geom_info (_sourceSubmoduleGid_);
1071+ DT_LOG_DEBUG (logPrio, " Searching line intercept on source submodule #"
1072+ << _sourceSubmoduleGid_ << " ..." );
1073+ const geomtools::geom_info & srcSubmodGinfo =
1074+ geoManager ().get_mapping ().get_geom_info (_sourceSubmoduleGid_);
10741075 const geomtools::logical_volume & srcSubmodLog = srcSubmodGinfo.get_logical ();
10751076 const geomtools::i_shape_3d & srcSubmodShape = srcSubmodLog.get_shape ();
10761077 const geomtools::placement & srcSubmodPlacement = srcSubmodGinfo.get_world_placement ();
@@ -1248,6 +1249,7 @@ namespace snemo {
12481249 padVtxInfo.tolerance = _intercept_tolerance_;
12491250 sourcePadInterceptSuccess = true ;
12501251 if (datatools::logger::is_debug (logPrio)) {
1252+ DT_LOG_DEBUG (logPrio, " Line intercept is :" );
12511253 padVtxInfo.print (std::cerr, " [debug] " );
12521254 }
12531255 DT_LOG_DEBUG (logPrio, " padVtxInfo.distance_xy = " << padVtxInfo.distance_xy / CLHEP::mm << " mm" );
@@ -1421,7 +1423,7 @@ namespace snemo {
14211423 calibrationSpotVtxInfo.gid = sourceCalibrationSpotGid;
14221424 calibrationSpotVtxInfo.face_intercept = srcCalibrationSpotFii;
14231425 if (srcCalibrationSpotExtrapolationDist > 0.0 ) {
1424- calibrationSpotVtxInfo.distance = srcCalibrationSpotExtrapolationDist;
1426+ calibrationSpotVtxInfo.distance = srcCalibrationSpotExtrapolationDist;
14251427 calibrationSpotVtxInfo.distance_xy = srcCalibrationSpotExtrapolationDist_Xy;
14261428 } else {
14271429 calibrationSpotVtxInfo.distance = 0.0 ;
@@ -1547,8 +1549,10 @@ namespace snemo {
15471549
15481550 // Optimization for strip scanning:
15491551 if (use_foils or use_calib_src) {
1550- DT_LOG_DEBUG (logPrio, " Searching line intercept on source submodule #" << _sourceSubmoduleGid_ << " ..." );
1551- const geomtools::geom_info & srcSubmodGinfo = geoManager ().get_mapping ().get_geom_info (_sourceSubmoduleGid_);
1552+ DT_LOG_DEBUG (logPrio, " Searching line intercept on source submodule #"
1553+ << _sourceSubmoduleGid_ << " ..." );
1554+ const geomtools::geom_info & srcSubmodGinfo =
1555+ geoManager ().get_mapping ().get_geom_info (_sourceSubmoduleGid_);
15521556 const geomtools::logical_volume & srcSubmodLog = srcSubmodGinfo.get_logical ();
15531557 const geomtools::i_shape_3d & srcSubmodShape = srcSubmodLog.get_shape ();
15541558 const geomtools::placement & srcSubmodPlacement = srcSubmodGinfo.get_world_placement ();
@@ -1595,11 +1599,37 @@ namespace snemo {
15951599 }
15961600 minStripId = std::max (minStripId, (int16_t ) (minId - 1 ));
15971601 maxStripId = std::min (maxStripId, (int16_t ) (maxId + 1 ));
1598- sourceSubmoduleLineExtrapolationSuccess = true ;
1602+
1603+ // 2024-05-13, FM: NEW:
1604+ // Calib track range:
1605+ minId = 100000 ;
1606+ maxId = -100000 ;
1607+ for (uint32_t iTrack = 0 ; iTrack < _sourceCalibTrackGids_.size (); iTrack++) {
1608+ const geomtools::geom_id & sourceCalibTrackGid = _sourceCalibTrackGids_[iTrack];
1609+ const geomtools::geom_info & sourceCalibTrackGinfo = geoManager ().get_mapping ().get_geom_info (sourceCalibTrackGid);
1610+ const geomtools::placement & sourceCalibTrackPlacement = sourceCalibTrackGinfo.get_world_placement ();
1611+ double yTrack = sourceCalibTrackPlacement.get_translation ().y ();
1612+ if (std::abs (yTrack - yImpact) < _max_source_extrapolation_xy_length_) {
1613+ int32_t sourceTrackId = (int32_t ) sourceCalibTrackGid.get (1 );
1614+ if (sourceTrackId > maxId) {
1615+ maxId = sourceTrackId;
1616+ }
1617+ if (sourceTrackId < minId) {
1618+ minId = sourceTrackId;
1619+ }
1620+ }
1621+ minTrackId = std::max (minTrackId, (int16_t ) (minId - 1 ));
1622+ maxTrackId = std::min (maxTrackId, (int16_t ) (maxId + 1 ));
1623+ }
1624+ sourceSubmoduleLineExtrapolationSuccess = true ;
15991625 } else {
16001626 DT_LOG_DEBUG (logPrio, " No line intercept on the source submodule #" << _sourceSubmoduleGid_);
16011627 }
16021628 } // if (sourceSubmoduleLineExtrapolationSuccess)
1629+ DT_LOG_DEBUG (logPrio, " minStripId=" << minStripId);
1630+ DT_LOG_DEBUG (logPrio, " maxStripId=" << maxStripId);
1631+ DT_LOG_DEBUG (logPrio, " minTrackId=" << minTrackId);
1632+ DT_LOG_DEBUG (logPrio, " maxTrackId=" << maxTrackId);
16031633
16041634 if (useSourceSubmoduleHelixExtrapolation and not sourceSubmoduleLineExtrapolationSuccess) {
16051635 snemo::geometry::helix_intercept hIntercept (helix,
@@ -1621,9 +1651,12 @@ namespace snemo {
16211651 int32_t minId = +100000 ;
16221652 int32_t maxId = -100000 ;
16231653 // Find candidate source strips
1654+ DT_LOG_DEBUG (logPrio, " Scanning strips..." );
16241655 for (uint32_t iStrip = 0 ; iStrip < _sourceStripGids_.size (); iStrip++) {
16251656 const geomtools::geom_id & sourceStripGid = _sourceStripGids_[iStrip];
1626- const geomtools::geom_info & sourceStripGinfo = geoManager ().get_mapping ().get_geom_info (sourceStripGid);
1657+ DT_LOG_DEBUG (logPrio, " Source strip GID : " << sourceStripGid);
1658+ const geomtools::geom_info & sourceStripGinfo
1659+ = geoManager ().get_mapping ().get_geom_info (sourceStripGid);
16271660 const geomtools::placement & sourceStripPlacement = sourceStripGinfo.get_world_placement ();
16281661 double yStripWorld = sourceStripPlacement.get_translation ().y ();
16291662 if (std::abs (yStripWorld - yImpactWorld) < _max_source_extrapolation_xy_length_) {
@@ -1662,6 +1695,7 @@ namespace snemo {
16621695 continue ;
16631696 }
16641697 if ((int32_t ) sourceStripId < minStripId or (int32_t ) sourceStripId > maxStripId) {
1698+ DT_LOG_DEBUG (logPrio, " Pass source strip GID : " << sourceStripGid << " ..." );
16651699 continue ;
16661700 }
16671701 DT_LOG_DEBUG (logPrio, " Searching helix intercept on strip #" << sourceStripId);
@@ -1769,6 +1803,7 @@ namespace snemo {
17691803 double distRef2Impact_Xy = (srcPadImpactWorld_Xy - refPoint_Xy).mag ();
17701804 double extrapolationDist_Xy = distRef2Impact_Xy - distRef2End_Xy;
17711805 DT_LOG_DEBUG (logPrio, " extrapolationDist_Xy = " << extrapolationDist_Xy / CLHEP::mm << " mm" );
1806+ // Result:
17721807 padVtxInfo.category = snemo::geometry::vertex_info::CATEGORY_ON_SOURCE_FOIL;
17731808 padVtxInfo.from = iFrom;
17741809 padVtxInfo.extrapolation_mode = vertex_info::EXTRAPOLATION_LINE;
@@ -2036,11 +2071,14 @@ namespace snemo {
20362071 calibSpotFii.set_impact (calibSpotWorldImpact);
20372072 double calibSpotDistRef2Impact = (calibSpotWorldImpact - refPoint).mag ();
20382073 double calibSpotExtrapolationDist = calibSpotDistRef2Impact - distRef2End;
2039- // XY extrapolation:
2074+ DT_LOG_DEBUG (logPrio, " calibSpotExtrapolationDist = "
2075+ << calibSpotExtrapolationDist / CLHEP::mm << " mm" );
2076+ // XY extrapolation:
20402077 geomtools::vector_2d calibSpotImpact_Xy (calibSpotWorldImpact.x (), calibSpotWorldImpact.y ());
20412078 double calibSpotDistRef2Impact_Xy = (calibSpotImpact_Xy - refPoint_Xy).mag ();
20422079 double calibSpotExtrapolationDist_Xy = calibSpotDistRef2Impact_Xy - distRef2End_Xy;
2043- // Result:
2080+ DT_LOG_DEBUG (logPrio, " calibSpotExtrapolationDist_Xy = " << calibSpotExtrapolationDist_Xy / CLHEP::mm << " mm" );
2081+ // Result:
20442082 vertex_info calibSpotVtxInfo;
20452083 calibSpotVtxInfo.category = snemo::geometry::vertex_info::CATEGORY_ON_SOURCE_FOIL;
20462084 calibSpotVtxInfo.from = iFrom;
@@ -2104,8 +2142,8 @@ namespace snemo {
21042142 DT_LOG_DEBUG (logPrio, " Helix intercept is to far from the calibration source spot" );
21052143 } // extrapolation distance check
21062144 } // if (success)
2107- } // if (useCalibrationSpotHelixExtrapolation...
2108- } // for (uint32_t iStrip
2145+ } // if (useCalibrationSpotHelixExtrapolation...)
2146+ } // for (uint32_t iStrip...)
21092147 } // if (use_calib_src)
21102148
21112149 _post_process_source_vertex_ (srcVertexes);
@@ -2502,7 +2540,6 @@ namespace snemo {
25022540 {
25032541 // Prefix "VED" stands for "Vertex Extrapolation Driver" :
25042542 datatools::logger::declare_ocd_logging_configuration (ocd_, " fatal" , " VED." );
2505-
25062543 {
25072544 // // Description of the 'VED.use_linear_extrapolation' configuration property :
25082545 // datatools::configuration_property_description &cpd = ocd_.add_property_info();
@@ -2521,9 +2558,9 @@ namespace snemo {
25212558 }
25222559 }
25232560
2524- } // end of namespace reconstruction
2561+ } // end of namespace reconstruction
25252562
2526- } // end of namespace snemo
2563+ } // end of namespace snemo
25272564
25282565/* OCD support */
25292566#include < datatools/object_configuration_description.h>
0 commit comments