16 #include "TLorentzVector.h"
25 std::vector<TAbsFitParticle*>* ParList2,
41 }
else if (
Mass < 0) {
43 <<
"Mass constraint in TFitConstraintM cannot be set to a negative value, will be set to 0.";
50 std::vector<TAbsFitParticle*>* ParList1,
51 std::vector<TAbsFitParticle*>* ParList2,
67 }
else if (
Mass < 0) {
69 <<
"Mass constraint in TFitConstraintM cannot be set to a negative value, will be set to 0.";
169 TMatrixD* DerivativeMatrix =
new TMatrixD(1, 4);
170 (*DerivativeMatrix) *= 0.;
175 Double_t Factor = 0.;
176 TLorentzVector Pf(0., 0., 0., 0.);
180 for (
unsigned int i = 0;
i < Npart;
i++) {
181 const TLorentzVector* FourVec = (
_ParList1[
i])->getCurr4Vec();
185 edm::LogInfo(
"KinFitter") <<
"Division by zero in " << IsA()->GetName() <<
" (named " << GetName() <<
", titled "
186 << GetTitle() <<
") will lead to Inf in derivative matrix for particle "
187 << particle->GetName() <<
".";
189 Factor = 1. / Pf.M();
192 for (
unsigned int i = 0;
i < Npart;
i++) {
193 const TLorentzVector* FourVec = (
_ParList2[
i])->getCurr4Vec();
197 edm::LogInfo(
"KinFitter") <<
"Division by zero in " << IsA()->GetName() <<
" (named " << GetName() <<
", titled "
198 << GetTitle() <<
") will lead to Inf in derivative matrix for particle "
199 << particle->GetName() <<
".";
201 Factor = -1. / Pf.M();
206 (*DerivativeMatrix)(0, 0) = -Pf[0];
207 (*DerivativeMatrix)(0, 1) = -Pf[1];
208 (*DerivativeMatrix)(0, 2) = -Pf[2];
209 (*DerivativeMatrix)(0, 3) = +Pf[3];
210 (*DerivativeMatrix) *= Factor;
212 return DerivativeMatrix;
218 Double_t InitValue(0);
226 Double_t CurrentValue(0);
235 UInt_t Npart = List->size();
236 for (
unsigned int i = 0;
i < Npart;
i++) {
237 ok = (particle == (*List)[
i]);
247 TLorentzVector
P(0., 0., 0., 0.);
248 UInt_t Npart = List->size();
249 for (
unsigned int i = 0;
i < Npart;
i++) {
250 const TLorentzVector* FourVec =
nullptr;
252 FourVec = ((*List)[
i])->getIni4Vec();
254 FourVec = ((*List)[
i])->getCurr4Vec();
263 std::stringstream
info;
264 info << std::scientific << std::setprecision(6);
266 info <<
"__________________________" << std::endl << std::endl;
267 info <<
"OBJ: " << IsA()->GetName() <<
"\t" << GetName() <<
"\t" << GetTitle() << std::endl;