Skip to content

Commit

Permalink
Use the new edm4hep::CellIDEncoding (#56)
Browse files Browse the repository at this point in the history
* Use the new edm4hep::CellIDEncoding

* Add a minimum version of EDM4hep

---------

Co-authored-by: jmcarcell <[email protected]>
  • Loading branch information
jmcarcell and jmcarcell authored Nov 7, 2023
1 parent 7f1dd93 commit 11419ae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ find_package(ROOT COMPONENTS RIO Tree)
# Load macros and functions for Gaudi-based projects
find_package(Gaudi)
find_package(k4FWCore)
find_package(EDM4HEP)
find_package(EDM4HEP 0.10.1)
find_package(Geant4)
find_package(DD4hep)
find_package(CLHEP)
Expand Down
8 changes: 3 additions & 5 deletions Detector/DetComponents/src/RedoSegmentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// EDM4hep
#include "edm4hep/CalorimeterHitCollection.h"
#include "edm4hep/SimCalorimeterHitCollection.h"
#include "edm4hep/Constants.h"

/** @class RedoSegmentation Detector/DetComponents/src/RedoSegmentation.h RedoSegmentation.h
*
Expand Down Expand Up @@ -61,15 +62,12 @@ class RedoSegmentation : public GaudiAlgorithm {
/// Handle for the EDM positioned hits to be read
DataHandle<edm4hep::CalorimeterHitCollection> m_inHits{
"hits/caloInHits", Gaudi::DataHandle::Reader, this};
/// Handle for the input hits cell id encoding
MetaDataHandle<std::string> m_inHitsCellIDEncoding{
m_inHits,"CellIDEncodingString", Gaudi::DataHandle::Reader};
/// Handle for the EDM hits to be written
DataHandle<edm4hep::SimCalorimeterHitCollection> m_outHits{
"hits/caloOutHits", Gaudi::DataHandle::Writer, this};
/// Handle for the output hits cell id encoding
/// Handle for the output hits cell id encoding.
MetaDataHandle<std::string> m_outHitsCellIDEncoding{
m_outHits,"CellIDEncodingString", Gaudi::DataHandle::Writer};
m_outHits, edm4hep::CellIDEncoding, Gaudi::DataHandle::Writer};
/// New segmentation
dd4hep::DDSegmentation::Segmentation* m_segmentation;
int m_segmentationType; // use enum instead? defined in some namespace?
Expand Down
3 changes: 2 additions & 1 deletion SimG4Components/src/SimG4SaveCalHits.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

// EDM4hep
#include "edm4hep/SimCalorimeterHitCollection.h"
#include "edm4hep/Constants.h"

/** @class SimG4SaveCalHits SimG4Components/src/SimG4SaveCalHits.h SimG4SaveCalHits.h
*
Expand Down Expand Up @@ -68,7 +69,7 @@ class SimG4SaveCalHits : public GaudiTool, virtual public ISimG4SaveOutputTool {
"CaloHits", Gaudi::DataHandle::Writer, this};
/// Output handle for cell ID encoding string
MetaDataHandle<std::string> m_cellIDEncoding{
m_caloHits, "CellIDEncodingString", Gaudi::DataHandle::Writer};
m_caloHits, edm4hep::CellIDEncoding, Gaudi::DataHandle::Writer};
/// Name of the readouts (hits collections) to save, deprecated
Gaudi::Property<std::vector<std::string>> m_readoutNames{
this, "readoutNames", {}, "[Deprecated] Names of the readouts (hits collections) to save"};
Expand Down
3 changes: 2 additions & 1 deletion SimG4Components/src/SimG4SaveTrackerHits.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

// EDM4hep
#include "edm4hep/SimTrackerHitCollection.h"
#include "edm4hep/Constants.h"

/** @class SimG4SaveTrackerHits SimG4Components/src/SimG4SaveTrackerHits.h SimG4SaveTrackerHits.h
*
Expand Down Expand Up @@ -69,7 +70,7 @@ class SimG4SaveTrackerHits : public GaudiTool, virtual public ISimG4SaveOutputTo
"TrackerHits", Gaudi::DataHandle::Writer, this};
/// Output handle for cell ID encoding string
MetaDataHandle<std::string> m_cellIDEncoding {
m_trackHits, "CellIDEncodingString", Gaudi::DataHandle::Writer};
m_trackHits, edm4hep::CellIDEncoding, Gaudi::DataHandle::Writer};
/// Names of the readouts (hits collections) to save, deprecated
Gaudi::Property<std::vector<std::string>> m_readoutNames {
this, "readoutNames", {}, "[Deprecated] Name of the readouts (hits collections) to save"};
Expand Down

0 comments on commit 11419ae

Please sign in to comment.