1 #ifndef __JFIT__JFITTOOLKIT__
2 #define __JFIT__JFITTOOLKIT__
26 namespace JPP {
using namespace JFIT; }
41 inline double getP(
const double expval,
bool hit)
44 return -expm1(-expval);
69 inline double getChi2(
const double expval,
bool hit)
72 return -log1p(-
exp(-expval));
92 template<
class JModel_t,
class JHit_t>
95 const double ds = (hit.getT() - model.getT(hit)) / sigma;
117 template<
class JModel_t,
class T>
122 for (
T hit = __begin; hit != __end; ++hit) {
123 chi2 +=
getChi2(model, *hit, sigma);
178 JMatrixNZ V(track, __begin, __end, alpha, sigma);
182 return getChi2(track, __begin, __end, V);
200 for (
size_t j = 0;
j != V.
size(); ++
j) {
201 chi2 +=
V(i,
j) * Y[
j];
204 return chi2*chi2 /
V(i,i);
226 template<
class JModel_t,
class JFit_t,
class T>
227 inline double getChi2(
const JModel_t&
model,
const JFit_t& fit,
T __begin,
T __end)
231 for (
T hit = __begin; hit != __end; ++hit) {
232 chi2 += fit(model, *hit);
256 return (M == 0 ? 1.0 : 0.0);
259 const double T = T_ns * 1.0e-9;
Auxiliary methods for mathematics.
static double getDot(const variance &first, const variance &second)
Get dot product.
multiplicity_type getLowerL1Multiplicity() const
Get lower multiplicty.
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
Determination of the time residual vector of hits for a track along z-axis (JFIT::JLine1Z).
Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z).
do set_variable OUTPUT_DIRECTORY $WORKDIR T
double getMultiplesRate(const multiplicity_type M) const
Get multiples rate at given multiplicity.
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...
void invert()
Invert matrix according LDU decomposition.
size_t size() const
Get dimension of matrix.
double getSinglesRate() const
Get singles rate.
size_t multiplicity_type
Type definition of multiplicity.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
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
double getProbability(const size_t N, const size_t M, const JK40Rates &R_Hz, const double T_ns)
Get probability due to random background.
Data structure for fit of straight line paralel to z-axis.
double poisson(const size_t n, const double mu)
Poisson probability density distribition.
multiplicity_type getUpperL1Multiplicity() const
Get upper multiplicty.
Base class for data structures with artithmetic capabilities.
double getChi2(const double P)
Get chi2 corresponding to given probability.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
Auxiliary class for K40 rates.