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

Model fits to data. More...

Classes

struct  JEventSelector
 Event selector. More...
 
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...
 
class  JMuonEnergy
 Auxiliary class to to determine muon energy. 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...
 
class  JMuonStart
 Auxiliary class to determine start and end position of muon trajectory. More...
 
struct  JMuonStartParameters_t
 Data structure for fit parameters. More...
 
struct  event_type
 Auxiliary data structure to store data and fit in memory. More...
 
struct  JStringEditor
 Auxiliary class to edit time offset of data per string. More...
 
struct  JPerth
 Thread pool for fits to data. More...
 
struct  JPerth_t
 Auxiliary data structure for chi2 function object. More...
 
struct  JRange_t
 Type definition of range. 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
 
typedef std::vector< JHitW0buffer_type
 hits More...
 
typedef std::map< int,
buffer_type
map_type
 string -> hits More...
 
typedef std::vector< event_typedata_type
 
typedef
JLANG::JSTDObjectReader< const
event_type
input_type
 
typedef
JFIT::JRegressorStorage
< JFIT::JLine3Z,
JFIT::JGandalf
JRegressorStorage_t
 
typedef JFIT::JRegressor
< JFIT::JLine3Z,
JFIT::JGandalf
JRegressor_t
 

Enumerations

enum  JFitStatus_t {
  ERROR = -100, INSUFFICIENT_NUMBER_OF_HITS, INSUFFICIENT_NUMBER_OF_DOMS, UNDEFINED = -1,
  SINGLE_STAGE = 0, INCOMPLETE_CHAIN = +1, COMPLETE_CHAIN = +100
}
 

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=SINGLE_STAGE)
 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=SINGLE_STAGE)
 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...
 
double getProbability (const JModule &module, const JDAQSummaryFrame &frame, const JRateL1_t &R_Hz, const double T_ns, const std::multiset< int > &top)
 Get probability of given response in optical module due to random background. More...
 
bool filter (const JDAQEvent &tev, const JEvt &evt, const Evt *const pE)
 Event selection. More...
 

Detailed Description

Model fits to data.

Author
mdejong
mdejong, azegarelli, scelli
mdejong, gmaggi
gmaggi
mdejong, gmaggi, azegarelli
adomi
adomi, gmaggi

Typedef Documentation

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

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

Definition at line 353 of file JHistory.hh.

Definition at line 354 of file JHistory.hh.

hits

Definition at line 67 of file JPerth.cc.

string -> hits

Definition at line 68 of file JPerth.cc.

Definition at line 78 of file JPerth.cc.

Definition at line 79 of file JPerth.cc.

Definition at line 128 of file JPerth.cc.

Definition at line 129 of file JPerth.cc.

Enumeration Type Documentation

Enumerator
ERROR 
INSUFFICIENT_NUMBER_OF_HITS 
INSUFFICIENT_NUMBER_OF_DOMS 
UNDEFINED 
SINGLE_STAGE 
INCOMPLETE_CHAIN 
COMPLETE_CHAIN 

Definition at line 16 of file JFitStatus.hh.

Function Documentation

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

Get position.

Parameters
fitfit
Returns
position

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

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

Get direction.

Parameters
fitfit
Returns
direction

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

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

Get axis.

Parameters
fitfit
Returns
axis

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

96  {
97  return JAxis3D(getPosition(fit), getDirection(fit));
98  }
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 107 of file JReconstruction/JEvtToolkit.hh.

108  {
109  return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
110  }
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 = SINGLE_STAGE 
)
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 124 of file JReconstruction/JEvtToolkit.hh.

130  {
131  return JFit(history,
132  track.getX(), track.getY(), track.getZ(),
133  track.getDX(), track.getDY(), track.getDZ(),
134  track.getT(),
135  Q, NDF,
136  energy, status);
137  }
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 = SINGLE_STAGE 
)
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 152 of file JReconstruction/JEvtToolkit.hh.

159  {
160  return JFit(history,
161  track.getX(), track.getY(), track.getZ(),
162  angle.getDX(), angle.getDY(), angle.getDZ(),
163  track.getT(),
164  Q, NDF,
165  energy, status);
166  }
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 176 of file JReconstruction/JEvtToolkit.hh.

177  {
178  return JMATH::getDot(getDirection(first), getDirection(second));
179  }
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 189 of file JReconstruction/JEvtToolkit.hh.

190  {
191  return JMATH::getDot(getDirection(fit), dir);
192  }
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 204 of file JReconstruction/JEvtToolkit.hh.

205  {
206  return N - 0.25 * chi2 / NDF;
207  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
then if[[!-f $DETECTOR]] then JDetector sh $DETECTOR fi cat $WORKDIR trigger_parameters txt<< EOFtrigger3DMuon.enabled=1;trigger3DMuon.numberOfHits=5;trigger3DMuon.gridAngle_deg=1;ctMin=0.0;TMaxLocal_ns=15.0;EOF set_variable TRIGGEREFFICIENCY_TRIGGERED_EVENTS_ONLY INPUT_FILES=() for((i=1;$i<=$NUMBER_OF_RUNS;++i));do JSirene.sh $DETECTOR $JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz $WORKDIR/sirene_ ${i}.root JTriggerEfficiency.sh $DETECTOR $DETECTOR $WORKDIR/sirene_ ${i}.root $WORKDIR/trigger_efficiency_ ${i}.root $WORKDIR/trigger_parameters.txt $JPP_DATA/PMT_parameters.txt INPUT_FILES+=($WORKDIR/trigger_efficiency_ ${i}.root) done for ANGLE_DEG in $ANGLES_DEG[*];do set_variable SIGMA_NS 3.0 set_variable OUTLIERS 3 set_variable OUTPUT_FILE $WORKDIR/matrix\[${ANGLE_DEG}\deg\].root $JPP_DIR/examples/JReconstruction-f"$INPUT_FILES[*]"-o $OUTPUT_FILE-S ${SIGMA_NS}-A ${ANGLE_DEG}-O ${OUTLIERS}-d ${DEBUG}--!fiif[[$OPTION=="plot"]];then if((0));then for H1 in h0 h1;do JPlot1D-f"$WORKDIR/matrix["${^ANGLES_DEG}" deg].root:${H1}"-y"1 2e3"-Y-L TR-T""-\^"number of events [a.u.]"-> o chi2
Definition: JMatrixNZ.sh:106
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 218 of file JReconstruction/JEvtToolkit.hh.

219  {
220  return NDF - 0.25 * chi2 / NDF;
221  }
then if[[!-f $DETECTOR]] then JDetector sh $DETECTOR fi cat $WORKDIR trigger_parameters txt<< EOFtrigger3DMuon.enabled=1;trigger3DMuon.numberOfHits=5;trigger3DMuon.gridAngle_deg=1;ctMin=0.0;TMaxLocal_ns=15.0;EOF set_variable TRIGGEREFFICIENCY_TRIGGERED_EVENTS_ONLY INPUT_FILES=() for((i=1;$i<=$NUMBER_OF_RUNS;++i));do JSirene.sh $DETECTOR $JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz $WORKDIR/sirene_ ${i}.root JTriggerEfficiency.sh $DETECTOR $DETECTOR $WORKDIR/sirene_ ${i}.root $WORKDIR/trigger_efficiency_ ${i}.root $WORKDIR/trigger_parameters.txt $JPP_DATA/PMT_parameters.txt INPUT_FILES+=($WORKDIR/trigger_efficiency_ ${i}.root) done for ANGLE_DEG in $ANGLES_DEG[*];do set_variable SIGMA_NS 3.0 set_variable OUTLIERS 3 set_variable OUTPUT_FILE $WORKDIR/matrix\[${ANGLE_DEG}\deg\].root $JPP_DIR/examples/JReconstruction-f"$INPUT_FILES[*]"-o $OUTPUT_FILE-S ${SIGMA_NS}-A ${ANGLE_DEG}-O ${OUTLIERS}-d ${DEBUG}--!fiif[[$OPTION=="plot"]];then if((0));then for H1 in h0 h1;do JPlot1D-f"$WORKDIR/matrix["${^ANGLES_DEG}" deg].root:${H1}"-y"1 2e3"-Y-L TR-T""-\^"number of events [a.u.]"-> o chi2
Definition: JMatrixNZ.sh:106
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 231 of file JReconstruction/JEvtToolkit.hh.

232  {
233  return -chi2;
234  }
then if[[!-f $DETECTOR]] then JDetector sh $DETECTOR fi cat $WORKDIR trigger_parameters txt<< EOFtrigger3DMuon.enabled=1;trigger3DMuon.numberOfHits=5;trigger3DMuon.gridAngle_deg=1;ctMin=0.0;TMaxLocal_ns=15.0;EOF set_variable TRIGGEREFFICIENCY_TRIGGERED_EVENTS_ONLY INPUT_FILES=() for((i=1;$i<=$NUMBER_OF_RUNS;++i));do JSirene.sh $DETECTOR $JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz $WORKDIR/sirene_ ${i}.root JTriggerEfficiency.sh $DETECTOR $DETECTOR $WORKDIR/sirene_ ${i}.root $WORKDIR/trigger_efficiency_ ${i}.root $WORKDIR/trigger_parameters.txt $JPP_DATA/PMT_parameters.txt INPUT_FILES+=($WORKDIR/trigger_efficiency_ ${i}.root) done for ANGLE_DEG in $ANGLES_DEG[*];do set_variable SIGMA_NS 3.0 set_variable OUTLIERS 3 set_variable OUTPUT_FILE $WORKDIR/matrix\[${ANGLE_DEG}\deg\].root $JPP_DIR/examples/JReconstruction-f"$INPUT_FILES[*]"-o $OUTPUT_FILE-S ${SIGMA_NS}-A ${ANGLE_DEG}-O ${OUTLIERS}-d ${DEBUG}--!fiif[[$OPTION=="plot"]];then if((0));then for H1 in h0 h1;do JPlot1D-f"$WORKDIR/matrix["${^ANGLES_DEG}" deg].root:${H1}"-y"1 2e3"-Y-L TR-T""-\^"number of events [a.u.]"-> o chi2
Definition: JMatrixNZ.sh:106
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 244 of file JReconstruction/JEvtToolkit.hh.

245  {
246  if (first.getHistory().size() == second.getHistory().size())
247  return first.getQ() > second.getQ();
248  else
249  return first.getHistory().size() > second.getHistory().size();
250  }
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 283 of file JReconstruction/JEvtToolkit.hh.

284  {
285  return std::find_if(fit.getHistory().begin(),
286  fit.getHistory().end(),
287  JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
288  }
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 298 of file JReconstruction/JEvtToolkit.hh.

299  {
300  return std::find_if(fit.getHistory().begin(),
301  fit.getHistory().end(),
302  JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
303  }
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 312 of file JReconstruction/JEvtToolkit.hh.

313  {
314  return has_history(fit, JMUONPREFIT);
315  }
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 324 of file JReconstruction/JEvtToolkit.hh.

325  {
326  return has_history(fit, JMUONSIMPLEX);
327  }
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 336 of file JReconstruction/JEvtToolkit.hh.

337  {
338  return has_history(fit, JMUONGANDALF);
339  }
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 348 of file JReconstruction/JEvtToolkit.hh.

349  {
350  return has_history(fit, JMUONENERGY);
351  }
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 360 of file JReconstruction/JEvtToolkit.hh.

361  {
362  return has_history(fit, JMUONSTART);
363  }
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 372 of file JReconstruction/JEvtToolkit.hh.

373  {
374  return has_history(fit, JRange<int>(JMUONBEGIN, JMUONEND));
375  }
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 384 of file JReconstruction/JEvtToolkit.hh.

385  {
386  return has_history(fit, JSHOWERPREFIT);
387  }
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 396 of file JReconstruction/JEvtToolkit.hh.

397  {
398  return has_history(fit, JSHOWERPOSITIONFIT);
399  }
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 408 of file JReconstruction/JEvtToolkit.hh.

409  {
410  return has_history(fit, JSHOWERCOMPLETEFIT);
411  }
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 420 of file JReconstruction/JEvtToolkit.hh.

421  {
422  return has_history(fit, JRange<int>(JSHOWERBEGIN, JSHOWEREND));
423  }
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 435 of file JReconstruction/JEvtToolkit.hh.

436  {
437  return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
438  }
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 447 of file JReconstruction/JEvtToolkit.hh.

448  {
450  }
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 459 of file JReconstruction/JEvtToolkit.hh.

460  {
462  }
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 476 of file JReconstruction/JEvtToolkit.hh.

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

Get best reconstructed muon.

Parameters
evtevent
Returns
track

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

502  {
504  }
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 513 of file JReconstruction/JEvtToolkit.hh.

514  {
516  }
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.
double JRECONSTRUCTION::getProbability ( const JModule module,
const JDAQSummaryFrame frame,
const JRateL1_t R_Hz,
const double  T_ns,
const std::multiset< int > &  top 
)
inline

Get probability of given response in optical module due to random background.

Parameters
modulemodule
framesummary frame
R_Hzmultiples rates [Hz]
T_nstime window [ns]
toplist of indentifiers of PMTs with hit in given module
Returns
probability

Definition at line 75 of file JMuonStart.hh.

80  {
81  using namespace std;
82  using namespace JPP;
83  using namespace KM3NETDAQ;
84 
85  size_t N = 0; // number of active PMTs
86  size_t M = 0; // multiplicity
87  double R = 0.0; // total rate
88 
89  for (size_t i = 0; i != module.size(); ++i) {
90 
91  if (getDAQStatus(frame, module, i) &&
92  getPMTStatus(frame, module, i) &&
93  !module.getPMT(i).has(PMT_DISABLE)) {
94 
95  N += 1;
96  M += top.count(i);
97  R += frame.getRate(i);
98  }
99  }
100 
101  if (N > 0)
102  return JFIT::getProbability(N, M, JK40Rates(R/N, R_Hz), T_ns);
103  else
104  return (M == 0 ? 1.0 : 0.0);
105  }
double getRate(const int tdc, const double factor=1.0) const
Get count rate.
bool has(const int bit) const
Test PMT status.
Definition: JStatus.hh:120
static const int PMT_DISABLE
KM3NeT Data Definitions v3.2.0-2-gaaf0dd0 https://git.km3net.de/common/km3net-dataformat.
Definition: pmt_status.hh:12
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:173
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
bool getPMTStatus(const JStatus &status)
Test status of PMT.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
double getProbability(const size_t N, const size_t M, const JK40Rates &R_Hz, const double T_ns)
Get probability due to random background.
Definition: JFitToolkit.hh:248
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.
Auxiliary class for K40 rates.
Definition: JK40Rates.hh:41
bool JRECONSTRUCTION::filter ( const JDAQEvent tev,
const JEvt evt,
const Evt *const  pE 
)

Event selection.

Parameters
tevDAQ event
evtinput event
pEpointer to Monte Carlo event
Returns
true if selected; else false

Definition at line 21 of file JReconstruction/event_selector.cc.

22  {
23  using namespace std;
24  using namespace JPP;
25  /*
26  if (!evt.empty() && evt[0].getQ() >= 100) {
27 
28  if (pE != NULL) {
29 
30  Trk muon;
31 
32  for (const auto& t1 : pE->mc_trks) {
33  if (is_muon(t1)) {
34  if (t1.E > muon.E) {
35  muon = t1;
36  }
37  }
38  }
39 
40  return (is_muon(muon) && getAngle(getDirection(event[0]), getDirection(muon)) > 5.0);
41  }
42  }
43  */
44  return true;
45  }