Jpp test-rotations-old-57-g407471f53
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 correct energy correction
132 * \param debug debug
133 */
135 const JStorage_t& storage,
136 const JK40Rates& rates_Hz,
137 const JEnergyCorrection& correct,
138 const int debug) :
139 prefit (parameters.prefit, debug),
140 simplex (parameters.simplex, debug),
141 gandalf (parameters.gandalf, storage.gandalf, debug),
142 start (parameters.start, storage.start, rates_Hz, debug),
143 energy (parameters.energy, storage.energy, correct, debug),
144 features(parameters.features, storage.features, debug)
145 {}
146
147
148 /**
149 * Get input data.
150 *
151 * \param router module router
152 * \param summary summary data
153 * \param event event
154 * \param coverage coverage
155 * \return input data
156 */
158 const JSummaryRouter& summary,
159 const JDAQEvent& event,
160 const coverage_type& coverage) const
161 {
162 input_type input(event.getDAQEventHeader());
163
164 input.prefit = prefit .getInput(router, event, coverage);
165 input.simplex = simplex .getInput(router, event, JEvt(), coverage);
166 input.gandalf = gandalf .getInput(router, summary, event, JEvt(), coverage);
167 input.start = start .getInput(router, summary, event, JEvt(), coverage);
168 input.energy = energy .getInput(router, summary, event, JEvt(), coverage);
169 input.features = features.getInput(router, summary, event, JEvt(), coverage);
170
171 return input;
172 }
173
174
175 /**
176 * Fit function.
177 *
178 * \param input input data
179 * \return fit results
180 */
182 {
183 std::vector<int> apps;
184
185 input.simplex.in = prefit(input.prefit);
186
187 apps.push_back(JMUONPREFIT);
188
189 input.gandalf.in = simplex(input.simplex);
190
191 apps.push_back(JMUONSIMPLEX);
192
193 input.start.in = gandalf(input.gandalf);
194
195 apps.push_back(JMUONGANDALF);
196
197 input.energy.in = start(input.start);
198
199 apps.push_back(JMUONSTART);
200
201 input.features.in= energy(input.energy);
202
203 apps.push_back(JMUONENERGY);
204
205 JEvt out = features(input.features);
206
207 apps.push_back(JMUONFEATURES);
208
209 for (JFIT::JEvt::iterator i = out.begin(); i != out.end(); ++i) {
210 i->setStatus(i->getHistory().getStatus(apps) ? COMPLETE_CHAIN : INCOMPLETE_CHAIN);
211 }
212
213 return out;
214 }
215
222 };
223}
224
225#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 JMUONFEATURES
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 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.