Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION::JMuonSimplex Struct Reference

Wrapper class to make intermediate fit of muon trajectory. More...

#include <JMuonSimplex.hh>

Inheritance diagram for JRECONSTRUCTION::JMuonSimplex:
JRECONSTRUCTION::JMuonSimplexParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Types

typedef JRegressor< JLine3Z, JSimplexJRegressor_t
 
typedef JTRIGGER::JHitR1 hit_type
 
typedef std::vector< hit_typebuffer_type
 

Public Member Functions

 JMuonSimplex (const JMuonSimplexParameters_t &parameters, const JModuleRouter &router, const int debug=0)
 Constructor.
 
JEvt operator() (const KM3NETDAQ::JDAQEvent &event, const JEvt &in)
 Fit function.
 
JEvt operator() (const buffer_type &dataL0, const buffer_type &dataL1, const JEvt &in)
 Fit function.
 
void reset ()
 Reset fit parameters.
 
bool equals (const JMuonSimplexParameters_t &parameters) const
 Equality.
 
 ClassDef (JMuonSimplexParameters_t, 2)
 

Public Attributes

const JModuleRouterrouter
 
double sigma_ns
 time resolution [ns]
 
bool useL0
 option for L0 hit use
 
size_t numberOfPrefits
 number of prefits
 
double TMaxLocal_ns
 time window for local coincidences [ns]
 
double ctMin
 minimal cosine space angle between PMT axes
 
double roadWidth_m
 road width [m]
 
double TMin_ns
 minimal time w.r.t. Cherenkov hypothesis [ns]
 
double TMax_ns
 maximal time w.r.t. Cherenkov hypothesis [ns]
 
int NMax
 maximum number of iterations
 
bool reprocess
 reprocess
 

Detailed Description

Wrapper class to make intermediate fit of muon trajectory.

The JMuonSimplex fit uses one or more start values (usually taken from the output of JMuonPrefit) and produces new start values for subsequent fits (usually JMuonGandalf).
All hits of which the PMT position lies within a set road width (JMuonSimplexParameters_t::roadWidth_m) and time is within a set window (JMuonSimplexParameters_t::TMin_ns, JMuonSimplexParameters_t::TMax_ns) around the Cherenkov hypothesis are taken.
In case there are multiple hits from the same PMT is the specified window, the first hit is taken and the other hits are discarded.
The chi-squared is based on an M-estimator of the time residuals.

Definition at line 65 of file JMuonSimplex.hh.

Member Typedef Documentation

◆ JRegressor_t

◆ hit_type

◆ buffer_type

Constructor & Destructor Documentation

◆ JMuonSimplex()

JRECONSTRUCTION::JMuonSimplex::JMuonSimplex ( const JMuonSimplexParameters_t & parameters,
const JModuleRouter & router,
const int debug = 0 )
inline

Constructor.

Parameters
parametersparameters
routermodule router
debugdebug

Definition at line 82 of file JMuonSimplex.hh.

84 :
85 JMuonSimplexParameters_t(parameters),
86 JRegressor_t(parameters.sigma_ns),
88 {
89 using namespace JFIT;
90
91 this->estimator.reset(new JMEstimatorLorentzian());
92
93 JRegressor_t::debug = debug;
94 JRegressor_t::MAXIMUM_ITERATIONS = NMax;
95 }
int debug
debug level
Definition JSirene.cc:69
Auxiliary classes and methods for linear and iterative data regression.
Definition JEnergy.hh:15
Lorentzian M-estimator.
JRegressor< JLine3Z, JSimplex > JRegressor_t
const JModuleRouter & router

Member Function Documentation

◆ operator()() [1/2]

JEvt JRECONSTRUCTION::JMuonSimplex::operator() ( const KM3NETDAQ::JDAQEvent & event,
const JEvt & in )
inline

Fit function.

Parameters
eventevent
instart values
Returns
fit results

Definition at line 105 of file JMuonSimplex.hh.

106 {
107 using namespace std;
108 using namespace JFIT;
109 using namespace JTRIGGER;
110
111 const JBuildL0<hit_type> buildL0;
113
114 buffer_type dataL0;
115 buffer_type dataL1;
116
117 const KM3NETDAQ::JDAQTimeslice timeslice(event, true);
118 JSuperFrame2D<JHit> buffer;
119
120 for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
121
122 if (router.hasModule(i->getModuleID())) {
123
124 buffer(*i, router.getModule(i->getModuleID()));
125
126 if (useL0) {
127 buildL0(buffer, back_inserter(dataL0));
128 }
129 {
130 buildL2(buffer, back_inserter(dataL1));
131 }
132 }
133 }
134
135 return (*this)(dataL0, dataL1, in);
136 }
bool hasModule(const JObjectID &id) const
Has module.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Template L0 hit builder.
Definition JBuildL0.hh:38
Template L2 builder.
Definition JBuildL2.hh:49
2-dimensional frame with time calibrated data from one optical module.
Auxiliary classes and methods for triggering.
double TMaxLocal_ns
time window for local coincidences [ns]
double ctMin
minimal cosine space angle between PMT axes
Data structure for L2 parameters.

◆ operator()() [2/2]

JEvt JRECONSTRUCTION::JMuonSimplex::operator() ( const buffer_type & dataL0,
const buffer_type & dataL1,
const JEvt & in )
inline

Fit function.

Parameters
dataL0L0 hit data
dataL1L1 hit data
instart values
Returns
fit results

Definition at line 147 of file JMuonSimplex.hh.

150 {
151 using namespace std;
152 using namespace JFIT;
153 using namespace JGEOMETRY3D;
154 using namespace JLANG;
155
156 JEvt out;
157
159
160 data.reserve(dataL0.size() +
161 dataL1.size());
162
163
164 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
165
166 const JRotation3D R (getDirection(*track));
167 const JLine1Z tz(getPosition (*track).rotate(R), track->getT());
169
170 data.clear();
171
172 for (buffer_type::const_iterator i = dataL1.begin(); i != dataL1.end(); ++i) {
173
174 hit_type hit(*i);
175
176 hit.rotate(R);
177
178 if (match(hit)) {
179 data.push_back(hit);
180 }
181 }
182
183 if (useL0) {
184
185 buffer_type::iterator __end = data.end();
186
187 for (buffer_type::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
188
189 if (find_if(data.begin(), __end, make_predicate(&hit_type::getModuleID, i->getModuleID())) == __end) {
190
191 hit_type hit(*i);
192
193 hit.rotate(R);
194
195 if (match(hit)) {
196 data.push_back(hit);
197 }
198 }
199 }
200 }
201
202
203 this->step.resize(5);
204
205 this->step[0] = JLine3Z(JLine1Z(JVector3D(0.5, 0.0, 0.0), 0.0));
206 this->step[1] = JLine3Z(JLine1Z(JVector3D(0.0, 0.5, 0.0), 0.0));
207 this->step[2] = JLine3Z(JLine1Z(JVector3D(0.0, 0.0, 0.0), 1.0));
208 this->step[3] = JLine3Z(JLine1Z(JVector3D(), 0.0), JVersor3Z(0.005, 0.0));
209 this->step[4] = JLine3Z(JLine1Z(JVector3D(), 0.0), JVersor3Z(0.0, 0.005));
210
211 const int NDF = getCount(data.begin(), data.end()) - this->step.size();
212
213 if (NDF > 0) {
214
215 const double chi2 = (*this)(JLine3Z(tz), data.begin(), data.end());
216
217 JTrack3D tb(this->value);
218
219 tb.rotate_back(R);
220
221 out.push_back(getFit(JHistory(track->getHistory()).add(JMUONSIMPLEX), tb, getQuality(chi2, NDF), NDF));
222
223 out.rbegin()->setW(track->getW());
224 }
225 }
226
227 return out;
228 }
Data structure for fit of straight line paralel to z-axis.
Definition JLine1Z.hh:29
Data structure for fit of straight line in positive z-direction.
Definition JLine3Z.hh:40
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Data structure for vector in three dimensions.
Definition JVector3D.hh:36
Data structure for normalised vector in positive z-direction.
Definition JVersor3Z.hh:41
int getModuleID() const
Get module identifier.
static const int JMUONSIMPLEX
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition JAngle3D.hh:19
Auxiliary classes and methods for language specific functionality.
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
JPosition3D getPosition(const JFit &fit)
Get position.
JFIT::JHistory JHistory
Definition JHistory.hh:354
JFit getFit(const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
Get fit.
JDirection3D getDirection(const JFit &fit)
Get direction.
Acoustic event fit.
Model for fit to acoustics data.
Acoustic hit.
Definition JBillabong.cc:70
JHistory & add(const int type)
Add event to history.
Definition JHistory.hh:295
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]

◆ reset()

void JRECONSTRUCTION::JMuonSimplexParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 39 of file JMuonSimplexParameters_t.hh.

40 {
41 sigma_ns = 3;
42 useL0 = true;
44 TMaxLocal_ns = 15.0;
45 ctMin = 0.0;
46 roadWidth_m = 200.0;
47 TMin_ns = -50.0;
48 TMax_ns = +50.0;
49 NMax = 1000;
50 reprocess = false;
51 }

◆ equals()

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

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 59 of file JMuonSimplexParameters_t.hh.

60 {
61 return (this->sigma_ns == parameters.sigma_ns &&
62 this->useL0 == parameters.useL0 &&
63 this->numberOfPrefits == parameters.numberOfPrefits &&
64 this->TMaxLocal_ns == parameters.TMaxLocal_ns &&
65 this->ctMin == parameters.ctMin &&
66 this->roadWidth_m == parameters.roadWidth_m &&
67 this->TMin_ns == parameters.TMin_ns &&
68 this->TMax_ns == parameters.TMax_ns &&
69 this->NMax == parameters.NMax &&
70 this->reprocess == parameters.reprocess);
71 }

◆ ClassDef()

JRECONSTRUCTION::JMuonSimplexParameters_t::ClassDef ( JMuonSimplexParameters_t ,
2  )
inherited

Member Data Documentation

◆ router

const JModuleRouter& JRECONSTRUCTION::JMuonSimplex::router

Definition at line 231 of file JMuonSimplex.hh.

◆ sigma_ns

double JRECONSTRUCTION::JMuonSimplexParameters_t::sigma_ns
inherited

time resolution [ns]

Definition at line 75 of file JMuonSimplexParameters_t.hh.

◆ useL0

bool JRECONSTRUCTION::JMuonSimplexParameters_t::useL0
inherited

option for L0 hit use

Definition at line 76 of file JMuonSimplexParameters_t.hh.

◆ numberOfPrefits

size_t JRECONSTRUCTION::JMuonSimplexParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 77 of file JMuonSimplexParameters_t.hh.

◆ TMaxLocal_ns

double JRECONSTRUCTION::JMuonSimplexParameters_t::TMaxLocal_ns
inherited

time window for local coincidences [ns]

Definition at line 78 of file JMuonSimplexParameters_t.hh.

◆ ctMin

double JRECONSTRUCTION::JMuonSimplexParameters_t::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 79 of file JMuonSimplexParameters_t.hh.

◆ roadWidth_m

double JRECONSTRUCTION::JMuonSimplexParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 80 of file JMuonSimplexParameters_t.hh.

◆ TMin_ns

double JRECONSTRUCTION::JMuonSimplexParameters_t::TMin_ns
inherited

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

Definition at line 81 of file JMuonSimplexParameters_t.hh.

◆ TMax_ns

double JRECONSTRUCTION::JMuonSimplexParameters_t::TMax_ns
inherited

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

Definition at line 82 of file JMuonSimplexParameters_t.hh.

◆ NMax

int JRECONSTRUCTION::JMuonSimplexParameters_t::NMax
inherited

maximum number of iterations

Definition at line 83 of file JMuonSimplexParameters_t.hh.

◆ reprocess

bool JRECONSTRUCTION::JMuonSimplexParameters_t::reprocess
inherited

reprocess

Definition at line 84 of file JMuonSimplexParameters_t.hh.


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