diff --git a/converter/include/k4SimDelphes/DelphesEDM4HepOutputConfiguration.h b/converter/include/k4SimDelphes/DelphesEDM4HepOutputConfiguration.h index 02b366e..571fddf 100644 --- a/converter/include/k4SimDelphes/DelphesEDM4HepOutputConfiguration.h +++ b/converter/include/k4SimDelphes/DelphesEDM4HepOutputConfiguration.h @@ -4,6 +4,7 @@ #include "ExRootAnalysis/ExRootConfReader.h" #include +#include #include #include #include @@ -77,10 +78,10 @@ namespace k4SimDelphes { std::string RecoParticleCollectionName{"ReconstructedParticles"}; /** - * Name of the MCRecoParticleAssociationCollection holding the associations of + * Name of the RecoMCParticleLinkCollection holding the links of * generated to reconstructed particles. */ - std::string MCRecoAssociationCollectionName{"MCRecoAssociations"}; + std::string RecoMCParticleLinkCollectionName{"MCRecoAssociations"}; /** * Name of the ParticleIDCollection holding the ctags / isolation variables. @@ -112,7 +113,7 @@ namespace k4SimDelphes { os << std::setw(40) << " MissingETCollections: " << settings.MissingETCollections << "\n"; os << std::setw(40) << " ScalarHTCollections: " << settings.ScalarHTCollections << "\n"; os << std::setw(40) << " RecoParticleCollectionName: " << settings.RecoParticleCollectionName << "\n"; - os << std::setw(40) << " MCRecoAssociationCollectionName: " << settings.MCRecoAssociationCollectionName << "\n"; + os << std::setw(40) << " RecoMCParticleLinkCollectionName: " << settings.RecoMCParticleLinkCollectionName << "\n"; os << "------------------------------------------------------------\n"; return os; @@ -155,8 +156,16 @@ namespace k4SimDelphes { settings.RecoParticleCollectionName = confReader->GetString("EDM4HepOutput::RecoParticleCollectionName", "ReconstructedParticles"); - settings.MCRecoAssociationCollectionName = - confReader->GetString("EDM4HepOutput::MCRecoAssociationCollectionName", "MCRecoAssociations"); + const auto assocName = confReader->GetString("EDM4HepOutput::MCRecoAssociationCollectionName", "not-available"); + if (assocName != std::string("not-available")) { + std::cerr << "WARNING: k4SimDelphes::getEDM4hepOutputSettings | MCRecoAssociationCollectionName is deprecated, " + "use RecoMCParticleLinkCollection instead" + << std::endl; + settings.RecoMCParticleLinkCollectionName = assocName; + } + + settings.RecoMCParticleLinkCollectionName = + confReader->GetString("EDM4HepOutput::RecoMCParticleLinkCollectionName", "MCRecoAssociations"); return settings; } diff --git a/converter/src/DelphesEDM4HepConverter.cc b/converter/src/DelphesEDM4HepConverter.cc index bcdc807..0a9c41b 100644 --- a/converter/src/DelphesEDM4HepConverter.cc +++ b/converter/src/DelphesEDM4HepConverter.cc @@ -80,7 +80,7 @@ namespace k4SimDelphes { : m_magneticFieldBz(magFieldBz), m_recoCollName(outputSettings.RecoParticleCollectionName), m_particleIDName(outputSettings.ParticleIDCollectionName), - m_mcRecoAssocCollName(outputSettings.MCRecoAssociationCollectionName) { + m_mcRecoAssocCollName(outputSettings.RecoMCParticleLinkCollectionName) { for (const auto& branch : branches) { if (contains(PROCESSING_ORDER, branch.className)) { m_branches.push_back(branch); diff --git a/doc/output_config.md b/doc/output_config.md index ed89c9e..9f064b7 100644 --- a/doc/output_config.md +++ b/doc/output_config.md @@ -88,9 +88,9 @@ The filled collection contains only one element per event. The parameters **`RecoParticleCollectionName`** and -**`MCRecoAssociationCollectionName`** control the names of the [global +**`RecoMCParticleLinkCollectionName`** control the names of the [global reconstructed particle collection](#reconstructedparticlecollections) and the -collection with the `MCRecoParticleAssociation`s that can be used to find the +collection with the `RecoMCParticleLink`s that can be used to find the `MCParticle`s associated to `ReconstructedParticle`s (and vice versa). ## Class conversions @@ -99,19 +99,19 @@ The following table lists which Delphes classes correspond to which `edm4hep` classes. For the conversion the Delphes classes are taken from the `TreeWriter` (the `BranchClass` for each `Branch` defined in there) -| Delphes | `edm4hep` | -|---------------|---------------------------------------------------| -| `GenParticle` | `MCParticle` | -| `Track` | `ReconstructedParticle` with associated `Track` | -| `Tower` | `ReconstructedParticle` with associated `Cluster` | -| `Jet` | `ReconstructedParticle` | -| `Muon` | `ReconstructedParticle` (subset collection) | -| `Electron` | `ReconstructedParticle` (subset collection) | -| `Photon` | `ReconstructedParticle` (subset collection) | -| `MissingET` | `ReconstructedParticle` | -| `ScalarHT` | `ParticleID` | -| `ParticleFlowCandidate` | `ReconstructedParticle` | -| n/a | `MCRecoParticleAssociation` | +| Delphes | `edm4hep` | +|-------------------------|---------------------------------------------------| +| `GenParticle` | `MCParticle` | +| `Track` | `ReconstructedParticle` with associated `Track` | +| `Tower` | `ReconstructedParticle` with associated `Cluster` | +| `Jet` | `ReconstructedParticle` | +| `Muon` | `ReconstructedParticle` (subset collection) | +| `Electron` | `ReconstructedParticle` (subset collection) | +| `Photon` | `ReconstructedParticle` (subset collection) | +| `MissingET` | `ReconstructedParticle` | +| `ScalarHT` | `ParticleID` | +| `ParticleFlowCandidate` | `ReconstructedParticle` | +| n/a | `RecoMCParticleLink` | All Delphes classes that are not listed here are currently not converted. diff --git a/examples/edm4hep_output_config.tcl b/examples/edm4hep_output_config.tcl index 33893d6..ce7091c 100644 --- a/examples/edm4hep_output_config.tcl +++ b/examples/edm4hep_output_config.tcl @@ -9,5 +9,5 @@ module EDM4HepOutput EDM4HepOutput { add MissingETCollections MissingET add ScalarHTCollections ScalarHT set RecoParticleCollectionName ReconstructedParticles - set MCRecoAssociationCollectionName MCRecoAssociations + set RecoMCParticleLinkCollectionName MCRecoAssociations }