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