k4SimGeant4
Loading...
Searching...
No Matches
RedoSegmentation.h
Go to the documentation of this file.
1#ifndef DETCOMPONENTS_REDOSEGMENTATION_H
2#define DETCOMPONENTS_REDOSEGMENTATION_H
3
4// GAUDI
5#include "Gaudi/Algorithm.h"
6#include "GaudiKernel/ToolHandle.h"
7
8// k4FWCore
9#include "k4FWCore/DataHandle.h"
10#include "k4Interface/IGeoSvc.h"
11
12// DD4hep
13#include "DD4hep/Readout.h"
14#include "DD4hep/Segmentations.h"
15
16// EDM4hep
17#include "edm4hep/CalorimeterHitCollection.h"
18#include "edm4hep/SimCalorimeterHitCollection.h"
19
34
35class RedoSegmentation : public Gaudi::Algorithm {
36public:
37 explicit RedoSegmentation(const std::string&, ISvcLocator*);
38 virtual ~RedoSegmentation();
42 virtual StatusCode initialize() final;
46 virtual StatusCode execute(const EventContext&) const final;
50 virtual StatusCode finalize() final;
51
52private:
57 uint64_t volumeID(uint64_t aCellId) const;
59 ServiceHandle<IGeoSvc> m_geoSvc;
61 mutable k4FWCore::DataHandle<edm4hep::CalorimeterHitCollection> m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader,
62 this};
63
64 mutable k4FWCore::DataHandle<edm4hep::SimCalorimeterHitCollection> m_outHits{"hits/caloOutHits",
65 Gaudi::DataHandle::Writer, this};
66
67 dd4hep::DDSegmentation::Segmentation* m_segmentation;
68 int m_segmentationType; // use enum instead? defined in some namespace?
70 Gaudi::Property<std::string> m_oldReadoutName{this, "oldReadoutName", "",
71 "Name of the detector readout used in simulation"};
72
73 dd4hep::DDSegmentation::Segmentation* m_oldSegmentation;
74 int m_oldSegmentationType; // use enum instead? defined in some namespace?
76 Gaudi::Property<std::string> m_newReadoutName{this, "newReadoutName", "", "Name of the new detector readout"};
78 dd4hep::DDSegmentation::BitFieldCoder* m_oldDecoder;
80 Gaudi::Property<std::vector<std::string>> m_oldIdentifiers{
81 this, "oldSegmentationIds", {}, "Segmentation fields that are going to be replaced by the new segmentation"};
82
83 std::vector<std::string> m_detectorIdentifiers;
85 Gaudi::Property<uint> m_debugPrint{this, "debugPrint", 10, "Limit of debug printing"};
86};
87#endif /* DETCOMPONENTS_REDOSEGMENTATION_H */
dd4hep::DDSegmentation::Segmentation * m_segmentation
New segmentation.
Definition RedoSegmentation.h:67
virtual StatusCode initialize() final
Initialize.
Definition RedoSegmentation.cpp:19
k4FWCore::DataHandle< edm4hep::CalorimeterHitCollection > m_inHits
Handle for the EDM positioned hits to be read.
Definition RedoSegmentation.h:61
Gaudi::Property< uint > m_debugPrint
Limit of debug printing.
Definition RedoSegmentation.h:85
virtual StatusCode finalize() final
Finalize.
Definition RedoSegmentation.cpp:144
uint64_t volumeID(uint64_t aCellId) const
Get ID of the volume that contains the cell.
Definition RedoSegmentation.cpp:149
virtual ~RedoSegmentation()
Definition RedoSegmentation.cpp:17
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition RedoSegmentation.h:59
int m_segmentationType
Definition RedoSegmentation.h:68
Gaudi::Property< std::vector< std::string > > m_oldIdentifiers
Segmentation fields that are going to be replaced by the new segmentation.
Definition RedoSegmentation.h:80
Gaudi::Property< std::string > m_newReadoutName
Name of the new detector readout.
Definition RedoSegmentation.h:76
Gaudi::Property< std::string > m_oldReadoutName
Name of the detector readout used in simulation.
Definition RedoSegmentation.h:70
dd4hep::DDSegmentation::BitFieldCoder * m_oldDecoder
Old bitfield decoder.
Definition RedoSegmentation.h:78
RedoSegmentation(const std::string &, ISvcLocator *)
Definition RedoSegmentation.cpp:11
k4FWCore::DataHandle< edm4hep::SimCalorimeterHitCollection > m_outHits
Handle for the EDM hits to be written.
Definition RedoSegmentation.h:64
int m_oldSegmentationType
Definition RedoSegmentation.h:74
virtual StatusCode execute(const EventContext &) const final
Execute.
Definition RedoSegmentation.cpp:87
std::vector< std::string > m_detectorIdentifiers
Detector fields that are going to be rewritten.
Definition RedoSegmentation.h:83
dd4hep::DDSegmentation::Segmentation * m_oldSegmentation
Old segmentation.
Definition RedoSegmentation.h:73