Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JARCAMuonReconstruction.hh
Go to the documentation of this file.
1#ifndef __JRECONSTRUCTION__JARCAMUONRECONSTRUCTION__
2#define __JRECONSTRUCTION__JARCAMUONRECONSTRUCTION__
3
4#include <string>
5#include <iomanip>
6
9
10#include "JLang/JClock.hh"
11
25
26#include "Jeep/JProperties.hh"
27
28
29/**
30 * \author mdejong
31 */
32
33namespace JRECONSTRUCTION {}
34namespace JPP { using namespace JRECONSTRUCTION; }
35
36namespace JRECONSTRUCTION {
37
38 /**
39 * ARCA muon reconstruction.
40 */
42 /**
43 * Parameters.
44 */
69
70
71 /**
72 * Storage for PDFs.
73 */
74 struct JStorage_t {
75 /**
76 * Constructor.
77 *
78 * \param fileDescriptor PDF file descriptor
79 * \param parameters parameters
80 */
81 JStorage_t(const std::string& fileDescriptor,
82 const JParameters_t& parameters) :
83 gandalf (fileDescriptor, JTimeRange(parameters.gandalf .TMin_ns, parameters.gandalf .TMax_ns), parameters.gandalf.TTS_ns),
84 start (fileDescriptor, JTimeRange(parameters.start .TMin_ns, parameters.start .TMax_ns)),
85 energy (fileDescriptor, JTimeRange(parameters.energy .TMin_ns, parameters.energy .TMax_ns)),
86 features(fileDescriptor, JTimeRange(parameters.features.TMin_ns, parameters.features.TMax_ns), parameters.features.TTS_ns)
87 {}
88
89 JMuonGandalf::storage_type gandalf;
90 JMuonStart ::storage_type start;
91 JMuonEnergy ::storage_type energy;
92 JMuonGandalf::storage_type features;
93 };
94
95
96 /**
97 * Input data type.
98 */
99 struct input_type :
100 public JDAQEventHeader
101 {
102 /**
103 * Default constructor.
104 */
106 {}
107
108
109 /**
110 * Constructor.
111 *
112 * \param header header
113 */
115 JDAQEventHeader(header)
116 {}
117
118 JMuonPrefit ::input_type prefit;
119 JMuonSimplex ::input_type simplex;
120 JMuonGandalf ::input_type gandalf;
121 JMuonStart ::input_type start;
122 JMuonEnergy ::input_type energy;
124 };
125
126
127 /**
128 * Constructor.
129 *
130 * \param parameters parameters
131 * \param storage storage
132 * \param rates_Hz K40 rates [Hz]
133 * \param pmtParameters PMT parameters
134 * \param correct energy correction
135 * \param debug debug
136 */
138 const JStorage_t& storage,
139 const JK40Rates& rates_Hz,
140 const JPMTParametersMap& pmtParameters,
141 const JEnergyCorrection& correct,
142 const int debug) :
143 prefit (parameters.prefit, debug),
144 simplex (parameters.simplex, debug),
145 gandalf (parameters.gandalf, storage.gandalf, pmtParameters, debug),
146 start (parameters.start, storage.start, rates_Hz, debug),
147 energy (parameters.energy, storage.energy, pmtParameters, correct, debug),
148 features(parameters.features, storage.features, debug)
149 {}
150
151
152 /**
153 * Get input data.
154 *
155 * \param router module router
156 * \param summary summary data
157 * \param event event
158 * \param coverage coverage
159 * \return input data
160 */
162 const JSummaryRouter& summary,
163 const JDAQEvent& event,
164 const coverage_type& coverage) const
165 {
166 input_type input(event.getDAQEventHeader());
167
168 input.prefit = prefit .getInput(router, event, coverage);
169 input.simplex = simplex .getInput(router, event, JEvt(), coverage);
170 input.gandalf = gandalf .getInput(router, summary, event, JEvt(), coverage);
171 input.start = start .getInput(router, summary, event, JEvt(), coverage);
172 input.energy = energy .getInput(router, summary, event, JEvt(), coverage);
173 input.features = features.getInput(router, summary, event, JEvt(), coverage);
174
175 return input;
176 }
177
178
179 /**
180 * Fit function.
181 *
182 * \param input input data
183 * \return fit results
184 */
186 {
187 std::vector<int> apps;
188
189 {
190 JLANG::JClock::sentry sentry(clock[apps.size()]);
191
192 input.simplex.in = prefit(input.prefit);
193
194 apps.push_back(JMUONPREFIT);
195 }
196 {
197 JLANG::JClock::sentry sentry(clock[apps.size()]);
198
199 input.gandalf.in = simplex(input.simplex);
200
201 apps.push_back(JMUONSIMPLEX);
202 }
203 {
204 JLANG::JClock::sentry sentry(clock[apps.size()]);
205
206 input.start.in = gandalf(input.gandalf);
207
208 apps.push_back(JMUONGANDALF);
209 }
210 {
211 JLANG::JClock::sentry sentry(clock[apps.size()]);
212
213 input.energy.in = start(input.start);
214
215 apps.push_back(JMUONSTART);
216 }
217 {
218 JLANG::JClock::sentry sentry(clock[apps.size()]);
219
220 input.features.in = energy(input.energy);
221
222 apps.push_back(JMUONENERGY);
223 }
224
225 JLANG::JClock::sentry sentry(clock[apps.size()]);
226
227 JEvt out = features(input.features);
228
229 apps.push_back(JMUONFEATURES);
230
231 for (JFIT::JEvt::iterator i = out.begin(); i != out.end(); ++i) {
232 i->setStatus(i->getHistory().getStatus(apps) ? COMPLETE_CHAIN : INCOMPLETE_CHAIN);
233 }
234
235 return out;
236 }
237
244
246 };
247}
248
249#endif
int debug
debug level
Definition JSirene.cc:74
Utility class to parse parameter values.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Router for direct addressing of module data in detector data structure.
Auxiliary class for map of PMT parameters.
Utility class to parse parameter values.
Data structure for set of track fit results.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Auxiliary class for correction of energy determined by JEnergy.cc.
Auxiliary class to to determine muon energy.
input_type getInput(const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage) const
Get input data.
Auxiliary class to determine start and end position of muon trajectory.
Definition JMuonStart.hh:74
input_type getInput(const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage) const
Get input data.
Router for fast addressing of summary data in KM3NETDAQ::JDAQSummaryslice data structure as a functio...
const JDAQEventHeader & getDAQEventHeader() const
Get DAQ event header.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Data structure for coverage of detector by dynamical calibrations.
Definition JCoverage.hh:19
Auxiliary data structure for scoped timing.
Definition JClock.hh:53
Group of clocks.
Definition JClock.hh:165
Auxiliary class for K40 rates.
Definition JK40Rates.hh:41
JStorage_t(const std::string &fileDescriptor, const JParameters_t &parameters)
Constructor.
input_type(const JDAQEventHeader &header)
Constructor.
JARCAMuonReconstruction(const JParameters_t &parameters, const JStorage_t &storage, const JK40Rates &rates_Hz, const JPMTParametersMap &pmtParameters, const JEnergyCorrection &correct, const int debug)
Constructor.
JEvt operator()(input_type &input)
Fit function.
input_type getInput(const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const coverage_type &coverage) const
Get input data.
Wrapper class to add features after the final fit of muon trajectory.
input_type getInput(const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage) const
Get input data.
Wrapper class to make final fit of muon trajectory.
input_type getInput(const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage) const
Get input data.
Wrapper class to make pre-fit of muon trajectory.
input_type getInput(const JModuleRouter &router, const JDAQEvent &event, const coverage_type &coverage) const
Get input data.
Wrapper class to make intermediate fit of muon trajectory.
input_type getInput(const JModuleRouter &router, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage) const
Get input data.
Data structure for fit parameters.