Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//==========================================================================
// AIDA Detector description implementation
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
//
//==========================================================================
#ifndef DD4HEP_DDDIGI_DIGIEDM4HEPINPUT_H
#define DD4HEP_DDDIGI_DIGIEDM4HEPINPUT_H
// Framework include files
#include <DDDigi/DigiInputAction.h>
#include <DDDigi/DigiData.h>
/// Forward declarations
namespace edm4hep {
class EventHeaderCollection;
class MCParticleCollection;
}
namespace podio {
class CollectionBase;
class Frame;
}
/// Namespace for the AIDA detector description toolkit
namespace dd4hep {
/// Namespace for the Digitization part of the AIDA detector description toolkit
namespace digi {
/// Forward declarations
class DataSegment;
class DataContext;
/// EDM4HEP Digi input reader
/**
*
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_DIGITIZATION
*/
class DigiEdm4hepInput : public DigiInputAction {
public:
static constexpr double epsilon = std::numeric_limits<double>::epsilon();
/// Forward declarations
class internals_t;
class work_t;
class source_t;
class collection_t;
using podio_coll_t = const podio::CollectionBase;
using descriptor_t = std::pair<const Key, collection_t>;
/// Reference to internal data
std::unique_ptr<internals_t> internals;
/// Type of tracker hit container
std::string m_trackerHitType { };
/// Type of calorimenter hit container
std::string m_caloHitType { };
/// Type of particles container
std::string m_particlesType { };
/// Type of event header container
std::string m_evtHeaderType { };
public:
/// Initializing constructor
DigiEdm4hepInput(const DigiKernel& krnl, const std::string& nam);
/// Generic conversion function for hits
template <typename HIT_TYPE, typename EDM4HEP_COLLECTION_TYPE>
void hits_from_edm4hep(DigiContext& context,
DataSegment& segment,
Key::mask_type mask,
const std::string& nam,
const EDM4HEP_COLLECTION_TYPE* collection) const;
/// Generic conversion function for MC particles
void parts_from_edm4hep(DigiContext& context,
DataSegment& segment,
int mask,
const std::string& nam,
const edm4hep::MCParticleCollection* collection) const;
/// Generic conversion function for event parameter settings
void params_from_edm4hep(DigiContext& context,
DataSegment& segment,
int mask,
const std::string& nam,
const podio::Frame& frame,
const edm4hep::EventHeaderCollection* collection) const;
/// Callback to handle single branch
virtual void operator()(DigiContext& context, work_t& work) const;
/// Event action callback
virtual void execute(DigiContext& context) const override;
};
} // End namespace digi
} // End namespace dd4hep
#endif // DD4HEP_DDDIGI_DIGIEDM4HEPINPUT_H