Skip to content

Commit

Permalink
Change name of output config parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Oct 4, 2024
1 parent fc868a1 commit be455d1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 22 deletions.
19 changes: 14 additions & 5 deletions converter/include/k4SimDelphes/DelphesEDM4HepOutputConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ExRootAnalysis/ExRootConfReader.h"

#include <iomanip>
#include <iostream>
#include <ostream>
#include <string>
#include <vector>
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion converter/src/DelphesEDM4HepConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
30 changes: 15 additions & 15 deletions doc/output_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion examples/edm4hep_output_config.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ module EDM4HepOutput EDM4HepOutput {
add MissingETCollections MissingET
add ScalarHTCollections ScalarHT
set RecoParticleCollectionName ReconstructedParticles
set MCRecoAssociationCollectionName MCRecoAssociations
set RecoMCParticleLinkCollectionName MCRecoAssociations
}

0 comments on commit be455d1

Please sign in to comment.