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/Constants.h"
19#include "edm4hep/SimCalorimeterHitCollection.h"
20
35
36class RedoSegmentation : public Gaudi::Algorithm {
37public:
38 explicit RedoSegmentation(const std::string&, ISvcLocator*);
39 virtual ~RedoSegmentation();
43 virtual StatusCode initialize() final;
47 virtual StatusCode execute(const EventContext&) const final;
51 virtual StatusCode finalize() final;
52
53private:
58 uint64_t volumeID(uint64_t aCellId) const;
60 ServiceHandle<IGeoSvc> m_geoSvc;
62 mutable k4FWCore::DataHandle<edm4hep::CalorimeterHitCollection> m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader,
63 this};
64
65 mutable k4FWCore::DataHandle<edm4hep::SimCalorimeterHitCollection> m_outHits{"hits/caloOutHits",
66 Gaudi::DataHandle::Writer, this};
67
68 dd4hep::DDSegmentation::Segmentation* m_segmentation;
69 int m_segmentationType; // use enum instead? defined in some namespace?
71 Gaudi::Property<std::string> m_oldReadoutName{this, "oldReadoutName", "",
72 "Name of the detector readout used in simulation"};
73
74 dd4hep::DDSegmentation::Segmentation* m_oldSegmentation;
75 int m_oldSegmentationType; // use enum instead? defined in some namespace?
77 Gaudi::Property<std::string> m_newReadoutName{this, "newReadoutName", "", "Name of the new detector readout"};
79 dd4hep::DDSegmentation::BitFieldCoder* m_oldDecoder;
81 Gaudi::Property<std::vector<std::string>> m_oldIdentifiers{
82 this, "oldSegmentationIds", {}, "Segmentation fields that are going to be replaced by the new segmentation"};
83
84 std::vector<std::string> m_detectorIdentifiers;
86 Gaudi::Property<uint> m_debugPrint{this, "debugPrint", 10, "Limit of debug printing"};
87};
88#endif /* DETCOMPONENTS_REDOSEGMENTATION_H */
dd4hep::DDSegmentation::Segmentation * m_segmentation
New segmentation.
Definition RedoSegmentation.h:68
virtual StatusCode initialize() final
Initialize.
Definition RedoSegmentation.cpp:25
k4FWCore::DataHandle< edm4hep::CalorimeterHitCollection > m_inHits
Handle for the EDM positioned hits to be read.
Definition RedoSegmentation.h:62
Gaudi::Property< uint > m_debugPrint
Limit of debug printing.
Definition RedoSegmentation.h:86
virtual StatusCode finalize() final
Finalize.
Definition RedoSegmentation.cpp:151
uint64_t volumeID(uint64_t aCellId) const
Get ID of the volume that contains the cell.
Definition RedoSegmentation.cpp:156
virtual ~RedoSegmentation()
Definition RedoSegmentation.cpp:23
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition RedoSegmentation.h:60
int m_segmentationType
Definition RedoSegmentation.h:69
Gaudi::Property< std::vector< std::string > > m_oldIdentifiers
Segmentation fields that are going to be replaced by the new segmentation.
Definition RedoSegmentation.h:81
Gaudi::Property< std::string > m_newReadoutName
Name of the new detector readout.
Definition RedoSegmentation.h:77
Gaudi::Property< std::string > m_oldReadoutName
Name of the detector readout used in simulation.
Definition RedoSegmentation.h:71
dd4hep::DDSegmentation::BitFieldCoder * m_oldDecoder
Old bitfield decoder.
Definition RedoSegmentation.h:79
RedoSegmentation(const std::string &, ISvcLocator *)
Definition RedoSegmentation.cpp:17
k4FWCore::DataHandle< edm4hep::SimCalorimeterHitCollection > m_outHits
Handle for the EDM hits to be written.
Definition RedoSegmentation.h:65
int m_oldSegmentationType
Definition RedoSegmentation.h:75
virtual StatusCode execute(const EventContext &) const final
Execute.
Definition RedoSegmentation.cpp:94
std::vector< std::string > m_detectorIdentifiers
Detector fields that are going to be rewritten.
Definition RedoSegmentation.h:84
dd4hep::DDSegmentation::Segmentation * m_oldSegmentation
Old segmentation.
Definition RedoSegmentation.h:74