1 #ifndef __JFIT__JLINE1ZESTIMATOR__
2 #define __JFIT__JLINE1ZESTIMATOR__
18 namespace JPP {
using namespace JFIT; }
110 (*this)(__begin, __end);
134 if (
N >= NUMBER_OF_PARAMETERS) {
143 for (
T i = __begin; i != __end; ++i) {
150 const double W = 1.0/
N;
167 double xi = j->getX() - getX();
168 double yi = j->getY() - getY();
173 if ((
done = (++j == __end))) {
177 double xj = j->getX() - getX();
178 double yj = j->getY() - getY();
185 const double y = ((xj + xi) * dx +
217 __x +=
V.a00 * y0 +
V.a01 * y1 +
V.a02 * y2;
218 __y +=
V.a10 * y0 +
V.a11 * y1 +
V.a12 * y2;
219 __t =
V.a20 * y0 +
V.a21 * y1 +
V.a22 * y2;
225 throw JValueOutOfRange(
"JEstimator<JLine1Z>::JEstimator(): Not enough data points.");
256 if (
N != (
int) A.
size()) {
260 if (
N >= NUMBER_OF_PARAMETERS) {
270 for (
size_t row = 0; row != A.
size(); ++row, ++i) {
272 const double dx = i->getX() - getX();
273 const double dy = i->getY() - getY();
275 const double rt = sqrt(dx*dx + dy*dy);
288 for (
size_t col = 0; col != A.
size(); ++col, ++
j) {
290 const double dx = j->getX() - getX();
291 const double dy = j->getY() - getY();
292 const double dz = j->getZ() - getZ();
294 const double rt = sqrt(dx*dx + dy*dy);
307 const double vs =
A(row,col);
313 V.a00 += xr * vs * xc;
314 V.a01 += xr * vs * yc;
315 V.a02 += xr * vs * tc;
316 V.a11 += yr * vs * yc;
317 V.a12 += yr * vs * tc;
318 V.a22 += tr * vs * tc;
328 __x +=
V.a00 * x1 +
V.a01 * y1 +
V.a02 * t1;
329 __y +=
V.a10 * x1 +
V.a11 * y1 +
V.a12 * t1;
330 __t =
V.a20 * x1 +
V.a21 * y1 +
V.a22 * t1;
338 static const int NUMBER_OF_PARAMETERS = 3;
Linear fit of straight line parallel to z-axis to set of hits (objects with position and time)...
double getKappaC()
Get average R-dependence of arrival time of Cherenkov light (a.k.a.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
JEstimator()
Default constructor.
Template definition of linear fit.
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
JEstimator(T __begin, T __end)
Constructor.
Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z).
void update(T __begin, T __end, const JMatrixNZ &A)
Update track parameters using updated co-variance matrix (e.g. matrix with one hit switched off)...
do set_variable OUTPUT_DIRECTORY $WORKDIR T
const JEstimator< JLine1Z > & operator()(T __begin, T __end)
Fit.
set_variable NUMBER_OF_ITERATIONS set_variable EPSILON cat acoustics_fit_parameters txt<< EOF $CONFIGURATION[*]Nmin=3;sigma_s=100.0e-6;stdev=10.0;mestimator=0;fixStrings=0;EOF for STRING in $STRINGS[*];do#fit stretching and(z) position of given string set_variable DETECTOR_TMP ${TMPDIR:-/tmp}/detector_A.datx JEditDetector-a $DETECTOR-o $DETECTOR_TMP-r $STRING JEditDetector-a $DETECTOR-o $DETECTOR-k $STRING for MUL in 0.005 0.001;do DX_M=0.2 for((N=0;$N< $NUMBER_OF_ITERATIONS;++N));do CHI2[3]=$CHI2[1] fitPositionOfString $STRING Z $DX_M fitStretchingOfString $STRING $MUL if(($CHI2[3]-$CHI2[1]< $EPSILON));then break fi done if(($N >=$NUMBER_OF_ITERATIONS));then printf"warning: reached maximum number of iterations %d - converenge %7.3f\n"$N $(($CHI2[3]-$CHI2[1])) fi done JMergeDetector-a $DETECTOR-a $DETECTOR_TMP-o $DETECTOR rm-f $DETECTOR_TMP JConvertDetectorFormat-a $DETECTOR-o $DETECTOR-r-d 0 > &dev null done
JMATH::JMatrix3S V
co-variance matrix of fit parameters
size_t size() const
Get dimension of matrix.
const double getSpeedOfLight()
Get speed of light.
const double getInverseSpeedOfLight()
Get inverse speed of light.
Data structure for fit of straight line paralel to z-axis.
Exception for accessing a value in a collection that is outside of its range.
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A