Skip to content

Commit

Permalink
fixes for compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Dec 29, 2022
1 parent 7239eca commit 0be210e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/algorithms/pid/IrtCherenkovParticleID.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ std::vector<edm4eic::CherenkovParticleID*> eicrecon::IrtCherenkovParticleID::Alg
// add to the total
weight_sum += phot_weight;
theta_sum += phot_weight * phot_theta;
phot_theta_phi.push_back({phot_theta,phot_phi});
phot_theta_phi.push_back({ phot_theta, phot_phi });
npe++;
// FIXME: these need MC cheating
// rindex_sum += irt_photon->GetVertexRefractiveIndex();
Expand All @@ -270,16 +270,17 @@ std::vector<edm4eic::CherenkovParticleID*> eicrecon::IrtCherenkovParticleID::Alg


// fill output collections -----------------------------------------------
auto out_particle_id = new edm4eic::CherenkovParticleID();
edm4eic::MutableCherenkovParticleID out_particle_id;

// fill Cherenkov angle estimate
out_particle_id->setRadiator(irt_rad->m_ID);
out_particle_id->setNpe(npe);
out_particle_id->setTheta(theta_ave);
out_particle_id->setRindex(rindex_ave);
out_particle_id->setWavelength(wavelength_ave);
out_particle_id.setRadiator(irt_rad->m_ID);
out_particle_id.setNpe(npe);
out_particle_id.setTheta(theta_ave);
out_particle_id.setRindex(rindex_ave);
out_particle_id.setWavelength(wavelength_ave);
for(auto [phot_theta,phot_phi] : phot_theta_phi) {
out_particle_id->addToThetaPhiPhotons(edm4hep::Vector2f{phot_theta,phot_phi});
edm4hep::Vector2f theta_phi( float(phot_theta), float(phot_phi) );
out_particle_id.addToThetaPhiPhotons(theta_phi);
}
m_log->trace("-> {} Radiator (ID={}):", rad_name, irt_rad->m_ID);
m_log->trace(" Cherenkov Angle Estimate:");
Expand All @@ -300,27 +301,28 @@ std::vector<edm4eic::CherenkovParticleID*> eicrecon::IrtCherenkovParticleID::Alg
auto hyp_npe = irt_hypothesis->GetNpe(irt_rad);

// fill `out_hypothesis` output collection
auto out_hypothesis = new edm4hep::ParticleID();
out_hypothesis.setType(irt_rad.m_ID);
edm4hep::MutableParticleID out_hypothesis;
out_hypothesis.setType(irt_rad->m_ID);
out_hypothesis.setPDG(pdg);
out_hypothesis.setAlgorithmType(m_algorithm_id);
out_hypothesis.setLikelihood(hyp_weight);
out_hypothesis.addToParameters(hyp_npe);
m_log->trace(" {:>6}: {:>10.3} {:>10.3}", pdg, hyp_weight, hyp_npe);

// relate
out_particle_id.addToHypotheses(out_hypothesis);
out_particle_id.addToHypotheses(edm4hep::ParticleID(out_hypothesis));

} // end hypothesis loop

// relate photons
// out_particle_id.addToPhotons(TODO);

// relate charged particle
out_particle_id.setChargedParticle(out_charged_particles.at(irt_rad));
auto out_charged_particle = *out_charged_particles.at(irt_rad);
out_particle_id.setChargedParticle(out_charged_particle);

// append
out_particle_ids.push_back(out_particle_id);
out_particle_ids.push_back(new edm4eic::CherenkovParticleID(out_particle_id));

} // end radiator loop

Expand Down
1 change: 1 addition & 0 deletions src/algorithms/pid/IrtCherenkovParticleID.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <edm4eic/RawPMTHitCollection.h>
#include <edm4eic/TrackSegmentCollection.h>
#include <edm4eic/CherenkovParticleIDCollection.h>
#include <edm4hep/ParticleIDCollection.h>

// IRT
#include <IRT/CherenkovRadiator.h>
Expand Down

0 comments on commit 0be210e

Please sign in to comment.