Jpp  19.1.0-rc.1
the software that should make you happy
JBuild.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JBUILD__
2 #define __JTRIGGER__JBUILD__
3 
6 #include "JDetector/JModule.hh"
10 #include "JTrigger/JMatch.hh"
11 
12 
13 /**
14  * \author mdejong
15  */
16 
17 namespace JTRIGGER {}
18 namespace JPP { using namespace JTRIGGER; }
19 
20 namespace JTRIGGER {
21 
23  using JDETECTOR::JModule;
24 
25 
26  /**
27  * Auxiliary base class for hit building.
28  *
29  * This class provides for
30  * - a configurable selection of DAQ hits; and
31  * - a configurable method to pre-process consecutive hits.
32  *
33  * The underlying action is subsequently transferred to JSuperFrame2D.
34  */
35  template<class JHit_t>
36  struct JBuild {
37 
38  typedef JHit_t value_type;
41 
42  /**
43  * Default constructor.
44  *
45  * The default corresponds to no pre-processing of hits.
46  */
47  JBuild() :
48  option(JPreprocessor::none_t),
50  {}
51 
52 
53  /**
54  * Set pre-processor of consecutive hits.
55  *
56  * \param option option
57  * \param match match criterion
58  */
60  {
61  this->option = option;
62  this->match.reset(match.clone());
63  }
64 
65 
66  /**
67  * Reset pre-processor of consecutive hits.
68  */
70  {
72  this->match.reset();
73  }
74 
75 
76  /**
77  * Set DAQ hit selector.
78  *
79  * \param selector DAQ hit selector
80  */
82  {
83  this->selector.reset(selector.clone());
84  }
85 
86 
87  /**
88  * Reset DAQ hit selector.
89  */
91  {
92  this->selector.reset(new JDAQHitDefaultSelector());
93  }
94 
95 
96  /**
97  * Demultiplex and pre-process DAQ super frame.
98  *
99  * \param input DAQ super frame
100  * \param module module data
101  * \return 2D super frame
102  */
104  const JModule& module) const
105  {
107 
108  if (match.is_valid()) {
109  buffer.preprocess(option, *match);
110  }
111 
112  return buffer;
113  }
114 
115  JPreprocessor::JOption_t option; //!< pre-processor option
116  JLANG::JSharedPointer<match_type> match; //!< pre-processor match criterion
118  };
119 }
120 
121 #endif
Base class for match operations for cluster and hit-preprocessing methods.
Data structure for optical module.
Auxiliaries for pre-processing of hits.
Data structure for a composite optical module.
Definition: JModule.hh:75
bool is_valid() const
Check validity of pointer.
virtual void reset() override
Reset pointer.
Function object interface for hit matching.
Definition: JMatch.hh:27
2-dimensional frame with time calibrated data from one optical module.
static JSuperFrame2D< JElement_t, JAllocator_t > demultiplex
Demultiplexer.
void preprocess(JPreprocessor::JOption_t option, const match_type &match)
Pre-process data.
Data frame of one optical module.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
Auxiliary class to set-up Hit.
Definition: JSirene.hh:58
Auxiliary base class for hit building.
Definition: JBuild.hh:36
JSuperFrame2D< JHit_t > & demultiplex(const JDAQSuperFrame &input, const JModule &module) const
Demultiplex and pre-process DAQ super frame.
Definition: JBuild.hh:103
void setDAQHitSelector(const JDAQHitSelector &selector)
Set DAQ hit selector.
Definition: JBuild.hh:81
void resetDAQHitSelector()
Reset DAQ hit selector.
Definition: JBuild.hh:90
JDAQHitSelector selector_type
Definition: JBuild.hh:40
JLANG::JSharedPointer< selector_type > selector
DAQ hit selector.
Definition: JBuild.hh:117
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:115
void setPreprocessor(const JPreprocessor::JOption_t option, const match_type &match)
Set pre-processor of consecutive hits.
Definition: JBuild.hh:59
JHit_t value_type
Definition: JBuild.hh:38
JLANG::JSharedPointer< match_type > match
pre-processor match criterion
Definition: JBuild.hh:116
JBuild()
Default constructor.
Definition: JBuild.hh:47
void resetPreprocessor()
Reset pre-processor of consecutive hits.
Definition: JBuild.hh:69
JMatch< value_type > match_type
Definition: JBuild.hh:39
Default class to select DAQ hits.
Auxiliary class to select DAQ hits.
Auxiliary class for specifying the way of pre-processing of hits.
JOption_t
Preprocessing options.
@ none_t
no pre-processing