|
25 | 25 | // LArSoft includes |
26 | 26 | #include "larcore/Geometry/Geometry.h" |
27 | 27 | #include "larcore/Geometry/WireReadout.h" |
| 28 | +#include "larcorealg/Geometry/WireReadoutGeom.h" |
28 | 29 | #include "lardata/ArtDataHelper/HitCreator.h" |
29 | 30 | #include "lardata/DetectorInfoServices/DetectorClocksService.h" |
30 | 31 | #include "lardata/DetectorInfoServices/DetectorPropertiesService.h" |
@@ -369,6 +370,7 @@ void SnippetHit3DBuilderSBN::configure(fhicl::ParameterSet const &pset) |
369 | 370 | m_outputHistograms = pset.get<bool >("OutputHistograms", false); |
370 | 371 | m_makeAssociations = pset.get<bool >("MakeAssociations", false); |
371 | 372 |
|
| 373 | + m_geometry = art::ServiceHandle<geo::Geometry const>{}.get(); |
372 | 374 | m_wireReadout = &art::ServiceHandle<geo::WireReadout const>{}->Get(); |
373 | 375 |
|
374 | 376 | // Returns the wire pitch per plane assuming they will be the same for all TPCs |
@@ -1822,27 +1824,28 @@ void SnippetHit3DBuilderSBN::CollectArtHits(const art::Event& evt) const |
1822 | 1824 | std::map<geo::PlaneID,double> planeIDToPositionMap; |
1823 | 1825 |
|
1824 | 1826 | // Initialize the plane to hit vector map |
1825 | | - for(auto const& tpcID : m_geometry->Iterate<geo::TPCID>()) |
| 1827 | + for(auto const& tpcGeo : m_geometry->Iterate<geo::TPCGeo>()) |
1826 | 1828 | { |
1827 | | - m_planeToSnippetHitMap[geo::PlaneID(tpcID,0)] = SnippetHitMap(); |
1828 | | - m_planeToSnippetHitMap[geo::PlaneID(tpcID,1)] = SnippetHitMap(); |
1829 | | - m_planeToSnippetHitMap[geo::PlaneID(tpcID,2)] = SnippetHitMap(); |
| 1829 | + m_planeToSnippetHitMap[geo::PlaneID(tpcGeo.ID(),0)] = SnippetHitMap(); |
| 1830 | + m_planeToSnippetHitMap[geo::PlaneID(tpcGeo.ID(),1)] = SnippetHitMap(); |
| 1831 | + m_planeToSnippetHitMap[geo::PlaneID(tpcGeo.ID(),2)] = SnippetHitMap(); |
1830 | 1832 |
|
1831 | | - // Should we provide output? |
1832 | | - if (!m_weHaveAllBeenHereBefore) |
1833 | | - { |
1834 | | - std::ostringstream outputString; |
| 1833 | + // Should we provide output? |
| 1834 | + if (!m_weHaveAllBeenHereBefore) |
| 1835 | + { |
| 1836 | + std::ostringstream outputString; |
1835 | 1837 |
|
1836 | | - outputString << "***> plane 0 offset: " << m_PlaneToT0OffsetMap.find(geo::PlaneID(tpcID,0))->second |
1837 | | - << ", plane 1: " << m_PlaneToT0OffsetMap.find(geo::PlaneID(tpcID,1))->second |
1838 | | - << ", plane 2: " << m_PlaneToT0OffsetMap.find(geo::PlaneID(tpcID,2))->second << "\n"; |
1839 | | - outputString << " Det prop plane 0: " << det_prop.GetXTicksOffset(geo::PlaneID(tpcID,0)) << ", plane 1: " << det_prop.GetXTicksOffset(geo::PlaneID(tpcID,1)) << ", plane 2: " << det_prop.GetXTicksOffset(geo::PlaneID(tpcID,2)) << ", Trig: " << trigger_offset(clock_data) << "\n"; |
1840 | | - debugMessage += outputString.str() + "\n"; |
1841 | | - } |
| 1838 | + outputString << "***> plane 0 offset: " << m_PlaneToT0OffsetMap.find(geo::PlaneID(tpcGeo.ID(),0))->second |
| 1839 | + << ", plane 1: " << m_PlaneToT0OffsetMap.find(geo::PlaneID(tpcGeo.ID(),1))->second |
| 1840 | + << ", plane 2: " << m_PlaneToT0OffsetMap.find(geo::PlaneID(tpcGeo.ID(),2))->second << "\n"; |
| 1841 | + outputString << " Det prop plane 0: " << det_prop.GetXTicksOffset(geo::PlaneID(tpcGeo.ID(),0)) << ", plane 1: " << det_prop.GetXTicksOffset(geo::PlaneID(tpcGeo.ID(),1)) << ", plane 2: " << det_prop.GetXTicksOffset(geo::PlaneID(tpcGeo.ID(),2)) << ", Trig: " << trigger_offset(clock_data) << "\n"; |
| 1842 | + |
| 1843 | + debugMessage += outputString.str() + "\n"; |
| 1844 | + } |
1842 | 1845 |
|
1843 | | - geo::PlaneID const planeID2{tpcID, 2}; |
1844 | | - double xPosition(det_prop.ConvertTicksToX(0., planeID2)); |
1845 | | - planeIDToPositionMap[planeID2] = xPosition; |
| 1846 | + geo::PlaneID const planeID2{tpcGeo.ID(), 2}; |
| 1847 | + double xPosition(det_prop.ConvertTicksToX(0., planeID2)); |
| 1848 | + planeIDToPositionMap[planeID2] = xPosition; |
1846 | 1849 | } |
1847 | 1850 |
|
1848 | 1851 | if (!m_weHaveAllBeenHereBefore) |
|
0 commit comments