17 #include "TLorentzVector.h" 28 ,_TheMassConstraint(0)
34 std::vector<TAbsFitParticle*>* ParList2, Double_t
Mass)
55 <<
"Mass constraint in TFitConstraintM cannot be set to a negative value, will be set to 0.";
61 std::vector<TAbsFitParticle*>* ParList1,
62 std::vector<TAbsFitParticle*>* ParList2, Double_t
Mass)
83 <<
"Mass constraint in TFitConstraintM cannot be set to a negative value, will be set to 0.";
156 TMatrixD* DerivativeMatrix =
new TMatrixD(1,4);
157 (*DerivativeMatrix) *= 0.;
162 Double_t Factor = 0.;
163 TLorentzVector Pf(0., 0., 0., 0.);
167 for (
unsigned int i=0;
i<Npart;
i++) {
168 const TLorentzVector* FourVec = (
_ParList1[
i])->getCurr4Vec();
173 <<
"Division by zero in " 174 << IsA()->GetName() <<
" (named " << GetName() <<
", titled " << GetTitle()
175 <<
") will lead to Inf in derivative matrix for particle " 176 << particle->GetName() <<
".";
181 for (
unsigned int i=0;
i<Npart;
i++) {
182 const TLorentzVector* FourVec = (
_ParList2[
i])->getCurr4Vec();
187 <<
"Division by zero in " 188 << IsA()->GetName() <<
" (named " << GetName() <<
", titled " << GetTitle()
189 <<
") will lead to Inf in derivative matrix for particle " 190 << particle->GetName() <<
".";
197 (*DerivativeMatrix)(0,0) = -Pf[0] ;
198 (*DerivativeMatrix)(0,1) = -Pf[1];
199 (*DerivativeMatrix)(0,2) = -Pf[2];
200 (*DerivativeMatrix)(0,3) = +Pf[3];
201 (*DerivativeMatrix) *= Factor;
203 return DerivativeMatrix;
211 Double_t InitValue(0) ;
219 Double_t CurrentValue(0);
230 UInt_t Npart = List->size();
231 for (
unsigned int i=0;
i<Npart;
i++) {
232 ok = (particle == (*List)[
i]);
241 TLorentzVector
P(0., 0., 0., 0.);
242 UInt_t Npart = List->size();
243 for (
unsigned int i=0;
i<Npart;
i++) {
244 const TLorentzVector* FourVec =
nullptr;
246 FourVec = ((*List)[
i])->getIni4Vec();
248 FourVec = ((*List)[
i])->getCurr4Vec();
257 std::stringstream
info;
258 info << std::scientific << std::setprecision(6);
260 info <<
"__________________________" << std::endl
262 info <<
"OBJ: " << IsA()->GetName() <<
"\t" << GetName() <<
"\t" << GetTitle() << std::endl;
264 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)