Fit function.
193 const double STANDARD_DEVIATIONS = 3.0;
198 data.reserve(dataL0.size() +
203 for (JOmega3D_t::const_iterator dir =
omega.begin(); dir !=
omega.end(); ++dir) {
208 buffer_type::iterator __end =
copy(dataL1.begin(), dataL1.end(),
data.begin());
210 for (buffer_type::iterator
i =
data.begin();
i != __end; ++
i) {
219 buffer_type::iterator __p =
data.begin();
223 partial_sort(
data.begin(), __p, __end,
cmz);
235 buffer_type::iterator p = __end;
236 buffer_type::iterator q =
copy(dataL0.begin(), dataL0.end(), p);
238 for (buffer_type::iterator
i = p;
i != q; ++
i) {
244 if (match1D.count(*
i,
data.begin(), __end) != 0) {
255 if (
distance(
data.begin(), __end) <= NUMBER_OF_PARAMETERS) {
263 double chi2 = numeric_limits<double>::max();
264 int NDF =
distance(
data.begin(), __end) - NUMBER_OF_PARAMETERS;
272 if (number_of_outliers > NDF - 1) {
273 number_of_outliers = NDF - 1;
276 double ymin = numeric_limits<double>::max();
278 buffer_type::iterator __end1 = __end;
280 for (
int n = 0;
n <= number_of_outliers; ++
n, --__end1) {
292 (*this)(
data.begin(), __end1);
301 if (y <= -(STANDARD_DEVIATIONS * STANDARD_DEVIATIONS)) {
303 WARNING(endl <<
"chi2(1) " << y << endl);
315 NDF =
distance(
data.begin(), __end1) - NUMBER_OF_PARAMETERS;
320 catch(
const exception& error) {}
324 ymin -= STANDARD_DEVIATIONS * STANDARD_DEVIATIONS;
329 const int number_of_outliers = NDF - 1;
333 (*this)(
data.begin(), __end);
340 for (
int n = 0;
n <= number_of_outliers; ++
n) {
345 for (
size_t i = 0;
i !=
Y.size(); ++
i) {
355 if (ymax < STANDARD_DEVIATIONS * STANDARD_DEVIATIONS) {
363 this->update(
data.begin(), __end,
V);
371 catch(
const exception& error) {
375 static_cast<JLine1Z&
>(*this) = tz;
386 catch(
const exception& error) {}
389 if (chi2 != numeric_limits<double>::max()) {
400 JEvt::iterator __end = out.end();
408 JEvt::iterator
p2 =
p1;
410 for (JEvt::iterator
i =
p1;
i != out.end(); ++
i) {
411 if (
i->getQ() > p2->getQ()) {
422 for (
double Q = p2->getQ();
p1 != out.end() && (
p1->getQ() >= p2->getQ() -
Qmin ||
p1->getQ() <=
Q);
Q = (
p1++)->
getQ()) {}
424 swap(*(__end++), *p2);
444 JEvt::iterator __p = __end;
459 out.erase(__end, out.end());
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
Q(UTCMax_s-UTCMin_s)-livetime_s
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
static struct JTRIGGER::clusterizeWeight clusterizeWeight
int getModuleID() const
Get module identifier.
Auxiliary class to compare fit results with respect to a reference direction (e.g. true muon).
void set(const JVector3D &pos, T __begin, T __end, const double alpha, const double sigma)
Set co-variance matrix.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
bool useL0
option for L0 hit use
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
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.
void update(const size_t k, const double value)
Update inverted matrix at given diagonal element.
static struct JRECONSTRUCTION::JMuonPrefit::cmz cmz
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
int numberOfOutliers
maximum number of outliers
static struct JTRIGGER::JHitR1::compare compare
double roadWidth_m
road width [m]
double Qmin
minimal quality step
static const int JMUONPREFIT
double gridAngle_deg
grid angle for directions [deg]
void set(const JLine1Z &track, T __begin, T __end)
Set time residual vector.
double getQ(const double D_m, const double f_kHz, const double d_m)
Get relative quality for given frequency at given distance.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
double TMaxLocal_ns
time window for local coincidences [ns]
void invert()
Invert matrix according LDU decomposition.
double getDZ() const
Get Z-slope.
int factoryLimit
factory limit for combinatorics
size_t numberOfPrefits
number of prefits
then JCookie sh JDataQuality D $DETECTOR_ID R
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
double DZMax
maximal slope for downward pointing solutions
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
Data structure for fit of straight line paralel to z-axis.
void copy(const Head &from, JHead &to)
Copy header from from to to.
size_t numberOfDZMax
additional number of downward pointing solutions
double getChi2(const double P)
Get chi2 corresponding to given probability.
static struct JTRIGGER::clusterize clusterize
double sigma_ns
time resolution [ns]
int NMaxHits
maximal number of hits