Commit 9f330887 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Update for dd4pod update

parent c160e633
......@@ -56,25 +56,29 @@ namespace Jug {
// for now just use total momentum smearing as this is the largest effect,
// ideally we should also smear the angles but this should be good enough
// for now.
const double pgen = std::hypot(p.psx(), p.psy(), p.psz());
const double momentum = pgen * m_gaussDist();
const double energy = std::hypot(momentum, p.mass());
const double px = p.psx() * momentum / pgen;
const double py = p.psy() * momentum / pgen;
const double pz = p.psz() * momentum / pgen;
const double pgen = p.ps().mag();
const float momentum = pgen * m_gaussDist();
const float energy = p.energy();
const float px = p.ps().x * momentum / pgen;
const float py = p.ps().y * momentum / pgen;
const float pz = p.ps().z * momentum / pgen;
// @TODO: vertex smearing
const float vx = p.vs().x;
const float vy = p.vs().y;
const float vz = p.vs().z;
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
ID++, // Unique index
{px, py, pz}, // 3-momentum [GeV]
{vx, vy, vz}, // Vertex [mm]
p.time(), // time [ns]
p.pdgID(), // PDG type
static_cast<int16_t>(p.status()), // Status
static_cast<int16_t>(p.charge()), // Charge
momentum, // 3-momentum magnitude [GeV]
energy, // energy [GeV]
p.mass(), // mass [GeV]
1.}; // particle weight
out_parts->push_back(rec_part);
}
......
......@@ -79,16 +79,10 @@ namespace Jug::Reco {
using Acts::UnitConstants::um;
using Acts::UnitConstants::ns;
double p = std::hypot( part.psx() * GeV, part.psy() * GeV, part.psz() * GeV);
ROOT::Math::XYZVector momentum(part.psx() * GeV, part.psy() * GeV, part.psz() * GeV);
const double p = part.ps().mag() * GeV;
/// \todo create or find better particle data interface.
// get the particle charge
double charge = ((part.pdgID() > 0) ? 1 : -1);
// electron is negative but positive pdg code
if( std::abs(part.pdgID()) == 11 ) {
charge *= -1;
}
const double charge = part.charge();
// build some track cov matrix
Acts::BoundSymMatrix cov = Acts::BoundSymMatrix::Zero();
......@@ -102,14 +96,14 @@ namespace Jug::Reco {
Acts::BoundVector params;
params(Acts::eBoundLoc0) = 0.0 * mm ; // cylinder radius
params(Acts::eBoundLoc1) = 0.0 * mm ; // cylinder length
params(Acts::eBoundPhi) = momentum.Phi();
params(Acts::eBoundTheta) = momentum.Theta();
params(Acts::eBoundPhi) = part.ps().phi();
params(Acts::eBoundTheta) = part.ps().theta();
params(Acts::eBoundQOverP) = charge / p;
params(Acts::eBoundTime) = part.time() * ns;
//// Construct a perigee surface as the target surface
auto pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
Acts::Vector3{part.vsx() * mm, part.vsy() * mm, part.vsz() * mm});
Acts::Vector3{part.vs().x * mm, part.vs().y * mm, part.vs().z * mm});
//params(Acts::eBoundQOverP) = charge/p;
init_trk_params->push_back({pSurface, params, charge,cov});
......
Supports Markdown
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