Jpp  test_elongated_shower_pde
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
Auxiliaries for pre-processing of hits.
Data structure for a composite optical module.
Definition: JModule.hh:68
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
Auxiliary base class for hit building.
Definition: JBuild.hh:36
JLANG::JSharedPointer< selector_type > selector
DAQ hit selector.
Definition: JBuild.hh:117
Function object interface for hit matching.
Definition: JMatch.hh:25
JLANG::JSharedPointer< match_type > match
pre-processor match criterion
Definition: JBuild.hh:116
bool is_valid() const
Check validity of pointer.
void setDAQHitSelector(const JDAQHitSelector &selector)
Set DAQ hit selector.
Definition: JBuild.hh:81
Default class to select DAQ hits.
JBuild()
Default constructor.
Definition: JBuild.hh:47
void preprocess(JPreprocessor::JOption_t option, const match_type &match)
Pre-process data.
static JSuperFrame2D< JElement_t, JAllocator_t > demultiplex
Demultiplexer.
virtual clone_type clone() const override
Get clone of this object.
Definition: JClonable.hh:69
Base class for match operations for cluster and hit-preprocessing methods.
JDAQHitSelector selector_type
Definition: JBuild.hh:40
JSuperFrame2D< JHit_t > & demultiplex(const JDAQSuperFrame &input, const JModule &module) const
Demultiplex and pre-process DAQ super frame.
Definition: JBuild.hh:103
void resetPreprocessor()
Reset pre-processor of consecutive hits.
Definition: JBuild.hh:69
void resetDAQHitSelector()
Reset DAQ hit selector.
Definition: JBuild.hh:90
JOption_t
Preprocessing options.
Auxiliary class to set-up Hit.
Definition: JSirene.hh:55
2-dimensional frame with time calibrated data from one optical module.
Auxiliary class to select DAQ hits.
virtual void reset() override
Reset pointer.
Auxiliary class for specifying the way of pre-processing of hits.
JMatch< value_type > match_type
Definition: JBuild.hh:39
Data frame of one optical module.
Data structure for optical module.