 |
Belle II Software
release-05-01-25
|
14 #include <framework/core/Module.h>
16 #include <analysis/DecayDescriptor/DecayDescriptor.h>
19 #include <analysis/OrcaKinFit/BaseFitter.h>
20 #include <analysis/OrcaKinFit/TextTracer.h>
23 #include <analysis/OrcaKinFit/MomentumConstraint.h>
24 #include <analysis/OrcaKinFit/RecoilMassConstraint.h>
25 #include <analysis/OrcaKinFit/MassConstraint.h>
28 #include <analysis/OrcaKinFit/ParticleFitObject.h>
31 #include <analysis/dataobjects/EventExtraInfo.h>
34 #include <framework/datastore/StoreObjPtr.h>
37 #include <TLorentzVector.h>
38 #include <TMatrixFSym.h>
41 #include <CLHEP/Matrix/SymMatrix.h>
42 #include <CLHEP/Vector/LorentzVector.h>
50 namespace OrcaKinFit {
58 class ParticleKinematicFitterModule :
public Module {
82 virtual void endRun()
override;
92 virtual void event()
override;
231 std::vector<Particle*>& allparticles,
const Particle* daughter);
std::string m_orcaTracer
Tracer (None, Text or ROOT)
Abstract base class for fitting engines of kinematic fits.
MomentumConstraint m_hardConstraintPy
hard beam constraint py
RecoilMassConstraint m_hardConstraintRecoilMass
hard recoil mass constraint
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.
Implements constraint 0 = mass1 - mass2 - m.
std::string m_kinematicFitter
Kinematic Fitter name.
void addConstraintsToFitter(BaseFitter &fitter)
Adds Orca fit object to the constraints.
bool doKinematicFit(Particle *p)
Main steering routine for any kinematic fitter.
std::vector< double > m_unmeasuredLeptonFitObject
unmeasured fit object
TMatrixFSym getTMatrixFSymMomentumErrorMatrix()
Returns particle's 7x7 momentum-error matrix as a TMatrixFSym.
float getFitObjectError(ParticleFitObject *fitobject, int ilocal)
Returns fit object error on the parameter ilocal.
DecayDescriptor m_decaydescriptor
Decay descriptor of decays to look for.
TextTracer * m_textTracer
internal text output variable
bool AddFour(Particle *mother)
Added four vectors and calcuated a covariance matrix for a combined particles.
Implements a constraint of the form efact*sum(E)+pxfact*sum(px)+pyfact*sum(py)+pzfact*sum(pz)=value.
double m_recoilMass
Recoil mass for RecoilMass constraint.
CLHEP::HepSymMatrix getCLHEPMomentumVertexErrorMatrix(Particle *particle)
Returns particle's 7x7 momentum-vertex-error matrix as a HepSymMatrix.
StoreObjPtr< EventExtraInfo > m_eventextrainfo
StoreObjPtr for the EventExtraInfo in this mode.
CLHEP::HepLorentzVector getCLHEPLorentzVector(Particle *particle)
Returns particle's 4-momentum as a HepLorentzVector.
std::vector< double > m_unmeasuredGammaFitObject
unmeasured fit object
virtual void terminate() override
termination.
CLHEP::HepSymMatrix getCLHEPMomentumErrorMatrix(Particle *particle)
Returns particle's 4x4 momentum-error matrix as a HepSymMatrix.
void addUnmeasuredGammaToOrcaKinFit(BaseFitter &fitter)
Adds an unmeasured gamma (E, phi, theta) to the fit (-3C) stored as EventExtraInfo TODO.
void addParticleToOrcaKinFit(BaseFitter &fitter, Particle *particle, const int index)
Adds given particle to the OrcaKinFit.
bool m_debugFitter
activate internal debugging (for New and Newton fitter only)
bool m_updateMother
update mother kinematics
virtual void initialize() override
Initialize the Module.
void updateOrcaKinFitMother(BaseFitter &fitter, std::vector< Particle * > &particleChildren, Particle *mother)
Update the mother: momentum is sum of daughters TODO update covariance matrix.
MomentumConstraint m_hardConstraintE
hard beam constraint E
std::string m_listName
particle list name
TMatrixFSym getFitObjectCovMat(ParticleFitObject *fitobject)
Returns covariance matrix.
Abstract base class for different kinds of events.
void addTracerToFitter(BaseFitter &fitter)
Adds tracer to the fitter.
Type-safe access to single objects in the data store.
void resetFitter(BaseFitter &fitter)
Resets all objects associated with the OrcaKinFit fitter.
TMatrixFSym getCovMat7(ParticleFitObject *fitobject)
Returns covariance matrix.
bool m_updateDaughters
update daughter kinematics
std::string m_orcaConstraint
Constraint (softBeam, hardBeam (default))
bool m_addUnmeasuredPhoton
add one unmeasured photon to the fit (costs 3 constraints)
TLorentzVector getTLorentzVectorConstraints()
Get constraints (at whatever stage before/after fitting)
Class to store reconstructed particles.
TMatrixFSym getTMatrixFSymMomentumVertexErrorMatrix()
Returns particle's 7x7 momentum-vertex-error matrix as a TMatrixFSym.
TLorentzVector getTLorentzVector(ParticleFitObject *fitobject)
virtual void event() override
Event processor.
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
bool storeOrcaKinFitParticles(const std::string &prefix, BaseFitter &fitter, std::vector< Particle * > &particleChildren, Particle *mother)
store fit object information as ExtraInfo
virtual void endRun() override
Called when ending a new run.
MomentumConstraint m_hardConstraintPz
hard beam constraint pz
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 ...
double m_invMass
Inviriant mass for Mass constraint.
bool m_add3CPhoton
add one photon with unmeasured energy to the fit (costs 1 constraints)
std::string m_decayString
daughter particles selection
int m_debugFitterLevel
internal debugging level (for New and Newton fitter only)
MassConstraint m_hardConstraintMass
hard mass constraint
bool doOrcaKinFitFit(Particle *p)
Kinematic fit using OrcaKinFit.
bool updateOrcaKinFitDaughters(BaseFitter &fitter, Particle *mother)
Update the daughters: momentum is sum of daughters TODO update covariance matrix.
void addFitObjectToConstraints(ParticleFitObject &fitobject)
Adds Orca fit object to the constraints.
MomentumConstraint m_hardConstraintPx
hard beam constraint px
void setConstraints()
Sets constraints, this is not connect to particles or a fitter at this stage.
std::string m_orcaFitterEngine
Orca Fitter Engine name.
ParticleKinematicFitterModule()
Constructor.
virtual void beginRun() override
Called when entering a new run.