Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JORCAMuonReconstruction.hh
Go to the documentation of this file.
1#ifndef __JRECONSTRUCTION__JORCAMUONRECONSTRUCTION__
2#define __JRECONSTRUCTION__JORCAMUONRECONSTRUCTION__
3
4#include <string>
5#include <ostream>
6#include <iomanip>
7
10
11#include "JLang/JClock.hh"
12
26
27#include "Jeep/JProperties.hh"
28
29/**
30 * \author mdejong
31 */
32
33namespace JRECONSTRUCTION {}
34namespace JPP { using namespace JRECONSTRUCTION; }
35
36namespace JRECONSTRUCTION {
37
38 /**
39 * ORCA muon reconstruction.
40 */
42 /**
43 * Parameters.
44 */
71
72
73 /**
74 * Storage for PDFs.
75 */
76 struct JStorage_t {
77 /**
78 * Constructor.
79 *
80 * \param fileDescriptor PDF file descriptor
81 * \param parameters parameters
82 */
83 JStorage_t(const std::string& fileDescriptor,
84 const JParameters_t& parameters) :
85 gandalf (fileDescriptor, JTimeRange(parameters.gandalf .TMin_ns, parameters.gandalf .TMax_ns), parameters.gandalf.TTS_ns),
86 start (fileDescriptor, JTimeRange(parameters.start .TMin_ns, parameters.start .TMax_ns)),
87 energy (fileDescriptor, JTimeRange(parameters.energy .TMin_ns, parameters.energy .TMax_ns)),
88 start2 (fileDescriptor, JTimeRange(parameters.start2 .TMin_ns, parameters.start2 .TMax_ns)),
89 features(fileDescriptor, JTimeRange(parameters.features.TMin_ns, parameters.features.TMax_ns), parameters.features.TTS_ns)
90 {}
91
92 JMuonGandalf::storage_type gandalf;
93 JMuonStart ::storage_type start;
94 JMuonEnergy ::storage_type energy;
95 JMuonStart ::storage_type start2;
96 JMuonGandalf::storage_type features;
97 };
98
99
100 /**
101 * Input data type.
102 */
103 struct input_type :
104 public JDAQEventHeader
105 {
106 /**
107 * Default constructor.
108 */
110 {}
111
112
113 /**
114 * Constructor.
115 *
116 * \param header header
117 */
119 JDAQEventHeader(header)
120 {}
121
122 JMuonPrefit ::input_type prefit;
123 JMuonSimplex ::input_type simplex;
124 JMuonStart ::input_type start;
125 JMuonGandalf ::input_type gandalf;
126 JMuonStart ::input_type start2;
127 JMuonEnergy ::input_type energy;
129 };
130
131
132 /**
133 * Constructor.
134 *
135 * \param parameters parameters
136 * \param storage storage
137 * \param rates_Hz K40 rates [Hz]
138 * \param pmtParameters PMT parameters
139 * \param correct energy correction
140 * \param debug debug
141 */
143 const JStorage_t& storage,
144 const JK40Rates& rates_Hz,
145 const JPMTParametersMap& pmtParameters,
146 const JEnergyCorrection& correct,
147 const int debug) :
148 prefit (parameters.prefit, debug),
149 simplex (parameters.simplex, debug),
150 start (parameters.start, storage.start, rates_Hz, debug),
151 gandalf (parameters.gandalf, storage.gandalf, pmtParameters, debug),
152 start2 (parameters.start2, storage.start2, rates_Hz, debug),
153 energy (parameters.energy, storage.energy, pmtParameters, correct, debug),
154 features(parameters.features, storage.features, debug)
155 {}
156
157
158 /**
159 * Get input data.
160 *
161 * \param router module router
162 * \param summary summary data
163 * \param event event
164 * \param coverage coverage
165 * \return input data
166 */
168 const JSummaryRouter& summary,
169 const JDAQEvent& event,
170 const coverage_type& coverage) const
171 {
172 input_type input(event.getDAQEventHeader());
173
174 input.prefit = prefit .getInput(router, event, coverage);
175 input.simplex = simplex .getInput(router, event, JEvt(), coverage);
176 input.start = start .getInput(router, summary, event, JEvt(), coverage);
177 input.gandalf = gandalf .getInput(router, summary, event, JEvt(), coverage);
178 input.start2 = start2 .getInput(router, summary, event, JEvt(), coverage);
179 input.energy = energy .getInput(router, summary, event, JEvt(), coverage);
180 input.features = features.getInput(router, summary, event, JEvt(), coverage);
181
182 return input;
183 }
184
185
186 /**
187 * Fit function.
188 *
189 * \param input input data
190 * \return fit results
191 */
193 {
194 std::vector<int> apps;
195
196 {
197 JLANG::JClock::sentry sentry(clock[apps.size()]);
198
199 input.simplex.in = prefit(input.prefit);
200
201 apps.push_back(JMUONPREFIT);
202 }
203 {
204 JLANG::JClock::sentry sentry(clock[apps.size()]);
205
206 input.start.in = simplex(input.simplex);
207
208 apps.push_back(JMUONSIMPLEX);
209 }
210 {
211 JLANG::JClock::sentry sentry(clock[apps.size()]);
212
213 input.gandalf.in = start(input.start);
214
215 apps.push_back(JMUONSTART);
216 }
217 {
218 JLANG::JClock::sentry sentry(clock[apps.size()]);
219
220 input.start2.in = gandalf(input.gandalf);
221
222 apps.push_back(JMUONGANDALF);
223 }
224 {
225 JLANG::JClock::sentry sentry(clock[apps.size()]);
226
227 input.energy.in = start2(input.start2);
228
229 apps.push_back(JMUONSTART);
230 }
231 {
232 JLANG::JClock::sentry sentry(clock[apps.size()]);
233
234 input.features.in = energy(input.energy);
235
236 apps.push_back(JMUONENERGY);
237 }
238
239 JLANG::JClock::sentry sentry(clock[apps.size()]);
240
241 JEvt out = features(input.features);
242
243 apps.push_back(JMUONFEATURES);
244
245 for (JFIT::JEvt::iterator i = out.begin(); i != out.end(); ++i) {
246 i->setStatus(i->getHistory().getStatus(apps) ? COMPLETE_CHAIN : INCOMPLETE_CHAIN);
247 }
248
249 return out;
250 }
251
259
261 };
262}
263
264#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
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.
JStorage_t(const std::string &fileDescriptor, const JParameters_t &parameters)
Constructor.
input_type(const JDAQEventHeader &header)
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.
JORCAMuonReconstruction(const JParameters_t &parameters, const JStorage_t &storage, const JK40Rates &rates_Hz, const JPMTParametersMap &pmtParameters, const JEnergyCorrection &correct, const int debug)
Constructor.