Skip to content

Commit

Permalink
fix metadata of topoclusters (#118)
Browse files Browse the repository at this point in the history
* fix metadata of topoclusters

* also fix tool for FCChh
  • Loading branch information
giovannimarchiori authored Oct 16, 2024
1 parent b571f7c commit 3d639be
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
7 changes: 6 additions & 1 deletion RecCalorimeter/src/components/CaloTopoCluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// k4geo
#include "detectorCommon/DetUtils_k4geo.h"

// datamodel
// EDM4HEP
#include "edm4hep/Cluster.h"
#include "edm4hep/ClusterCollection.h"
#include "edm4hep/CalorimeterHit.h"
Expand Down Expand Up @@ -79,6 +79,11 @@ StatusCode CaloTopoCluster::initialize() {
return StatusCode::FAILURE;
}
}

// initialise the list of metadata for the clusters
std::vector<std::string> shapeParameterNames = {"dR_over_E"};
m_shapeParametersHandle.put(shapeParameterNames);

return StatusCode::SUCCESS;
}

Expand Down
11 changes: 9 additions & 2 deletions RecCalorimeter/src/components/CaloTopoCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#include "Gaudi/Algorithm.h"
#include "GaudiKernel/ToolHandle.h"

// k4FWCore
// Key4HEP
#include "k4FWCore/DataHandle.h"
#include "k4FWCore/MetaDataHandle.h"
#include "k4Interface/ICaloReadCellNoiseMap.h"
#include "k4Interface/ICaloReadNeighboursMap.h"
#include "k4Interface/ICalorimeterTool.h"
Expand All @@ -15,13 +16,14 @@

class IGeoSvc;

// datamodel
// EDM4HEP
namespace edm4hep {
class CalorimeterHit;
class CalorimeterHitCollection;
class ClusterCollection;
}

// DD4HEP
namespace DD4hep {
namespace DDSegmentation {
class Segmentation;
Expand Down Expand Up @@ -97,6 +99,11 @@ class CaloTopoCluster : public Gaudi::Algorithm {
mutable DataHandle<edm4hep::ClusterCollection> m_clusterCollection{"calo/clusters", Gaudi::DataHandle::Writer, this};
// Cluster cells in collection
mutable DataHandle<edm4hep::CalorimeterHitCollection> m_clusterCellsCollection{"calo/clusterCells", Gaudi::DataHandle::Writer, this};
/// Handle for the cluster shape metadata to write
MetaDataHandle<std::vector<std::string>> m_shapeParametersHandle{
m_clusterCollection,
edm4hep::labels::ShapeParameterNames,
Gaudi::DataHandle::Writer};
/// Pointer to the geometry service
SmartIF<IGeoSvc> m_geoSvc;
/// Handle for the input tool
Expand Down
4 changes: 4 additions & 0 deletions RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ StatusCode CaloTopoClusterFCCee::initialize() {
m_decoder_ecal = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder();
m_index_layer_ecal = m_decoder_ecal->index("layer");

// initialise the list of metadata for the clusters
std::vector<std::string> shapeParameterNames = {"dR_over_E"};
m_shapeParametersHandle.put(shapeParameterNames);

return StatusCode::SUCCESS;
}

Expand Down
11 changes: 9 additions & 2 deletions RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#include "Gaudi/Algorithm.h"
#include "GaudiKernel/ToolHandle.h"

// k4FWCore
// Key4HEP
#include "k4FWCore/DataHandle.h"
#include "k4FWCore/MetaDataHandle.h"
#include "k4Interface/ICaloReadCellNoiseMap.h"
#include "k4Interface/ICaloReadNeighboursMap.h"
#include "k4Interface/ICalorimeterTool.h"
Expand All @@ -21,13 +22,14 @@
// k4SimGeant4
class IGeoSvc;

// Datamodel
// EDM4HEP
namespace edm4hep {
class CalorimeterHit;
class CalorimeterHitCollection;
class ClusterCollection;
}

// DD4HEP
namespace DD4hep {
namespace DDSegmentation {
class Segmentation;
Expand Down Expand Up @@ -102,6 +104,11 @@ class CaloTopoClusterFCCee : public Gaudi::Algorithm {
mutable DataHandle<edm4hep::ClusterCollection> m_clusterCollection{"calo/clusters", Gaudi::DataHandle::Writer, this};
// Cluster cells in collection
mutable DataHandle<edm4hep::CalorimeterHitCollection> m_clusterCellsCollection{"calo/clusterCells", Gaudi::DataHandle::Writer, this};
/// Handle for the cluster shape metadata to write
MetaDataHandle<std::vector<std::string>> m_shapeParametersHandle{
m_clusterCollection,
edm4hep::labels::ShapeParameterNames,
Gaudi::DataHandle::Writer};
/// Pointer to the geometry service
SmartIF<IGeoSvc> m_geoSvc;
/// Handle for the input tool
Expand Down

0 comments on commit 3d639be

Please sign in to comment.