Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION::JShowerPointSimplex Class Reference

class to handle the second position fit of the shower reconstruction, mainly dedicated for ORCA More...

#include <JShowerPointSimplex.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerPointSimplex:
JRECONSTRUCTION::JShowerPointSimplexParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Classes

struct  input_type
 Input data type. More...
 

Public Types

typedef JRegressor< JPoint4D, JGandalfJRegressor_t
 
typedef JTRIGGER::JHitR1 hit_type
 
typedef std::vector< hit_typebuffer_type
 

Public Member Functions

 JShowerPointSimplex (const JShowerPointSimplexParameters_t &parameters, const int debug=0)
 Parameterized constructor.
 
input_type getInput (const JModuleRouter &router, const KM3NETDAQ::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 JShowerPointSimplexParameters_t &parameters) const
 Equality.
 
 ClassDef (JShowerPointSimplexParameters_t, 2)
 

Public Attributes

size_t numberOfPrefits
 number of prefits
 
double sigma_ns
 time resolution [ns]
 
double TMaxLocal_ns
 time window for local coincidences [ns]
 
double TMax_ns
 maximum time for local coincidences [ns]
 
double TMin_ns
 minimum time for local coincidences [ns]
 
double DMax_m
 maximal distance to optical module [m]
 
double ctMin
 minimal cosine space angle between PMT axes
 
int mestimator
 m-estimator
 
int NMax
 maximum number of iterations
 

Detailed Description

class to handle the second position fit of the shower reconstruction, mainly dedicated for ORCA

Definition at line 73 of file JShowerPointSimplex.hh.

Member Typedef Documentation

◆ JRegressor_t

◆ hit_type

◆ buffer_type

Constructor & Destructor Documentation

◆ JShowerPointSimplex()

JRECONSTRUCTION::JShowerPointSimplex::JShowerPointSimplex ( const JShowerPointSimplexParameters_t & parameters,
const int debug = 0 )
inline

Parameterized constructor.

Parameters
parametersstruct that holds default-optimized parameters for the reconstruction.
debugdebug

Definition at line 125 of file JShowerPointSimplex.hh.

126 :
128 JRegressor_t(parameters.sigma_ns)
129 {
130 using namespace JPP;
131
132 JRegressor_t::debug = debug;
133 JRegressor_t::MAXIMUM_ITERATIONS = NMax;
134 JRegressor_t::EPSILON = 1e-4;
135
136 this->estimator.reset(getMEstimator(parameters.mestimator));
137 this->parameters.resize(4);
138 this->parameters[0] = JPoint4D::pX();
139 this->parameters[1] = JPoint4D::pY();
140 this->parameters[2] = JPoint4D::pZ();
141 this->parameters[3] = JPoint4D::pT();
142 }
int debug
debug level
Definition JSirene.cc:72
static parameter_type pT()
Definition JPoint4D.hh:61
static parameter_type pZ()
Definition JPoint4D.hh:60
static parameter_type pX()
Definition JPoint4D.hh:58
static parameter_type pY()
Definition JPoint4D.hh:59
JRegressor< JPoint4D, JGandalf > JRegressor_t
JMEstimator * getMEstimator(const int type)
Get M-Estimator.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).

Member Function Documentation

◆ getInput()

input_type JRECONSTRUCTION::JShowerPointSimplex::getInput ( const JModuleRouter & router,
const KM3NETDAQ::JDAQEvent & event,
const JEvt & in,
const coverage_type & coverage ) const
inline

Get input data.

Parameters
routermodule router
eventevent
instart values
coveragecoverage
Returns
input data

Definition at line 152 of file JShowerPointSimplex.hh.

153 {
154 using namespace std;
155 using namespace KM3NETDAQ;
156 using namespace JTRIGGER;
157 const JBuildL0<hit_type> buildL0;
159
160 input_type input(event.getDAQEventHeader(), in, coverage);
161
162 buffer_type& dataL0 = input.dataL0;
163 buffer_type& dataL1 = input.dataL1;
164
165 buildL0(JDAQTimeslice(event, true), router, back_inserter(dataL0));
166 buildL2(JDAQTimeslice(event, false), router, back_inserter(dataL1)); // false = triggered
167
168 return input;
169 }
Template L0 hit builder.
Definition JBuildL0.hh:38
Template L2 builder.
Definition JBuildL2.hh:49
const JDAQEventHeader & getDAQEventHeader() const
Get DAQ event header.
Auxiliary classes and methods for triggering.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
double TMaxLocal_ns
time window for local coincidences [ns]
double ctMin
minimal cosine space angle between PMT axes
Data structure for L2 parameters.

◆ operator()()

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

Fit function.

Parameters
inputinput data
Returns
fit results

Definition at line 177 of file JShowerPointSimplex.hh.

178 {
179 using namespace std;
180 using namespace JPP;
181
183
184 JEvt out;
185
186 const buffer_type& dataL0 = input.dataL0;
187 const buffer_type& dataL1 = input.dataL1;
188
189 // select start values
190
191 JEvt in = input.in;
192
193 in.select(numberOfPrefits, qualitySorter);
194
195 if (!in.empty()) {
196 in.select(JHistory::is_event(in.begin()->getHistory()));
197 }
198
199 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
200
201 JPoint4D vx(getPosition(*shower), shower->getT());
202
205
206 data.reserve(dataL0.size() + dataL1.size());
207 for (buffer_type::const_iterator i = dataL1.begin(); i != dataL1.end(); ++i) {
208
209 if (match(*i)) {
210 data.push_back(*i);
211 }
212 }
213
214 buffer_type::iterator __end = data.end();
215
216 for (buffer_type::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
217 if (find_if(data.begin(), __end, make_predicate(&hit_type::getModuleID, i->getModuleID())) == __end) {
218 if (match(*i)) {
219 data.push_back(*i);
220 }
221 }
222 }
223
224 const int NDF = getCount(data.begin(), data.end()) - this->parameters.size();
225
226 if (NDF > 0) {
227
228 double chi2 = (*this)(vx, data.begin(), data.end());
229
230 JShower3E sh_fit(this->value.getPosition(),
231 JDirection3D(),
232 this->value.getT(),
233 shower->getE());
234 out.push_back(getFit(JHistory(shower->getHistory(), event()), sh_fit, getQuality(chi2, NDF), NDF, sh_fit.getE()));
235 // set additional values
236
237 out.rbegin()->setW(JPP_COVERAGE_ORIENTATION, input.coverage.orientation);
238 out.rbegin()->setW(JPP_COVERAGE_POSITION, input.coverage.position);
239 }
240 }
241
242 // apply default sorter
243
244 sort(out.begin(), out.end(), qualitySorter);
245
246 copy(input.in.begin(), input.in.end(), back_inserter(out));
247
248 return out;
249 }
Data structure for vertex fit.
Definition JPoint4D.hh:24
Data structure for direction in three dimensions.
3D track with energy.
Definition JTrack3E.hh:32
int getModuleID() const
Get module identifier.
static const int JSHOWERPOINTSIMPLEX
static const int JPP_COVERAGE_POSITION
coverage of dynamic position calibration from any Jpp application
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration from any Jpp application
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition JHead.cc:163
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
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:405
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
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.
Acoustic event fit.
Auxiliary class to test history.
Definition JHistory.hh:136
Auxiliary class to match data points with given model.
double TMin_ns
minimum time for local coincidences [ns]
double TMax_ns
maximum time for local coincidences [ns]
double DMax_m
maximal distance to optical module [m]

◆ reset()

void JRECONSTRUCTION::JShowerPointSimplexParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 35 of file JShowerPointSimplexParameters_t.hh.

36 {
37 numberOfPrefits = 0; // 0 means process all inputs
38 sigma_ns = 1;
39 TMaxLocal_ns = 10;
40 TMax_ns = 60.0;
41 TMin_ns = -60.0;
42 DMax_m = 50.0;
43 ctMin = 0.2;
45 NMax = 1000;
46 }
@ EM_LORENTZIAN

◆ equals()

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

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 54 of file JShowerPointSimplexParameters_t.hh.

55 {
56 return (this->numberOfPrefits == parameters.numberOfPrefits &&
57 this->sigma_ns == parameters.sigma_ns &&
58 this->TMaxLocal_ns == parameters.TMaxLocal_ns &&
59 this->TMax_ns == parameters.TMax_ns &&
60 this->TMin_ns == parameters.TMin_ns &&
61 this->DMax_m == parameters.DMax_m &&
62 this->ctMin == parameters.ctMin &&
63 this->mestimator == parameters.mestimator &&
64 this->NMax == parameters.NMax
65 );
66 }

◆ ClassDef()

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

Member Data Documentation

◆ numberOfPrefits

size_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 70 of file JShowerPointSimplexParameters_t.hh.

◆ sigma_ns

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::sigma_ns
inherited

time resolution [ns]

Definition at line 71 of file JShowerPointSimplexParameters_t.hh.

◆ TMaxLocal_ns

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMaxLocal_ns
inherited

time window for local coincidences [ns]

Definition at line 72 of file JShowerPointSimplexParameters_t.hh.

◆ TMax_ns

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 73 of file JShowerPointSimplexParameters_t.hh.

◆ TMin_ns

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 74 of file JShowerPointSimplexParameters_t.hh.

◆ DMax_m

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::DMax_m
inherited

maximal distance to optical module [m]

Definition at line 75 of file JShowerPointSimplexParameters_t.hh.

◆ ctMin

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 76 of file JShowerPointSimplexParameters_t.hh.

◆ mestimator

int JRECONSTRUCTION::JShowerPointSimplexParameters_t::mestimator
inherited

m-estimator

Definition at line 77 of file JShowerPointSimplexParameters_t.hh.

◆ NMax

int JRECONSTRUCTION::JShowerPointSimplexParameters_t::NMax
inherited

maximum number of iterations

Definition at line 78 of file JShowerPointSimplexParameters_t.hh.


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