| <large>libXpertMassCore and libXpertMassGui Developer Documentation</large>

- libXpertMassCore
- Generic

# MsXpS::libXpertMassCore::Math::Generic Class

class MsXpS::libXpertMassCore::Math::Generic

The Generic class provides a number of generic features for math calculations. More...

Header: | `#include <MsXpS/libXpertMassCore/Math/Generic.hpp>`

- List of all members, including inherited members
- Generic is part of libXpertMassCore Math.

## Static Public Members

std::tuple<double, double, double, double> | weightedCenterOfMass(const pappso::Trace &input_trace)

## Detailed Description

## Member Function Documentation

### `[static]` std::tuple<double, double, double, double> Generic::weightedCenterOfMass(const pappso::Trace &input_trace)

Calculates the weighted center of mass or the curve input_trace.

The returned tuple has four members:

- Member 0: center of mass, the abscissa of the center of mass of the input curve;
- Member 1: y max, the intensity at the center of mass
- Member 2: sigma [related to the FWHM according to: FWHM = 2 * sqrt(2 * std::log(2)) * sigma]
- Member 3: b, the baseline correction (0, at the moment)

If input_trace is empty, the returned tuples has all its members set to 0.0.