Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION::JShowerPositionFit Class Reference

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

#include <JShowerPositionFit.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerPositionFit:
JRECONSTRUCTION::JShowerPositionFitParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Classes

struct  input_type
 Input data type. More...
 

Public Member Functions

 JShowerPositionFit (const JShowerPositionFitParameters_t &parameters, const storage_type &storage, const int debug=0)
 Parameterized 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 JShowerPositionFitParameters_t &parameters) const
 Equality.
 
 ClassDef (JShowerPositionFitParameters_t, 2)
 

Public Attributes

size_t numberOfPrefits
 number of prefits
 
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 Emin_GeV
 minimum energy to scan
 
double Emax_GeV
 maximum energy to scan
 
int En
 number of points to scan in energy range
 
double R_Hz
 default rate [Hz]
 
double TTS_ns
 transition-time spread [ns]
 
double VMax_npe
 maximum number of of photo-electrons
 
int NMax
 maximum number of iterations
 

Private Types

typedef JHitW0 hit_type
 
typedef std::vector< hit_typebuffer_type
 
typedef JRegressor< JPoint4E, JGandalfJRegressor_t
 

Private Attributes

std::vector< double > Ev
 

Detailed Description

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

Definition at line 78 of file JShowerPositionFit.hh.

Member Typedef Documentation

◆ hit_type

◆ buffer_type

◆ JRegressor_t

Constructor & Destructor Documentation

◆ JShowerPositionFit()

JRECONSTRUCTION::JShowerPositionFit::JShowerPositionFit ( const JShowerPositionFitParameters_t & parameters,
const storage_type & storage,
const int debug = 0 )
inline

Parameterized constructor.

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

Definition at line 128 of file JShowerPositionFit.hh.

130 :
132 JRegressor_t(storage)
133 {
134 using namespace JPP;
135
136 JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
137 JRegressor_t::Vmax_npe = VMax_npe;
138 JRegressor_t::MAXIMUM_ITERATIONS = NMax;
139 JRegressor_t::EPSILON = 1e-3;
140 JRegressor_t::debug = debug;
141
142 if (Emin_GeV > Emax_GeV || En <= 1) {
143 THROW(JException, "Invalid energy input " << Emin_GeV << ' ' << Emax_GeV << ' ' << En);
144 }
145
146 const double base = std::pow((Emax_GeV / Emin_GeV), 1.0 / (En - 1));
147
148 for (int i = 0; i != En; ++i) {
149 Ev.push_back(Emin_GeV * std::pow(base, i));
150 }
151
152 this->parameters.resize(5);
153
154 this->parameters[0] = JPoint4E::pX();
155 this->parameters[1] = JPoint4E::pY();
156 this->parameters[2] = JPoint4E::pZ();
157 this->parameters[3] = JPoint4E::pT();
158 this->parameters[4] = JPoint4E::pE();
159 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
int debug
debug level
Definition JSirene.cc:72
static parameter_type pZ()
Definition JPoint4E.hh:71
static parameter_type pX()
Definition JPoint4E.hh:69
static parameter_type pY()
Definition JPoint4E.hh:70
static parameter_type pE()
Definition JPoint4E.hh:73
static parameter_type pT()
Definition JPoint4E.hh:72
General exception.
Definition JException.hh:24
JRegressor< JPoint4E, JGandalf > JRegressor_t
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double VMax_npe
maximum number of of photo-electrons
double TMin_ns
minimum time for local coincidences [ns]
double TMax_ns
maximum time for local coincidences [ns]

Member Function Documentation

◆ getInput()

input_type JRECONSTRUCTION::JShowerPositionFit::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 170 of file JShowerPositionFit.hh.

175 {
176 using namespace std;
177 using namespace JPP;
178 using namespace JTRIGGER;
179
180 const JBuildL0<JHitL0> buildL0;
181
182 input_type input(event.getDAQEventHeader(), in, coverage);
183
185 buildL0(JDAQTimeslice(event, true), router, back_inserter(data));
186
187 for (const auto& hit : data) {
188 input.data.push_back(hit_type(hit, summary.getRate(hit.getPMTIdentifier(), this->R_Hz)));
189 }
190 return input;
191 }
double getRate(const JDAQPMTIdentifier &id) const
Get rate.
Template L0 hit builder.
Definition JBuildL0.hh:38
const JDAQEventHeader & getDAQEventHeader() const
Get DAQ event header.
Auxiliary classes and methods for triggering.

◆ operator()()

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

Fit function.

Parameters
inputinput data
Returns
fit results

Definition at line 198 of file JShowerPositionFit.hh.

198 {
199
200 using namespace std;
201 using namespace JFIT;
202 using namespace JGEOMETRY3D;
203
205 JEvt out;
206
207 const buffer_type& data = input.data;
208
209 // select start values
210
211 JEvt in = input.in;
212
213 in.select(numberOfPrefits, qualitySorter);
214
215 if (!in.empty()) {
216 in.select(JHistory::is_event(in.begin()->getHistory()));
217 }
218
219 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
220
221 JPoint4D vx(getPosition(*shower), shower->getT());
222
223 const JFIT::JModel<JPoint4D> match(vx, DMax_m, JRegressor_t::T_ns);
224
225 buffer_type buffer;
226
227 for (buffer_type::const_iterator i = data.begin(); i != data.end(); ++i) {
228
229 if (match(*i)) {
230 buffer.push_back(*i);
231 }
232 }
233
234 // select first hit
235
236 sort(buffer.begin(), buffer.end(), JHitL0::compare);
237
238 vector<hit_type>::iterator __end = unique(buffer.begin(), buffer.end(), equal_to<JDAQPMTIdentifier>());
239
240 const int NDF = distance(buffer.begin(), __end) - this->parameters.size();
241
242 if (NDF > 0) {
243
244 // set fit parameters
245 for (vector<double>::iterator e = Ev.begin(); e != Ev.end(); ++e) {
246
247 JPoint4E sh(vx, *e);
248
249 double chi2 = (*this)(sh, buffer.begin(), __end);
250
251 JShower3D result(JVertex3D(this->value.getPosition(), this->value.getT()), JDirection3D());
252
253 out.push_back(getFit(JHistory(shower->getHistory(), event()), result, getQuality(chi2), NDF, this->value.getE()));
254
255 // set additional values
256 out.rbegin()->setW(JPP_COVERAGE_ORIENTATION, input.coverage.orientation);
257 out.rbegin()->setW(JPP_COVERAGE_POSITION, input.coverage.position);
258
259 }
260 }
261 }
262
263 // apply default sorter
264
265 sort(out.begin(), out.end(), qualitySorter);
266
267 copy(input.in.begin(), input.in.end(), back_inserter(out));
268
269 return out;
270 }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Data structure for vertex fit.
Definition JPoint4D.hh:24
Data structure for vertex fit.
Definition JPoint4E.hh:24
Data structure for direction in three dimensions.
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
Auxiliary classes and methods for linear and iterative data regression.
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition JAngle3D.hh:19
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:455
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.
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.
return result
Definition JPolint.hh:862
Acoustic event fit.
Auxiliary class to test history.
Definition JHistory.hh:157
Auxiliary class to match data points with given model.
double DMax_m
maximal distance to optical module [m]
Auxiliary data structure for sorting of hits.
Definition JHitL0.hh:85

◆ reset()

void JRECONSTRUCTION::JShowerPositionFitParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 32 of file JShowerPositionFitParameters_t.hh.

33 {
34 numberOfPrefits = 0; // process all inputs from PointSimplex, which should give a max of 100
35 TMax_ns = 100.0;
36 TMin_ns = -100.0;
37 DMax_m = 80.0;
38 R_Hz = 10000;
39 Emin_GeV = 1;
40 Emax_GeV = 200;
41 En = 10;
42 TTS_ns = 2;
43 VMax_npe = 20.0;
44 NMax = 1000;
45 }

◆ equals()

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

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 53 of file JShowerPositionFitParameters_t.hh.

54 {
55 return (this->numberOfPrefits == parameters.numberOfPrefits &&
56 this->TMax_ns == parameters.TMax_ns &&
57 this->TMin_ns == parameters.TMin_ns &&
58 this->DMax_m == parameters.DMax_m &&
59 this->R_Hz == parameters.R_Hz &&
60 this->TTS_ns == parameters.TTS_ns &&
61 this->Emin_GeV == parameters.Emin_GeV &&
62 this->Emax_GeV == parameters.Emax_GeV &&
63 this->En == parameters.En &&
64 this->VMax_npe == parameters.VMax_npe &&
65 this->NMax == parameters.NMax);
66 }

◆ ClassDef()

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

Member Data Documentation

◆ Ev

std::vector<double> JRECONSTRUCTION::JShowerPositionFit::Ev
private

Definition at line 88 of file JShowerPositionFit.hh.

◆ numberOfPrefits

size_t JRECONSTRUCTION::JShowerPositionFitParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 70 of file JShowerPositionFitParameters_t.hh.

◆ TMax_ns

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 71 of file JShowerPositionFitParameters_t.hh.

◆ TMin_ns

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 72 of file JShowerPositionFitParameters_t.hh.

◆ DMax_m

double JRECONSTRUCTION::JShowerPositionFitParameters_t::DMax_m
inherited

maximal distance to optical module [m]

Definition at line 73 of file JShowerPositionFitParameters_t.hh.

◆ Emin_GeV

double JRECONSTRUCTION::JShowerPositionFitParameters_t::Emin_GeV
inherited

minimum energy to scan

Definition at line 74 of file JShowerPositionFitParameters_t.hh.

◆ Emax_GeV

double JRECONSTRUCTION::JShowerPositionFitParameters_t::Emax_GeV
inherited

maximum energy to scan

Definition at line 75 of file JShowerPositionFitParameters_t.hh.

◆ En

int JRECONSTRUCTION::JShowerPositionFitParameters_t::En
inherited

number of points to scan in energy range

Definition at line 76 of file JShowerPositionFitParameters_t.hh.

◆ R_Hz

double JRECONSTRUCTION::JShowerPositionFitParameters_t::R_Hz
inherited

default rate [Hz]

Definition at line 77 of file JShowerPositionFitParameters_t.hh.

◆ TTS_ns

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TTS_ns
inherited

transition-time spread [ns]

Definition at line 78 of file JShowerPositionFitParameters_t.hh.

◆ VMax_npe

double JRECONSTRUCTION::JShowerPositionFitParameters_t::VMax_npe
inherited

maximum number of of photo-electrons

Definition at line 79 of file JShowerPositionFitParameters_t.hh.

◆ NMax

int JRECONSTRUCTION::JShowerPositionFitParameters_t::NMax
inherited

maximum number of iterations

Definition at line 80 of file JShowerPositionFitParameters_t.hh.


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