7 #include "GaudiKernel/MsgStream.h"
24 if(
hits.empty() )
return {};
35 float a =
it->distance*invSpeedOfLight;
36 float invBeta =
it->time/
a;
37 float invBetaError =
it->error/
a;
39 const char*
text =
it->useInFit ?
" hit " :
" outlier ";
40 float beta =
it->distance*invSpeedOfLight/
it->time;
41 float dbeta =
it->distance*invSpeedOfLight/(
it->time*
it->time)*
it->error;
43 <<
" error " <<
it->error <<
" beta " <<
beta <<
" error " << dbeta
44 <<
" 1./beta " << invBeta <<
" error " << invBetaError <<
" use " <<
it->useInFit <<
endmsg;
46 if(
it->useInFit && (invBeta - pullCut*invBetaError > maxInvBeta || invBeta + pullCut*invBetaError < 1) ) {
50 if( !
it->useInFit )
continue;
51 sum1 +=
it->distance*
it->distance*invSpeedOfLight*
it->weight2;
52 sum2 +=
it->distance*
it->time*
it->weight2;
55 if( sum2 == 0 )
return {};
58 float beta = sum1/sum2;
59 float invBeta = 1./
beta;
65 float res =
it->time -
it->distance*invSpeedOfLight*invBeta;
68 const char*
text =
it->useInFit ?
" hit " :
" outlier ";
71 if( !
it->useInFit )
continue;
75 if(
ndof == 0 )
return {};
100 float bestChi2Ndof =
result.chi2PerDOF();
101 for(
unsigned int i=0;
i<
hits.size();++
i ){
104 if( !
hits[
i].useInFit )
continue;
107 hits[
i].useInFit =
false;
110 if( resultNew.
status != 0 ){
112 if( chi2Ndof < bestChi2Ndof ){
113 bestChi2Ndof = chi2Ndof;
118 hits[
i].useInFit =
true;
122 if( worstHit == -1 ) {
127 hits[worstHit].useInFit =
false;