Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/algorithms/pid/IrtCherenkovParticleID.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ void IrtCherenkovParticleID::init(CherenkovDetectorCollection* irt_det_coll) {

void IrtCherenkovParticleID::process(const IrtCherenkovParticleID::Input& input,
const IrtCherenkovParticleID::Output& output) const {
const auto [in_aerogel_tracks, in_gas_tracks, in_merged_tracks, in_raw_hits, in_hit_assocs] =
const auto [in_aerogel_tracks, in_gas_tracks, in_merged_tracks, in_raw_hits, in_hit_links] =
input;
auto [out_aerogel_particleIDs, out_gas_particleIDs] = output;

// logging
trace("{:=^70}", " call IrtCherenkovParticleID::AlgorithmProcess ");
trace("number of raw sensor hits: {}", in_raw_hits->size());
trace("number of raw sensor hit with associated photons: {}", in_hit_assocs->size());
trace("number of raw sensor hit with associated photons: {}", in_hit_links->size());
Comment thread
Copilot marked this conversation as resolved.
Outdated

std::map<std::string, const edm4eic::TrackSegmentCollection*> in_charged_particles{
{"Aerogel", in_aerogel_tracks},
Expand Down Expand Up @@ -227,10 +227,10 @@ void IrtCherenkovParticleID::process(const IrtCherenkovParticleID::Input& input,
edm4hep::MCParticle mc_photon;
bool mc_photon_found = false;
if (m_cfg.cheatPhotonVertex || m_cfg.cheatTrueRadiator) {
for (const auto& hit_assoc : *in_hit_assocs) {
if (hit_assoc.getRawHit().isAvailable()) {
if (hit_assoc.getRawHit().id() == raw_hit.id()) {
mc_photon = hit_assoc.getSimHit().getParticle();
for (const auto& hit_link : *in_hit_links) {
if (hit_link.getRawHit().isAvailable()) {
if (hit_link.getRawHit().id() == raw_hit.id()) {
mc_photon = hit_link.getSimHit().getParticle();
Comment thread
wdconinc marked this conversation as resolved.
Outdated
mc_photon_found = true;
if (mc_photon.getPDG() != -22) {
warning("non-opticalphoton hit: PDG = {}", mc_photon.getPDG());
Expand Down Expand Up @@ -464,8 +464,8 @@ void IrtCherenkovParticleID::process(const IrtCherenkovParticleID::Input& input,
}

// relate hit associations
for (const auto& hit_assoc : *in_hit_assocs) {
out_cherenkov_pid.addToRawHitAssociations(hit_assoc);
for (const auto& hit_link : *in_hit_links) {
out_cherenkov_pid.addToRawHitAssociations(hit_link);
}

} // end radiator loop
Expand Down
8 changes: 4 additions & 4 deletions src/algorithms/pid/IrtCherenkovParticleID.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <IRT/CherenkovRadiator.h>
#include <algorithms/algorithm.h>
#include <edm4eic/CherenkovParticleIDCollection.h>
#include <edm4eic/MCRecoTrackerHitAssociationCollection.h>
#include <edm4eic/MCRecoTrackerHitLinkCollection.h>
#include <edm4eic/RawTrackerHitCollection.h>
#include <edm4eic/TrackSegmentCollection.h>
#include <stdint.h>
Expand All @@ -26,15 +26,15 @@
namespace eicrecon {

// - `in_raw_hits` is a collection of digitized (raw) sensor hits, possibly including noise hits
// - `in_hit_assocs` is a collection of digitized (raw) sensor hits, associated with MC (simulated) hits;
// - `in_hit_links` is a collection of digitized (raw) sensor hits, associated with MC (simulated) hits;
// noise hits are not included since there is no associated simulated photon
Comment thread
wdconinc marked this conversation as resolved.
Outdated
// - `in_charged_particles` is a map of a radiator name to a collection of TrackSegments
// - each TrackSegment has a list of TrackPoints: the propagation of reconstructed track (trajectory) points
// - the output is a map: radiator name -> collection of particle ID objects
using IrtCherenkovParticleIDAlgorithm = algorithms::Algorithm<
algorithms::Input<const edm4eic::TrackSegmentCollection, const edm4eic::TrackSegmentCollection,
const edm4eic::TrackSegmentCollection, const edm4eic::RawTrackerHitCollection,
const edm4eic::MCRecoTrackerHitAssociationCollection>,
const edm4eic::MCRecoTrackerHitLinkCollection>,
algorithms::Output<edm4eic::CherenkovParticleIDCollection,
edm4eic::CherenkovParticleIDCollection>>;

Expand All @@ -46,7 +46,7 @@ class IrtCherenkovParticleID : public IrtCherenkovParticleIDAlgorithm,
: IrtCherenkovParticleIDAlgorithm{name,
{"inputAerogelTrackSegments", "inputGasTrackSegments",
"inputMergedTrackSegments", "inputRawHits",
"inputRawHitAssociations"},
"inputRawHitLinks"},
{"outputAerogelParticleIDs", "outputGasParticleIDs"},
"Effectively 'zip' the input particle IDs"} {}

Expand Down
2 changes: 1 addition & 1 deletion src/detectors/DRICH/DRICH.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void InitPlugin(JApplication* app) {
app->Add(new JOmniFactoryGeneratorT<IrtCherenkovParticleID_factory>(
"DRICHIrtCherenkovParticleID",
{"DRICHAerogelTracks", "DRICHGasTracks", "DRICHMergedTracks", "DRICHRawHits",
"DRICHRawHitsAssociations"},
"DRICHRawHitsLinks"},
{"DRICHAerogelIrtCherenkovParticleID", "DRICHGasIrtCherenkovParticleID"}, irt_cfg, app));

// merge aerogel and gas PID results
Expand Down
5 changes: 3 additions & 2 deletions src/factories/pid/IrtCherenkovParticleID_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <IRT/CherenkovDetectorCollection.h>
#include <JANA/JEvent.h>
#include <edm4eic/CherenkovParticleIDCollection.h>
#include <edm4eic/MCRecoTrackerHitLinkCollection.h>
#include <algorithm>
#include <memory>
#include <string>
Expand All @@ -31,7 +32,7 @@ class IrtCherenkovParticleID_factory
PodioInput<edm4eic::TrackSegment> m_gas_tracks_input{this};
PodioInput<edm4eic::TrackSegment> m_merged_tracks_input{this};
PodioInput<edm4eic::RawTrackerHit> m_raw_hits_input{this};
PodioInput<edm4eic::MCRecoTrackerHitAssociation> m_raw_hit_assoc_input{this};
PodioInput<edm4eic::MCRecoTrackerHitLink> m_raw_hit_links_input{this};
PodioOutput<edm4eic::CherenkovParticleID> m_aerogel_particleIDs_output{this};
PodioOutput<edm4eic::CherenkovParticleID> m_gas_particleIDs_output{this};

Expand Down Expand Up @@ -71,7 +72,7 @@ class IrtCherenkovParticleID_factory

void Process(int32_t /* run_number */, uint64_t /* event_number */) {
m_algo->process({m_aerogel_tracks_input(), m_gas_tracks_input(), m_merged_tracks_input(),
m_raw_hits_input(), m_raw_hit_assoc_input()},
m_raw_hits_input(), m_raw_hit_links_input()},
{m_aerogel_particleIDs_output().get(), m_gas_particleIDs_output().get()});
}
};
Expand Down
Loading