Skip to content

Commit

Permalink
put compat include in separate header
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Nov 29, 2024
1 parent d9157ba commit d69324a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
13 changes: 1 addition & 12 deletions Examples/Io/EDM4hep/src/EDM4hepMeasurementReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ActsExamples/Io/EDM4hep/EDM4hepMeasurementReader.hpp"

#include "Acts/Definitions/Units.hpp"
#include "Acts/Plugins/EDM4hep/TrackerHitCompatibility.hpp"
#include "Acts/Plugins/Podio/PodioUtil.hpp"
#include "ActsExamples/EventData/Cluster.hpp"
#include "ActsExamples/EventData/Measurement.hpp"
Expand All @@ -18,18 +19,6 @@
#include <list>
#include <stdexcept>

#if __has_include(<edm4hep/TrackerHit3D.h>)
#include "edm4hep/TrackerHit3D.h"
#include "edm4hep/TrackerHit3DCollection.h"
#else
#include "edm4hep/TrackerHit.h"
#include "edm4hep/TrackerHitCollection.h"
namespace edm4hep {
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
using TrackerHit3D = edm4hep::TrackerHit;
} // namespace edm4hep
#endif

#include <edm4hep/TrackerHitPlane.h>
#include <edm4hep/TrackerHitPlaneCollection.h>

Expand Down
14 changes: 3 additions & 11 deletions Examples/Io/EDM4hep/src/EDM4hepMeasurementWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,17 @@
#include "ActsExamples/Io/EDM4hep/EDM4hepMeasurementWriter.hpp"

#include "Acts/Definitions/Units.hpp"
#include "Acts/Plugins/EDM4hep/TrackerHitCompatibility.hpp"
#include "ActsExamples/EventData/Cluster.hpp"
#include "ActsExamples/EventData/Measurement.hpp"
#include "ActsExamples/Framework/WhiteBoard.hpp"
#include "ActsExamples/Io/EDM4hep/EDM4hepUtil.hpp"

#include <stdexcept>

#include <podio/Frame.h>

// Compatibility with EDM4hep < 0.99 and >= 0.99
#if __has_include(<edm4hep/TrackerHit3DCollection.h>)
#include <edm4hep/TrackerHit3DCollection.h>
#else
#include <edm4hep/TrackerHitCollection.h>
namespace edm4hep {
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
}
#endif
#include <edm4hep/TrackerHitPlane.h>
#include <edm4hep/TrackerHitPlaneCollection.h>
#include <podio/Frame.h>

namespace ActsExamples {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// This file is part of the ACTS project.
//
// Copyright (C) 2016 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#pragma once

// Compatibility with EDM4hep < 0.99 and >= 0.99
#if __has_include(<edm4hep/TrackerHit3D.h>)
#include "edm4hep/TrackerHit3D.h"
#include "edm4hep/TrackerHit3DCollection.h"
#else
#include "edm4hep/TrackerHit.h"
#include "edm4hep/TrackerHitCollection.h"
namespace edm4hep {
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
using TrackerHit3D = edm4hep::TrackerHit;
} // namespace edm4hep
#endif

0 comments on commit d69324a

Please sign in to comment.