File indexing completed on 2025-01-18 09:14:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DIGI_DIGIEDM4HEPOUTPUT_H
0014 #define DIGI_DIGIEDM4HEPOUTPUT_H
0015
0016
0017 #include <DDDigi/DigiOutputAction.h>
0018
0019
0020 #if __has_include("edm4hep/TrackerHitCollection.h")
0021 #include <edm4hep/TrackerHitCollection.h>
0022 namespace edm4hep {
0023 using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
0024 }
0025 #else
0026 #include <edm4hep/TrackerHit3DCollection.h>
0027 #endif
0028
0029
0030 namespace edm4hep {
0031 class CalorimeterHitCollection;
0032 }
0033
0034
0035 namespace dd4hep {
0036
0037
0038 namespace digi {
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 class DigiEdm4hepOutput : public DigiOutputAction {
0055 public:
0056 class internals_t;
0057 protected:
0058
0059 std::shared_ptr<internals_t> internals;
0060
0061 protected:
0062
0063 DDDIGI_DEFINE_ACTION_CONSTRUCTORS(DigiEdm4hepOutput);
0064
0065 virtual ~DigiEdm4hepOutput();
0066
0067 public:
0068
0069 DigiEdm4hepOutput(const kernel_t& kernel, const std::string& nam);
0070
0071 virtual void initialize();
0072
0073 virtual bool have_output() const override final;
0074
0075 virtual void open_output() const override final;
0076
0077 virtual void close_output() const override final;
0078
0079 virtual void commit_output() const override final;
0080 };
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091 class DigiEdm4hepOutputProcessor : public DigiContainerProcessor {
0092 friend class DigiEdm4hepOutput;
0093
0094 protected:
0095
0096 std::shared_ptr<DigiEdm4hepOutput::internals_t> internals;
0097
0098 float m_pointResoutionRPhi = 0.004;
0099
0100 float m_pointResoutionZ = 0.004;
0101
0102 int m_hit_type = 0;
0103
0104 public:
0105
0106 DigiEdm4hepOutputProcessor(const DigiKernel& krnl, const std::string& nam);
0107
0108
0109 virtual ~DigiEdm4hepOutputProcessor() = default;
0110
0111
0112 template <typename T> void
0113 convert_depos(const T& cont, const predicate_t& predicate, edm4hep::TrackerHit3DCollection* collection) const;
0114
0115
0116 template <typename T> void
0117 convert_depos(const T& cont, const predicate_t& predicate, edm4hep::CalorimeterHitCollection* collection) const;
0118
0119
0120 template <typename T> void
0121 convert_deposits(DigiContext& context, const T& cont, const predicate_t& predicate) const;
0122
0123
0124 void convert_history(DigiContext& context, const DepositsHistory& cont, work_t& work, const predicate_t& predicate) const;
0125
0126
0127 void convert_particles(DigiContext& context, const ParticleMapping& cont) const;
0128
0129
0130 virtual void execute(DigiContext& context, work_t& work, const predicate_t& predicate) const override final;
0131 };
0132 }
0133 }
0134 #endif