Commit df851c00 authored by Whitney Armstrong's avatar Whitney Armstrong

Added maxHitRadius for vertex hits

- Hits must fall within this radius to seed a track.
parent 654bdfb4
#include <cmath> #include <cmath>
// Gaudi // Gaudi
#include "GaudiAlg/GaudiAlgorithm.h" #include "GaudiAlg/GaudiAlgorithm.h"
#include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ToolHandle.h"
...@@ -6,6 +7,7 @@ ...@@ -6,6 +7,7 @@
#include "GaudiAlg/GaudiTool.h" #include "GaudiAlg/GaudiTool.h"
#include "GaudiKernel/RndmGenerators.h" #include "GaudiKernel/RndmGenerators.h"
#include "GaudiKernel/Property.h" #include "GaudiKernel/Property.h"
#include "GaudiKernel/PhysicalConstants.h"
#include "JugBase/DataHandle.h" #include "JugBase/DataHandle.h"
#include "JugBase/IGeoSvc.h" #include "JugBase/IGeoSvc.h"
...@@ -15,18 +17,7 @@ ...@@ -15,18 +17,7 @@
#include "eicd/TrackerHitCollection.h" #include "eicd/TrackerHitCollection.h"
#include "eicd/ClusterCollection.h" #include "eicd/ClusterCollection.h"
using namespace Gaudi::Units;
///// (Reconstructed) track parameters e.g. close to the vertex.
//using TrackParameters = Acts::CurvilinearTrackParameters;
///// Container of reconstructed track states for multiple tracks.
//using TrackParametersContainer = std::vector<TrackParameters>;
///// MultiTrajectory definition
//using Trajectory = Acts::MultiTrajectory<SourceLink>;
///// Container for the truth fitting/finding track(s)
//using TrajectoryContainer = std::vector<SimMultiTrajectory>;
namespace Jug::Reco { namespace Jug::Reco {
...@@ -46,6 +37,7 @@ namespace Jug::Reco { ...@@ -46,6 +37,7 @@ namespace Jug::Reco {
DataHandle<Clusters> m_inputClusters{"inputClusters", Gaudi::DataHandle::Reader, this}; DataHandle<Clusters> m_inputClusters{"inputClusters", Gaudi::DataHandle::Reader, this};
DataHandle<TrackParametersContainer> m_outputInitialTrackParameters{"outputInitialTrackParameters", DataHandle<TrackParametersContainer> m_outputInitialTrackParameters{"outputInitialTrackParameters",
Gaudi::DataHandle::Writer, this}; Gaudi::DataHandle::Writer, this};
Gaudi::Property<double> m_maxHitRadius{this, "maxHitRadius", 40.0*mm};
public: public:
TrackParamVertexClusterInit(const std::string& name, ISvcLocator* svcLoc) TrackParamVertexClusterInit(const std::string& name, ISvcLocator* svcLoc)
...@@ -71,6 +63,8 @@ namespace Jug::Reco { ...@@ -71,6 +63,8 @@ namespace Jug::Reco {
// Create output collections // Create output collections
auto init_trk_params = m_outputInitialTrackParameters.createAndPut(); auto init_trk_params = m_outputInitialTrackParameters.createAndPut();
double max_radius = m_maxHitRadius.value();
for(const auto& c : *clusters) { for(const auto& c : *clusters) {
using Acts::UnitConstants::GeV; using Acts::UnitConstants::GeV;
...@@ -87,6 +81,9 @@ namespace Jug::Reco { ...@@ -87,6 +81,9 @@ namespace Jug::Reco {
for (const auto& t : *vtx_hits) { for (const auto& t : *vtx_hits) {
double len = std::hypot(t.x(), t.y(), t.z()); double len = std::hypot(t.x(), t.y(), t.z());
if( len > max_radius ) {
continue;
}
// build some track cov matrix // build some track cov matrix
Acts::BoundSymMatrix cov = Acts::BoundSymMatrix::Zero(); Acts::BoundSymMatrix cov = Acts::BoundSymMatrix::Zero();
......
...@@ -111,10 +111,6 @@ namespace Jug::Reco { ...@@ -111,10 +111,6 @@ namespace Jug::Reco {
auto vol_ctx = m_geoSvc->cellIDPositionConverter()->findContext(ahit.cellID()); auto vol_ctx = m_geoSvc->cellIDPositionConverter()->findContext(ahit.cellID());
auto vol_id = vol_ctx->identifier; auto vol_id = vol_ctx->identifier;
// 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() << " vol_id : " << vol_id << endmsg;
debug() << " placment pos : " << vol_ctx->volumePlacement().position() << endmsg; debug() << " placment pos : " << vol_ctx->volumePlacement().position() << endmsg;
...@@ -132,15 +128,12 @@ namespace Jug::Reco { ...@@ -132,15 +128,12 @@ namespace Jug::Reco {
pos = surface->globalToLocal(Acts::GeometryContext(), {ahit.x(), ahit.y(), ahit.z()}, {0, 0, 0}) pos = surface->globalToLocal(Acts::GeometryContext(), {ahit.x(), ahit.y(), ahit.z()}, {0, 0, 0})
.value(); //, pos); .value(); //, pos);
//// smear truth to create local measurement
Acts::BoundVector loc = Acts::BoundVector::Zero(); Acts::BoundVector loc = Acts::BoundVector::Zero();
loc[Acts::eBoundLoc0] = pos[0]; //+ m_cfg.sigmaLoc0 * stdNormal(rng); loc[Acts::eBoundLoc0] = pos[0];
loc[Acts::eBoundLoc0] = pos[1]; //+ m_cfg.sigmaLoc1 * stdNormal(rng); loc[Acts::eBoundLoc0] = pos[1];
debug() << "loc : (" << loc[0] << ", " << loc[1] << ")" << endmsg; debug() << "loc : (" << loc[0] << ", " << loc[1] << ")" << endmsg;
// create source link at the end of the container // create source link at the end of the container
// auto it = source_links->emplace_hint(source_links->end(), *surface, hit, 2, loc, cov);
auto it = source_links->emplace_hint(source_links->end(), *surface, 2, loc, cov); auto it = source_links->emplace_hint(source_links->end(), *surface, 2, loc, cov);
// ensure hits and links share the same order to prevent ugly surprises // ensure hits and links share the same order to prevent ugly surprises
if (std::next(it) != source_links->end()) { if (std::next(it) != source_links->end()) {
......
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