Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split ParticleID collection into smaller collections #131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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
Loading