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;
269 info <<
"initial value: " <<
getInitValue() << std::endl;
Double_t CalcMass(std::vector< TAbsFitParticle * > *List, Bool_t IniVal)
Double_t getCurrentValue() override
Double_t _TheMassConstraint
Bool_t OnList(std::vector< TAbsFitParticle * > *List, TAbsFitParticle *particle)
TMatrixD * getDerivative(TAbsFitParticle *particle) override
~TFitConstraintM() override
TString getInfoString() override
void addParticles2(TAbsFitParticle *p1, TAbsFitParticle *p2=nullptr, TAbsFitParticle *p3=nullptr, TAbsFitParticle *p4=nullptr, TAbsFitParticle *p5=nullptr, TAbsFitParticle *p6=nullptr, TAbsFitParticle *p7=nullptr, TAbsFitParticle *p8=nullptr, TAbsFitParticle *p9=nullptr, TAbsFitParticle *p10=nullptr)
void addParticles1(TAbsFitParticle *p1, TAbsFitParticle *p2=nullptr, TAbsFitParticle *p3=nullptr, TAbsFitParticle *p4=nullptr, TAbsFitParticle *p5=nullptr, TAbsFitParticle *p6=nullptr, TAbsFitParticle *p7=nullptr, TAbsFitParticle *p8=nullptr, TAbsFitParticle *p9=nullptr, TAbsFitParticle *p10=nullptr)
std::pair< OmniClusterRef, TrackingParticleRef > P
std::vector< TAbsFitParticle * > _ParList1
void addParticle1(TAbsFitParticle *particle)
Double_t getInitValue() override
std::vector< TAbsFitParticle * > _ParList2
void addParticle2(TAbsFitParticle *particle)