11#include <framework/core/Module.h>
13#include <analysis/DecayDescriptor/DecayDescriptor.h>
16#include <analysis/OrcaKinFit/BaseFitter.h>
17#include <analysis/OrcaKinFit/TextTracer.h>
20#include <analysis/OrcaKinFit/MomentumConstraint.h>
21#include <analysis/OrcaKinFit/RecoilMassConstraint.h>
22#include <analysis/OrcaKinFit/MassConstraint.h>
25#include <analysis/OrcaKinFit/ParticleFitObject.h>
28#include <framework/dataobjects/EventExtraInfo.h>
29#include <analysis/dataobjects/ParticleList.h>
32#include <framework/datastore/StoreObjPtr.h>
35#include <Math/Vector4D.h>
36#include <TMatrixFSym.h>
39#include <CLHEP/Matrix/SymMatrix.h>
40#include <CLHEP/Vector/LorentzVector.h>
48 namespace OrcaKinFit {
76 virtual void event()
override;
219 std::vector<Particle*>& allparticles,
const Particle* daughter);
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
Abstract base class for fitting engines of kinematic fits.
Implements constraint 0 = mass1 - mass2 - m.
Implements a constraint of the form efact*sum(E)+pxfact*sum(px)+pyfact*sum(py)+pzfact*sum(pz)=value.
MassConstraint m_hardConstraintMass
hard mass constraint
bool fillFitParticles(Particle *mother, std::vector< Particle * > &particleChildren)
Fills valid particle's children (with valid error matrix) in the vector of Particles that will enter ...
void addFitObjectToConstraints(ParticleFitObject &fitobject)
Adds Orca fit object to the constraints.
void updateMapOfTrackAndDaughter(unsigned &l, std::vector< std::vector< unsigned > > &pars, std::vector< unsigned > &pard, std::vector< Particle * > &allparticles, const Particle *daughter)
update the map of daughter and tracks, find out which tracks belong to each daughter.
bool m_liftPhotonTheta
lift theta constraint of the 3CPhoton.
std::vector< double > m_unmeasuredLeptonFitObject
unmeasured fit object
bool AddFour(Particle *mother)
Added four vectors and calculated a covariance matrix for a combined particles.
std::string m_orcaConstraint
Constraint (softBeam, hardBeam (default))
int m_debugFitterLevel
internal debugging level (for New and Newton fitter only)
virtual void initialize() override
Initialize the Module.
CLHEP::HepSymMatrix getCLHEPMomentumVertexErrorMatrix(Particle *particle)
Returns particle's 7x7 momentum-vertex-error matrix as a HepSymMatrix.
MomentumConstraint m_hardConstraintE
hard beam constraint E
virtual void event() override
Event processor.
bool m_debugFitter
activate internal debugging (for New and Newton fitter only)
bool m_updateDaughters
update daughter kinematics
std::string m_decayString
daughter particles selection
std::string m_listName
particle list name
void addUnmeasuredGammaToOrcaKinFit(BaseFitter &fitter)
Adds an unmeasured gamma (E, phi, theta) to the fit (-3C) stored as EventExtraInfo TODO.
virtual void terminate() override
termination.
MomentumConstraint m_hardConstraintPz
hard beam constraint pz
float getFitObjectError(ParticleFitObject *fitobject, int ilocal)
Returns fit object error on the parameter ilocal.
ROOT::Math::PxPyPzEVector getLorentzVectorConstraints()
Get constraints (at whatever stage before/after fitting)
std::string m_orcaFitterEngine
Orca Fitter Engine name.
bool doOrcaKinFitFit(Particle *p)
Kinematic fit using OrcaKinFit.
bool m_add3CPhoton
add one photon with unmeasured energy to the fit (costs 1 constraints)
TMatrixFSym getTMatrixFSymMomentumErrorMatrix()
Returns particle's 7x7 momentum-error matrix as a TMatrixFSym.
std::vector< double > m_unmeasuredGammaFitObject
unmeasured fit object
void addConstraintsToFitter(BaseFitter &fitter)
Adds Orca fit object to the constraints.
void addTracerToFitter(BaseFitter &fitter)
Adds tracer to the fitter.
RecoilMassConstraint m_hardConstraintRecoilMass
hard recoil mass constraint
TMatrixFSym getTMatrixFSymMomentumVertexErrorMatrix()
Returns particle's 7x7 momentum-vertex-error matrix as a TMatrixFSym.
StoreObjPtr< EventExtraInfo > m_eventextrainfo
StoreObjPtr for the EventExtraInfo in this mode.
MomentumConstraint m_hardConstraintPy
hard beam constraint py
double m_recoilMass
Recoil mass for RecoilMass constraint.
CLHEP::HepLorentzVector getCLHEPLorentzVector(Particle *particle)
Returns particle's 4-momentum as a HepLorentzVector.
TextTracer * m_textTracer
internal text output variable
DecayDescriptor m_decaydescriptor
Decay descriptor of decays to look for.
TMatrixFSym getCovMat7(ParticleFitObject *fitobject)
Returns covariance matrix.
ROOT::Math::PxPyPzEVector getLorentzVector(ParticleFitObject *fitobject)
bool updateOrcaKinFitDaughters(BaseFitter &fitter, Particle *mother)
Update the daughters: momentum is sum of daughters TODO update covariance matrix.
void setConstraints()
Sets constraints, this is not connect to particles or a fitter at this stage.
bool m_addUnmeasuredPhoton
add one unmeasured photon to the fit (costs 3 constraints)
TMatrixFSym getFitObjectCovMat(ParticleFitObject *fitobject)
Returns covariance matrix.
CLHEP::HepSymMatrix getCLHEPMomentumErrorMatrix(Particle *particle)
Returns particle's 4x4 momentum-error matrix as a HepSymMatrix.
double m_invMass
Invariant mass for Mass constraint.
ParticleKinematicFitterModule()
Constructor.
bool m_fixUnmeasuredPhotonToHER
fix the momentum of the unmeasured photon to HER
std::string m_orcaTracer
Tracer (None, Text or ROOT)
StoreObjPtr< ParticleList > m_plist
StoreObjPtr for the particle list.
void addParticleToOrcaKinFit(BaseFitter &fitter, Particle *particle, const int index)
Adds given particle to the OrcaKinFit.
void updateOrcaKinFitMother(BaseFitter &fitter, std::vector< Particle * > &particleChildren, Particle *mother)
Update the mother: momentum is sum of daughters TODO update covariance matrix.
std::string m_kinematicFitter
Kinematic Fitter name.
void resetFitter(BaseFitter &fitter)
Resets all objects associated with the OrcaKinFit fitter.
bool m_fixUnmeasuredPhotonToLER
fix the momentum of the unmeasured photon to LER
bool storeOrcaKinFitParticles(const std::string &prefix, BaseFitter &fitter, std::vector< Particle * > &particleChildren, Particle *mother)
store fit object information as ExtraInfo
bool doKinematicFit(Particle *p)
Main steering routine for any kinematic fitter.
bool m_updateMother
update mother kinematics
MomentumConstraint m_hardConstraintPx
hard beam constraint px
Class to store reconstructed particles.
Type-safe access to single objects in the data store.
Abstract base class for different kinds of events.