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