Jpp 21.0.0-rc.1
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 clock.resize(7);
157
158 clock[0].setTitle("prefit");
159 clock[1].setTitle("simplex");
160 clock[2].setTitle("start");
161 clock[3].setTitle("gandalf");
162 clock[4].setTitle("start2");
163 clock[5].setTitle("energy");
164 clock[6].setTitle("features");
165 }
166
167
168 /**
169 * Get input data.
170 *
171 * \param router module router
172 * \param summary summary data
173 * \param event event
174 * \param coverage coverage
175 * \return input data
176 */
178 const JSummaryRouter& summary,
179 const JDAQEvent& event,
180 const coverage_type& coverage) const
181 {
182 input_type input(event.getDAQEventHeader());
183
184 input.prefit = prefit .getInput(router, event, coverage);
185 input.simplex = simplex .getInput(router, event, JEvt(), coverage);
186 input.start = start .getInput(router, summary, event, JEvt(), coverage);
187 input.gandalf = gandalf .getInput(router, summary, event, JEvt(), coverage);
188 input.start2 = start2 .getInput(router, summary, event, JEvt(), coverage);
189 input.energy = energy .getInput(router, summary, event, JEvt(), coverage);
190 input.features = features.getInput(router, summary, event, JEvt(), coverage);
191
192 return input;
193 }
194
195
196 /**
197 * Fit function.
198 *
199 * \param input input data
200 * \return fit results
201 */
203 {
204 std::vector<int> apps;
205
206 {
207 JLANG::JClock::sentry sentry(clock[0]);
208
209 input.simplex.in = prefit(input.prefit);
210
211 apps.push_back(JMUONPREFIT);
212 }
213 {
214 JLANG::JClock::sentry sentry(clock[1]);
215
216 input.start.in = simplex(input.simplex);
217
218 apps.push_back(JMUONSIMPLEX);
219 }
220 {
221 JLANG::JClock::sentry sentry(clock[2]);
222
223 input.gandalf.in = start(input.start);
224
225 apps.push_back(JMUONSTART);
226 }
227 {
228 JLANG::JClock::sentry sentry(clock[3]);
229
230 input.start2.in = gandalf(input.gandalf);
231
232 apps.push_back(JMUONGANDALF);
233 }
234 {
235 JLANG::JClock::sentry sentry(clock[4]);
236
237 input.energy.in = start2(input.start2);
238
239 apps.push_back(JMUONSTART);
240 }
241 {
242 JLANG::JClock::sentry sentry(clock[5]);
243
244 input.features.in = energy(input.energy);
245
246 apps.push_back(JMUONENERGY);
247 }
248
249 JLANG::JClock::sentry sentry(clock[6]);
250
251 JEvt out = features(input.features);
252
253 apps.push_back(JMUONFEATURES);
254
255 for (JFIT::JEvt::iterator i = out.begin(); i != out.end(); ++i) {
256 i->setStatus(i->getHistory().getStatus(apps) ? COMPLETE_CHAIN : INCOMPLETE_CHAIN);
257 }
258
259 return out;
260 }
261
269
271 };
272}
273
274#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:65
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.