Skip to content

Commit

Permalink
Split ParticleID collection into smaller collections
Browse files Browse the repository at this point in the history
Having one large ParticleID collection made sense historically before
EDM4hep reversed the direction of the ReconstructedParticle ->
ParticleID relation. Since now ParticleIDs point to the
ReconstructedParticles it's easier to handle downstream (and especially
in FCCAnalyses) if there are several smaller and more specific
ParticleID collections for each of the input collections that are
converted.
  • Loading branch information
tmadlener committed Oct 4, 2024
1 parent 003f22e commit bc92e5c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion converter/include/k4SimDelphes/DelphesEDM4HepConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ namespace k4SimDelphes {
double m_magneticFieldBz; // necessary for determining track parameters

std::string m_recoCollName;
std::string m_particleIDName;
std::string m_recoMCLinkCollName;

// map from UniqueIDs (delphes generated particles) to MCParticles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ namespace k4SimDelphes {
* generated to reconstructed particles.
*/
std::string RecoMCParticleLinkCollectionName{"MCRecoAssociations"};

/**
* Name of the ParticleIDCollection holding the ctags / isolation variables.
*/
std::string ParticleIDCollectionName{"ParticleIDs"};
};

template <typename T> std::ostream& operator<<(std::ostream& os, std::vector<T> const& container) {
Expand Down
8 changes: 2 additions & 6 deletions converter/src/DelphesEDM4HepConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ namespace k4SimDelphes {
OutputSettings const& outputSettings, double magFieldBz)
: m_magneticFieldBz(magFieldBz),
m_recoCollName(outputSettings.RecoParticleCollectionName),
m_particleIDName(outputSettings.ParticleIDCollectionName),
m_recoMCLinkCollName(outputSettings.RecoMCParticleLinkCollectionName) {
for (const auto& branch : branches) {
if (contains(PROCESSING_ORDER, branch.className)) {
Expand Down Expand Up @@ -224,7 +223,7 @@ namespace k4SimDelphes {
magFieldCollection->push_back(m_magneticFieldBz);

auto* mcRecoRelations = getCollection<edm4hep::RecoMCParticleLinkCollection>(m_recoMCLinkCollName);
auto* idCollection = getCollection<edm4hep::ParticleIDCollection>(m_particleIDName);
auto* idCollection = createCollection<edm4hep::ParticleIDCollection>(branch + "_PID");
auto* trackerHitColl = getCollection<edm4hep::TrackerHit3DCollection>(TRACKERHIT_OUTPUT_NAME);

for (auto iCand = 0; iCand < delphesCollection->GetEntries(); ++iCand) {
Expand Down Expand Up @@ -346,7 +345,7 @@ namespace k4SimDelphes {

void DelphesEDM4HepConverter::processJets(const TClonesArray* delphesCollection, std::string const& branch) {
auto* jetCollection = createCollection<edm4hep::ReconstructedParticleCollection>(branch);
auto* idCollection = getCollection<edm4hep::ParticleIDCollection>(m_particleIDName);
auto* idCollection = createCollection<edm4hep::ParticleIDCollection>(branch + "_tags");

for (auto iCand = 0; iCand < delphesCollection->GetEntries(); ++iCand) {
auto* delphesCand = static_cast<Jet*>(delphesCollection->At(iCand));
Expand Down Expand Up @@ -510,9 +509,6 @@ namespace k4SimDelphes {
if (m_collections.find(m_recoMCLinkCollName) == m_collections.end()) {
createCollection<edm4hep::RecoMCParticleLinkCollection>(m_recoMCLinkCollName);
}
if (m_collections.find(m_particleIDName) == m_collections.end()) {
createCollection<edm4hep::ParticleIDCollection>(m_particleIDName);
}
if (m_collections.find(TRACKERHIT_OUTPUT_NAME) == m_collections.end()) {
createCollection<edm4hep::TrackerHit3DCollection>(TRACKERHIT_OUTPUT_NAME);
}
Expand Down

0 comments on commit bc92e5c

Please sign in to comment.