Diana Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Friends | List of all members
QVector Class Reference

Interface for vectors in Diana analysis. More...

Inheritance diagram for QVector:
QObject

Public Member Functions

 QVector ()
 default constructor More...
 
 QVector (const UInt_t size)
 constructor with its size More...
 
 QVector (const QVector &orig)
 copy constructor More...
 
virtual ~QVector ()
 destructor More...
 
UInt_t Size () const
 size of QVector More...
 
void Initialize (const double val=0)
 initialize elements (default to 0) More...
 
double & operator[] (const UInt_t i)
 retrieve an element More...
 
double & operator() (const UInt_t i)
 
const double & operator[] (const UInt_t i) const
 retrieve an element More...
 
const double & operator() (const UInt_t i) const
 
const QVectoroperator= (const QVector &orig)
 copy the content from another QVector More...
 
const QVectoroperator= (const QVectorI &orig)
 copy the content from a QVectorI More...
 
const QVectoroperator= (const std::vector< double > &orig)
 copy the content from a QVectorI More...
 
QVector operator- () const
 revert sign to all components More...
 
QVector Mult (const QVector &other) const
 multiplication element by element More...
 
QVector Div (const QVector &other) const
 multiplication element by element More...
 
const QVectoroperator*= (const double t)
 multiplication by scalar More...
 
const QVectoroperator/= (const double v)
 divide by scalar More...
 
const QVectoroperator+= (const double v)
 sum scalar to all elements More...
 
const QVectoroperator-= (const double v)
 subtract scalar to all elements More...
 
const QVectoroperator+= (const QVector &v)
 add a QVector More...
 
const QVectoroperator-= (const QVector &v)
 subtract a QVector More...
 
const QVectoroperator*= (const QVector &v)
 subtract a QVector More...
 
const QVectoroperator/= (const QVector &v)
 subtract a QVector More...
 
double operator* (const QVector &other) const
 scalar product More...
 
QVector operator+ (const QVector &other) const
 sum vector More...
 
QVector operator- (const QVector &other) const
 subtract vector More...
 
QVector operator+ (double t) const
 add scalar More...
 
QVector operator- (double t) const
 subtract scalar More...
 
QVector operator* (double t) const
 multiply by scalar More...
 
QVector operator/ (double t) const
 divide by scalar More...
 
QMatrix T () const
 transpose More...
 
QMatrix Reshape (UInt_t n, UInt_t m)
 reshape the vector into a matrix More...
 
const QMatrix Reshape (UInt_t n, UInt_t m) const
 reshape the vector into a matrix More...
 
const QVectorRebin (const int rebin, bool sum=false)
 Rebin the vector. More...
 
const QVectorShift (const int nstep)
 Cyclic shift of vector. More...
 
const QVectorReverse ()
 time reversal of the vector More...
 
const QVectorShiftReal (const double fstep)
 Cyclic shift of vector by a real number, first shift by the integer part of fstep then linear interpolation between samples is performed. More...
 
const QVectorDifferentiate ()
 make vector derivative More...
 
QVector Derivative2P (const double delta=1.) const
 compute derivative with 2 point interpolation, uses Differentiate() More...
 
QVector Derivative2PF (const double delta=1.) const
 compute derivative with forward 2 point interpolation More...
 
QVector Derivative3P (const double delta=1.) const
 compute derivative with 3 point interpolation, symmetric More...
 
QVector Derivative3PB (const double delta=1.) const
 compute derivative with 3 point interpolation, backward mode More...
 
QVector Derivative3PF (const double delta=1.) const
 compute derivative with 3 point interpolation, forward mode More...
 
QVector Derivative5P (const double delta=1.) const
 compute derivative with 5 point interpolation, symmetric More...
 
QVector Derivative5PB (const double delta=1.) const
 compute derivative with 5 point interpolation, backward mode More...
 
QVector DerivativeEulero (const double delta=1.) const
 compute derivative with Eulero interpolation, backward mode More...
 
QVector Abs () const
 Return a vector of the absolute values. More...
 
const QVectorSort (const bool asc=true)
 sort this vector More...
 
const QVectorIntegrate (const double constTerm=0)
 Integrate vector. More...
 
void Resize (const UInt_t newsize)
 resize a QVector More...
 
void Append (const double val)
 append More...
 
double Norma () const
 norma More...
 
double Sum (UInt_t nelem, UInt_t first=0) const
 sum elements More...
 
double Sum () const
 sum elements More...
 
double GetMean (const UInt_t nelem, const UInt_t first=0) const
 Get Mean. More...
 
double GetMean () const
 
double GetRMS (const UInt_t nelem, const UInt_t first=0) const
 Get RMS. More...
 
double GetRMS () const
 Get RMS. More...
 
double GetMedian () const
 Get median. More...
 
double GetMedianAbsoluteDeviation () const
 Get median absolute deviation. More...
 
double GetMax () const
 get maximum element More...
 
double GetMin () const
 get minimum element More...
 
int GetMaxIndex (const UInt_t nelem, const UInt_t first) const
 get maximum element position between first and first + nelem More...
 
int GetMinIndex (const UInt_t nelem, const UInt_t first) const
 get minimum element position between first and first + nelem More...
 
UInt_t GetMaxIndex () const
 get maximum element index More...
 
UInt_t GetMinIndex () const
 get minimum element index More...
 
double * GetArray () const
 get an array of doubles, owned by the caller! More...
 
std::vector< double > GetArrayVector () const
 get a pointer to the content More...
 
const double * GetConstArray () const
 
void SetArray (const double *orig, const UInt_t size)
 get a constant pointer to the content More...
 
virtual void Clear ()
 clear the vector More...
 
std::string sqlString () const
 
virtual void Dump (std::ostream &o) const
 Dump object to stream. More...
 
void Draw (Option_t *option="")
 Draw root. More...
 
TGraph * GetGraph (double samplingFrequency=1., double scale=1.) const
 Get a root TGraph (owned by the caller) More...
 
QVector GetSubVector (UInt_t size, UInt_t start=0, UInt_t stride=1)
 
const QVector GetSubVector (UInt_t size, UInt_t start=0, UInt_t stride=1) const
 
- Public Member Functions inherited from QObject
 QObject ()
 default constructor More...
 
virtual ~QObject ()
 destructor More...
 
QObjectoperator= (const QObject &rhs)
 operator= More...
 
void Validate ()
 make object valid More...
 
void InValidate ()
 make object non valid More...
 
bool IsValid () const
 check wheter object is valid More...
 
void SetWrite (bool write=true)
 write or not this object More...
 
bool GetWrite () const
 check wheter write or not this object More...
 
bool IsRequired () const
 check wheter this object is required by some module More...
 
void SetIsRequired (bool required=true)
 set that this object is required
More...
 
bool IsJustAdded () const
 check wheter this object has been just added by some module More...
 
void SetIsJustAdded (bool added=true)
 set that this object has been just added
More...
 
void Reset ()
 set object to non valid and calls Clear() More...
 
virtual bool Fill (QObject *evData) const =0
 calls operator= of inheriting classes. Validity flag and bits are not copied. This function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp. If evData type mismatches returns false, true otherwise. More...
 
void FullyFill (QObject *evData) const
 calls Fill(QObject*) if this QObject IsValid(). Copies Validity flag and bits More...
 
virtual QObjectDuplicate () const =0
 create object of same type, this function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp More...
 
virtual void Print () const
 print content on screen More...
 
virtual QError WriteOnStream (std::ostream &o) const
 print content to stream (intended for storage in text files) More...
 
virtual QError ReadFromStream (std::istream &o)
 fill content from stream (intended for storage in text files) More...
 
void CopyBits (QObject *obj) const
 copy validity and temporary bits to another QObject More...
 

Protected Member Functions

 QVector (const QVector &orig, const bool dataOwner)
 copy constructor for QVector(Const)View More...
 
 QVector (double *vec, const UInt_t size, const UInt_t stride)
 constructor not owner More...
 

Protected Attributes

const bool fDataOwner
 if this vector onws its data More...
 
UInt_t fSize
 size of the array More...
 
UInt_t fAllocSize
 
UInt_t fStride
 data stride More...
 
Double_t * fData
 array More...
 
gsl_vector * fMathVec
 temporary gsl_vector to use the gsl library More...
 

Private Member Functions

void SetMathVector () const
 
 QObjectDef (QVector, 4)
 

Static Private Member Functions

static double * ArrayAlloc (const UInt_t size)
 
static void ArrayCopy (const double *orig, const UInt_t origStride, double *dest, const UInt_t destStride, const UInt_t size)
 
static void ArrayFree (double *array)
 

Friends

class QVectorView
 
class QVectorConstView
 
class QVectorC
 
class QMatrix
 
class QMatrixC
 
class QMatrixCArray
 
class QRealComplexFFTW3
 
class QFFTWRealComplexPlan
 

Additional Inherited Members

- Public Types inherited from QObject
enum  { kIsValid = BIT(15) , kWrite = BIT(0) , kIsRequired = BIT(1) , kIsJustAdded = BIT(2) }
 TObject bits. More...
 
- Static Public Member Functions inherited from QObject
static QObjectNew (const char *object)
 

Detailed Description

Interface for vectors in Diana analysis.

Author
R. Faccini, M. Vignati

This class is intended for use as mathematical vectors, not as container vector (like std::vector). Every class written within the DIANA framework should use this class instead of C arrays or std::vector<double>

Examples
GlobalDataManagerExample.C, MTutorialAveragePulse.cc, MTutorialPulseShape.cc, and ScanEvents.C.

Definition at line 30 of file QVector.hh.

Constructor & Destructor Documentation

◆ QVector() [1/5]

QVector::QVector ( )

default constructor

Definition at line 84 of file QVector.cc.

References fMathVec.

Referenced by GetSubVector().

◆ QVector() [2/5]

QVector::QVector ( const UInt_t  size)
explicit

constructor with its size

Parameters
sizestart size of QVector

Definition at line 95 of file QVector.cc.

References fMathVec, and Resize().

◆ QVector() [3/5]

QVector::QVector ( const QVector orig)

copy constructor

Parameters
origoriginal QVector

Definition at line 109 of file QVector.cc.

References ArrayCopy(), fData, fMathVec, fStride, Resize(), and Size().

◆ ~QVector()

QVector::~QVector ( )
virtual

destructor

Definition at line 156 of file QVector.cc.

References ArrayFree(), fAllocSize, fData, fDataOwner, fMathVec, and fSize.

◆ QVector() [4/5]

QVector::QVector ( const QVector orig,
const bool  dataOwner 
)
protected

copy constructor for QVector(Const)View

Definition at line 123 of file QVector.cc.

References ArrayCopy(), fAllocSize, fData, fMathVec, fSize, fStride, Resize(), and Size().

◆ QVector() [5/5]

QVector::QVector ( double *  vec,
const UInt_t  size,
const UInt_t  stride 
)
protected

constructor not owner

Definition at line 145 of file QVector.cc.

References fMathVec.

Member Function Documentation

◆ Abs()

QVector QVector::Abs ( ) const

Return a vector of the absolute values.

Definition at line 427 of file QVector.cc.

References Size(), and vec.

◆ Append()

void QVector::Append ( const double  val)

append

add one more element at the end of the vector

Parameters
val

Definition at line 597 of file QVector.cc.

References ArrayAlloc(), ArrayCopy(), ArrayFree(), DianaThrow, fAllocSize, fData, fDataOwner, fMathVec, fSize, fStride, QERR_SIZE_NOT_MATCH, and Size().

Referenced by QTriggerOptimumFilter::BuildOptimumFilter().

◆ ArrayAlloc()

Q_BEGIN_NAMESPACE double * QVector::ArrayAlloc ( const UInt_t  size)
staticprivate

◆ ArrayCopy()

void QVector::ArrayCopy ( const double *  orig,
const UInt_t  origStride,
double *  dest,
const UInt_t  destStride,
const UInt_t  size 
)
staticprivate

◆ ArrayFree()

void QVector::ArrayFree ( double *  array)
staticprivate

◆ Clear()

virtual void QVector::Clear ( )
inlinevirtual

clear the vector

Implements QObject.

Definition at line 406 of file QVector.hh.

References Resize().

Referenced by QAverageVector::Clear(), and QFitter::Fit().

◆ Derivative2P()

QVector QVector::Derivative2P ( const double  delta = 1.) const

compute derivative with 2 point interpolation, uses Differentiate()

Definition at line 451 of file QVector.cc.

References Differentiate().

◆ Derivative2PF()

QVector QVector::Derivative2PF ( const double  delta = 1.) const

compute derivative with forward 2 point interpolation

Definition at line 459 of file QVector.cc.

References Size().

◆ Derivative3P()

QVector QVector::Derivative3P ( const double  delta = 1.) const

compute derivative with 3 point interpolation, symmetric

Definition at line 469 of file QVector.cc.

References Size().

◆ Derivative3PB()

QVector QVector::Derivative3PB ( const double  delta = 1.) const

compute derivative with 3 point interpolation, backward mode

Definition at line 481 of file QVector.cc.

References Size().

◆ Derivative3PF()

QVector QVector::Derivative3PF ( const double  delta = 1.) const

compute derivative with 3 point interpolation, forward mode

Definition at line 493 of file QVector.cc.

References Size().

◆ Derivative5P()

QVector QVector::Derivative5P ( const double  delta = 1.) const

compute derivative with 5 point interpolation, symmetric

Definition at line 508 of file QVector.cc.

References Size().

◆ Derivative5PB()

QVector QVector::Derivative5PB ( const double  delta = 1.) const

compute derivative with 5 point interpolation, backward mode

Definition at line 524 of file QVector.cc.

References Size().

◆ DerivativeEulero()

QVector QVector::DerivativeEulero ( const double  delta = 1.) const

compute derivative with Eulero interpolation, backward mode

Definition at line 540 of file QVector.cc.

References Size().

◆ Differentiate()

const QVector & QVector::Differentiate ( )

make vector derivative

Definition at line 442 of file QVector.cc.

References Size().

Referenced by Derivative2P().

◆ Div()

QVector QVector::Div ( const QVector other) const

multiplication element by element

v[i]=v1[i]/v2[i]

Parameters
other
Returns
the same object modified

Definition at line 258 of file QVector.cc.

References b, fMathVec, and SetMathVector().

◆ Draw()

void QVector::Draw ( Option_t *  option = "")
virtual

Draw root.

Reimplemented from QObject.

Definition at line 744 of file QVector.cc.

References fSize.

◆ Dump()

void QVector::Dump ( std::ostream &  o) const
virtual

Dump object to stream.

Reimplemented from QObject.

Definition at line 772 of file QVector.cc.

References Size().

◆ GetArray()

double * QVector::GetArray ( ) const

get an array of doubles, owned by the caller!

Definition at line 696 of file QVector.cc.

References a, ArrayAlloc(), ArrayCopy(), fData, fSize, and fStride.

◆ GetArrayVector()

std::vector<double> QVector::GetArrayVector ( ) const
inline

get a pointer to the content

Warning! if the current vector is resized you are not granted that this pointer will point to the QVector array.

Definition at line 389 of file QVector.hh.

References fData, and Size().

◆ GetConstArray()

const double* QVector::GetConstArray ( ) const
inline

Definition at line 390 of file QVector.hh.

References fData.

◆ GetGraph()

TGraph * QVector::GetGraph ( double  samplingFrequency = 1.,
double  scale = 1. 
) const

Get a root TGraph (owned by the caller)

Examples
ScanEvents.C.

Definition at line 761 of file QVector.cc.

References Size().

◆ GetMax()

double QVector::GetMax ( ) const
inline

get maximum element

Examples
MTutorialPulseShape.cc.

Definition at line 355 of file QVector.hh.

References fMathVec, and SetMathVector().

Referenced by QGPulse::GetPulseFromChain().

◆ GetMaxIndex() [1/2]

UInt_t QVector::GetMaxIndex ( ) const
inline

get maximum element index

Definition at line 373 of file QVector.hh.

References fMathVec, and SetMathVector().

◆ GetMaxIndex() [2/2]

int QVector::GetMaxIndex ( const UInt_t  nelem,
const UInt_t  first 
) const

get maximum element position between first and first + nelem

Definition at line 680 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ GetMean() [1/2]

double QVector::GetMean ( ) const
inline

Definition at line 329 of file QVector.hh.

References fSize.

Referenced by Sum().

◆ GetMean() [2/2]

double QVector::GetMean ( const UInt_t  nelem,
const UInt_t  first = 0 
) const
inline

Get Mean.

Parameters
nelemnumber of elements
firstfirst element

Definition at line 326 of file QVector.hh.

References Sum().

Referenced by QTriggerBULLDAQ::TriggerStream().

◆ GetMedian()

double QVector::GetMedian ( ) const

Get median.

Definition at line 641 of file QVector.cc.

References fMathVec, SetMathVector(), and Size().

Referenced by GetMedianAbsoluteDeviation().

◆ GetMedianAbsoluteDeviation()

double QVector::GetMedianAbsoluteDeviation ( ) const

Get median absolute deviation.

Definition at line 666 of file QVector.cc.

References GetMedian(), and Size().

◆ GetMin()

double QVector::GetMin ( ) const
inline

get minimum element

Definition at line 360 of file QVector.hh.

References fMathVec, and SetMathVector().

◆ GetMinIndex() [1/2]

UInt_t QVector::GetMinIndex ( ) const
inline

get minimum element index

Definition at line 378 of file QVector.hh.

References fMathVec, and SetMathVector().

◆ GetMinIndex() [2/2]

int QVector::GetMinIndex ( const UInt_t  nelem,
const UInt_t  first 
) const

get minimum element position between first and first + nelem

Definition at line 688 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ GetRMS() [1/2]

double QVector::GetRMS ( ) const
inline

Get RMS.

Definition at line 341 of file QVector.hh.

References fSize.

◆ GetRMS() [2/2]

double QVector::GetRMS ( const UInt_t  nelem,
const UInt_t  first = 0 
) const

Get RMS.

Parameters
nelemnumber of elements
firstfirst element

Definition at line 632 of file QVector.cc.

References fMathVec, SetMathVector(), and Sum().

Referenced by QTriggerBULLDAQ::TriggerStream().

◆ GetSubVector() [1/2]

QVector QVector::GetSubVector ( UInt_t  size,
UInt_t  start = 0,
UInt_t  stride = 1 
)

Definition at line 701 of file QVector.cc.

References DianaThrow, fData, fStride, QERR_SIZE_NOT_MATCH, QVector(), and Size().

Referenced by QTriggerBULLDAQ::TriggerStream().

◆ GetSubVector() [2/2]

const QVector QVector::GetSubVector ( UInt_t  size,
UInt_t  start = 0,
UInt_t  stride = 1 
) const

Definition at line 709 of file QVector.cc.

References DianaThrow, fData, fStride, QERR_SIZE_NOT_MATCH, QVector(), and Size().

◆ Initialize()

void QVector::Initialize ( const double  val = 0)

initialize elements (default to 0)

Parameters
val

Definition at line 218 of file QVector.cc.

References fData, fSize, and fStride.

Referenced by QFitter::Fit(), and QTriggerOptimumFilter::TriggerStream().

◆ Integrate()

const QVector & QVector::Integrate ( const double  constTerm = 0)

Integrate vector.

Parameters
constTermintegral constant to be added

Definition at line 553 of file QVector.cc.

References Size().

◆ Mult()

QVector QVector::Mult ( const QVector other) const

multiplication element by element

v[i]=v1[i]*v2[i]

Parameters
other
Returns
the same object modified

Definition at line 250 of file QVector.cc.

References b, fMathVec, and SetMathVector().

◆ Norma()

double QVector::Norma ( ) const

norma

$norma = \sqrt{v\cdot v}$

Definition at line 618 of file QVector.cc.

◆ operator()() [1/2]

double& QVector::operator() ( const UInt_t  i)
inline

Definition at line 66 of file QVector.hh.

References operator[]().

◆ operator()() [2/2]

const double& QVector::operator() ( const UInt_t  i) const
inline

Definition at line 76 of file QVector.hh.

References operator[]().

◆ operator*() [1/2]

double QVector::operator* ( const QVector other) const

scalar product

Parameters
otherright element
Returns
scalar product

Definition at line 324 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ operator*() [2/2]

QVector QVector::operator* ( double  t) const

multiply by scalar

Parameters
tright element
Returns
scaled vector

Definition at line 346 of file QVector.cc.

◆ operator*=() [1/2]

const QVector & QVector::operator*= ( const double  t)

multiplication by scalar

Parameters
t
Returns
the same object modified

Definition at line 272 of file QVector.cc.

References fMathVec, and SetMathVector().

Referenced by operator/=().

◆ operator*=() [2/2]

const QVector & QVector::operator*= ( const QVector v)

subtract a QVector

Parameters
v
Returns
the same object modified

Definition at line 310 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ operator+() [1/2]

QVector QVector::operator+ ( const QVector other) const

sum vector

Parameters
otherright element
Returns
sum vector

Definition at line 360 of file QVector.cc.

◆ operator+() [2/2]

QVector QVector::operator+ ( double  t) const

add scalar

Parameters
tright element
Returns
translate vector

Definition at line 333 of file QVector.cc.

◆ operator+=() [1/2]

const QVector & QVector::operator+= ( const double  v)

sum scalar to all elements

Parameters
t
Returns
the same object modified

Definition at line 280 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ operator+=() [2/2]

const QVector & QVector::operator+= ( const QVector v)

add a QVector

Parameters
v
Returns
the same object modified

Definition at line 294 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ operator-() [1/3]

QVector QVector::operator- ( ) const

revert sign to all components

Definition at line 244 of file QVector.cc.

◆ operator-() [2/3]

QVector QVector::operator- ( const QVector other) const

subtract vector

Parameters
otherright element
Returns
difference vector

Definition at line 367 of file QVector.cc.

◆ operator-() [3/3]

QVector QVector::operator- ( double  t) const

subtract scalar

Parameters
tright element
Returns
translated vector

Definition at line 340 of file QVector.cc.

◆ operator-=() [1/2]

const QVector & QVector::operator-= ( const double  v)

subtract scalar to all elements

Parameters
t
Returns
the same object modified

Definition at line 287 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ operator-=() [2/2]

const QVector & QVector::operator-= ( const QVector v)

subtract a QVector

Parameters
v
Returns
the same object modified

Definition at line 302 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ operator/()

QVector QVector::operator/ ( double  t) const

divide by scalar

Parameters
tright element
Returns
scaled vector

Definition at line 353 of file QVector.cc.

◆ operator/=() [1/2]

const QVector & QVector::operator/= ( const double  v)

divide by scalar

Parameters
t
Returns
the same object modified

Definition at line 267 of file QVector.cc.

References operator*=().

◆ operator/=() [2/2]

const QVector & QVector::operator/= ( const QVector v)

subtract a QVector

Parameters
v
Returns
the same object modified

Definition at line 317 of file QVector.cc.

References fMathVec, and SetMathVector().

◆ operator=() [1/3]

const QVector & QVector::operator= ( const QVector orig)

copy the content from another QVector

Parameters
origoriginal QVector

Definition at line 188 of file QVector.cc.

References ArrayCopy(), fData, fSize, fStride, and Resize().

Referenced by QAverageVector::operator=(), and QAverageVector::ReadFromStream().

◆ operator=() [2/3]

const QVector & QVector::operator= ( const QVectorI orig)

copy the content from a QVectorI

Definition at line 194 of file QVector.cc.

References fData, fSize, fStride, Resize(), and QVectorI::Size().

◆ operator=() [3/3]

const QVector & QVector::operator= ( const std::vector< double > &  orig)

copy the content from a QVectorI

Definition at line 201 of file QVector.cc.

References fData, fSize, fStride, and Resize().

◆ operator[]() [1/2]

double & QVector::operator[] ( const UInt_t  i)

retrieve an element

Parameters
iith element
Returns
element i of the QVector

Definition at line 223 of file QVector.cc.

References DianaThrow, fData, fSize, fStride, and QERR_OUT_OF_RANGE.

Referenced by operator()(), and Reverse().

◆ operator[]() [2/2]

const double & QVector::operator[] ( const UInt_t  i) const

retrieve an element

version for objects that cannot modify the QVector

Parameters
iith element
Returns
element i of the QVector

Definition at line 233 of file QVector.cc.

References DianaThrow, fData, fSize, fStride, and QERR_OUT_OF_RANGE.

◆ QObjectDef()

QVector::QObjectDef ( QVector  ,
 
)
private

◆ Rebin()

const QVector & QVector::Rebin ( const int  rebin,
bool  sum = false 
)

Rebin the vector.

Parameters
rebinCombine rebin bins into one
sumEither sum the bins together (if sum is true), otherwise average them
Returns
the same object modified

Definition at line 383 of file QVector.cc.

References Resize(), and Size().

◆ Reshape() [1/2]

QMatrix QVector::Reshape ( UInt_t  n,
UInt_t  m 
)

reshape the vector into a matrix

IMPORANT NOTE: These algorithms do not work if the vector has a non-unity stride!

Definition at line 568 of file QVector.cc.

References fData, fStride, QERR_SIZE_NOT_MATCH, and Size().

◆ Reshape() [2/2]

const QMatrix QVector::Reshape ( UInt_t  n,
UInt_t  m 
) const

reshape the vector into a matrix

IMPORANT NOTE: These algorithms do not work if the vector has a non-unity stride!

Definition at line 582 of file QVector.cc.

References fData, fStride, QERR_SIZE_NOT_MATCH, and Size().

◆ Resize()

void QVector::Resize ( const UInt_t  newsize)

◆ Reverse()

const QVector & QVector::Reverse ( )

time reversal of the vector

Returns
the same object modified

Definition at line 374 of file QVector.cc.

References operator[](), and Size().

◆ SetArray()

void QVector::SetArray ( const double *  orig,
const UInt_t  size 
)

get a constant pointer to the content

copy the content of an array into the vector

Parameters
origoriginal array
sizenumber of elements in the array

Definition at line 719 of file QVector.cc.

References ArrayCopy(), fData, fStride, and Resize().

◆ SetMathVector()

void QVector::SetMathVector ( ) const
private

◆ Shift()

const QVector & QVector::Shift ( const int  nstep)

Cyclic shift of vector.

Parameters
nstepif > 0 shift right, if < 0 shift left
Returns
the same object modified

Definition at line 395 of file QVector.cc.

References abs(), and Size().

Referenced by QTriggerOptimumFilter::BuildOptimumFilter(), ShiftReal(), QTriggerOptimumFilter::TriggerStream(), and QFFT::ZeroPad().

◆ ShiftReal()

const QVector & QVector::ShiftReal ( const double  fstep)

Cyclic shift of vector by a real number, first shift by the integer part of fstep then linear interpolation between samples is performed.

Parameters
fstepif > 0 shift right, if < 0 shift left
Returns
the same object modified

Definition at line 413 of file QVector.cc.

References Shift(), and Size().

◆ Size()

UInt_t QVector::Size ( ) const
inline

◆ Sort()

const QVector & QVector::Sort ( const bool  asc = true)

sort this vector

Parameters
ascif true ascending if false descending

Definition at line 434 of file QVector.cc.

References fMathVec, and SetMathVector().

Referenced by QMatrixC::HermitianEigenValues().

◆ sqlString()

std::string QVector::sqlString ( ) const

@ brief return string needed to dump vector into sql DB

Definition at line 726 of file QVector.cc.

References Size().

◆ Sum() [1/2]

double QVector::Sum ( ) const
inline

sum elements

Definition at line 319 of file QVector.hh.

References fSize, and GetMean().

Referenced by GetMean(), and GetRMS().

◆ Sum() [2/2]

double QVector::Sum ( UInt_t  nelem,
UInt_t  first = 0 
) const

sum elements

Definition at line 624 of file QVector.cc.

Referenced by QTriggerOptimumFilter::BuildOptimumFilter(), and QTriggerBULLDAQ::TriggerStream().

◆ T()

QMatrix QVector::T ( ) const

transpose

a transposed vector is a matrix with a single row

Returns
matrix

Definition at line 561 of file QVector.cc.

References QMatrix::SetRow(), and Size().

Friends And Related Function Documentation

◆ QFFTWRealComplexPlan

friend class QFFTWRealComplexPlan
friend

Definition at line 462 of file QVector.hh.

◆ QMatrix

friend class QMatrix
friend

Definition at line 458 of file QVector.hh.

◆ QMatrixC

friend class QMatrixC
friend

Definition at line 459 of file QVector.hh.

◆ QMatrixCArray

friend class QMatrixCArray
friend

Definition at line 460 of file QVector.hh.

◆ QRealComplexFFTW3

friend class QRealComplexFFTW3
friend

Definition at line 461 of file QVector.hh.

◆ QVectorC

friend class QVectorC
friend

Definition at line 457 of file QVector.hh.

◆ QVectorConstView

friend class QVectorConstView
friend

Definition at line 456 of file QVector.hh.

◆ QVectorView

friend class QVectorView
friend

Definition at line 455 of file QVector.hh.

Member Data Documentation

◆ fAllocSize

UInt_t QVector::fAllocSize
protected

Definition at line 438 of file QVector.hh.

Referenced by Append(), QVector(), Resize(), and ~QVector().

◆ fData

Double_t* QVector::fData
protected

◆ fDataOwner

const bool QVector::fDataOwner
protected

if this vector onws its data

Definition at line 433 of file QVector.hh.

Referenced by Append(), Resize(), and ~QVector().

◆ fMathVec

gsl_vector* QVector::fMathVec
mutableprotected

◆ fSize

UInt_t QVector::fSize
protected

◆ fStride

UInt_t QVector::fStride
protected

The documentation for this class was generated from the following files: