Skip to content

Commit

Permalink
Use podio::collMetadataParamName and fix a few headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored and andresailer committed Oct 22, 2024
1 parent 8c287cd commit f157ea0
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions k4Reco/Overlay/components/OverlayTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@
#include "OverlayTiming.h"
#include <GaudiKernel/MsgStream.h>

#include "podio/Frame.h"
#include "podio/FrameCategories.h"

#include "edm4hep/CaloHitContributionCollection.h"
#include "edm4hep/Constants.h"
#include "edm4hep/MutableCaloHitContribution.h"
#include "edm4hep/EventHeaderCollection.h"
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/SimCalorimeterHitCollection.h"
#include "edm4hep/SimTrackerHitCollection.h"

#include "k4FWCore/MetadataUtils.h"

#include <TMath.h>

#include <limits>
#include <random>
#include <utility>
#include <vector>

template <typename T> inline float time_of_flight(const T& pos) {
// Returns the time of flight to the radius in ns
Expand Down Expand Up @@ -387,12 +393,13 @@ StatusCode OverlayTiming::finalize() {
{std::make_pair(inputLocations("SimTrackerHits"), outputLocations("OutputSimTrackerHits")),
std::make_pair(inputLocations("SimCalorimeterHits"), outputLocations("OutputSimCalorimeterHits"))}) {
for (size_t i = 0; i < input.size(); ++i) {
auto name = input[i];
auto value = k4FWCore::getParameter<std::string>(name + "__" + edm4hep::labels::CellIDEncoding, this);
auto value = k4FWCore::getParameter<std::string>(
podio::collMetadataParamName(input[i], edm4hep::labels::CellIDEncoding), this);
if (value.has_value()) {
k4FWCore::putParameter(output[i] + "__" + edm4hep::labels::CellIDEncoding, value.value(), this);
k4FWCore::putParameter(podio::collMetadataParamName(output[i], edm4hep::labels::CellIDEncoding),
value.value(), this);
} else {
warning() << "No metadata found for " << name << " when copying CellID metadata was requested" << endmsg;
warning() << "No metadata found for " << input[i] << " when copying CellID metadata was requested" << endmsg;
}
}
}
Expand Down

0 comments on commit f157ea0

Please sign in to comment.