Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the new edm4hep::CellIDEncoding #55

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading