Jpp - 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...
 
struct  JHitL0Comparator
 Auxiliary class for permutations of L0 hits. More...
 
struct  JHitL1Comparator
 Auxiliary class for permutations of L1 hits. 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 386 of file JReconstruction/JEvt.hh.

Definition at line 387 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 76 of file JReconstruction/JEvtToolkit.hh.

77  {
78  return JPosition3D(fit.getX(), fit.getY(), fit.getZ());
79  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JDirection3D JRECONSTRUCTION::getDirection ( const JFit fit)
inline

Get direction.

Parameters
fitfit
Returns
direction

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

89  {
90  return JDirection3D(fit.getDX(), fit.getDY(), fit.getDZ());
91  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JAxis3D JRECONSTRUCTION::getAxis ( const JFit fit)
inline

Get axis.

Parameters
fitfit
Returns
axis

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

101  {
102  return JAxis3D(getPosition(fit), getDirection(fit));
103  }
Axis object.
Definition: JAxis3D.hh:38
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 112 of file JReconstruction/JEvtToolkit.hh.

113  {
114  return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
115  }
3D track with energy.
Definition: JTrack3E.hh:30
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 129 of file JReconstruction/JEvtToolkit.hh.

135  {
136  return JFit(history,
137  track.getX(), track.getY(), track.getZ(),
138  track.getDX(), track.getDY(), track.getDZ(),
139  track.getT(),
140  Q, NDF,
141  energy, status);
142  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition: JTrack3D.hh:126
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:42
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
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 157 of file JReconstruction/JEvtToolkit.hh.

164  {
165  return JFit(history,
166  track.getX(), track.getY(), track.getZ(),
167  angle.getDX(), angle.getDY(), angle.getDZ(),
168  track.getT(),
169  Q, NDF,
170  energy, status);
171  }
double getZ(const JPosition3D &pos) const
Get point of emission of Cherenkov light along muon path.
Definition: JLine1Z.hh:134
double getY() const
Get y position.
Definition: JVector3D.hh:104
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:42
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition: JLine1Z.hh:114
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getDX() const
Get x direction.
Definition: JAngle3D.hh:108
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:130
double getDY() const
Get y direction.
Definition: JAngle3D.hh:119
double JRECONSTRUCTION::getDot ( const JFit first,
const JFit second 
)
inline

Get dot product.

Parameters
firstfirst fit
secondsecond fit
Returns
dot product

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

182  {
183  return JMATH::getDot(getDirection(first), getDirection(second));
184  }
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 194 of file JReconstruction/JEvtToolkit.hh.

195  {
196  return JMATH::getDot(getDirection(fit), dir);
197  }
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 209 of file JReconstruction/JEvtToolkit.hh.

210  {
211  return N - 0.25 * chi2 / NDF;
212  }
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
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 223 of file JReconstruction/JEvtToolkit.hh.

224  {
225  return NDF - 0.25 * chi2 / NDF;
226  }
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 236 of file JReconstruction/JEvtToolkit.hh.

237  {
238  return -chi2;
239  }
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 249 of file JReconstruction/JEvtToolkit.hh.

250  {
251  if (first.getHistory().size() == second.getHistory().size())
252  return first.getQ() > second.getQ();
253  else
254  return first.getHistory().size() > second.getHistory().size();
255  }
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 288 of file JReconstruction/JEvtToolkit.hh.

289  {
290  return std::find_if(fit.getHistory().begin(),
291  fit.getHistory().end(),
292  JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
293  }
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 303 of file JReconstruction/JEvtToolkit.hh.

304  {
305  return std::find_if(fit.getHistory().begin(),
306  fit.getHistory().end(),
307  JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
308  }
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 317 of file JReconstruction/JEvtToolkit.hh.

318  {
319  return has_history(fit, JMUONPREFIT);
320  }
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 329 of file JReconstruction/JEvtToolkit.hh.

330  {
331  return has_history(fit, JMUONSIMPLEX);
332  }
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 341 of file JReconstruction/JEvtToolkit.hh.

342  {
343  return has_history(fit, JMUONGANDALF);
344  }
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 353 of file JReconstruction/JEvtToolkit.hh.

354  {
355  return has_history(fit, JMUONENERGY);
356  }
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 365 of file JReconstruction/JEvtToolkit.hh.

366  {
367  return has_history(fit, JMUONSTART);
368  }
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 377 of file JReconstruction/JEvtToolkit.hh.

378  {
380  }
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 389 of file JReconstruction/JEvtToolkit.hh.

390  {
391  return has_history(fit, JSHOWERPREFIT);
392  }
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 401 of file JReconstruction/JEvtToolkit.hh.

402  {
403  return has_history(fit, JSHOWERPOSITIONFIT);
404  }
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 413 of file JReconstruction/JEvtToolkit.hh.

414  {
415  return has_history(fit, JSHOWERCOMPLETEFIT);
416  }
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 425 of file JReconstruction/JEvtToolkit.hh.

426  {
428  }
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 440 of file JReconstruction/JEvtToolkit.hh.

441  {
442  return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
443  }
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 452 of file JReconstruction/JEvtToolkit.hh.

453  {
455  }
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 464 of file JReconstruction/JEvtToolkit.hh.

465  {
467  }
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 481 of file JReconstruction/JEvtToolkit.hh.

484  {
485  JEvt::const_iterator p = std::find_if(evt.begin(), evt.begin(), selector);
486 
487  for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
488  if (selector(*i) && comparator(*i, *p)) {
489  p = i;
490  }
491  }
492 
493  if (p != evt.end())
494  return *p;
495  else
496  THROW(JIndexOutOfRange, "This event has no fit with given selector.");
497  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
Exception for accessing an index in a collection that is outside of its range.
Definition: JException.hh:90
const JFit& JRECONSTRUCTION::get_best_reconstructed_muon ( const JEvt evt)
inline

Get best reconstructed muon.

Parameters
evtevent
Returns
track

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

507  {
509  }
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.
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results.
const JFit& JRECONSTRUCTION::get_best_reconstructed_shower ( const JEvt evt)
inline

Get best reconstructed shower.

Parameters
evtevent
Returns
track

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

519  {
521  }
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.
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results.