Commit cc933e5e authored by Whitney Armstrong's avatar Whitney Armstrong

modified: ../../../JugBase/src/components/GeoSvc.h

	modified:   TrackerSourcesLinker.cpp
parent ef6cba89
Pipeline #6124 waiting for manual action with stages
in 13 seconds
......@@ -33,11 +33,11 @@ public:
GeoSvc(const std::string& name, ISvcLocator* svc);
virtual ~GeoSvc();
virtual StatusCode initialize() final;
virtual StatusCode finalize() final;
/** Build the dd4hep geometry.
* This function generates the DD4hep geometry.
*/
......@@ -64,8 +64,6 @@ public:
virtual double centralMagneticField() const {
return m_dd4hepgeo->field().magneticField({0,0,0}).z()*(Acts::UnitConstants::T/dd4hep::tesla);
}
;
private:
......@@ -76,9 +74,7 @@ private:
/// Pointer to the interface to the DD4hep geometry
dd4hep::Detector* m_dd4hepgeo;
std::shared_ptr<const dd4hep::rec::CellIDPositionConverter> m_cellid_converter = nullptr;//(*(m_geoSvc->detector()));
/// XML-files with the detector description
Gaudi::Property<std::vector<std::string>> m_xmlFileNames{this, "detectors", {}, "Detector descriptions XML-files"};
......
#include "JugReco/GeometryContainers.hpp"
#include <ios>
// Gaudi
#include "GaudiAlg/GaudiAlgorithm.h"
......@@ -15,6 +16,7 @@
#include "DDRec/SurfaceManager.h"
#include "DDRec/Surface.h"
#include "DD4hep/Volumes.h"
#include "DD4hep/VolumeManager.h"
#include "DD4hep/DD4hepUnits.h"
#include "Acts/Surfaces/Surface.hpp"
......@@ -131,14 +133,21 @@ namespace Jug::Reco {
cov(1, 1) = ahit.covsym_yy() * Acts::UnitConstants::mm * ahit.covsym_yy() * Acts::UnitConstants::mm;
auto vol_ctx = m_geoSvc->cellIDPositionConverter()->findContext(ahit.cellID());
auto vol_id = vol_ctx->identifier;
int64_t vol_id = vol_ctx->identifier;
const auto is = m_surfaces.find(vol_id);
debug() << " cell ID : 0x" << std::hex << ahit.cellID() << std::dec << endmsg;
if (is == m_surfaces.end()) {
debug() << " vol_id (" << vol_id << ") not found in m_surfaces." << endmsg;
auto detector = m_geoSvc->detector()->volumeManager().lookupDetector(vol_id);
debug() << " detector 0x" << std::hex << detector.id() <<std::dec << ", " << detector.path() << endmsg;
debug() << " vol_id " << vol_id << " (0x" << std::hex << vol_id <<std::dec<< ") not found in m_surfaces." << endmsg;
debug() << " vol_id " << uint64_t(vol_id) << " (0x" << std::hex << vol_id <<std::dec<< ") not found in m_surfaces." << endmsg;
debug() << " cell_id (0x" << std::hex << ahit.cellID() <<std::dec << ") not found in m_surfaces." << endmsg;
debug() << "hit " << ihit << endmsg;
continue;
}
const Acts::Surface* surface = is->second;
debug() << " surface center : " << surface->center(Acts::GeometryContext()) << endmsg;
//debug() << " surface center : " << surface->center(Acts::GeometryContext()) << endmsg;
// transform global position into local coordinates
Acts::Vector2 pos(0, 0);
// geometry context contains nothing here
......@@ -152,11 +161,10 @@ namespace Jug::Reco {
// local position
// auto loc = {ahit.x(), ahit.y(), ahit.z()} - vol_ctx->volumePlacement().position()
// debug() << " hit : \n" << ahit << endmsg;
// debug() << " cell ID : " << ahit.cellID() << endmsg;
// debug() << " position : (" << ahit.position(0) << ", " << ahit.position(1) << ", "<< ahit.position(2) <<
// ") " << endmsg; debug() << " vol_id : " << vol_id << endmsg; debug() << " placment pos : " <<
// vol_ctx->volumePlacement().position() << endmsg;
//debug() << " hit : \n" << ahit << endmsg;
//debug() << " position : (" << ahit.x() << ", " << ahit.y() << ", "<< ahit.z() <<
//") " << endmsg; debug() << " vol_id : " << vol_id << endmsg; debug() << " placment pos : " <<
//vol_ctx->volumePlacement().position() << endmsg;
// the measurement container is unordered and the index under which the
// measurement will be stored is known before adding it.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment