Commit 03eeec25 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Update for new EICD

parent 85487e0d
......@@ -47,6 +47,7 @@ namespace Jug {
const dd4pod::Geant4ParticleCollection* parts = m_inputHitCollection.get();
// output collection
auto out_parts = m_outputHitCollection.createAndPut();
int ID = 0;
for (const auto& p : *parts) {
if (p.genStatus() != 1) {
continue;
......@@ -62,7 +63,19 @@ namespace Jug {
const double py = p.psy() * momentum / pgen;
const double pz = p.psz() * momentum / pgen;
eic::ReconstructedParticle rec_part{p.pdgID(), energy, {px, py, pz}, (double)p.charge(), p.mass()};
eic::ReconstructedParticle rec_part{
ID++, // Unique index
{px, py, pz}, // 3-momentum [GeV]
{0, 0, 0}, // @TODO: Vertex [mm]
0., // @TODO: time [ns]
p.pdgID(), // PDG type
static_cast<int16_t>(0), // @TODO: Status
p.charge(), // Charge
momentum, // 3-momentum magnitude [GeV]
energy, // energy [GeV]
p.mass(), // mass [GeV]
1.}; // particle weight
out_parts->push_back(rec_part);
}
return StatusCode::SUCCESS;
......
......@@ -19,7 +19,7 @@
#include "Acts/EventData/MultiTrajectoryHelpers.hpp"
// Event Model related classes
#include "eicd/ParticleCollection.h"
#include "eicd/BasicParticleCollection.h"
#include "eicd/TrackerHitCollection.h"
#include "eicd/TrackParametersCollection.h"
#include "JugTrack/IndexSourceLink.hpp"
......@@ -28,6 +28,10 @@
#include "Acts/Utilities/Helpers.hpp"
#include "eicd/VectorPolar.h"
#include <cmath>
namespace Jug::Reco {
/** Extrac the particles form fit trajectories.
......@@ -39,7 +43,7 @@ namespace Jug::Reco {
public:
//DataHandle<eic::RawTrackerHitCollection> m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this};
DataHandle<TrajectoriesContainer> m_inputTrajectories{"inputTrajectories", Gaudi::DataHandle::Reader, this};
DataHandle<eic::ParticleCollection> m_outputParticles{"outputParticles", Gaudi::DataHandle::Writer, this};
DataHandle<eic::BasicParticleCollection> m_outputParticles{"outputParticles", Gaudi::DataHandle::Writer, this};
DataHandle<eic::TrackParametersCollection> m_outputTrackParameters{"outputTrackParameters", Gaudi::DataHandle::Writer, this};
public:
......@@ -148,18 +152,25 @@ namespace Jug::Reco {
return;
}
eic::Particle p({params[Acts::eBoundPhi],
params[Acts::eBoundTheta],
1.0 / std::abs(params[Acts::eBoundQOverP])},
{0.0, 0.0, 0.0, params[Acts::eBoundTime]},
0.000511,
(long long)11 * params[Acts::eBoundQOverP] /
std::abs(params[Acts::eBoundQOverP]),
0);
// debug() << p << endmsg;
eic::BasicParticle p{
-1,
eic::VectorPolar( // 3-momentum vector
{1.0/std::abs(params[Acts::eBoundQOverP]),
params[Acts::eBoundPhi], params[Acts::eBoundTheta]}),
{0., 0., 0.}, // vectex 3-vector
0., // time
0, // PDG particle code
0, // status
static_cast<int16_t>(std::copysign(1., params[Acts::eBoundQOverP]))}; // charge
rec_parts->push_back(p);
});
}
// set our IDs
for (int i = 0; i < rec_parts->size(); ++i) {
(*rec_parts)[i].ID(i);
}
return StatusCode::SUCCESS;
}
......
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