Jpp 20.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 <iomanip>
6
9
23
24#include "Jeep/JProperties.hh"
25
26/**
27 * \author mdejong
28 */
29
30namespace JRECONSTRUCTION {}
31namespace JPP { using namespace JRECONSTRUCTION; }
32
33namespace JRECONSTRUCTION {
34
35 /**
36 * ORCA muon reconstruction.
37 */
39 /**
40 * Parameters.
41 */
68
69
70 /**
71 * Storage for PDFs.
72 */
73 struct JStorage_t {
74 /**
75 * Constructor.
76 *
77 * \param fileDescriptor PDF file descriptor
78 * \param parameters parameters
79 */
80 JStorage_t(const std::string& fileDescriptor,
81 const JParameters_t& parameters) :
82 gandalf(fileDescriptor, JTimeRange(parameters.gandalf.TMin_ns, parameters.gandalf.TMax_ns), parameters.gandalf.TTS_ns),
83 start (fileDescriptor, JTimeRange(parameters.start .TMin_ns, parameters.start .TMax_ns)),
84 energy (fileDescriptor, JTimeRange(parameters.energy .TMin_ns, parameters.energy .TMax_ns)),
85 start2 (fileDescriptor, JTimeRange(parameters.start2 .TMin_ns, parameters.start2 .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 JMuonStart ::storage_type start2;
93 JMuonGandalf::storage_type features;
94 };
95
96
97 /**
98 * Input data type.
99 */
100 struct input_type :
101 public JDAQEventHeader
102 {
103 /**
104 * Default constructor.
105 */
107 {}
108
109
110 /**
111 * Constructor.
112 *
113 * \param header header
114 */
116 JDAQEventHeader(header)
117 {}
118
119 JMuonPrefit ::input_type prefit;
121 JMuonStart ::input_type start;
123 JMuonStart ::input_type start2;
124 JMuonEnergy ::input_type energy;
126 };
127
128
129 /**
130 * Constructor.
131 *
132 * \param parameters parameters
133 * \param storage storage
134 * \param rates_Hz K40 rates [Hz]
135 * \param pmtParameters PMT parameters
136 * \param correct energy correction
137 * \param debug debug
138 */
140 const JStorage_t& storage,
141 const JK40Rates& rates_Hz,
142 const JPMTParametersMap& pmtParameters,
143 const JEnergyCorrection& correct,
144 const int debug) :
145 prefit (parameters.prefit, debug),
146 simplex(parameters.simplex, debug),
147 start (parameters.start, storage.start, rates_Hz, debug),
148 gandalf(parameters.gandalf, storage.gandalf, debug),
149 start2 (parameters.start2, storage.start2, rates_Hz, debug),
150 energy (parameters.energy, storage.energy, pmtParameters, correct, debug),
151 features(parameters.features, storage.features, debug)
152 {}
153
154
155 /**
156 * Get input data.
157 *
158 * \param router module router
159 * \param summary summary data
160 * \param event event
161 * \param coverage coverage
162 * \return input data
163 */
165 const JSummaryRouter& summary,
166 const JDAQEvent& event,
167 const coverage_type& coverage) const
168 {
169 input_type input(event.getDAQEventHeader());
170
171 input.prefit = prefit .getInput(router, event, coverage);
172 input.simplex = simplex.getInput(router, event, JEvt(), coverage);
173 input.start = start .getInput(router, summary, event, JEvt(), coverage);
174 input.gandalf = gandalf.getInput(router, summary, event, JEvt(), coverage);
175 input.start2 = start2 .getInput(router, summary, event, JEvt(), coverage);
176 input.energy = energy .getInput(router, summary, event, JEvt(), coverage);
177 input.features = features.getInput(router, summary, event, JEvt(), coverage);
178
179 return input;
180 }
181
182
183 /**
184 * Fit function.
185 *
186 * \param input input data
187 * \return fit results
188 */
190 {
191 std::vector<int> apps;
192
193 input.simplex.in = prefit(input.prefit);
194
195 apps.push_back(JMUONPREFIT);
196
197 input.start.in = simplex(input.simplex);
198
199 apps.push_back(JMUONSIMPLEX);
200
201 input.gandalf.in = start(input.start);
202
203 apps.push_back(JMUONSTART);
204
205 input.start2.in = gandalf(input.gandalf);
206
207 apps.push_back(JMUONGANDALF);
208
209 input.energy.in = start2(input.start2);
210
211 apps.push_back(JMUONSTART);
212
213 input.features.in= energy(input.energy);
214
215 apps.push_back(JMUONENERGY);
216
217 JEvt out = features(input.features);
218
219 apps.push_back(JMUONFEATURES);
220
221 for (JFIT::JEvt::iterator i = out.begin(); i != out.end(); ++i) {
222 i->setStatus(i->getHistory().getStatus(apps) ? COMPLETE_CHAIN : INCOMPLETE_CHAIN);
223 }
224
225 return out;
226 }
227
235 };
236}
237
238#endif
int debug
debug level
Definition JSirene.cc:72
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:76
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 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.