1#ifndef DETCOMPONENTS_REDOSEGMENTATION_H
2#define DETCOMPONENTS_REDOSEGMENTATION_H
5#include "Gaudi/Algorithm.h"
6#include "GaudiKernel/ToolHandle.h"
9#include "k4FWCore/DataHandle.h"
10#include "k4FWCore/MetaDataHandle.h"
11#include "k4Interface/IGeoSvc.h"
14#include "DD4hep/Readout.h"
15#include "DD4hep/Segmentations.h"
18#include "edm4hep/CalorimeterHitCollection.h"
19#include "edm4hep/SimCalorimeterHitCollection.h"
20#include "edm4hep/Constants.h"
48 virtual StatusCode
execute(
const EventContext&)
const final;
59 uint64_t
volumeID(uint64_t aCellId)
const;
63 mutable DataHandle<edm4hep::CalorimeterHitCollection>
m_inHits{
64 "hits/caloInHits", Gaudi::DataHandle::Reader,
this};
66 mutable DataHandle<edm4hep::SimCalorimeterHitCollection>
m_outHits{
67 "hits/caloOutHits", Gaudi::DataHandle::Writer,
this};
70 m_outHits, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Writer};
76 "Name of the detector readout used in simulation"};
81 Gaudi::Property<std::string>
m_newReadoutName{
this,
"newReadoutName",
"",
"Name of the new detector readout"};
86 this,
"oldSegmentationIds", {},
"Segmentation fields that are going to be replaced by the new segmentation"};
90 Gaudi::Property<uint>
m_debugPrint{
this,
"debugPrint", 10,
"Limit of debug printing"};
Redo the segmentation after the simulation has ended.
Definition RedoSegmentation.h:37
dd4hep::DDSegmentation::Segmentation * m_segmentation
New segmentation.
Definition RedoSegmentation.h:72
virtual StatusCode initialize() final
Initialize.
Definition RedoSegmentation.cpp:15
Gaudi::Property< uint > m_debugPrint
Limit of debug printing.
Definition RedoSegmentation.h:90
virtual StatusCode finalize() final
Finalize.
Definition RedoSegmentation.cpp:141
uint64_t volumeID(uint64_t aCellId) const
Get ID of the volume that contains the cell.
Definition RedoSegmentation.cpp:145
virtual ~RedoSegmentation()
Definition RedoSegmentation.cpp:13
DataHandle< edm4hep::CalorimeterHitCollection > m_inHits
Handle for the EDM positioned hits to be read.
Definition RedoSegmentation.h:63
MetaDataHandle< std::string > m_outHitsCellIDEncoding
Handle for the output hits cell id encoding.
Definition RedoSegmentation.h:69
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition RedoSegmentation.h:61
int m_segmentationType
Definition RedoSegmentation.h:73
Gaudi::Property< std::vector< std::string > > m_oldIdentifiers
Segmentation fields that are going to be replaced by the new segmentation.
Definition RedoSegmentation.h:85
Gaudi::Property< std::string > m_newReadoutName
Name of the new detector readout.
Definition RedoSegmentation.h:81
Gaudi::Property< std::string > m_oldReadoutName
Name of the detector readout used in simulation.
Definition RedoSegmentation.h:75
dd4hep::DDSegmentation::BitFieldCoder * m_oldDecoder
Old bitfield decoder.
Definition RedoSegmentation.h:83
RedoSegmentation(const std::string &, ISvcLocator *)
Definition RedoSegmentation.cpp:8
int m_oldSegmentationType
Definition RedoSegmentation.h:79
virtual StatusCode execute(const EventContext &) const final
Execute.
Definition RedoSegmentation.cpp:82
std::vector< std::string > m_detectorIdentifiers
Detector fields that are going to be rewritten.
Definition RedoSegmentation.h:88
dd4hep::DDSegmentation::Segmentation * m_oldSegmentation
Old segmentation.
Definition RedoSegmentation.h:78
DataHandle< edm4hep::SimCalorimeterHitCollection > m_outHits
Handle for the EDM hits to be written.
Definition RedoSegmentation.h:66