Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1574bd3

Browse files
authoredFeb 12, 2024
Merge branch 'master' into master
2 parents 49a4f6e + 7e91000 commit 1574bd3

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed
 

‎DDDigi/io/DigiEdm4hepOutput.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <podio/Frame.h>
3030
#include <edm4hep/SimTrackerHit.h>
3131
#include <edm4hep/MCParticleCollection.h>
32-
#include <edm4hep/TrackerHitCollection.h>
3332
#include <edm4hep/EventHeaderCollection.h>
3433
#include <edm4hep/CalorimeterHitCollection.h>
3534
#include <edm4hep/CaloHitContributionCollection.h>
@@ -64,7 +63,7 @@ namespace dd4hep {
6463
/// MC particle collection
6564
particlecollection_t m_particles { };
6665
/// Collection of all edm4hep tracker object collections
67-
std::map<std::string, std::unique_ptr<edm4hep::TrackerHitCollection> > m_tracker_collections;
66+
std::map<std::string, std::unique_ptr<edm4hep::TrackerHit3DCollection> > m_tracker_collections;
6867
/// Collection of all edm4hep calorimeter object collections
6968
std::map<std::string, std::unique_ptr<edm4hep::CalorimeterHitCollection> > m_calo_collections;
7069
/// Output section name
@@ -122,7 +121,7 @@ namespace dd4hep {
122121
m_particles = std::make_pair(nam, std::make_unique<edm4hep::MCParticleCollection>());
123122
}
124123
else if ( typ == "TrackerHits" ) {
125-
m_tracker_collections.emplace(nam, std::make_unique<edm4hep::TrackerHitCollection>());
124+
m_tracker_collections.emplace(nam, std::make_unique<edm4hep::TrackerHit3DCollection>());
126125
}
127126
else if ( typ == "CalorimeterHits" ) {
128127
m_calo_collections.emplace(nam, std::make_unique<edm4hep::CalorimeterHitCollection>());
@@ -286,7 +285,7 @@ namespace dd4hep {
286285
template <typename T> void
287286
DigiEdm4hepOutputProcessor::convert_depos(const T& cont,
288287
const predicate_t& predicate,
289-
edm4hep::TrackerHitCollection* collection) const
288+
edm4hep::TrackerHit3DCollection* collection) const
290289
{
291290
std::array<float,6> covMat = {0., 0., m_pointResoutionRPhi*m_pointResoutionRPhi,
292291
0., 0., m_pointResoutionZ*m_pointResoutionZ
@@ -320,7 +319,7 @@ namespace dd4hep {
320319
if ( !cont.empty() ) {
321320
switch(cont.data_type) {
322321
case SegmentEntry::TRACKER_HITS:
323-
convert_depos(cont, predicate, static_cast<edm4hep::TrackerHitCollection*>(coll));
322+
convert_depos(cont, predicate, static_cast<edm4hep::TrackerHit3DCollection*>(coll));
324323
break;
325324
case SegmentEntry::CALORIMETER_HITS:
326325
convert_depos(cont, predicate, static_cast<edm4hep::CalorimeterHitCollection*>(coll));

‎DDDigi/io/DigiEdm4hepOutput.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@
1717
#include <DDDigi/DigiOutputAction.h>
1818

1919
/// C/C++ include files
20+
#if __has_include("edm4hep/TrackerHitCollection.h")
21+
#include <edm4hep/TrackerHitCollection.h>
22+
namespace edm4hep {
23+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
24+
}
25+
#else
26+
#include <edm4hep/TrackerHit3DCollection.h>
27+
#endif
2028

2129
/// Forward declarations from edm4hep
2230
namespace edm4hep {
23-
class TrackerHitCollection;
2431
class CalorimeterHitCollection;
2532
}
2633

@@ -35,7 +42,7 @@ namespace dd4hep {
3542
* Supported output containers types are:
3643
* - edm4hep::MCParticles aka "MCParticles"
3744
* - edm4hep::CalorimeterHitCollection aka "CalorimeterHits"
38-
* - edm4hep::TrackerHitCollection aka "TracketHits"
45+
* - edm4hep::TrackerHit3DCollection aka "TracketHits"
3946
*
4047
* This entity actually is only the work dispatcher:
4148
* It opens files and dumps data into
@@ -103,7 +110,7 @@ namespace dd4hep {
103110

104111
/// Convert tracker hits to edm4hep
105112
template <typename T> void
106-
convert_depos(const T& cont, const predicate_t& predicate, edm4hep::TrackerHitCollection* collection) const;
113+
convert_depos(const T& cont, const predicate_t& predicate, edm4hep::TrackerHit3DCollection* collection) const;
107114

108115
/// Convert calorimeter hits to edm4hep
109116
template <typename T> void

‎DDDigi/io/DigiIO.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
#include <edm4hep/SimTrackerHit.h>
2929
#include <edm4hep/MCParticle.h>
3030
#include <edm4hep/MCParticleCollection.h>
31+
#if __has_include("edm4hep/TrackerHitCollection.h")
3132
#include <edm4hep/TrackerHitCollection.h>
33+
namespace edm4hep {
34+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
35+
}
36+
#else
37+
#include <edm4hep/TrackerHit3DCollection.h>
38+
#endif
3239
#include <edm4hep/SimTrackerHitCollection.h>
3340
#include <edm4hep/CalorimeterHitCollection.h>
3441
#include <edm4hep/SimCalorimeterHitCollection.h>
@@ -224,7 +231,7 @@ namespace dd4hep {
224231
template <> template <>
225232
void data_io<edm4hep_input>::_to_edm4hep(const std::pair<const CellID, EnergyDeposit>& dep,
226233
const std::array<float, 6>& covMat,
227-
edm4hep::TrackerHitCollection& collection,
234+
edm4hep::TrackerHit3DCollection& collection,
228235
int hit_type)
229236

230237
{

0 commit comments

Comments
 (0)
Please sign in to comment.