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