Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION::JMuonStart Class Reference

Auxiliary class to determine start and end position of muon trajectory. More...

#include <JMuonStart.hh>

Inheritance diagram for JRECONSTRUCTION::JMuonStart:
JRECONSTRUCTION::JMuonStartParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Classes

struct  input_type
 Input data type. More...
 

Public Types

typedef JRegressor< JEnergyJRegressor_t
 
typedef JModuleL0 module_type
 
typedef std::vector< module_typedetector_type
 

Public Member Functions

 JMuonStart (const JMuonStartParameters_t &parameters, const storage_type &storage, const JK40Rates &rates_Hz, const int debug=0)
 Constructor.
 
input_type getInput (const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage) const
 Get input data.
 
JEvt operator() (const input_type &input)
 Fit function.
 
void reset ()
 Reset fit parameters.
 
bool equals (const JMuonStartParameters_t &parameters) const
 Equality.
 
 ClassDef (JMuonStartParameters_t, 3)
 

Public Attributes

const JK40Rates rates_Hz
 
double roadWidth_m
 road width [m]
 
size_t numberOfPrefits
 number of prefits
 
size_t numberOfPostfits
 number of postfits
 
double TMin_ns
 minimal time w.r.t. Cherenkov hypothesis [ns]
 
double TMax_ns
 maximal time w.r.t. Cherenkov hypothesis [ns]
 
double Pmin
 minimal probability
 
double Pmin1
 minimal probability single observation
 
double Pmin2
 minimal probability for twofold observations
 
int Nmax2
 maximal number for twofold observations
 

Detailed Description

Auxiliary class to determine start and end position of muon trajectory.

Definition at line 71 of file JMuonStart.hh.

Member Typedef Documentation

◆ JRegressor_t

◆ module_type

◆ detector_type

Constructor & Destructor Documentation

◆ JMuonStart()

JRECONSTRUCTION::JMuonStart::JMuonStart ( const JMuonStartParameters_t & parameters,
const storage_type & storage,
const JK40Rates & rates_Hz,
const int debug = 0 )
inline

Constructor.

Parameters
parametersparameters
storagestorage
rates_HzK40 rates [Hz]
debugdebug

Definition at line 125 of file JMuonStart.hh.

128 :
129 JMuonStartParameters_t(parameters),
130 JRegressor_t(storage),
132 {
133 if (this->getRmax() < parameters.roadWidth_m) {
134 roadWidth_m = this->getRmax();
135 }
136
137 JRegressor_t::debug = debug;
138 }
int debug
debug level
Definition JSirene.cc:74
JRegressor< JEnergy > JRegressor_t
Definition JMuonStart.hh:76

Member Function Documentation

◆ getInput()

input_type JRECONSTRUCTION::JMuonStart::getInput ( const JModuleRouter & router,
const JSummaryRouter & summary,
const JDAQEvent & event,
const JEvt & in,
const coverage_type & coverage ) const
inline

Get input data.

Parameters
routermodule router
summarysummary data
eventevent
instart values
coveragecoverage
Returns
input data

Definition at line 151 of file JMuonStart.hh.

156 {
157 using namespace std;
158 using namespace JTRIGGER;
159
160 input_type input(event.getDAQEventHeader(), in, coverage);
161
162 const JBuildL0 <JHitR0> buildL0;
164
165 const JDAQTimeslice timeslice(event, true);
166
167 JSuperFrame2D<JHit> buffer;
168
169 for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
170
171 if (router.hasModule(i->getModuleID())) {
172
173 buffer(*i, router.getModule(i->getModuleID()));
174
175 buildL0(buffer, back_inserter(data[i->getModuleID()]));
176 }
177 }
178
179 for (const auto& module : router.getReference()) {
180 if (!module.empty()) {
181 input.data.push_back(module_type(module, summary.getSummaryFrame(module.getID(), rates_Hz.getSinglesRate()), data[module.getID()]));
182 }
183 }
184
185 return input;
186 }
bool hasModule(const JModuleIdentifier &id) const
Has module.
const JModule & getModule(const JModuleIdentifier &id) const
Get module parameters.
const JClass_t & getReference() const
Get reference to object.
Definition JReference.hh:38
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
2-dimensional frame with time calibrated data from one optical module.
const JDAQEventHeader & getDAQEventHeader() const
Get DAQ event header.
Auxiliary classes and methods for triggering.
double getSinglesRate() const
Get singles rate.
Definition JK40Rates.hh:71

◆ operator()()

JEvt JRECONSTRUCTION::JMuonStart::operator() ( const input_type & input)
inline

Fit function.

Parameters
inputinput data
Returns
fit results

Definition at line 195 of file JMuonStart.hh.

196 {
197 using namespace std;
198 using namespace JPP;
199
200 JEvent event(JMUONSTART);
201
202 JEvt out;
203
204 // select start values
205
206 JEvt in = input.in;
207
208 sort(in.begin(), in.end(), qualitySorter);
209
210 if (numberOfPrefits != 0 && numberOfPrefits < in.size()) {
211
212 JEvt::iterator __end = next(in.begin(), numberOfPrefits);
213
214 if (numberOfPostfits > 0) {
215
216 __end = gridify(__end, in.end(), numberOfPostfits);
217 }
218
219 in.erase(__end, in.end());
220 }
221
222 if (!in.empty()) {
223 in.select(JHistory::is_event(in.begin()->getHistory()));
224 }
225
226 const JStart start(Pmin1, Pmin2, Nmax2);
227
228 struct JHit_t {
229
230 double getZ() const { return z; }
231 double getP() const { return p; }
232
233 double z;
234 double p;
235 };
236
237 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
238
239 const JRotation3D R (getDirection(*track));
240 const JLine1Z tz(getPosition (*track).rotate(R), track->getT());
241
243
244 for (const auto& module : input.data) {
245
246 JPosition3D pos(module->getPosition());
247
248 pos.transform(R, tz.getPosition());
249
250 if (pos.getX() <= roadWidth_m) {
251
252 const double z = pos.getZ() - pos.getX() / getTanThetaC();
253 const double t = tz .getT() + (pos.getZ() + pos.getX() * getKappaC()) * getInverseSpeedOfLight();
254
255 const double p = module.getProbability(rates_Hz.getMultiplesRates(), T_ns + t);
256
257 data.push_back({ z, p });
258 }
259 }
260
261 double Zmin = 0.0; // start position
262 double Zmax = 0.0; // end position
263
264 if (!data.empty()) {
265
266 sort(data.begin(), data.end(), make_comparator(&JHit_t::getZ));
267
268 vector<JHit_t>::const_iterator q1 = start.find(data. begin(), data. end());
269 vector<JHit_t>::const_reverse_iterator q2 = start.find(data.rbegin(), data.rend());
270
271 if (q1 != data.end() && q2 != data.rend()) {
272
273 vector<JHit_t>::const_iterator p1 = q1; if (p1 != data. begin()) { --p1; }
274 vector<JHit_t>::const_reverse_iterator p2 = q2; if (p2 != data.rbegin()) { --p2; }
275
276 Zmin = 0.5 * (p1->getZ() + q1->getZ());
277 Zmax = 0.5 * (p2->getZ() + q2->getZ());
278 }
279 }
280
281 JFit fit = *track;
282
283 fit.push_back(event());
284
285 out.push_back(fit);
286
287 // set additional values
288
289 out.rbegin()->setW(JSTART_ZMIN_M, Zmin);
290 out.rbegin()->setW(JSTART_ZMAX_M, Zmax);
291 out.rbegin()->setW(JSTART_LENGTH_METRES, Zmax - Zmin);
292 out.rbegin()->setW(JPP_COVERAGE_ORIENTATION, input.coverage.orientation);
293 out.rbegin()->setW(JPP_COVERAGE_POSITION, input.coverage.position);
294 }
295
296 // apply default sorter
297
298 sort(out.begin(), out.end(), qualitySorter);
299
300 copy(input.in.begin(), input.in.end(), back_inserter(out));
301
302 return out;
303 }
TPaveText * p1
Data structure for fit of straight line paralel to z-axis.
Definition JLine1Z.hh:29
Data structure for position in three dimensions.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
static const int JSTART_ZMAX_M
end position of track see JRECONSTRUCTION::JMuonStart
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration of this event
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
static const int JSTART_ZMIN_M
start position of track see JRECONSTRUCTION::JMuonStart
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration of this event
double getP(const double E1, const double E2, const double ED, const int M_min, const int M_max)
Get coincidence probability of two PMTs within one module due to random background.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
double getKappaC()
Get average R-dependence of arrival time of Cherenkov light (a.k.a.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JPosition3D getPosition(const JFit &fit)
Get position.
void copy(const JFIT::JEvt::const_iterator __begin, const JFIT::JEvt::const_iterator __end, Evt &out)
Copy tracks.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JDirection3D getDirection(const JFit &fit)
Get direction.
JEvt::iterator gridify(JEvt::iterator __begin, JEvt::iterator __end, const int N)
Gridify set of fits.
Acoustic event fit.
Acoustic single fit.
Auxiliary class to test history.
Definition JHistory.hh:157
int Nmax2
maximal number for twofold observations
double Pmin1
minimal probability single observation
double Pmin2
minimal probability for twofold observations
Auxiliary class for start or end point evaluation.
Definition JStart.hh:21
Auxiliary class to set-up Hit.
Definition JSirene.hh:60

◆ reset()

void JRECONSTRUCTION::JMuonStartParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 41 of file JMuonStartParameters_t.hh.

42 {
43 roadWidth_m = std::numeric_limits<double>::max();
46 TMin_ns = -25.0;
47 TMax_ns = +75.0;
48 Pmin = 0.0;
49 Pmin1 = 0.0;
50 Pmin2 = 0.0;
51 Nmax2 = 2;
52 }
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]

◆ equals()

bool JRECONSTRUCTION::JMuonStartParameters_t::equals ( const JMuonStartParameters_t & parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 60 of file JMuonStartParameters_t.hh.

61 {
62 return (this->roadWidth_m == parameters.roadWidth_m &&
63 this->numberOfPrefits == parameters.numberOfPrefits &&
64 this->numberOfPostfits == parameters.numberOfPostfits &&
65 this->TMin_ns == parameters.TMin_ns &&
66 this->TMax_ns == parameters.TMax_ns &&
67 this->Pmin == parameters.Pmin &&
68 this->Pmin1 == parameters.Pmin1 &&
69 this->Pmin2 == parameters.Pmin2 &&
70 this->Nmax2 == parameters.Nmax2);
71 }

◆ ClassDef()

JRECONSTRUCTION::JMuonStartParameters_t::ClassDef ( JMuonStartParameters_t ,
3  )
inherited

Member Data Documentation

◆ rates_Hz

const JK40Rates JRECONSTRUCTION::JMuonStart::rates_Hz

Definition at line 306 of file JMuonStart.hh.

◆ roadWidth_m

double JRECONSTRUCTION::JMuonStartParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 75 of file JMuonStartParameters_t.hh.

◆ numberOfPrefits

size_t JRECONSTRUCTION::JMuonStartParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 76 of file JMuonStartParameters_t.hh.

◆ numberOfPostfits

size_t JRECONSTRUCTION::JMuonStartParameters_t::numberOfPostfits
inherited

number of postfits

Definition at line 77 of file JMuonStartParameters_t.hh.

◆ TMin_ns

double JRECONSTRUCTION::JMuonStartParameters_t::TMin_ns
inherited

minimal time w.r.t. Cherenkov hypothesis [ns]

Definition at line 78 of file JMuonStartParameters_t.hh.

◆ TMax_ns

double JRECONSTRUCTION::JMuonStartParameters_t::TMax_ns
inherited

maximal time w.r.t. Cherenkov hypothesis [ns]

Definition at line 79 of file JMuonStartParameters_t.hh.

◆ Pmin

double JRECONSTRUCTION::JMuonStartParameters_t::Pmin
inherited

minimal probability

Definition at line 80 of file JMuonStartParameters_t.hh.

◆ Pmin1

double JRECONSTRUCTION::JMuonStartParameters_t::Pmin1
inherited

minimal probability single observation

Definition at line 81 of file JMuonStartParameters_t.hh.

◆ Pmin2

double JRECONSTRUCTION::JMuonStartParameters_t::Pmin2
inherited

minimal probability for twofold observations

Definition at line 82 of file JMuonStartParameters_t.hh.

◆ Nmax2

int JRECONSTRUCTION::JMuonStartParameters_t::Nmax2
inherited

maximal number for twofold observations

Definition at line 83 of file JMuonStartParameters_t.hh.


The documentation for this class was generated from the following file: