Jpp  15.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions
JRECONSTRUCTION Namespace Reference

Model fits to data. More...

Classes

struct  JQualitySorter
 General purpose sorter of fit results. More...
 
class  JPointing
 Auxiliary class to compare fit results with respect to a reference direction (e.g. true muon). More...
 
class  JPosition
 Auxiliary class to compare fit results with respect to a reference position (e.g. true muon). More...
 
class  JShowerEnergy
 
class  JAtmosphericMuon
 Auxiliary class to evaluate atmospheric muon hypothesis. More...
 
class  JHitW0
 Auxiliary class for a hit with background rate value. More...
 
struct  JMuonEnergyParameters_t
 Data structure for fit parameters. More...
 
struct  JMuonGandalf
 Wrapper class to make final fit of muon trajectory. More...
 
struct  JMuonGandalfParameters_t
 Data structure for fit parameters. More...
 
struct  JMuonParameters
 Muon reconstruction parameters. More...
 
struct  JMuonPrefit
 Wrapper class to make pre-fit of muon trajectory. More...
 
struct  JMuonPrefitParameters_t
 Data structure for fit parameters. More...
 
struct  JMuonSimplex
 Wrapper class to make intermediate fit of muon trajectory. More...
 
struct  JMuonSimplexParameters_t
 Data structure for fit parameters. More...
 
struct  JMuonStartParameters_t
 Data structure for fit parameters. More...
 
class  JShowerBjorkenY
 class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerBjorkenYParameters_t
 Data structure for fit parameters. More...
 
class  JShowerDirectionPrefit
 class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerDirectionPrefitParameters_t
 Data structure for fit parameters. More...
 
class  JShowerEnergyPrefit
 class to handle the third step of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerEnergyPrefitParameters_t
 Data structure for fit parameters. More...
 
class  JShowerFit
 class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerFitParameters_t
 Data structure for fit parameters. More...
 
struct  JShowerParameters
 Shower reconstruction parameters. More...
 
class  JShowerPointSimplex
 class to handle the second position fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerPointSimplexParameters_t
 
class  JShowerPositionFit
 class to handle the second position fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerPositionFitParameters_t
 
class  JShowerPrefit
 class to handle first step of the shower reconstruction in ORCA: it reconstructs the shower vertex, intended as the shower brightest point, as the barycenter of the hits More...
 
struct  JShowerPrefitParameters_t
 Data structure for fit parameters. More...
 
struct  JStart
 Auxiliary class for start or end point evaluation. More...
 

Typedefs

typedef JFIT::JFit JFit
 
typedef JFIT::JEvt JEvt
 
typedef JFIT::JEvent JEvent
 
typedef JFIT::JHistory JHistory
 

Functions

JPosition3D getPosition (const JFit &fit)
 Get position. More...
 
JDirection3D getDirection (const JFit &fit)
 Get direction. More...
 
JAxis3D getAxis (const JFit &fit)
 Get axis. More...
 
JTrack3E getTrack (const JFit &fit)
 Get track. More...
 
JFit getFit (const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=0)
 Get fit. More...
 
JFit getFit (const JHistory &history, const JLine1Z &track, const JAngle3D &angle, const double Q, const int NDF, const double energy=0.0, const int status=0)
 Get fit. More...
 
double getDot (const JFit &first, const JFit &second)
 Get dot product. More...
 
double getDot (const JFit &fit, const JDirection3D &dir)
 Get dot product. More...
 
double getQuality (const double chi2, const int N, const int NDF)
 Get quality of fit. More...
 
double getQuality (const double chi2, const int NDF)
 Get quality of fit. More...
 
double getQuality (const double chi2)
 Get quality of fit. More...
 
bool qualitySorter (const JFit &first, const JFit &second)
 Comparison of fit results. More...
 
bool has_history (const JFit &fit, const int type)
 Test whether given fit has specified history. More...
 
bool has_history (const JFit &fit, const JRange< int > &range)
 Test whether given fit has specified history. More...
 
bool has_muon_prefit (const JFit &fit)
 Test whether given fit has muon prefit in history. More...
 
bool has_muon_simplex (const JFit &fit)
 Test whether given fit has muon simplex in history. More...
 
bool has_muon_gandalf (const JFit &fit)
 Test whether given fit has muon gandalf in history. More...
 
bool has_muon_energy (const JFit &fit)
 Test whether given fit has muon energy in history. More...
 
bool has_muon_start (const JFit &fit)
 Test whether given fit has muon start in history. More...
 
bool has_muon_fit (const JFit &fit)
 Test whether given fit has muon fit in history. More...
 
bool has_shower_prefit (const JFit &fit)
 Test whether given fit has shower prefit in history. More...
 
bool has_shower_positionfit (const JFit &fit)
 Test whether given fit has shower position fit in history. More...
 
bool has_shower_completefit (const JFit &fit)
 Test whether given fit has shower complete fit in history. More...
 
bool has_shower_fit (const JFit &fit)
 Test whether given fit has shower fit in history. More...
 
template<class JTrackSelector_t >
bool has_reconstructed_track (const JEvt &evt, JTrackSelector_t selector)
 Test whether given event has a track according selection. More...
 
bool has_reconstructed_muon (const JEvt &evt)
 Test whether given event has a track with muon reconstruction. More...
 
bool has_reconstructed_shower (const JEvt &evt)
 Test whether given event has a track with shower reconstruction. More...
 
template<class JTrackSelector_t , class JQualitySorter_t >
const JFitget_best_reconstructed_track (const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
 Get best reconstructed track. More...
 
const JFitget_best_reconstructed_muon (const JEvt &evt)
 Get best reconstructed muon. More...
 
const JFitget_best_reconstructed_shower (const JEvt &evt)
 Get best reconstructed shower. More...
 

Detailed Description

Model fits to data.

Author
mdejong
mdejong, gmaggi
gmaggi
adomi
adomi, gmaggi

Typedef Documentation

Definition at line 453 of file JReconstruction/JEvt.hh.

Definition at line 454 of file JReconstruction/JEvt.hh.

Definition at line 282 of file JHistory.hh.

Definition at line 283 of file JHistory.hh.

Function Documentation

JPosition3D JRECONSTRUCTION::getPosition ( const JFit &  fit)
inline

Get position.

Parameters
fitfit
Returns
position

Definition at line 70 of file JReconstruction/JEvtToolkit.hh.

71  {
72  return JPosition3D(fit.getX(), fit.getY(), fit.getZ());
73  }
JDirection3D JRECONSTRUCTION::getDirection ( const JFit &  fit)
inline

Get direction.

Parameters
fitfit
Returns
direction

Definition at line 82 of file JReconstruction/JEvtToolkit.hh.

83  {
84  return JDirection3D(fit.getDX(), fit.getDY(), fit.getDZ());
85  }
JAxis3D JRECONSTRUCTION::getAxis ( const JFit &  fit)
inline

Get axis.

Parameters
fitfit
Returns
axis

Definition at line 94 of file JReconstruction/JEvtToolkit.hh.

95  {
96  return JAxis3D(getPosition(fit), getDirection(fit));
97  }
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
JTrack3E JRECONSTRUCTION::getTrack ( const JFit &  fit)
inline

Get track.

Parameters
fitfit
Returns
track

Definition at line 106 of file JReconstruction/JEvtToolkit.hh.

107  {
108  return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
109  }
JAxis3D getAxis(const Trk &track)
Get axis.
JFit JRECONSTRUCTION::getFit ( const JHistory history,
const JTrack3D &  track,
const double  Q,
const int  NDF,
const double  energy = 0.0,
const int  status = 0 
)
inline

Get fit.

Parameters
historyhistory
tracktrack
Qquality
NDFnumber of degrees of freedom
energyEnergy, which would be set as 0, if the fit does not reconstruct energy
statusstatus of the fit as defined in enum JFitStatus.hh
Returns
fit

Definition at line 123 of file JReconstruction/JEvtToolkit.hh.

129  {
130  return JFit(history,
131  track.getX(), track.getY(), track.getZ(),
132  track.getDX(), track.getDY(), track.getDZ(),
133  track.getT(),
134  Q, NDF,
135  energy, status);
136  }
Q(UTCMax_s-UTCMin_s)-livetime_s
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
JFit JRECONSTRUCTION::getFit ( const JHistory history,
const JLine1Z &  track,
const JAngle3D &  angle,
const double  Q,
const int  NDF,
const double  energy = 0.0,
const int  status = 0 
)
inline

Get fit.

Parameters
historyhistory
tracktrack
angleangle
Qquality
NDFnumber of degrees of freedom
energyEnergy, which would be set as 0, if the fit does not reconstruct energy
statusstatus of the fit as defined in JFitStatus.hh
Returns
fit

Definition at line 151 of file JReconstruction/JEvtToolkit.hh.

158  {
159  return JFit(history,
160  track.getX(), track.getY(), track.getZ(),
161  angle.getDX(), angle.getDY(), angle.getDZ(),
162  track.getT(),
163  Q, NDF,
164  energy, status);
165  }
Q(UTCMax_s-UTCMin_s)-livetime_s
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
double JRECONSTRUCTION::getDot ( const JFit &  first,
const JFit &  second 
)
inline

Get dot product.

Parameters
firstfirst fit
secondsecond fit
Returns
dot product

Definition at line 175 of file JReconstruction/JEvtToolkit.hh.

176  {
177  return JMATH::getDot(getDirection(first), getDirection(second));
178  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
JDirection3D getDirection(const Vec &dir)
Get direction.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
double JRECONSTRUCTION::getDot ( const JFit &  fit,
const JDirection3D &  dir 
)
inline

Get dot product.

Parameters
fitfit
dirdirection
Returns
dot product

Definition at line 188 of file JReconstruction/JEvtToolkit.hh.

189  {
190  return JMATH::getDot(getDirection(fit), dir);
191  }
JDirection3D getDirection(const Vec &dir)
Get direction.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
double JRECONSTRUCTION::getQuality ( const double  chi2,
const int  N,
const int  NDF 
)
inline

Get quality of fit.


The larger the quality, the better the fit.

Parameters
chi2chi2
Nnumber of hits
NDFnumber of degrees of freedom
Returns
quality

Definition at line 203 of file JReconstruction/JEvtToolkit.hh.

204  {
205  return N - 0.25 * chi2 / NDF;
206  }
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
double JRECONSTRUCTION::getQuality ( const double  chi2,
const int  NDF 
)
inline

Get quality of fit.


The larger the quality, the better the fit.

Parameters
chi2chi2
NDFnumber of degrees of freedom
Returns
quality

Definition at line 217 of file JReconstruction/JEvtToolkit.hh.

218  {
219  return NDF - 0.25 * chi2 / NDF;
220  }
double JRECONSTRUCTION::getQuality ( const double  chi2)
inline

Get quality of fit.


The larger the quality, the better the fit.

Parameters
chi2chi2
Returns
quality

Definition at line 230 of file JReconstruction/JEvtToolkit.hh.

231  {
232  return -chi2;
233  }
bool JRECONSTRUCTION::qualitySorter ( const JFit &  first,
const JFit &  second 
)
inline

Comparison of fit results.

Parameters
firstfirst fit
secondsecond fit
Returns
true if first fit has better quality than second; else false

Definition at line 243 of file JReconstruction/JEvtToolkit.hh.

244  {
245  if (first.getHistory().size() == second.getHistory().size())
246  return first.getQ() > second.getQ();
247  else
248  return first.getHistory().size() > second.getHistory().size();
249  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
bool JRECONSTRUCTION::has_history ( const JFit &  fit,
const int  type 
)
inline

Test whether given fit has specified history.

Parameters
fitfit
typeapplication type
Returns
true if type in history; else false

Definition at line 282 of file JReconstruction/JEvtToolkit.hh.

283  {
284  return std::find_if(fit.getHistory().begin(),
285  fit.getHistory().end(),
286  JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
287  }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
int type
Definition: JProperties.cc:16
bool JRECONSTRUCTION::has_history ( const JFit &  fit,
const JRange< int > &  range 
)
inline

Test whether given fit has specified history.

Parameters
fitfit
rangeapplication type range
Returns
true if type in history; else false

Definition at line 297 of file JReconstruction/JEvtToolkit.hh.

298  {
299  return std::find_if(fit.getHistory().begin(),
300  fit.getHistory().end(),
301  JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
302  }
int type
Definition: JProperties.cc:16
JFind_if< JResult_t T::*, JPredicate_t > make_find_if(JResult_t T::*member, const JPredicate_t &predicate)
Helper method to create find_if for data member.
Definition: JFind_if.hh:119
bool JRECONSTRUCTION::has_muon_prefit ( const JFit &  fit)
inline

Test whether given fit has muon prefit in history.

Parameters
fitfit
Returns
true if muon prefit in history; else false

Definition at line 311 of file JReconstruction/JEvtToolkit.hh.

312  {
313  return has_history(fit, JMUONPREFIT);
314  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JMUONPREFIT
bool JRECONSTRUCTION::has_muon_simplex ( const JFit &  fit)
inline

Test whether given fit has muon simplex in history.

Parameters
fitfit
Returns
true if muon simplex in history; else false

Definition at line 323 of file JReconstruction/JEvtToolkit.hh.

324  {
325  return has_history(fit, JMUONSIMPLEX);
326  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JMUONSIMPLEX
bool JRECONSTRUCTION::has_muon_gandalf ( const JFit &  fit)
inline

Test whether given fit has muon gandalf in history.

Parameters
fitfit
Returns
true if muon gandalf in history; else false

Definition at line 335 of file JReconstruction/JEvtToolkit.hh.

336  {
337  return has_history(fit, JMUONGANDALF);
338  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JMUONGANDALF
bool JRECONSTRUCTION::has_muon_energy ( const JFit &  fit)
inline

Test whether given fit has muon energy in history.

Parameters
fitfit
Returns
true if muon energy in history; else false

Definition at line 347 of file JReconstruction/JEvtToolkit.hh.

348  {
349  return has_history(fit, JMUONENERGY);
350  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JMUONENERGY
bool JRECONSTRUCTION::has_muon_start ( const JFit &  fit)
inline

Test whether given fit has muon start in history.

Parameters
fitfit
Returns
true if muon start in history; else false

Definition at line 359 of file JReconstruction/JEvtToolkit.hh.

360  {
361  return has_history(fit, JMUONSTART);
362  }
static const int JMUONSTART
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
bool JRECONSTRUCTION::has_muon_fit ( const JFit &  fit)
inline

Test whether given fit has muon fit in history.

Parameters
fitfit
Returns
true if muon fit in history; else false

Definition at line 371 of file JReconstruction/JEvtToolkit.hh.

372  {
373  return has_history(fit, JRange<int>(JMUONBEGIN, JMUONEND));
374  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JMUONBEGIN
begin range of reconstruction stages
static const int JMUONEND
end range of reconstruction stages
bool JRECONSTRUCTION::has_shower_prefit ( const JFit &  fit)
inline

Test whether given fit has shower prefit in history.

Parameters
fitfit
Returns
true if shower prefit in history; else false

Definition at line 383 of file JReconstruction/JEvtToolkit.hh.

384  {
385  return has_history(fit, JSHOWERPREFIT);
386  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JSHOWERPREFIT
bool JRECONSTRUCTION::has_shower_positionfit ( const JFit &  fit)
inline

Test whether given fit has shower position fit in history.

Parameters
fitfit
Returns
true if shower position fit in history; else false

Definition at line 395 of file JReconstruction/JEvtToolkit.hh.

396  {
397  return has_history(fit, JSHOWERPOSITIONFIT);
398  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JSHOWERPOSITIONFIT
bool JRECONSTRUCTION::has_shower_completefit ( const JFit &  fit)
inline

Test whether given fit has shower complete fit in history.

Parameters
fitfit
Returns
true if shower complete fit in history; else false

Definition at line 407 of file JReconstruction/JEvtToolkit.hh.

408  {
409  return has_history(fit, JSHOWERCOMPLETEFIT);
410  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JSHOWERCOMPLETEFIT
bool JRECONSTRUCTION::has_shower_fit ( const JFit &  fit)
inline

Test whether given fit has shower fit in history.

Parameters
fitfit
Returns
true if shower fit in history; else false

Definition at line 419 of file JReconstruction/JEvtToolkit.hh.

420  {
421  return has_history(fit, JRange<int>(JSHOWERBEGIN, JSHOWEREND));
422  }
static const int JSHOWEREND
end range of reconstruction stages
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
static const int JSHOWERBEGIN
begin range of reconstruction stages
template<class JTrackSelector_t >
bool JRECONSTRUCTION::has_reconstructed_track ( const JEvt evt,
JTrackSelector_t  selector 
)
inline

Test whether given event has a track according selection.


The track selector corresponds to the function operator bool selector(const Trk&);.

Parameters
evtevent
selectortrack selector
Returns
true if at least one corresponding track; else false

Definition at line 434 of file JReconstruction/JEvtToolkit.hh.

435  {
436  return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
437  }
bool JRECONSTRUCTION::has_reconstructed_muon ( const JEvt evt)
inline

Test whether given event has a track with muon reconstruction.

Parameters
evtevent
Returns
true if at least one reconstructed muon; else false

Definition at line 446 of file JReconstruction/JEvtToolkit.hh.

447  {
449  }
bool has_muon_fit(const JFit &fit)
Test whether given fit has muon fit in history.
bool has_reconstructed_track(const JEvt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
bool JRECONSTRUCTION::has_reconstructed_shower ( const JEvt evt)
inline

Test whether given event has a track with shower reconstruction.

Parameters
evtevent
Returns
true if at least one reconstructed shower; else false

Definition at line 458 of file JReconstruction/JEvtToolkit.hh.

459  {
461  }
bool has_shower_fit(const Trk &track)
Test whether given track has default shower fit in history.
bool has_reconstructed_track(const JEvt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
template<class JTrackSelector_t , class JQualitySorter_t >
const JFit& JRECONSTRUCTION::get_best_reconstructed_track ( const JEvt evt,
JTrackSelector_t  selector,
JQualitySorter_t  comparator 
)
inline

Get best reconstructed track.


The track selector corresponds to the function operator bool selector(const Trk&); and the track comparator to bool comprator(const Trk&, const Trk&);.

Parameters
evtevent
selectortrack selector
comparatortrack comparator
Returns
track

Definition at line 475 of file JReconstruction/JEvtToolkit.hh.

478  {
479  JEvt::const_iterator p = std::find_if(evt.begin(), evt.begin(), selector);
480 
481  for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
482  if (selector(*i) && comparator(*i, *p)) {
483  p = i;
484  }
485  }
486 
487  if (p != evt.end())
488  return *p;
489  else
490  THROW(JIndexOutOfRange, "This event has no fit with given selector.");
491  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
const JFit& JRECONSTRUCTION::get_best_reconstructed_muon ( const JEvt evt)
inline

Get best reconstructed muon.

Parameters
evtevent
Returns
track

Definition at line 500 of file JReconstruction/JEvtToolkit.hh.

501  {
503  }
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
bool has_muon_fit(const JFit &fit)
Test whether given fit has muon fit in history.
const JFit & get_best_reconstructed_track(const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.
const JFit& JRECONSTRUCTION::get_best_reconstructed_shower ( const JEvt evt)
inline

Get best reconstructed shower.

Parameters
evtevent
Returns
track

Definition at line 512 of file JReconstruction/JEvtToolkit.hh.

513  {
515  }
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
bool has_shower_fit(const Trk &track)
Test whether given track has default shower fit in history.
const JFit & get_best_reconstructed_track(const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.