All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IDecoder.h
Go to the documentation of this file.
1 /**
2  * @file IDecoder.h
3  *
4  * @brief This provides an art tool interface definition for tools which "decode" artdaq
5  * fragments into LArSoft data objects
6  *
7  * @author usher@slac.stanford.edu
8  *
9  */
10 #ifndef IDecoder_h
11 #define IDecoder_h
12 
13 // Framework Includes
14 #include "fhiclcpp/ParameterSet.h"
15 #include "art/Framework/Principal/Event.h"
16 
17 // Algorithm includes
18 #include "artdaq-core/Data/Fragment.hh"
19 
20 //------------------------------------------------------------------------------------------------------------------------------------------
21 
22 namespace art
23 {
24  class ProducesCollector;
25  class ConsumesCollector;
26  class Run;
27 }
28 
29 namespace daq
30 {
31 /**
32  * @brief IDecoder interface class definiton
33  */
34 class IDecoder
35 {
36 public:
37  /**
38  * @brief Virtual Destructor
39  */
40  virtual ~IDecoder() noexcept = default;
41 
42  /**
43  * @brief Declare to the framework what you expect to read.
44  */
45  virtual void consumes(art::ConsumesCollector&) {}
46 
47  /**
48  * @brief The space point building should output the hit collection
49  * for those hits which combine to form space points - a nice noise filter!
50  */
51  virtual void produces(art::ProducesCollector&) = 0;
52 
53  /**
54  * @brief Interface for configuring the particular algorithm tool
55  *
56  * @param ParameterSet The input set of parameters for configuration
57  */
58  virtual void configure(const fhicl::ParameterSet&) = 0;
59 
60  /**
61  * @brief Preparation to process a new run.
62  *
63  * To be called on every _art_ run transition.
64  */
65  virtual void setupRun(art::Run const& run) {}
66 
67  /**
68  * @brief Preparation to process a new event.
69  *
70  * To be called on every _art_ event transition.
71  */
72  virtual void setupEvent(art::Event const& event) {}
73 
74  /**
75  * @brief Initialize any data products the tool will output
76  *
77  */
78  virtual void initializeDataProducts() = 0;
79 
80  /**
81  * @brief Given a set of recob hits, run DBscan to form 3D clusters
82  *
83  * @param fragment The artdaq fragment to process
84  */
85  virtual void process_fragment(const artdaq::Fragment& fragment) = 0;
86 
87  /**
88  * @brief Output the data products to the event store
89  *
90  * @param event The event store objects
91  */
92  virtual void outputDataProducts(art::Event& event) = 0;
93 };
94 
95 } // namespace lar_cluster3d
96 #endif
IDecoder interface class definiton.
Definition: IDecoder.h:34
virtual void consumes(art::ConsumesCollector &)
Declare to the framework what you expect to read.
Definition: IDecoder.h:45
virtual ~IDecoder() noexcept=default
Virtual Destructor.
virtual void setupEvent(art::Event const &event)
Preparation to process a new event.
Definition: IDecoder.h:72
virtual void initializeDataProducts()=0
Initialize any data products the tool will output.
virtual void process_fragment(const artdaq::Fragment &fragment)=0
Given a set of recob hits, run DBscan to form 3D clusters.
virtual void configure(const fhicl::ParameterSet &)=0
Interface for configuring the particular algorithm tool.
virtual void setupRun(art::Run const &run)
Preparation to process a new run.
Definition: IDecoder.h:65
virtual void produces(art::ProducesCollector &)=0
The space point building should output the hit collection for those hits which combine to form space ...
virtual void outputDataProducts(art::Event &event)=0
Output the data products to the event store.