Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Enumerations | Functions | Variables
JFIT Namespace Reference

Auxiliary classes and methods for linear and iterative data regression. More...

Classes

class  JEnergy
 Data structure for fit of energy. More...
 
class  JEnergyCorrection
 Auxiliary class for correction of energy determined by JEnergy.cc. More...
 
struct  JRegressor< JEnergy >
 Regressor function object for JEnergy fit. More...
 
struct  JEstimator
 Template definition of linear fit. More...
 
class  JFit
 Data structure for track fit results. More...
 
class  JEvt
 Data structure for set of track fit results. More...
 
struct  JQualitySorter
 General purpose sorter of fit results. 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. More...
 
class  JAtmosphericMuon
 Auxiliary class to evaluate atmospheric muon hypothesis. More...
 
class  JGandalf
 Fit method based on the Levenberg-Marquardt method. More...
 
struct  JEvent
 Auxiliary class for historical event. More...
 
struct  JHistory
 Container for historical events. More...
 
class  JHitW0
 Auxiliary class for a hit with background rate value. More...
 
struct  JK40
 Auxiliary class for converting various rates to expectation values of the number of hits within a given time interval. More...
 
struct  JK40Hit
 Auxiliary class for simultaneously handling light yields and response of module. More...
 
class  JLine1Z
 Data structure for fit of straight line paralel to z-axis. More...
 
class  JEstimator< JLine1Z >
 Linear fit of straight line parallel to z-axis to set of hits (objects with position and time). More...
 
class  JLine3EZ
 Data structure for fit of straight line in positive z-direction with energy. More...
 
class  JLine3Z
 Data structure for fit of straight line in positive z-direction. More...
 
struct  JRegressor< JLine3Z, JSimplex >
 Regressor function object for JLine3Z fit using JSimplex minimiser. More...
 
struct  JRegressor< JLine3Z, JGandalf >
 Regressor function object for JLine3Z fit using JGandalf minimiser. More...
 
class  JMatrixNZ
 Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z). More...
 
struct  JMEstimator
 Interface for maximum likelihood estimator (M-estimator). More...
 
struct  JMEstimatorNull
 Null M-estimator. More...
 
struct  JMEstimatorNormal
 Normal M-estimator. More...
 
struct  JMEstimatorLorentzian
 Lorentzian M-estimator. More...
 
struct  JMEstimatorLinear
 Linear M-estimator. More...
 
struct  JMEstimatorTukey
 Tukey's biweight M-estimator. More...
 
struct  JModel
 Auxiliary class to match data points with given model. More...
 
struct  JModel< JLine1Z >
 Template specialisation of class JModel to match hit with muon trajectory along z-axis. More...
 
struct  JModel< JEnergy >
 Template specialisation of class JModel to match hit with muon energy. More...
 
struct  JModel< JPoint4D >
 Template specialisation of class JModel to match hit with bright point. More...
 
class  JMuonGandalf
 class to handle Muon Gandalf reconstruction first, two other angular reconstructionS should be ran : JMuonPrefit and JMuonSimplex More...
 
struct  JMuonGandalfParameters_t
 
struct  JMuonParameters
 
class  JMuonPrefit
 class to handle Prefit angular reconstruction. More...
 
struct  JMuonPrefitParameters_t
 Data struct that holds the parameters for JMuonPrefit angular reconstruction This is part of the constructor parameters of JMuonPrefit. More...
 
class  JMuonSimplex
 class to handle the Simplex angular reconstruction. More...
 
struct  JMuonSimplexParameters_t
 
struct  JNPE
 Auxiliary class for handling various light yields. More...
 
struct  JNPEHit
 Auxiliary class for simultaneously handling light yields and response of PMT. More...
 
class  JORCAShowerFit
 class to handle the third step of the shower reconstruction, mainly dedicated for ORCA More...
 
class  JORCAShowerPositionFit
 class to handle the second step of the shower reconstruction, mainly dedicated for ORCA More...
 
class  JORCAShowerPrefit
 class to handle first step of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JPMTW0
 Auxiliary class for handling PMT geometry, rate and response. More...
 
class  JPoint3D
 Data structure for position fit. More...
 
class  JEstimator< JPoint3D >
 Linear fit of crossing point (position) between axes (objects with position and direction). More...
 
class  JPoint4D
 Data structure for vertex fit. More...
 
class  JEstimator< JPoint4D >
 Linear fit of bright point (position and time) between hits (objects with position and time). More...
 
struct  JRegressor< JPoint4D, JSimplex >
 Regressor function object for JPoint4D fit using JSimplex minimiser. More...
 
struct  JAbstractMinimiser
 Abstract minimiser. More...
 
struct  JRegressor
 Template definition of a data regressor of given model. More...
 
struct  JAbstractRegressor
 Abstract class for global fit method. More...
 
class  JShower3EZ
 Data structure for fit of straight line in positive z-direction with energy. More...
 
struct  JRegressor< JShower3EZ, JSimplex >
 Regressor function object for JShower3EZ fit using JSimplex minimiser. More...
 
class  JShower3Z
 Data structure for cascade in positive z-direction. More...
 
struct  JShowerFitParameters_t
 struct that holds the Parameters used for JORCAShowerFit More...
 
struct  JShowerParameters
 
struct  JShowerPositionFitParameters_t
 
struct  JShowerPrefitParameters_t
 
class  JSimplex
 Simple fit method based on Powell's algorithm, see reference: Numerical Recipes in C++, W.H. More...
 
struct  JStart
 Auxiliary class for start or end point evaluation. More...
 
class  JVectorNZ
 Determination of the time residual vector of hits for a track along z-axis (JFIT::JLine1Z). More...
 

Enumerations

enum  JFitApplication_t {
  JMUONBEGIN = 0, JMUONPREFIT, JMUONSIMPLEX, JMUONGANDALF,
  JMUONENERGY, JMUONSTART, JLINEFIT, JMUONEND = 99,
  JSHOWERBEGIN = 100, JSHOWERPREFIT, JSHOWERPOSITIONFIT, JSHOWERCOMPLETEFIT,
  JSHOWEREND = 199, JUSERBEGIN = 1000, JMUONVETO, JPRESIM,
  JMUONPATH, JMCEVT, JUSEREND = 1099, JKM3DELTAPOS = 10000
}
 
enum  JFitParameter_t {
  JGANDALF_BETA0_RAD = 0, JGANDALF_BETA1_RAD = 1, JGANDALF_CHI2 = 2, JGANDALF_NUMBER_OF_HITS = 3,
  JENERGY_ENERGY = 4, JENERGY_CHI2 = 5, JGANDALF_LAMBDA = 6, JGANDALF_NUMBER_OF_ITERATIONS = 7,
  JSTART_NPE_MIP = 8, JSTART_NPE_MIP_TOTAL = 9, JSTART_LENGTH_METRES = 10, JVETO_NPE = 11,
  JVETO_NUMBER_OF_HITS = 12, JENERGY_MUON_RANGE_METRES = 13, JENERGY_NOISE_LIKELIHOOD = 14, JENERGY_NDF = 15,
  JENERGY_NUMBER_OF_HITS = 16, JCOPY_Z_M = 17
}
 
enum  JFitStatus_t { ERROR = -100, INSUFFICIENT_NUMBER_OF_HITS, INSUFFICIENT_NUMBER_OF_DOMS, OKAY = 1 }
 

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 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...
 
int getCount (const JHitL0 &hit)
 Get hit count. More...
 
int getCount (const JHitL1 &hit)
 Get hit count. More...
 
int getCount (const JHitR1 &hit)
 Get hit count. More...
 
template<class T >
int getCount (T __begin, T __end)
 Get hit count. More...
 
double getP (const double expval, bool hit)
 Get Poisson probability to observe a hit or not for given expectation value for the number of hits. More...
 
double getP (const double expval, const unsigned int numberOfHits, const double precision=1.0e-5)
 Get Poisson probability to observe given number of hits or more for the given expectation value for the number of hits. More...
 
double getChi2 (const double P)
 Get chi2 corresponding to given probability. More...
 
double getChi2 (const double expval, bool hit)
 Get chi2 to observe a hit or not for given expectation value for the number of hits. More...
 
template<class JModel_t , class JHit_t >
double getChi2 (const JModel_t &model, const JHit_t &hit, const double sigma)
 Determine chi2 of a hit for a given model and time resolution. More...
 
template<class JModel_t , class T >
double getChi2 (const JModel_t &model, T __begin, T __end, const double sigma)
 Determine chi2 of data for given model and time resolution. More...
 
template<class T >
double getChi2 (T __begin, T __end, const JMatrixNZ &V)
 Determine chi2 of data using full covariance matrix. More...
 
double getChi2 (const JVectorNZ &Y, const JMatrixNZ &V)
 Determine chi2 using full covariance matrix. More...
 
template<class T >
double getChi2 (const JLine1Z &track, T __begin, T __end, const JMatrixNZ &V)
 Determine chi2 of data for given track using full covariance matrix. More...
 
template<class T >
double getChi2 (const JLine1Z &track, T __begin, T __end, const double alpha, const double sigma)
 Determine chi2 of data for given track and angular and time resolution. More...
 
template<class T >
double getChi2 (T __begin, T __end, const JMatrixNZ &V, const int i)
 Determine difference between chi2 with and without hit using full covariance matrix. More...
 
double getChi2 (const JVectorNZ &Y, const JMatrixNZ &V, const int i)
 Determine difference between chi2 with and without hit using full covariance matrix. More...
 
template<class JModel_t , class JFit_t , class T >
double getChi2 (const JModel_t &model, const JFit_t &fit, T __begin, T __end)
 Get chi2 of data for given model and fit function. More...
 

Variables

static const int JPP_RECONSTRUCTION_TYPE = 4000
 Jpp reconstruction type for AAnet. More...
 

Detailed Description

Auxiliary classes and methods for linear and iterative data regression.

Author
mdejong
mdejong, gmaggi
gmaggi
adomi, gmaggi
adomi
lquinn
adomi

Class used for EM shower reconstruction in ORCA. It sets the optimal values for the shower position reconstruction. These values can be changed from command line if needed.

Enumeration Type Documentation

Enumerator
JMUONBEGIN 

Start of muon fit applications.

JMUONPREFIT 

JPrefit.cc.

JMUONSIMPLEX 

JSimplex.cc.

JMUONGANDALF 

JGandalf.cc.

JMUONENERGY 

JEnergy.cc.

JMUONSTART 

JStart.cc.

JLINEFIT 

An angular reco guess. It could be a seed for JPrefit.

JMUONEND 

End of muon fit applications.

JSHOWERBEGIN 

Start of shower fit applications.

JSHOWERPREFIT 

JShowerPrefit.cc.

JSHOWERPOSITIONFIT 

JShowerPositionFit.cc.

JSHOWERCOMPLETEFIT 

JShowerFit.cc.

JSHOWEREND 

End of shower fit applications.

JUSERBEGIN 

Start of user applications.

JMUONVETO 

JVeto.cc.

JPRESIM 

JPreSim_HTR.cc.

JMUONPATH 

JPath.cc.

JMCEVT 

JMCEvt.cc.

JUSEREND 

End of user applications.

JKM3DELTAPOS 

This is not a fit, this gives position information only.

Definition at line 20 of file JFitApplications.hh.

20  {
21 
22  JMUONBEGIN = 0, //!< Start of muon fit applications
23  JMUONPREFIT, //!< JPrefit.cc
24  JMUONSIMPLEX, //!< JSimplex.cc
25  JMUONGANDALF, //!< JGandalf.cc
26  JMUONENERGY, //!< JEnergy.cc
27  JMUONSTART, //!< JStart.cc
28  JLINEFIT, //!< An angular reco guess. It could be a seed for JPrefit
29  JMUONEND = 99, //!< End of muon fit applications
30 
31  JSHOWERBEGIN = 100, //!< Start of shower fit applications
32  JSHOWERPREFIT, //!< JShowerPrefit.cc
33  JSHOWERPOSITIONFIT, //!< JShowerPositionFit.cc
34  JSHOWERCOMPLETEFIT, //!< JShowerFit.cc
35  JSHOWEREND = 199, //!< End of shower fit applications
36 
37  JUSERBEGIN = 1000, //!< Start of user applications
38  JMUONVETO, //!< JVeto.cc
39  JPRESIM, //!< JPreSim_HTR.cc
40  JMUONPATH, //!< JPath.cc
41  JMCEVT, //!< JMCEvt.cc
42  JUSEREND = 1099, //!< End of user applications
43 
44  JKM3DELTAPOS = 10000 //!< This is not a fit, this gives position information only
45  };
End of user applications.
JShowerPositionFit.cc.
JShowerPrefit.cc.
Start of shower fit applications.
Start of user applications.
JMCEvt.cc.
End of muon fit applications.
Start of muon fit applications.
An angular reco guess. It could be a seed for JPrefit.
End of shower fit applications.
JPreSim_HTR.cc.
This is not a fit, this gives position information only.
Enumerator
JGANDALF_BETA0_RAD 

angular resolution [rad] from JGandalf.cc

JGANDALF_BETA1_RAD 

angular resolution [rad] from JGandalf.cc

JGANDALF_CHI2 

chi2 from JGandalf.cc

JGANDALF_NUMBER_OF_HITS 

number of hits from JGandalf.cc

JENERGY_ENERGY 

uncorrected energy [GeV] from JEnergy.cc

JENERGY_CHI2 

chi2 from JEnergy.cc

JGANDALF_LAMBDA 

control parameter from JGandalf.cc

JGANDALF_NUMBER_OF_ITERATIONS 

number of iterations from JGandalf.cc

JSTART_NPE_MIP 

number of photo-electrons up to the barycentre from JStart.cc

JSTART_NPE_MIP_TOTAL 

number of photo-electrons along the whole track from JStart.cc

JSTART_LENGTH_METRES 

distance between first and last hits in metres from JStart.cc

JVETO_NPE 

number of photo-electrons from JVeto.cc

JVETO_NUMBER_OF_HITS 

number of hits from JVeto.cc

JENERGY_MUON_RANGE_METRES 

range of a muon with the reconstructed energy [m] from JEnergy.cc

JENERGY_NOISE_LIKELIHOOD 

log likelihood of every hit being K40 from JEnergy.cc

JENERGY_NDF 

number of degrees of freedom from JEnergy.cc

JENERGY_NUMBER_OF_HITS 

number of hits from JEnergy.cc

JCOPY_Z_M 

true vertex position along track [m] from JCopy.cc

Definition at line 15 of file JFitParameters.hh.

15  {
16 
17  JGANDALF_BETA0_RAD = 0, //!< angular resolution [rad] from JGandalf.cc
18  JGANDALF_BETA1_RAD = 1, //!< angular resolution [rad] from JGandalf.cc
19  JGANDALF_CHI2 = 2, //!< chi2 from JGandalf.cc
20  JGANDALF_NUMBER_OF_HITS = 3, //!< number of hits from JGandalf.cc
21  JENERGY_ENERGY = 4, //!< uncorrected energy [GeV] from JEnergy.cc
22  JENERGY_CHI2 = 5, //!< chi2 from JEnergy.cc
23  JGANDALF_LAMBDA = 6, //!< control parameter from JGandalf.cc
24  JGANDALF_NUMBER_OF_ITERATIONS = 7, //!< number of iterations from JGandalf.cc
25  JSTART_NPE_MIP = 8, //!< number of photo-electrons up to the barycentre from JStart.cc
26  JSTART_NPE_MIP_TOTAL = 9, //!< number of photo-electrons along the whole track from JStart.cc
27  JSTART_LENGTH_METRES = 10, //!< distance between first and last hits in metres from JStart.cc
28  JVETO_NPE = 11, //!< number of photo-electrons from JVeto.cc
29  JVETO_NUMBER_OF_HITS = 12, //!< number of hits from JVeto.cc
30  JENERGY_MUON_RANGE_METRES = 13, //!< range of a muon with the reconstructed energy [m] from JEnergy.cc
31  JENERGY_NOISE_LIKELIHOOD = 14, //!< log likelihood of every hit being K40 from JEnergy.cc
32  JENERGY_NDF = 15, //!< number of degrees of freedom from JEnergy.cc
33  JENERGY_NUMBER_OF_HITS = 16, //!< number of hits from JEnergy.cc
34  JCOPY_Z_M = 17 //!< true vertex position along track [m] from JCopy.cc
35  };
number of degrees of freedom from JEnergy.cc
number of photo-electrons from JVeto.cc
chi2 from JEnergy.cc
number of iterations from JGandalf.cc
log likelihood of every hit being K40 from JEnergy.cc
chi2 from JGandalf.cc
angular resolution [rad] from JGandalf.cc
number of hits from JVeto.cc
control parameter from JGandalf.cc
angular resolution [rad] from JGandalf.cc
true vertex position along track [m] from JCopy.cc
number of hits from JEnergy.cc
uncorrected energy [GeV] from JEnergy.cc
number of hits from JGandalf.cc
number of photo-electrons up to the barycentre from JStart.cc
distance between first and last hits in metres from JStart.cc
number of photo-electrons along the whole track from JStart.cc
range of a muon with the reconstructed energy [m] from JEnergy.cc
Enumerator
ERROR 
INSUFFICIENT_NUMBER_OF_HITS 
INSUFFICIENT_NUMBER_OF_DOMS 
OKAY 

Definition at line 16 of file JFitStatus.hh.

Function Documentation

JPosition3D JFIT::getPosition ( const JFit fit)
inline

Get position.

Parameters
fitfit
Returns
position

Definition at line 63 of file JEvtToolkit.hh.

64  {
65  return JPosition3D(fit.getX(), fit.getY(), fit.getZ());
66  }
double getX() const
Get X-position.
Definition: JEvt.hh:144
double getY() const
Get Y-position.
Definition: JEvt.hh:145
double getZ() const
Get Z-position.
Definition: JEvt.hh:146
JDirection3D JFIT::getDirection ( const JFit fit)
inline

Get direction.

Parameters
fitfit
Returns
direction

Definition at line 75 of file JEvtToolkit.hh.

76  {
77  return JDirection3D(fit.getDX(), fit.getDY(), fit.getDZ());
78  }
double getDZ() const
Get Z-slope.
Definition: JEvt.hh:149
double getDY() const
Get Y-slope.
Definition: JEvt.hh:148
double getDX() const
Get X-slope.
Definition: JEvt.hh:147
JAxis3D JFIT::getAxis ( const JFit fit)
inline

Get axis.

Parameters
fitfit
Returns
axis

Definition at line 87 of file JEvtToolkit.hh.

88  {
89  return JAxis3D(getPosition(fit), getDirection(fit));
90  }
JDirection3D getDirection(const Vec &v)
Get direction.
JPosition3D getPosition(const Vec &v)
Get position.
JTrack3E JFIT::getTrack ( const JFit fit)
inline

Get track.

Parameters
fitfit
Returns
track

Definition at line 99 of file JEvtToolkit.hh.

100  {
101  return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
102  }
double getT() const
Get time.
Definition: JEvt.hh:150
JAxis3D getAxis(const Trk &track)
Get axis.
double getE() const
Get energy.
Definition: JEvt.hh:153
JFit JFIT::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 116 of file JEvtToolkit.hh.

122  {
123  return JFit(history,
124  track.getX(), track.getY(), track.getZ(),
125  track.getDX(), track.getDY(), track.getDZ(),
126  track.getT(),
127  Q, NDF,
128  energy, status);
129  }
Data structure for track fit results.
Definition: JEvt.hh:32
JFit 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 
)
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 144 of file JEvtToolkit.hh.

151  {
152  return JFit(history,
153  track.getX(), track.getY(), track.getZ(),
154  angle.getDX(), angle.getDY(), angle.getDZ(),
155  track.getT(),
156  Q, NDF,
157  energy, status);
158  }
double getZ(const JPosition3D &pos) const
Get point of emission of Cherenkov light along muon path.
Definition: JLine1Z.hh:134
Data structure for track fit results.
Definition: JEvt.hh:32
double getY() const
Get y position.
Definition: JVector3D.hh:102
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:92
double JFIT::getDot ( const JFit first,
const JFit second 
)
inline

Get dot product.

Parameters
firstfirst fit
secondsecond fit
Returns
dot product

Definition at line 168 of file JEvtToolkit.hh.

169  {
170  return JMATH::getDot(getDirection(first), getDirection(second));
171  }
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
JDirection3D getDirection(const Vec &v)
Get direction.
double JFIT::getDot ( const JFit fit,
const JDirection3D &  dir 
)
inline

Get dot product.

Parameters
fitfit
dirdirection
Returns
dot product

Definition at line 181 of file JEvtToolkit.hh.

182  {
183  return JMATH::getDot(getDirection(fit), dir);
184  }
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
JDirection3D getDirection(const Vec &v)
Get direction.
double JFIT::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 195 of file JEvtToolkit.hh.

196  {
197  const double w = NDF - 0.25 * chi2 / NDF;
198 
199  return w;
200  }
double JFIT::getQuality ( const double  chi2)
inline

Get quality of fit.

The larger the quality, the better the fit.

Parameters
chi2chi2
Returns
quality

Definition at line 210 of file JEvtToolkit.hh.

211  {
212  return -chi2;
213  }
bool JFIT::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 223 of file JEvtToolkit.hh.

224  {
225  if (first.getHistory().size() == second.getHistory().size())
226  return first.getQ() > second.getQ();
227  else
228  return first.getHistory().size() > second.getHistory().size();
229  }
double getQ() const
Get quality.
Definition: JEvt.hh:151
const JHistory & getHistory() const
Get history.
Definition: JHistory.hh:225
bool JFIT::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 262 of file JEvtToolkit.hh.

263  {
264  return std::find_if(fit.getHistory().begin(),
265  fit.getHistory().end(),
266  JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
267  }
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
const JHistory & getHistory() const
Get history.
Definition: JHistory.hh:225
bool JFIT::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 277 of file JEvtToolkit.hh.

278  {
279  return std::find_if(fit.getHistory().begin(),
280  fit.getHistory().end(),
281  JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
282  }
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
const JHistory & getHistory() const
Get history.
Definition: JHistory.hh:225
bool JFIT::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 291 of file JEvtToolkit.hh.

292  {
293  return has_history(fit, JMUONPREFIT);
294  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 303 of file JEvtToolkit.hh.

304  {
305  return has_history(fit, JMUONSIMPLEX);
306  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 315 of file JEvtToolkit.hh.

316  {
317  return has_history(fit, JMUONGANDALF);
318  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 327 of file JEvtToolkit.hh.

328  {
329  return has_history(fit, JMUONENERGY);
330  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 339 of file JEvtToolkit.hh.

340  {
341  return has_history(fit, JMUONSTART);
342  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 351 of file JEvtToolkit.hh.

352  {
353  return has_history(fit, JRange<int>(JMUONBEGIN, JMUONEND));
354  }
End of muon fit applications.
Start of muon fit applications.
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 363 of file JEvtToolkit.hh.

364  {
365  return has_history(fit, JSHOWERPREFIT);
366  }
JShowerPrefit.cc.
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 375 of file JEvtToolkit.hh.

376  {
377  return has_history(fit, JSHOWERPOSITIONFIT);
378  }
JShowerPositionFit.cc.
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 387 of file JEvtToolkit.hh.

388  {
389  return has_history(fit, JSHOWERCOMPLETEFIT);
390  }
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
bool JFIT::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 399 of file JEvtToolkit.hh.

400  {
401  return has_history(fit, JRange<int>(JSHOWERBEGIN, JSHOWEREND));
402  }
Start of shower fit applications.
End of shower fit applications.
bool has_history(const JFit &fit, const int type)
Test whether given fit has specified history.
Definition: JEvtToolkit.hh:262
template<class JTrackSelector_t >
bool JFIT::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 414 of file JEvtToolkit.hh.

415  {
416  return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
417  }
bool JFIT::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 426 of file JEvtToolkit.hh.

427  {
429  }
bool has_reconstructed_track(const Evt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
bool has_muon_fit(const Trk &track)
Test whether given track has default muon fit in history.
bool JFIT::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 438 of file JEvtToolkit.hh.

439  {
441  }
bool has_reconstructed_track(const Evt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.
bool has_shower_fit(const Trk &track)
Test whether given track has default shower fit in history.
template<class JTrackSelector_t , class JQualitySorter_t >
const JFit& JFIT::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 455 of file JEvtToolkit.hh.

458  {
459  JEvt::const_iterator p = std::find_if(evt.begin(), evt.begin(), selector);
460 
461  for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
462  if (selector(*i) && comparator(*i, *p)) {
463  p = i;
464  }
465  }
466 
467  if (p != evt.end())
468  return *p;
469  else
470  THROW(JIndexOutOfRange, "This event has no fit with given selector.");
471  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
const JFit& JFIT::get_best_reconstructed_muon ( const JEvt evt)
inline

Get best reconstructed muon.

Parameters
evtevent
Returns
track

Definition at line 480 of file JEvtToolkit.hh.

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

Get best reconstructed shower.

Parameters
evtevent
Returns
track

Definition at line 492 of file JEvtToolkit.hh.

493  {
495  }
const Trk & get_best_reconstructed_track(const Evt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.
bool qualitySorter(const JFIT::JFit &first, const JFIT::JFit &second)
Comparison of fit results.
bool has_shower_fit(const Trk &track)
Test whether given track has default shower fit in history.
int JFIT::getCount ( const JHitL0 &  hit)
inline

Get hit count.

Parameters
hitL0 hit
Returns
1

Definition at line 728 of file JEvtToolkit.hh.

729  {
730  return 1;
731  }
int JFIT::getCount ( const JHitL1 &  hit)
inline

Get hit count.

Parameters
hithit
Returns
count

Definition at line 740 of file JEvtToolkit.hh.

741  {
742  return hit.size();
743  }
int JFIT::getCount ( const JHitR1 &  hit)
inline

Get hit count.

Parameters
hithit
Returns
count

Definition at line 752 of file JEvtToolkit.hh.

753  {
754  return hit.getN();
755  }
template<class T >
int JFIT::getCount ( __begin,
__end 
)
inline

Get hit count.

Parameters
__beginbegin of L0/L1 data
__endend of L0/L1 data
Returns
hit count

Definition at line 766 of file JEvtToolkit.hh.

767  {
768  int count = 0;
769 
770  for (T hit = __begin; hit !=__end; ++hit) {
771  count += getCount(*hit);
772  }
773 
774  return count;
775  }
double getCount(TH1D *hptr, int muon_threshold)
double JFIT::getP ( const double  expval,
bool  hit 
)
inline

Get Poisson probability to observe a hit or not for given expectation value for the number of hits.

Parameters
expvalexpectation value
hithit
Returns
probability

Definition at line 37 of file JFitToolkit.hh.

38  {
39  if (hit)
40  return 1.0 - exp(-expval); // 1 - P(0)
41  else
42  return exp(-expval); // P(0)
43  }
double JFIT::getP ( const double  expval,
const unsigned int  numberOfHits,
const double  precision = 1.0e-5 
)
inline

Get Poisson probability to observe given number of hits or more for the given expectation value for the number of hits.

Parameters
expvalexpectation value
numberOfHitsnumber of hits
precisionprecision
Returns
propability

Definition at line 55 of file JFitToolkit.hh.

56  {
57  double P = 0.0;
58 
59  for (int i = numberOfHits; ; ++i) {
60 
61  const double p = TMath::PoissonI(i, expval);
62 
63  P += p;
64 
65  if ((double) i > expval && p < precision) {
66  break;
67  }
68  }
69 
70  return P;
71  }
double JFIT::getChi2 ( const double  P)
inline

Get chi2 corresponding to given probability.

Parameters
Pprobability
Returns
chi2

Definition at line 80 of file JFitToolkit.hh.

81  {
82  return -log(P);
83  }
double JFIT::getChi2 ( const double  expval,
bool  hit 
)
inline

Get chi2 to observe a hit or not for given expectation value for the number of hits.

Parameters
expvalexpectation value
hithit
Returns
probability

Definition at line 93 of file JFitToolkit.hh.

94  {
95  if (hit)
96  return -log(1.0 - exp(-expval));
97  else
98  return expval;
99  }
template<class JModel_t , class JHit_t >
double JFIT::getChi2 ( const JModel_t &  model,
const JHit_t &  hit,
const double  sigma 
)
inline

Determine chi2 of a hit for a given model and time resolution.

The template argument JModel_t refers to a data structure which should provide for the following method:

  double getT(const JHit_t& hit) const;    // get expected time of hit
Parameters
modelmodel
hithit
sigmasigma
Returns
chi2

Definition at line 117 of file JFitToolkit.hh.

118  {
119  const double ds = (hit.getT() - model.getT(hit)) / sigma;
120 
121  return ds * ds;
122  }
template<class JModel_t , class T >
double JFIT::getChi2 ( const JModel_t &  model,
__begin,
__end,
const double  sigma 
)
inline

Determine chi2 of data for given model and time resolution.

The template argument JModel_t refers to a data structure which should provide for the following method:

  double getT(const value_type& hit) const;    // expected time of hit

where value_type corresponds to the value type if the input data.

Parameters
modelmodel
__beginbegin of data
__endend of data
sigmatime resolution [ns]
Returns
chi2

Definition at line 142 of file JFitToolkit.hh.

143  {
144  double chi2 = 0.0;
145 
146  for (T hit = __begin; hit != __end; ++hit) {
147  chi2 += getChi2(model, *hit, sigma);
148  }
149 
150  return chi2;
151  }
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:80
template<class T >
double JFIT::getChi2 ( __begin,
__end,
const JMatrixNZ V 
)
inline

Determine chi2 of data using full covariance matrix.

Parameters
__beginbegin of residuals
__endend of residuals
Vcovariance matrix
Returns
chi2

Definition at line 163 of file JFitToolkit.hh.

164  {
165  return JMATH::getDot(__begin, __end, V);
166  }
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
double JFIT::getChi2 ( const JVectorNZ Y,
const JMatrixNZ V 
)
inline

Determine chi2 using full covariance matrix.

Parameters
Yresiduals
Vcovariance matrix
Returns
chi2

Definition at line 176 of file JFitToolkit.hh.

178  {
179  return getChi2(Y.begin(), Y.end(), V);
180  }
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:80
template<class T >
double JFIT::getChi2 ( const JLine1Z track,
__begin,
__end,
const JMatrixNZ V 
)
inline

Determine chi2 of data for given track using full covariance matrix.

Parameters
tracktrack
__beginbegin of data
__endend of data
Vcovariance matrix
Returns
chi2

Definition at line 193 of file JFitToolkit.hh.

197  {
198  const JVectorNZ Y(track, __begin, __end);
199 
200  return getChi2(Y, V);
201  }
Determination of the time residual vector of hits for a track along z-axis (JFIT::JLine1Z).
Definition: JVectorNZ.hh:25
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:80
template<class T >
double JFIT::getChi2 ( const JLine1Z track,
__begin,
__end,
const double  alpha,
const double  sigma 
)
inline

Determine chi2 of data for given track and angular and time resolution.

Parameters
tracktrack
__beginbegin of data
__endend of data
alphaangular resolution [deg]
sigmatime resolution [ns]
Returns
chi2

Definition at line 215 of file JFitToolkit.hh.

216  {
217  JMatrixNZ V(track, __begin, __end, alpha, sigma);
218 
219  V.invert();
220 
221  return getChi2(track, __begin, __end, V);
222  }
Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z).
Definition: JMatrixNZ.hh:28
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:80
template<class T >
double JFIT::getChi2 ( __begin,
__end,
const JMatrixNZ V,
const int  i 
)
inline

Determine difference between chi2 with and without hit using full covariance matrix.

Parameters
__beginbegin of residuals
__endend of residuals
Vcovariance matrix
iindex of excluded hit
Returns
difference between chi2 w/o hit i

Definition at line 235 of file JFitToolkit.hh.

236  {
237  double chi2 = 0.0;
238 
239  T y = __begin;
240 
241  for (unsigned int j = 0; j != V.size(); ++j, ++y) {
242  chi2 += V(i,j) * (*y);
243  }
244 
245  return chi2*chi2 / V(i,i);
246  }
double JFIT::getChi2 ( const JVectorNZ Y,
const JMatrixNZ V,
const int  i 
)
inline

Determine difference between chi2 with and without hit using full covariance matrix.

Parameters
Yresiduals
Vcovariance matrix
iindex of excluded hit
Returns
chi2

Definition at line 257 of file JFitToolkit.hh.

260  {
261  return getChi2(Y.begin(), Y.end(), V, i);
262  }
double getChi2(const double P)
Get chi2 corresponding to given probability.
Definition: JFitToolkit.hh:80
template<class JModel_t , class JFit_t , class T >
double JFIT::getChi2 ( const JModel_t &  model,
const JFit_t &  fit,
__begin,
__end 
)
inline

Get chi2 of data for given model and fit function.

The template argument JFit_t refers to a data structure which should provide for the function object operator:

  double operator()(const JModel_t& model, const value_type&) const;    // chi2

where JModel_t refers to the given model and value_type to the value type if the input data. The return value should correspond to the chi2 of the hit.

Parameters
modelmodel
fitfit function
__beginbegin of data
__endend of data

Definition at line 284 of file JFitToolkit.hh.

285  {
286  double chi2 = 0.0;
287 
288  for (T hit = __begin; hit != __end; ++hit) {
289  chi2 += fit(model, *hit);
290  }
291 
292  return chi2;
293  }

Variable Documentation

const int JFIT::JPP_RECONSTRUCTION_TYPE = 4000
static

Jpp reconstruction type for AAnet.

Definition at line 18 of file JFitApplications.hh.