@@ -436,7 +436,6 @@ namespace snemo {
436
436
DT_LOG_DEBUG (logPrio, " Direction (world) : " << geomtools::to_xyz (direction) );
437
437
DT_LOG_DEBUG (logPrio, " Distance ref->end : " << distRef2End / CLHEP::mm << " mm" );
438
438
DT_LOG_DEBUG (logPrio, " XY-distance ref->end : " << distRef2End_Xy / CLHEP::mm << " mm" );
439
-
440
439
for (int iBlockType : blockTypes) {
441
440
DT_LOG_DEBUG (logPrio, " Scanning block type=" << iBlockType << " ..." );
442
441
const std::vector<geomtools::geom_id> * blockGidsPtr = nullptr ;
@@ -1069,8 +1068,10 @@ namespace snemo {
1069
1068
1070
1069
// Optimization for strip scanning:
1071
1070
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_);
1074
1075
const geomtools::logical_volume & srcSubmodLog = srcSubmodGinfo.get_logical ();
1075
1076
const geomtools::i_shape_3d & srcSubmodShape = srcSubmodLog.get_shape ();
1076
1077
const geomtools::placement & srcSubmodPlacement = srcSubmodGinfo.get_world_placement ();
@@ -1248,6 +1249,7 @@ namespace snemo {
1248
1249
padVtxInfo.tolerance = _intercept_tolerance_;
1249
1250
sourcePadInterceptSuccess = true ;
1250
1251
if (datatools::logger::is_debug (logPrio)) {
1252
+ DT_LOG_DEBUG (logPrio, " Line intercept is :" );
1251
1253
padVtxInfo.print (std::cerr, " [debug] " );
1252
1254
}
1253
1255
DT_LOG_DEBUG (logPrio, " padVtxInfo.distance_xy = " << padVtxInfo.distance_xy / CLHEP::mm << " mm" );
@@ -1421,7 +1423,7 @@ namespace snemo {
1421
1423
calibrationSpotVtxInfo.gid = sourceCalibrationSpotGid;
1422
1424
calibrationSpotVtxInfo.face_intercept = srcCalibrationSpotFii;
1423
1425
if (srcCalibrationSpotExtrapolationDist > 0.0 ) {
1424
- calibrationSpotVtxInfo.distance = srcCalibrationSpotExtrapolationDist;
1426
+ calibrationSpotVtxInfo.distance = srcCalibrationSpotExtrapolationDist;
1425
1427
calibrationSpotVtxInfo.distance_xy = srcCalibrationSpotExtrapolationDist_Xy;
1426
1428
} else {
1427
1429
calibrationSpotVtxInfo.distance = 0.0 ;
@@ -1547,8 +1549,10 @@ namespace snemo {
1547
1549
1548
1550
// Optimization for strip scanning:
1549
1551
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_);
1552
1556
const geomtools::logical_volume & srcSubmodLog = srcSubmodGinfo.get_logical ();
1553
1557
const geomtools::i_shape_3d & srcSubmodShape = srcSubmodLog.get_shape ();
1554
1558
const geomtools::placement & srcSubmodPlacement = srcSubmodGinfo.get_world_placement ();
@@ -1595,11 +1599,37 @@ namespace snemo {
1595
1599
}
1596
1600
minStripId = std::max (minStripId, (int16_t ) (minId - 1 ));
1597
1601
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 ;
1599
1625
} else {
1600
1626
DT_LOG_DEBUG (logPrio, " No line intercept on the source submodule #" << _sourceSubmoduleGid_);
1601
1627
}
1602
1628
} // 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);
1603
1633
1604
1634
if (useSourceSubmoduleHelixExtrapolation and not sourceSubmoduleLineExtrapolationSuccess) {
1605
1635
snemo::geometry::helix_intercept hIntercept (helix,
@@ -1621,9 +1651,12 @@ namespace snemo {
1621
1651
int32_t minId = +100000 ;
1622
1652
int32_t maxId = -100000 ;
1623
1653
// Find candidate source strips
1654
+ DT_LOG_DEBUG (logPrio, " Scanning strips..." );
1624
1655
for (uint32_t iStrip = 0 ; iStrip < _sourceStripGids_.size (); iStrip++) {
1625
1656
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);
1627
1660
const geomtools::placement & sourceStripPlacement = sourceStripGinfo.get_world_placement ();
1628
1661
double yStripWorld = sourceStripPlacement.get_translation ().y ();
1629
1662
if (std::abs (yStripWorld - yImpactWorld) < _max_source_extrapolation_xy_length_) {
@@ -1662,6 +1695,7 @@ namespace snemo {
1662
1695
continue ;
1663
1696
}
1664
1697
if ((int32_t ) sourceStripId < minStripId or (int32_t ) sourceStripId > maxStripId) {
1698
+ DT_LOG_DEBUG (logPrio, " Pass source strip GID : " << sourceStripGid << " ..." );
1665
1699
continue ;
1666
1700
}
1667
1701
DT_LOG_DEBUG (logPrio, " Searching helix intercept on strip #" << sourceStripId);
@@ -1769,6 +1803,7 @@ namespace snemo {
1769
1803
double distRef2Impact_Xy = (srcPadImpactWorld_Xy - refPoint_Xy).mag ();
1770
1804
double extrapolationDist_Xy = distRef2Impact_Xy - distRef2End_Xy;
1771
1805
DT_LOG_DEBUG (logPrio, " extrapolationDist_Xy = " << extrapolationDist_Xy / CLHEP::mm << " mm" );
1806
+ // Result:
1772
1807
padVtxInfo.category = snemo::geometry::vertex_info::CATEGORY_ON_SOURCE_FOIL;
1773
1808
padVtxInfo.from = iFrom;
1774
1809
padVtxInfo.extrapolation_mode = vertex_info::EXTRAPOLATION_LINE;
@@ -2036,11 +2071,14 @@ namespace snemo {
2036
2071
calibSpotFii.set_impact (calibSpotWorldImpact);
2037
2072
double calibSpotDistRef2Impact = (calibSpotWorldImpact - refPoint).mag ();
2038
2073
double calibSpotExtrapolationDist = calibSpotDistRef2Impact - distRef2End;
2039
- // XY extrapolation:
2074
+ DT_LOG_DEBUG (logPrio, " calibSpotExtrapolationDist = "
2075
+ << calibSpotExtrapolationDist / CLHEP::mm << " mm" );
2076
+ // XY extrapolation:
2040
2077
geomtools::vector_2d calibSpotImpact_Xy (calibSpotWorldImpact.x (), calibSpotWorldImpact.y ());
2041
2078
double calibSpotDistRef2Impact_Xy = (calibSpotImpact_Xy - refPoint_Xy).mag ();
2042
2079
double calibSpotExtrapolationDist_Xy = calibSpotDistRef2Impact_Xy - distRef2End_Xy;
2043
- // Result:
2080
+ DT_LOG_DEBUG (logPrio, " calibSpotExtrapolationDist_Xy = " << calibSpotExtrapolationDist_Xy / CLHEP::mm << " mm" );
2081
+ // Result:
2044
2082
vertex_info calibSpotVtxInfo;
2045
2083
calibSpotVtxInfo.category = snemo::geometry::vertex_info::CATEGORY_ON_SOURCE_FOIL;
2046
2084
calibSpotVtxInfo.from = iFrom;
@@ -2104,8 +2142,8 @@ namespace snemo {
2104
2142
DT_LOG_DEBUG (logPrio, " Helix intercept is to far from the calibration source spot" );
2105
2143
} // extrapolation distance check
2106
2144
} // if (success)
2107
- } // if (useCalibrationSpotHelixExtrapolation...
2108
- } // for (uint32_t iStrip
2145
+ } // if (useCalibrationSpotHelixExtrapolation...)
2146
+ } // for (uint32_t iStrip...)
2109
2147
} // if (use_calib_src)
2110
2148
2111
2149
_post_process_source_vertex_ (srcVertexes);
@@ -2502,7 +2540,6 @@ namespace snemo {
2502
2540
{
2503
2541
// Prefix "VED" stands for "Vertex Extrapolation Driver" :
2504
2542
datatools::logger::declare_ocd_logging_configuration (ocd_, " fatal" , " VED." );
2505
-
2506
2543
{
2507
2544
// // Description of the 'VED.use_linear_extrapolation' configuration property :
2508
2545
// datatools::configuration_property_description &cpd = ocd_.add_property_info();
@@ -2521,9 +2558,9 @@ namespace snemo {
2521
2558
}
2522
2559
}
2523
2560
2524
- } // end of namespace reconstruction
2561
+ } // end of namespace reconstruction
2525
2562
2526
- } // end of namespace snemo
2563
+ } // end of namespace snemo
2527
2564
2528
2565
/* OCD support */
2529
2566
#include < datatools/object_configuration_description.h>
0 commit comments