Jpp 19.3.0-rc.3
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
22
23#include "Jeep/JProperties.hh"
24
25
26/**
27 * \author mdejong
28 */
29
30namespace JRECONSTRUCTION {}
31namespace JPP { using namespace JRECONSTRUCTION; }
32
33namespace JRECONSTRUCTION {
34
35 /**
36 * ARCA muon reconstruction.
37 */
39 /**
40 * Parameters.
41 */
64
65
66 /**
67 * Storage for PDFs.
68 */
69 struct JStorage_t {
70 /**
71 * Constructor.
72 *
73 * \param fileDescriptor PDF file descriptor
74 * \param parameters parameters
75 */
76 JStorage_t(const std::string& fileDescriptor,
77 const JParameters_t& parameters) :
78 gandalf(fileDescriptor, JTimeRange(parameters.gandalf.TMin_ns, parameters.gandalf.TMax_ns), parameters.gandalf.TTS_ns),
79 start (fileDescriptor, JTimeRange(parameters.start .TMin_ns, parameters.start .TMax_ns)),
80 energy (fileDescriptor, JTimeRange(parameters.energy .TMin_ns, parameters.energy .TMax_ns))
81 {}
82
83 JMuonGandalf::storage_type gandalf;
84 JMuonStart ::storage_type start;
85 JMuonEnergy ::storage_type energy;
86 };
87
88
89 /**
90 * Input data type.
91 */
92 struct input_type :
93 public JDAQEventHeader
94 {
95 /**
96 * Default constructor.
97 */
99 {}
100
101
102 /**
103 * Constructor.
104 *
105 * \param header header
106 */
108 JDAQEventHeader(header)
109 {}
110
111 JMuonPrefit ::input_type prefit;
114 JMuonStart ::input_type start;
115 JMuonEnergy ::input_type energy;
116 };
117
118
119 /**
120 * Constructor.
121 *
122 * \param parameters parameters
123 * \param storage storage
124 * \param rates_Hz K40 rates [Hz]
125 * \param correct energy correction
126 * \param debug debug
127 */
129 const JStorage_t& storage,
130 const JK40Rates& rates_Hz,
131 const JEnergyCorrection& correct,
132 const int debug) :
133 prefit (parameters.prefit, debug),
134 simplex(parameters.simplex, debug),
135 gandalf(parameters.gandalf, storage.gandalf, debug),
136 start (parameters.start, storage.start, rates_Hz, debug),
137 energy (parameters.energy, storage.energy, correct, debug)
138 {}
139
140
141 /**
142 * Get input data.
143 *
144 * \param router module router
145 * \param summary summary data
146 * \param event event
147 * \param coverage coverage
148 * \return input data
149 */
151 const JSummaryRouter& summary,
152 const JDAQEvent& event,
153 const coverage_type& coverage) const
154 {
155 input_type input(event.getDAQEventHeader());
156
157 input.prefit = prefit .getInput(router, event, coverage);
158 input.simplex = simplex.getInput(router, event, JEvt(), coverage);
159 input.gandalf = gandalf.getInput(router, summary, event, JEvt(), coverage);
160 input.start = start .getInput(router, summary, event, JEvt(), coverage);
161 input.energy = energy .getInput(router, summary, event, JEvt(), coverage);
162
163 return input;
164 }
165
166
167 /**
168 * Fit function.
169 *
170 * \param input input data
171 * \return fit results
172 */
174 {
175 std::vector<int> apps;
176
177 JEvt out;
178
179 {
180 out = prefit(input.prefit);
181
182 apps.push_back(JMUONPREFIT);
183 }
184 {
185 input.simplex.in = out;
186
187 out = simplex(input.simplex);
188
189 apps.push_back(JMUONSIMPLEX);
190 }
191 {
192 input.gandalf.in = out;
193
194 out = gandalf(input.gandalf);
195
196 apps.push_back(JMUONGANDALF);
197 }
198 {
199 input.start.in = out;
200
201 out = start(input.start);
202
203 apps.push_back(JMUONSTART);
204 }
205 {
206 input.energy.in = out;
207
208 out = energy(input.energy);
209
210 apps.push_back(JMUONENERGY);
211 }
212 {
213 for (JFIT::JEvt::iterator i = out.begin(); i != out.end(); ++i) {
214 i->setStatus(i->getHistory().getStatus(apps) ? COMPLETE_CHAIN : INCOMPLETE_CHAIN);
215 }
216 }
217
218 return out;
219 }
220
226 };
227}
228
229#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.
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.
static const int JMUONGANDALF
static const int JMUONPREFIT
static const int JMUONENERGY
static const int JMUONSIMPLEX
static const int JMUONSTART
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Model fits to data.
Data structure for coverage of detector by dynamical calibrations.
Definition JCoverage.hh:19
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.
JEvt operator()(input_type &input)
Fit function.
JARCAMuonReconstruction(const JParameters_t &parameters, const JStorage_t &storage, const JK40Rates &rates_Hz, const JEnergyCorrection &correct, const int debug)
Constructor.
input_type getInput(const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, 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.