Skip to content

Commit

Permalink
Use the new edm4hep::CellIDEncoding (#55)
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 a0d919e commit 36e5e00
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package(ROOT COMPONENTS RIO Tree)
find_package(Gaudi)
find_package(k4FWCore) # implicit: Gaudi
find_package(EDM4HEP) # implicit: Podio
find_package(EDM4HEP 0.10.1) # implicit: Podio
find_package(DD4hep)
find_package(FCCDetectors)
#---------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions RecCalorimeter/src/components/CreateCaloCells.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// EDM4HEP
#include "edm4hep/CalorimeterHitCollection.h"
#include "edm4hep/SimCalorimeterHitCollection.h"
#include "edm4hep/Constants.h"

// DD4hep
#include "DD4hep/Detector.h"
Expand Down Expand Up @@ -77,10 +78,10 @@ class CreateCaloCells : public GaudiAlgorithm {
/// Handle for calo hits (input collection)
DataHandle<edm4hep::SimCalorimeterHitCollection> m_hits{"hits", Gaudi::DataHandle::Reader, this};
/// Handle for the cellID encoding string of the input collection
MetaDataHandle<std::string> m_hitsCellIDEncoding{m_hits, "CellIDEncodingString", Gaudi::DataHandle::Reader};
MetaDataHandle<std::string> m_hitsCellIDEncoding{m_hits, edm4hep::CellIDEncoding, Gaudi::DataHandle::Reader};
/// Handle for calo cells (output collection)
DataHandle<edm4hep::CalorimeterHitCollection> m_cells{"cells", Gaudi::DataHandle::Writer, this};
MetaDataHandle<std::string> m_cellsCellIDEncoding{m_cells, "CellIDEncodingString", Gaudi::DataHandle::Writer};
MetaDataHandle<std::string> m_cellsCellIDEncoding{m_cells, edm4hep::CellIDEncoding, Gaudi::DataHandle::Writer};
/// Name of the detector readout
Gaudi::Property<std::string> m_readoutName{this, "readoutName", "ECalBarrelPhiEta", "Name of the detector readout"};
/// Name of active volumes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "edm4hep/CalorimeterHit.h"
#include "edm4hep/CalorimeterHitCollection.h"
#include "edm4hep/Constants.h"

#include <unordered_map>

Expand Down Expand Up @@ -50,11 +51,11 @@ class CreateCaloCellPositionsFCCee : public GaudiAlgorithm {
/// Input collection
DataHandle<edm4hep::CalorimeterHitCollection> m_hits{"hits/hits", Gaudi::DataHandle::Reader, this};
/// Input collection metadata handle
MetaDataHandle<std::string> m_hitsCellIDEncoding{m_hits, "CellIDEncodingString", Gaudi::DataHandle::Reader};
MetaDataHandle<std::string> m_hitsCellIDEncoding{m_hits, edm4hep::CellIDEncoding, Gaudi::DataHandle::Reader};
/// Output collection
DataHandle<edm4hep::CalorimeterHitCollection> m_positionedHits{"hits/positionedHits", Gaudi::DataHandle::Writer, this};
/// Output collection metadata handle
MetaDataHandle<std::string> m_positionedHitsCellIDEncoding{m_positionedHits, "CellIDEncodingString", Gaudi::DataHandle::Writer};
MetaDataHandle<std::string> m_positionedHitsCellIDEncoding{m_positionedHits, edm4hep::CellIDEncoding, Gaudi::DataHandle::Writer};

// Cache
std::unordered_map<dd4hep::DDSegmentation::CellID, edm4hep::Vector3f> m_positions_cache{};
Expand Down

0 comments on commit 36e5e00

Please sign in to comment.