k4SimGeant4
Loading...
Searching...
No Matches
RewriteBitfield.h
Go to the documentation of this file.
1#ifndef DETCOMPONENTS_REWRITEBITFIELD_H
2#define DETCOMPONENTS_REWRITEBITFIELD_H
3
4// GAUDI
5#include "Gaudi/Algorithm.h"
6#include "GaudiKernel/ToolHandle.h"
7
8// FCCSW
9#include "k4FWCore/DataHandle.h"
10class IGeoSvc;
11
12// DD4hep
13#include "DD4hep/Readout.h"
14namespace dd4hep {
15namespace DDSegmentation {
16class Segmentation;
17}
18}
19
20// datamodel
21namespace edm4hep {
22class CalorimeterHitCollection;
23}
24
39class RewriteBitfield : public Gaudi::Algorithm {
40public:
41 explicit RewriteBitfield(const std::string&, ISvcLocator*);
42 virtual ~RewriteBitfield();
46 virtual StatusCode initialize() final;
50 virtual StatusCode execute(const EventContext&) const final;
54 virtual StatusCode finalize() final;
55
56private:
58 ServiceHandle<IGeoSvc> m_geoSvc;
60 mutable DataHandle<edm4hep::CalorimeterHitCollection> m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader, this};
62 mutable DataHandle<edm4hep::CalorimeterHitCollection> m_outHits{"hits/caloOutHits", Gaudi::DataHandle::Writer, this};
64 Gaudi::Property<std::string> m_oldReadoutName{this, "oldReadoutName", "",
65 "Name of the detector readout used in simulation"};
67 Gaudi::Property<std::string> m_newReadoutName{this, "newReadoutName", "", "Name of the new detector readout"};
69 dd4hep::DDSegmentation::BitFieldCoder* m_oldDecoder;
71 dd4hep::DDSegmentation::BitFieldCoder* m_newDecoder;
73 Gaudi::Property<std::vector<std::string>> m_oldIdentifiers{
74 this, "removeIds", {}, "Segmentation fields that are going to be removed"};
76 std::vector<std::string> m_detectorIdentifiers;
78 Gaudi::Property<uint> m_debugPrint{this, "debugPrint", 10, "Limit of debug printing"};
79};
80#endif /* DETCOMPONENTS_REWRITEBITFIELD_H */
Rewrite the readout bitfield.
Definition RewriteBitfield.h:39
Gaudi::Property< std::vector< std::string > > m_oldIdentifiers
Segmentation fields that are going to be removed from the readout.
Definition RewriteBitfield.h:73
virtual StatusCode execute(const EventContext &) const final
Execute.
Definition RewriteBitfield.cpp:74
DataHandle< edm4hep::CalorimeterHitCollection > m_outHits
Handle for the EDM hits to be written.
Definition RewriteBitfield.h:62
Gaudi::Property< std::string > m_newReadoutName
Name of the new detector readout.
Definition RewriteBitfield.h:67
Gaudi::Property< std::string > m_oldReadoutName
Name of the detector readout used in simulation.
Definition RewriteBitfield.h:64
DataHandle< edm4hep::CalorimeterHitCollection > m_inHits
Handle for the EDM hits to be read.
Definition RewriteBitfield.h:60
virtual ~RewriteBitfield()
Definition RewriteBitfield.cpp:20
virtual StatusCode initialize() final
Initialize.
Definition RewriteBitfield.cpp:22
Gaudi::Property< uint > m_debugPrint
Limit of debug printing.
Definition RewriteBitfield.h:78
std::vector< std::string > m_detectorIdentifiers
Detector fields that are going to be rewritten ( = old field - to be removed)
Definition RewriteBitfield.h:76
dd4hep::DDSegmentation::BitFieldCoder * m_newDecoder
New bitfield decoder.
Definition RewriteBitfield.h:71
RewriteBitfield(const std::string &, ISvcLocator *)
Definition RewriteBitfield.cpp:15
virtual StatusCode finalize() final
Finalize.
Definition RewriteBitfield.cpp:104
dd4hep::DDSegmentation::BitFieldCoder * m_oldDecoder
Old bitfield decoder.
Definition RewriteBitfield.h:69
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition RewriteBitfield.h:58
Definition GeoConstruction.h:10
Definition EventInformation.h:10