1 #ifndef KinematicConstrainedVertexUpdatorT_H
2 #define KinematicConstrainedVertexUpdatorT_H
11 namespace KineDebug3 {
51 update(
const ROOT::Math::SVector<double, 3+7*nTrk> & inState,
52 ROOT::Math::SMatrix<
double, 3+7*nTrk,3+7*nTrk ,ROOT::Math::MatRepSym<double,3+7*nTrk> >& inCov, std::vector<KinematicState> & lStates,
60 ROOT::Math::SMatrix<double,nConstraint+4,3+7*nTrk>
g;
61 ROOT::Math::SVector<double,nConstraint+4>
val;
64 ROOT::Math::SVector<double, 3+7*nTrk>
finPar;
65 ROOT::Math::SVector<double, nConstraint+4>
lambda;
67 ROOT::Math::SMatrix<double,3,3,ROOT::Math::MatRepSym<double,3> >
pCov;
68 ROOT::Math::SMatrix<double,7,7,ROOT::Math::MatRepSym<double,7> >
nCovariance;
69 ROOT::Math::SMatrix<double,nConstraint+4,nConstraint+4,ROOT::Math::MatRepSym<double,nConstraint+4> >
v_g_sym;
75 template <
int nTrk,
int nConstra
int>
79 template <
int nTrk,
int nConstra
int>
83 template <
int nTrk,
int nConstra
int>
86 ROOT::Math::SMatrix<
double, 3+7*nTrk,3+7*nTrk ,ROOT::Math::MatRepSym<double,3+7*nTrk> >& inCov,
87 std::vector<KinematicState> & lStates,
94 int vSize = lStates.size();
96 assert( nConstraint==0 || cs!=0);
97 assert(vSize == nConstraint);
102 delta_alpha(0)-=lPoint.
x();
103 delta_alpha(1)-=lPoint.
y();
104 delta_alpha(2)-=lPoint.
z();
106 for(std::vector<KinematicState>::const_iterator
i = lStates.begin();
i != lStates.end();
i++)
107 for (
int j=0;
j<7;
j++) {
108 delta_alpha(cst)-=
i->kinematicParameters()(
j);
117 if( nConstraint !=0) {
118 cs->
init(lStates, lPoint, fieldValue);
119 val.Place_at(cs->
value(),0);
124 vConstraint.init(lStates, lPoint, fieldValue);
125 val.Place_at(vConstraint.value(),nConstraint);
126 g.Place_at(vConstraint.positionDerivative(),nConstraint, 0);
127 g.Place_at(vConstraint.parametersDerivative(),nConstraint, 3);
133 v_g_sym = ROOT::Math::Similarity(
g,inCov);
140 LogDebug(
"KinematicConstrainedVertexFitter3")
141 <<
"Fit failed: unable to invert SYM gain matrix\n";
147 val +=
g*delta_alpha;
148 lambda = v_g_sym *val;
151 finPar = inPar - inCov * (ROOT::Math::Transpose(
g) * lambda);
154 ROOT::Math::SMatrix<double,3+7*nTrk,3+7*nTrk,ROOT::Math::MatRepSym<double,3+7*nTrk> >
prod = ROOT::Math::SimilarityT(
g,v_g_sym);
155 ROOT::Math::SMatrix<double,3+7*nTrk,3+7*nTrk,ROOT::Math::MatRepSym<double,3+7*nTrk> > prod1;
156 ROOT::Math::AssignSym::Evaluate(prod1, inCov * prod * inCov);
160 pCov = inCov.template Sub< ROOT::Math::SMatrix<double,3,3,ROOT::Math::MatRepSym<double,3> > >(0,0);
163 double chi = ROOT::Math::Dot(lambda,val);
167 float ndf = 2*vSize - 3;
179 for(std::vector<KinematicState>::iterator i_st=lStates.begin(); i_st != lStates.end(); i_st++)
181 for(
int i =0;
i<7;
i++)
182 {newPar(
i) = finPar(3 + i_int*7 +
i);}
184 nCovariance = inCov.template Sub<ROOT::Math::SMatrix<double, 7,7,ROOT::Math::MatRepSym<double,7> > >(3 + i_int*7, 3 + i_int*7);
ROOT::Math::SVector< double, 3+7 *nTrk > finPar
RefCountedKinematicVertex update(const ROOT::Math::SVector< double, 3+7 *nTrk > &inState, ROOT::Math::SMatrix< double, 3+7 *nTrk, 3+7 *nTrk, ROOT::Math::MatRepSym< double, 3+7 *nTrk > > &inCov, std::vector< KinematicState > &lStates, const GlobalPoint &lPoint, GlobalVector const &fieldValue, MultiTrackKinematicConstraintT< nTrk, nConstraint > *cs)
ROOT::Math::SMatrix< double, nConstraint+4, 3+7 *nTrk > g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
ROOT::Math::SVector< double, 7 > AlgebraicVector7
ROOT::Math::SVector< double, nConstraint+4 > val
VertexKinematicConstraintT vConstraint
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > nCovariance
~KinematicConstrainedVertexUpdatorT()
parametersDerivativeType const & parametersDerivative() const
ReferenceCountingPointer< KinematicVertex > RefCountedKinematicVertex
positionDerivativeType const & positionDerivative() const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > pCov
ROOT::Math::SVector< double, 3+7 *nTrk > delta_alpha
ROOT::Math::SVector< double, nConstraint+4 > lambda
KinematicConstrainedVertexUpdatorT()
ROOT::Math::SMatrix< double, nConstraint+4, nConstraint+4, ROOT::Math::MatRepSym< double, nConstraint+4 > > v_g_sym
virtual void init(const std::vector< KinematicState > &states, const GlobalPoint &point, const GlobalVector &mf)=0
KinematicVertexFactory vFactory
valueType const & value() const