9#include <analysis/modules/PseudoVertexFitter/PseudoVertexFitterModule.h>
10#include <analysis/dataobjects/Particle.h>
11#include <analysis/dataobjects/ParticleList.h>
12#include <framework/database/DBObjPtr.h>
30 setDescription(
"Pseudo fitter adds a covariance matrix which is sum of the daughter covariance matrices.");
40 B2ERROR(
"No list name specified! Please enter the list name of the particle you want to add a covariance matrix to.");
43 B2INFO(
"PseudoVertexFitter: adding covariance matrix to " <<
m_listName);
51 B2ERROR(
"ParticleList " <<
m_listName <<
" not found");
55 unsigned int n = plist->getListSize();
56 for (
unsigned i = 0; i < n; i++) {
57 Particle* particle = plist->getParticle(i);
61 if (!ok) particle->setPValue(-1);
72 const std::vector<Particle*> daughters = mother->
getDaughters();
73 std::vector<TMatrixFSym> daughter_matrices;
74 daughter_matrices.reserve(daughters.size());
75 for (
auto daughter : daughters) {
76 daughter_matrices.push_back(daughter->getMomentumVertexErrorMatrix());
79 TMatrixFSym mother_errMatrix(7);
80 for (
int i = 0; i < 7; i++) {
81 for (
int j = 0; j < 7; j++) {
82 for (
unsigned int k = 0; k < daughters.size(); k++) {
83 mother_errMatrix[i][j] += daughter_matrices[k][i][j];
92 if (!ok)
return false;
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class to store reconstructed particles.
unsigned getNDaughters(void) const
Returns number of daughter particles.
std::vector< Belle2::Particle * > getDaughters() const
Returns a vector of pointers to daughter particles.
void setMomentumVertexErrorMatrix(const TMatrixFSym &errMatrix)
Sets 7x7 error matrix.
TMatrixFSym getMomentumVertexErrorMatrix() const
Returns 7x7 error matrix.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
std::string m_listName
particle list name
bool add_matrix(Particle *p)
Main steering routine.
PseudoVertexFitterModule()
Constructor.
Type-safe access to single objects in the data store.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.