File indexing completed on 2025-01-18 09:14:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DD4HEP_DDDIGI_DIGIEDM4HEPINPUT_H
0014 #define DD4HEP_DDDIGI_DIGIEDM4HEPINPUT_H
0015
0016
0017 #include <DDDigi/DigiInputAction.h>
0018 #include <DDDigi/DigiData.h>
0019
0020
0021 namespace edm4hep {
0022 class EventHeaderCollection;
0023 class MCParticleCollection;
0024 }
0025 namespace podio {
0026 class CollectionBase;
0027 class Frame;
0028 }
0029
0030
0031 namespace dd4hep {
0032
0033
0034 namespace digi {
0035
0036
0037 class DataSegment;
0038 class DataContext;
0039
0040
0041
0042
0043
0044
0045
0046
0047 class DigiEdm4hepInput : public DigiInputAction {
0048 public:
0049 static constexpr double epsilon = std::numeric_limits<double>::epsilon();
0050
0051
0052 class internals_t;
0053 class work_t;
0054 class source_t;
0055 class collection_t;
0056 using podio_coll_t = const podio::CollectionBase;
0057 using descriptor_t = std::pair<const Key, collection_t>;
0058
0059
0060 std::unique_ptr<internals_t> internals;
0061
0062 std::string m_trackerHitType { };
0063
0064 std::string m_caloHitType { };
0065
0066 std::string m_particlesType { };
0067
0068 std::string m_evtHeaderType { };
0069
0070 public:
0071
0072 DigiEdm4hepInput(const DigiKernel& krnl, const std::string& nam);
0073
0074
0075 template <typename HIT_TYPE, typename EDM4HEP_COLLECTION_TYPE>
0076 void hits_from_edm4hep(DigiContext& context,
0077 DataSegment& segment,
0078 Key::mask_type mask,
0079 const std::string& nam,
0080 const EDM4HEP_COLLECTION_TYPE* collection) const;
0081
0082
0083 void parts_from_edm4hep(DigiContext& context,
0084 DataSegment& segment,
0085 int mask,
0086 const std::string& nam,
0087 const edm4hep::MCParticleCollection* collection) const;
0088
0089
0090 void params_from_edm4hep(DigiContext& context,
0091 DataSegment& segment,
0092 int mask,
0093 const std::string& nam,
0094 const podio::Frame& frame,
0095 const edm4hep::EventHeaderCollection* collection) const;
0096
0097
0098 virtual void operator()(DigiContext& context, work_t& work) const;
0099
0100
0101 virtual void execute(DigiContext& context) const override;
0102 };
0103 }
0104 }
0105 #endif