Commit aae2c9f6 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Update Juggler for EICD changes

parent b52349d9
......@@ -39,7 +39,7 @@ namespace Jug::Reco {
*
* \ingroup tracking
*/
class ParticlesFromTrackFit : public GaudiAlgorithm, AlgorithmIDMixin<int32_t> {
class ParticlesFromTrackFit : public GaudiAlgorithm {
public:
//DataHandle<eic::RawTrackerHitCollection> m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this};
DataHandle<TrajectoriesContainer> m_inputTrajectories{"inputTrajectories", Gaudi::DataHandle::Reader, this};
......@@ -49,11 +49,10 @@ namespace Jug::Reco {
public:
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
ParticlesFromTrackFit(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc)
, AlgorithmIDMixin(name, info()) {
: GaudiAlgorithm(name, svcLoc) {
declareProperty("inputTrajectories", m_inputTrajectories,"");
declareProperty("outputParticles", m_outputParticles, "");
declareProperty("outputTrackParameters", m_outputTrackParameters, "ACTS Track Parameters");
declareProperty("outputTrackParameters", m_outputTrackParameters, "Acts Track Parameters");
}
StatusCode initialize() override {
......@@ -98,7 +97,6 @@ namespace Jug::Reco {
// Get the fitted track parameter
//
bool hasFittedParams = false;
int ID = 0;
if (traj.hasTrackParameters(trackTip)) {
hasFittedParams = true;
const auto& boundParam = traj.trackParameters(trackTip);
......@@ -119,20 +117,36 @@ namespace Jug::Reco {
debug() << " chi2 = " << trajState.chi2Sum << endmsg;
}
const float boundQoverP = parameter[Acts::eBoundQOverP];
eic::TrackParameters pars{
{ID++, algorithmID()},
{parameter[Acts::eBoundLoc0], parameter[Acts::eBoundLoc1]},
{sqrt(static_cast<float>(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0))),
sqrt(static_cast<float>(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)))},
{parameter[Acts::eBoundTheta], parameter[Acts::eBoundPhi]},
{sqrt(static_cast<float>(covariance(Acts::eBoundTheta, Acts::eBoundTheta))),
sqrt(static_cast<float>(covariance(Acts::eBoundPhi, Acts::eBoundPhi)))},
boundQoverP,
sqrt(static_cast<float>(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP))),
static_cast<float>(parameter[Acts::eBoundTime]),
sqrt(static_cast<float>(covariance(Acts::eBoundTime, Acts::eBoundTime))),
static_cast<float>(std::copysign(1., boundQoverP))}; // charge
const std::array<float, 21> covMatrix {
static_cast<float>(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)),
static_cast<float>(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)),
static_cast<float>(covariance(Acts::eBoundTheta, Acts::eBoundTheta)),
static_cast<float>(covariance(Acts::eBoundPhi, Acts::eBoundPhi)),
static_cast<float>(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)),
static_cast<float>(covariance(Acts::eBoundTime, Acts::eBoundTime)),
static_cast<float>(covariance(Acts::eBoundLoc0, Acts::eBoundLoc1)),
static_cast<float>(covariance(Acts::eBoundLoc0, Acts::eBoundTheta)),
static_cast<float>(covariance(Acts::eBoundLoc0, Acts::eBoundPhi)),
static_cast<float>(covariance(Acts::eBoundLoc0, Acts::eBoundQOverP)),
static_cast<float>(covariance(Acts::eBoundLoc0, Acts::eBoundTime)),
static_cast<float>(covariance(Acts::eBoundLoc1, Acts::eBoundTheta)),
static_cast<float>(covariance(Acts::eBoundLoc1, Acts::eBoundPhi)),
static_cast<float>(covariance(Acts::eBoundLoc1, Acts::eBoundQOverP)),
static_cast<float>(covariance(Acts::eBoundLoc1, Acts::eBoundTime)),
static_cast<float>(covariance(Acts::eBoundTheta, Acts::eBoundPhi)),
static_cast<float>(covariance(Acts::eBoundTheta, Acts::eBoundQOverP)),
static_cast<float>(covariance(Acts::eBoundTheta, Acts::eBoundTime)),
static_cast<float>(covariance(Acts::eBoundPhi, Acts::eBoundQOverP)),
static_cast<float>(covariance(Acts::eBoundPhi, Acts::eBoundTime)),
static_cast<float>(covariance(Acts::eBoundQOverP, Acts::eBoundTime))};
eic::TrackParameters pars{0, // type: track head --> 0
{parameter[Acts::eBoundLoc0], parameter[Acts::eBoundLoc1]},
static_cast<float>(parameter[Acts::eBoundTheta]),
static_cast<float>(parameter[Acts::eBoundPhi]),
static_cast<float>(parameter[Acts::eBoundQOverP]),
static_cast<float>(parameter[Acts::eBoundTime]),
covMatrix};
track_pars->push_back(pars);
}
......@@ -177,7 +191,7 @@ namespace Jug::Reco {
// set our IDs
for (size_t i = 0; i < rec_parts->size(); ++i) {
(*rec_parts)[i].ID({static_cast<int32_t>(i), algorithmID()});
(*rec_parts)[i].ID({static_cast<int32_t>(i), 0});
}
return StatusCode::SUCCESS;
......
#include <algorithm>
// FIXME needs renaming (TrackProjector) and updating to fix and remove hardcoded numbers
// Gaudi
#include "GaudiAlg/GaudiAlgorithm.h"
#include "GaudiKernel/ToolHandle.h"
......
......@@ -67,7 +67,6 @@ namespace Jug::Reco {
const dd4pod::Geant4ParticleCollection* mcparts = m_inputMCParticles.get();
// Create output collections
auto init_trk_params = m_outputTrackParameters.createAndPut();
int ID = 0;
for(const auto& part : *mcparts) {
......@@ -86,13 +85,17 @@ namespace Jug::Reco {
continue;
}
float q_over_p = charge / p;
// TrackParameters params(ID, loc, eic::FloatPair locError, eic::Direction direction, eic::Direction
// directionError, float qOverP, float qOverPError, float time, float timeError);
eic::TrackParameters params(eic::Index(ID++), {float(0.0), float(0.0)}, {float(0.1), float(0.1)},
{float(part.ps().phi()), float(part.ps().theta())}, {float(0.1), float(0.1)},
q_over_p, float(q_over_p * 0.05), float(part.time()), float(1.0), float(charge));
const float q_over_p = charge / p;
std::array<float, 21> covMatrix;
covMatrix.fill(0.1);
eic::TrackParameters params(-1, // type --> seed (-1)
{0.0f, 0.0f}, // location on surface
part.ps().theta(), // theta (rad)
part.ps().phi(), // phi (rad)
q_over_p * .05f, // Q/P (e/GeV)
part.time(), // Time (ns)
covMatrix); // 15 element diagonal covariance matrix
////// Construct a perigee surface as the target surface
//auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
......
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