Jpp 20.0.0-195-g190c9e876
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 JPMTParametersMap &pmtParameters, 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

const JPMTParametersMappmtParameters
 
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 JPMTParametersMap & pmtParameters,
const int debug = 0 )
inline

Parameterized constructor.

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

Definition at line 131 of file JShowerPositionFit.hh.

134 :
136 JRegressor_t(storage),
138 {
139 using namespace JPP;
140
141 JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
142 JRegressor_t::Vmax_npe = VMax_npe;
143 JRegressor_t::MAXIMUM_ITERATIONS = NMax;
144 JRegressor_t::EPSILON = 1e-3;
145 JRegressor_t::debug = debug;
146
147 if (Emin_GeV > Emax_GeV || En <= 1) {
148 THROW(JException, "Invalid energy input " << Emin_GeV << ' ' << Emax_GeV << ' ' << En);
149 }
150
151 const double base = std::pow((Emax_GeV / Emin_GeV), 1.0 / (En - 1));
152
153 for (int i = 0; i != En; ++i) {
154 Ev.push_back(Emin_GeV * std::pow(base, i));
155 }
156
157 this->parameters.resize(5);
158
159 this->parameters[0] = JPoint4E::pX();
160 this->parameters[1] = JPoint4E::pY();
161 this->parameters[2] = JPoint4E::pZ();
162 this->parameters[3] = JPoint4E::pT();
163 this->parameters[4] = JPoint4E::pE();
164 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
int debug
debug level
Definition JSirene.cc:74
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
const JPMTParametersMap & pmtParameters
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 176 of file JShowerPositionFit.hh.

181 {
182 using namespace std;
183 using namespace JPP;
184 using namespace JTRIGGER;
185
186 const JBuildL0<JHitL0> buildL0;
187
188 input_type input(event.getDAQEventHeader(), in, coverage);
189
191
192 buildL0(JDAQTimeslice(event, true), router, back_inserter(data));
193
194 for (const auto& hit : data) {
195
196 const JPMTIdentifier id(hit.getModuleID(), hit.getPMTAddress());
197
199
200 const int type = wip.getType();
201 const double QE = wip.QE;
202 const double R_Hz = summary.getRate(hit.getPMTIdentifier(), this->R_Hz);
203
204 input.data.push_back(hit_type(hit, type, QE, R_Hz));
205 }
206
207 return input;
208 }
const JPMTParameters & getPMTParameters(const JPMTIdentifier &id) const
Get PMT parameters.
Data structure for PMT parameters.
double QE
relative quantum efficiency
int getType() const
Get type for for time-slewing correction.
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 215 of file JShowerPositionFit.hh.

215 {
216
217 using namespace std;
218 using namespace JFIT;
219 using namespace JGEOMETRY3D;
220
222 JEvt out;
223
224 const buffer_type& data = input.data;
225
226 // select start values
227
228 JEvt in = input.in;
229
230 in.select(numberOfPrefits, qualitySorter);
231
232 if (!in.empty()) {
233 in.select(JHistory::is_event(in.begin()->getHistory()));
234 }
235
236 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
237
238 JPoint4D vx(getPosition(*shower), shower->getT());
239
240 const JFIT::JModel<JPoint4D> match(vx, DMax_m, JRegressor_t::T_ns);
241
242 buffer_type buffer;
243
244 for (buffer_type::const_iterator i = data.begin(); i != data.end(); ++i) {
245
246 if (match(*i)) {
247 buffer.push_back(*i);
248 }
249 }
250
251 // select first hit
252
253 sort(buffer.begin(), buffer.end(), JHitL0::compare);
254
255 vector<hit_type>::iterator __end = unique(buffer.begin(), buffer.end(), equal_to<JDAQPMTIdentifier>());
256
257 const int NDF = distance(buffer.begin(), __end) - this->parameters.size();
258
259 if (NDF > 0) {
260
261 // set fit parameters
262 for (vector<double>::iterator e = Ev.begin(); e != Ev.end(); ++e) {
263
264 JPoint4E sh(vx, *e);
265
266 double chi2 = (*this)(sh, buffer.begin(), __end);
267
268 JShower3D result(JVertex3D(this->value.getPosition(), this->value.getT()), JDirection3D());
269
270 out.push_back(getFit(JHistory(shower->getHistory(), event()), result, getQuality(chi2), NDF, this->value.getE()));
271
272 // set additional values
273 out.rbegin()->setW(JPP_COVERAGE_ORIENTATION, input.coverage.orientation);
274 out.rbegin()->setW(JPP_COVERAGE_POSITION, input.coverage.position);
275
276 }
277 }
278 }
279
280 // apply default sorter
281
282 sort(out.begin(), out.end(), qualitySorter);
283
284 copy(input.in.begin(), input.in.end(), back_inserter(out));
285
286 return out;
287 }
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 of this event
static const int JPP_COVERAGE_ORIENTATION
coverage of dynamic orientation calibration of this event
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 89 of file JShowerPositionFit.hh.

◆ pmtParameters

const JPMTParametersMap& JRECONSTRUCTION::JShowerPositionFit::pmtParameters

Definition at line 289 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: