NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcSample Class Reference

Sampling and statistics tools for various multi-dimensional data samples. More...

#include "NcSample.h"

Inheritance diagram for NcSample:

Detailed Description

Sampling and statistics tools for various multi-dimensional data samples.


Copyright(c) 1996 NCFS/IIHE, All Rights Reserved. *
*
Authors: The Netherlands Center for Fundamental Studies (NCFS). *
The Inter-university Institute for High Energies (IIHE). *
Website : http://www.iihe.ac.be *
Contact : Nick van Eijndhoven (nickve.nl@gmail.com) *
*
Contributors are mentioned in the code where appropriate. *
*
No part of this software may be used, copied, modified or distributed *
by any means nor transmitted or translated into machine language for *
commercial purposes without written permission by the IIHE representative. *
Permission to use the software strictly for non-commercial purposes *
is hereby granted without fee, provided that the above copyright notice *
appears in all copies and that both the copyright notice and this *
permission notice appear in the supporting documentation. *
This software is provided "as is" without express or implied warranty. *
The authors make no claims that this software is free of error, or is *
consistent with any particular standard of merchantability, or that it *
will meet your requirements for any particular application, other than *
indicated in the corresponding documentation. *
This software should not be relied on for solving a problem whose *
incorrect solution could result in injury to a person or loss of property. *
If you do use this software in such a manner, it is at your own risk. *
The authors disclaim all liability for direct or consequential damage *
resulting from your use of this software. *

// Class NcSample
// Perform statistics on various multi-dimensional data samples.
//
// A data sample can be filled using the "Enter" and/or "Remove" functions,
// or by importing the data from a TGraph or TGraph2D via the "Load" function.
// The "Reset" function resets the complete sample to 'empty'.
//
// The member function SetStoreMode() allows to store the data of each entry,
// or limit the number of stored entries via a so-called dynamic buffer,
// which removes (after a selected ordering) the first entry after reaching
// a specified maximum number of entries.
// Please refer to the documentation of SetStoreMode() for further details.
//
// The info which can be extracted from a certain data sample are the
// minimum, maximum, sum, mean, variance, sigma, median, spread, SNR, CV,
// RMS, covariance and correlation.
// The "spread" of the sample represents the average deviation w.r.t.
// some reference value, i.e. spread=<|v_i-v_ref|>.
// The "Data" function provides all statistics data for a certain sample.
// The variables for which these statistical parameters have to be calculated
// are indicated either by the name or the index of the variable which is
// passed as an argument to the various member functions.
// The index convention for a data point (x,y,z,t) is : x=1 y=2 z=3 t=4.
// The member function SetNames() allows the user to specify different names
// to replace the default ("X","Y","Z","T") naming.
//
// To develop c.q. improve a data acquisition system (DAQ), the functions
// SampleAndHold(), SampleAndSum() and Transmit() may be used to
// investigate the performance of a sampling device, like for instance
// a Switched Capacitor Array (SCA) and an Analog to Digital Converter (ADC).
//
// Interfaces with various graphics facilities are provided like for instance
// GetGraph(), Get1DHistogram(), Animation() etc...
//
// Example :
// ---------
// For an NcSample s a data point (x,y) can be entered as s.Enter(x,y) and
// the mean_x can be obtained as s.GetMean(1) whereas the mean_y is obtained
// via s.GetMean(2).
// The correlation between x and y is available via s.GetCor(1,2).
// The x-statistics are obtained via s.Data(1), y-statistics via s.Data(2),
// and the covariance and correlation between x and y via s.Data(1,2).
// All statistics of a sample are obtained via s.Data().
//
//--- Author: Nick van Eijndhoven 30-mar-1996 CERN Geneva
//- Modified: Nick van Eijndhoven, IIHE-VUB, Brussel, January 14, 2025 13:09Z

Definition at line 27 of file NcSample.h.

Public Member Functions

 NcSample (const char *name="", const char *title="")
 
 NcSample (const NcSample &s)
 
virtual ~NcSample ()
 
void Animation (Int_t i, Int_t j, Int_t k, Int_t mode, Int_t m, Int_t delay, TString opt="PFB")
 
void Animation (Int_t i, Int_t j, Int_t mode, Int_t k, Int_t delay, TString opt="AP")
 
void Animation (TString nameA, TString nameB, Int_t mode, TString nameC, Int_t delay, TString opt="AP")
 
void Animation (TString nameA, TString nameB, TString nameC, Int_t mode, TString nameD, Int_t delay, TString opt="PFB")
 
virtual TObject * Clone (const char *name="") const
 
void Data (Int_t i=0, Int_t j=0)
 
void Data (TString nameA, TString nameB="-")
 
Double_t Digitize (Int_t i, Int_t nbits, Double_t vcal, Int_t mode)
 
Double_t Digitize (TString name, Int_t nbits, Double_t vcal, Int_t mode)
 
void Enter (Double_t x)
 
void Enter (Double_t x, Double_t y)
 
void Enter (Double_t x, Double_t y, Double_t z)
 
void Enter (Double_t x, Double_t y, Double_t z, Double_t t)
 
TH1D Get1DHistogram (Int_t i, Int_t j=0, Bool_t sumw2=kFALSE, Int_t nbx=100, TF1 *f=0)
 
TH1D Get1DHistogram (TString nameA, TString nameB="-", Bool_t sumw2=kFALSE, Int_t nbx=100, TF1 *f=0)
 
TH2D Get2DHistogram (Int_t i, Int_t j, Int_t k=0, Bool_t sumw2=kFALSE, Int_t nbx=100, Int_t nby=100, TF1 *f=0)
 
TH2D Get2DHistogram (TString nameA, TString nameB, TString nameC="-", Bool_t sumw2=kFALSE, Int_t nbx=100, Int_t nby=100, TF1 *f=0)
 
TH3D Get3DHistogram (Int_t i, Int_t j, Int_t k, Int_t m=0, Bool_t sumw2=kFALSE, Int_t nbx=100, Int_t nby=100, Int_t nbz=100, TF1 *f=0)
 
TH3D Get3DHistogram (TString nameA, TString nameB, TString nameC, TString nameD="-", Bool_t sumw2=kFALSE, Int_t nbx=100, Int_t nby=100, Int_t nbz=100, TF1 *f=0)
 
Double_t GetCor (Int_t i, Int_t j) const
 
Double_t GetCor (TString nameA, TString nameB) const
 
Double_t GetCov (Int_t i, Int_t j) const
 
Double_t GetCov (TString nameA, TString nameB) const
 
Double_t GetCV (Int_t i, Int_t mode=1) const
 
Double_t GetCV (TString name, Int_t mode=1) const
 
Int_t GetDimension () const
 
NcSample GetDtSample (Int_t i, Int_t nc, Int_t store=1, Int_t nmax=0, Int_t order=0)
 
NcSample GetDtSample (TString name, Int_t nc, Int_t store=1, Int_t nmax=0, Int_t order=0)
 
Double_t GetEntry (Int_t i, Int_t j, Int_t mode=0, Int_t k=0)
 
Double_t GetEntry (Int_t i, TString nameA, Int_t mode=0, TString nameB="-")
 
TGraph2D GetGraph (Int_t i, Int_t j, Int_t k, TF1 *f=0)
 
TGraph2D GetGraph (Int_t i, Int_t j, Int_t k, TString f)
 
TGraphTime * GetGraph (Int_t i, Int_t j, Int_t mode, Int_t k, Bool_t smp=kTRUE)
 
TGraph GetGraph (Int_t i, Int_t j, TF1 *f=0)
 
TGraph GetGraph (Int_t i, Int_t j, TString f)
 
TGraph GetGraph (Int_t i, TF1 *f=0)
 
TGraph GetGraph (Int_t i, TString f)
 
TGraph GetGraph (TString nameA, TF1 *f=0)
 
TGraphTime * GetGraph (TString nameA, TString nameB, Int_t mode, TString nameC, Bool_t smp=kTRUE)
 
TGraph GetGraph (TString nameA, TString nameB, TF1 *f=0)
 
TGraph2D GetGraph (TString nameA, TString nameB, TString nameC, TF1 *f=0)
 
TGraph2D GetGraph (TString nameA, TString nameB, TString nameC, TString f)
 
TGraph2DErrors GetGraph2DErrors (TGraph2D *g, Int_t ix=0, Int_t iy=0, Int_t iz=0, TF1 *fx=0, TF1 *fy=0, TF1 *fz=0)
 
TGraph2DErrors GetGraph2DErrors (TGraph2D *g, TString nameA, TString nameB, TString nameC, TF1 *fx=0, TF1 *fy=0, TF1 *fz=0)
 
TGraphErrors GetGraphErrors (TGraph *g, Int_t ix=0, Int_t iy=0, TF1 *fx=0, TF1 *fy=0)
 
TGraphErrors GetGraphErrors (TGraph *g, TString nameA, TString nameB, TF1 *fx=0, TF1 *fy=0)
 
Int_t GetIndex (TString name) const
 
Double_t GetMaximum (Int_t i) const
 
Double_t GetMaximum (TString name) const
 
Double_t GetMean (Int_t i) const
 
Double_t GetMean (TString name) const
 
Double_t GetMedian (Int_t i)
 
Double_t GetMedian (TH1 *histo, Int_t mode=0) const
 
Double_t GetMedian (TString name)
 
Double_t GetMinimum (Int_t i) const
 
Double_t GetMinimum (TString name) const
 
Int_t GetN () const
 
TGraphQQ GetQQplot (Int_t i, Int_t j, TF1 *f=0)
 
TGraphQQ GetQQplot (TString nameA, TString nameB, TF1 *f=0)
 
Double_t GetQuantile (Double_t f, Int_t i)
 
Double_t GetQuantile (Double_t f, TH1 *histo, Int_t mode=0) const
 
Double_t GetQuantile (Double_t f, TString name)
 
Double_t GetRMS (Int_t i) const
 
Double_t GetRMS (TString name) const
 
TH1D GetSamplingHistogram (Int_t i, TF1 *f=0)
 
TH1D GetSamplingHistogram (Int_t i, TString f)
 
TH1D GetSamplingHistogram (TString nameA, TF1 *f=0)
 
TH1D GetSamplingHistogram (TString nameA, TString f)
 
Double_t GetSigma (Int_t i, Int_t model=0) const
 
Double_t GetSigma (TString name, Int_t model=0) const
 
Double_t GetSNR (Int_t i, Int_t mode=2, Bool_t db=kTRUE) const
 
Double_t GetSNR (TString name, Int_t mode=2, Bool_t db=kTRUE) const
 
Double_t GetSpread (Int_t i, Int_t model=0, Double_t vref=0)
 
Double_t GetSpread (TH1 *histo, Int_t mode=0, Int_t model=0, Double_t vref=0) const
 
Double_t GetSpread (TString name, Int_t model=0, Double_t vref=0)
 
Int_t GetStoreMode () const
 
Int_t GetStoreNmax () const
 
void GetSubset (NcSample *s, Int_t ifirst, Int_t ilast, Int_t mode=0, Int_t k=0)
 
Double_t GetSum (Int_t i) const
 
Double_t GetSum (TString name) const
 
Double_t GetVar (Int_t i, Int_t model=0) const
 
Double_t GetVar (TString name, Int_t model=0) const
 
TString GetVariableName (Int_t i) const
 
void ListOrdered (Int_t mode, Int_t i)
 
void ListOrdered (Int_t mode, TString name)
 
void Load (TArray *h, Int_t clr=1)
 
void Load (TGraph *g, Int_t clr=1)
 
void Load (TGraph2D *g, Int_t clr=1)
 
void Load (TH1 *h, Int_t clr=1)
 
void Remove (Double_t x)
 
void Remove (Double_t x, Double_t y)
 
void Remove (Double_t x, Double_t y, Double_t z)
 
void Remove (Double_t x, Double_t y, Double_t z, Double_t t)
 
void RemoveEntry (Int_t i, Int_t j, Int_t mode, Int_t k)
 
void RemoveEntry (Int_t i, Int_t j, Int_t mode, TString name)
 
void RemoveEntry (Int_t i, Int_t mode, Int_t j)
 
void RemoveEntry (Int_t i, Int_t mode, TString name)
 
void Reset ()
 
NcSample SampleAndHold (TF1 f, Double_t step, Double_t vmin, Double_t vmax, Int_t loc=-1) const
 
NcSample SampleAndSum (Int_t i, Double_t step, Int_t loc=0, Int_t j=0, Double_t vmin=0, Double_t vmax=-1)
 
NcSample SampleAndSum (TString nameA, Double_t step, Int_t loc=0, TString nameB="-", Double_t vmin=0, Double_t vmax=-1)
 
void SetNames (TString name1="X", TString name2="Y", TString name3="Z", TString name4="T")
 
void SetStoreMode (Int_t mode=1, Int_t nmax=0, Int_t i=0)
 
Long64_t Transmit (Int_t i, Int_t nbits, Double_t range, Double_t Vbias=0, TArray *peds=0, TH1 *hist=0, Int_t B=0, Int_t C=3)
 
Long64_t Transmit (TString name, Int_t nbits, Double_t range, Double_t Vbias=0, TArray *peds=0, TH1 *hist=0, Int_t B=0, Int_t C=3)
 

Protected Types

enum  { fMaxdim =4 }
 

Protected Member Functions

TArrayL64 ADC (Int_t nbits, Double_t range, Double_t Vbias=0, TArray *Vsig=0, TH1 *hist=0, Int_t B=0, Int_t C=3) const
 
void Compute ()
 
TArrayD DAC (Int_t nbits, Double_t range, Double_t Vbias=0, TArray *adcs=0, TArray *peds=0, TH1 *hist=0, Int_t B=0, Int_t C=3) const
 
void List (Int_t i)
 
void List (Int_t i, Int_t j) const
 
void Order (Int_t mode, Int_t i)
 

Protected Attributes

TObject * fAnimObject
 ! Multi-purpose pointer for animation objects
 
TArrayD * fArr
 ! Temp. storage array for ordered values
 
TCanvas * fCanvas
 ! Multi-purpose canvas for e.g. animation displays
 
Double_t fCor [fMaxdim][fMaxdim]
 
Double_t fCov [fMaxdim][fMaxdim]
 
Int_t fDim
 
TGraphTime * fGraphT
 ! Temp. pointer to return a TGraphTime object
 
TArrayI * fIndices
 ! Temp. storage array for the indices of the ordered entries
 
Double_t fMax [fMaxdim]
 
Double_t fMean [fMaxdim]
 
Double_t fMin [fMaxdim]
 
Int_t fMoveVariable
 
Int_t fN
 
TString fNames [fMaxdim]
 
Int_t fNmax
 
Int_t fOrdered
 ! Indicator of the status of the current ordering
 
Int_t fRemove
 
Double_t fRMSdev [fMaxdim]
 
Double_t fSigma [fMaxdim]
 
Int_t fStore
 
Double_t fSum [fMaxdim]
 
Double_t fSum2 [fMaxdim][fMaxdim]
 
TArrayD * fT
 
TArrayD * fX
 
TArrayD * fY
 
TArrayD * fZ
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
fMaxdim 

Definition at line 142 of file NcSample.h.

Constructor & Destructor Documentation

◆ NcSample() [1/2]

NcSample::NcSample ( const char * name = "",
const char * title = "" )
// Creation of an NcSample object and resetting the statistics values.
// The dimension is initialised to maximum

Definition at line 91 of file NcSample.cxx.

◆ ~NcSample()

NcSample::~NcSample ( )
virtual
// Default destructor.

Definition at line 120 of file NcSample.cxx.

◆ NcSample() [2/2]

NcSample::NcSample ( const NcSample & s)
// Copy constructor.

Definition at line 175 of file NcSample.cxx.

Member Function Documentation

◆ ADC()

TArrayL64 NcSample::ADC ( Int_t nbits,
Double_t range,
Double_t Vbias = 0,
TArray * Vsig = 0,
TH1 * hist = 0,
Int_t B = 0,
Int_t C = 3 ) const
protected
// Internal member function for processing of an Analog to Digital Converter (ADC).
// Construct from analog input signals the discrete quantized data values of an "nbits" ADC,
// based on the "range" for the analog signal and a bias voltage "Vbias" (see below).
// The analog input signals are provided by the TArray "Vsig".
// The resulting (integer) quantized ADC values are returned in a TArrayL64 object.
//
// Note : Make sure to use the same units for "range", "Vbias" and the analog input signals.
//
// The number of available quantization levels is given by N=2^|nbits|, of which the lowest
// level represents the value 0. This yields for the quantized values (adc) the range [0,N-1].
// The mapping of an analog input voltage (Vin) to one of the quantization levels depends on the
// specified "range" and "Vbias" and whether we have a linear or Log ADC (see below).
//
// As outlined below, the range of the analog input voltage can be specified as the Full Scale
// voltage range (Vfs) corresponding to adc=N-1 or as the Reference voltage (Vref) corresponding to
// the hypothetical adc=N.
//
// The Least Significant Bit (LSB) represents the smallest analog input voltage interval
// that can reliably be resolved. In other words LSB=Voltage(adc=1)-Voltage(adc=0).
// For a linear ADC we have : LSB=Vfs/(N-1) or equivalently LSB=Vref/N.
// For a Log_B ADC (see below) we have : LSB=Vref*pow(B,-C)*(pow(B,C/N)-1).
//
// The formulas for the Vin->adc mapping with Vin=(Vbias+Vsig) are :
// Linear ADC : adc=Vin/LSB.
// Log_B ADC (see below) : adc=(N/C)*Log_B(pow(B,C)*Vin/Vref).
//
// Which leads to the following relations between Vref and Vfs :
// Linear ADC : Vref=Vfs+LSB.
// Log_B ADC (see below) : Vfs=Vref*pow(B,-C)*pow(B,(N-1)*C/N).
//
// The Dynamic Range (DR) is defined as the ratio of the largest and smallest input voltages
// that can reliably be resolved.
// Expressed in decibel we have : DR=20*log_10(Vfs/LSB) dB.
//
// For details about the procedure, please refer to the excellent textbook :
// "The Scientist and Engineer's Guide to Digital Signal Processing" by Steven W. Smith,
// which is online available at http://www.dspguide.com/pdfbook.htm
//
// and the publication by Y. Sundarasaradula et al. :
// "A 6-bit, Two-step, Successive Approximation Logarithmic ADC for Biomedical Applications"
// which is online available at https://spiral.imperial.ac.uk/bitstream/10044/1/44156/2/2016_ICECS_LogADC_Camera.pdf.
//
// Input arguments :
// -----------------
// nbits : Digital quantization of the input values will be performed using nbits.
// range >0 : The full scale voltage range (Vfs) of the analog signal that corresponds to adc=N-1.
// <0 : |range| is the reference voltage (Vref) of the analog signal that corresponds to the hypothetical adc=N.
// Vbias : The bias voltage that will be added to the analog input signal before digitization.
// Vsig : Array containing the analog input signals.
// B >1 : Base for a Log ADC (e.g. B=10 emulates a Log_10 ADC).
// =0 : The ADC will be linear
// =1 : The ADC will be a Log_e ADC.
// Note : When B>0 all (Vbias+Vsig) input values should be positive.
// C : Code efficiency factor for a Log ADC.
// Rule of thumb : pow(B,-C) is about the smallest signal/|range| ratio that can be resolved.
// So, for a log_10 ADC with C=3, the smallest signal that can be resolved is about |range|/1000.
// Note : It is required that C>0.
//
// Optional output arguments :
// ---------------------------
// hist : Histogram with the digitized result
//
// Notes :
// -------
// 1) In case no "Vsig" array is provided, just the ADC specs will be printed
// and in the TArrayL64 only the adc value corresponding to Vbias is returned.
// This allows to quickly investigate various scenarios without any data treatment.
// 2) Providing a "Vsig" array with different small (random) amplitudes allows to mimic variations of the bias or
// characteristics of the various switched capacitor array elements for the individual samplings.
// This resembles a so called "pedestal run" in real life Data Acquisition (DAQ) applications.
// For a linear ADC, the contents of the returned TArrayL64 can be used afterwards for pedestal subtraction.
//
// The maximum number of bits that is supported is 60 to guarantee identical functioning
// on all machines.
//
// In case of inconsistent input parameters, no digitization is performed and an empty TArrayL64 is returned.
//
// The default values are Vbias=0, Vsig=0, hist=0, B=0 and C=3.

Definition at line 5209 of file NcSample.cxx.

◆ Animation() [1/4]

void NcSample::Animation ( Int_t i,
Int_t j,
Int_t k,
Int_t mode,
Int_t m,
Int_t delay,
TString opt = "PFB" )
// Animation of an (ordered) sampling with : X-axis=variable i, Y-axis=variable j and Z-axis=variable k.
// The first variable has index 1.
//
// Every data entry is considered to occur at a step in time, and this member function
// displays an animated time development of the sampling of the specified 2D data points.
// The input argument "delay" represents the pause time (in ms) between every step.
//
// The time flow can be controlled by ordering the various entries according to
// the specified m-th variable and the input argument "mode".
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// Note : If mode=0 the value of "m" is irrelevant.
//
// The input argument "opt" represents the drawing option(s) for a TGraph2D.
//
// The default value is opt="PFB".
//
// This facility is only available if the storage mode has been activated.

Definition at line 4815 of file NcSample.cxx.

◆ Animation() [2/4]

void NcSample::Animation ( Int_t i,
Int_t j,
Int_t mode,
Int_t k,
Int_t delay,
TString opt = "AP" )
// Animation of an (ordered) sampling with : X-axis=variable i and Y-axis=variable j.
// The first variable has index 1.
//
// Every data entry is considered to occur at a step in time, and this member function
// displays an animated time development of the sampling of the specified 2D data points.
// The input argument "delay" represents the pause time (in ms) between every step.
//
// The time flow can be controlled by ordering the various entries according to
// the specified k-th variable and the input argument "mode".
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// Note : If mode=0 the value of "k" is irrelevant.
//
// The input argument "opt" represents the drawing option(s) for a TGraph.
//
// The default value is opt="AP".
//
// This facility is only available if the storage mode has been activated.

Definition at line 4701 of file NcSample.cxx.

◆ Animation() [3/4]

void NcSample::Animation ( TString nameA,
TString nameB,
Int_t mode,
TString nameC,
Int_t delay,
TString opt = "AP" )
// Animation of an (ordered) sampling with : X-axis=variable nameA and Y-axis=variable nameB.
//
// Every data entry is considered to occur at a step in time, and this member function
// displays an animated time development of the sampling of the specified 2D data points.
// The input argument "delay" represents the pause time (in ms) between every step.
//
// The time flow can be controlled by ordering the various entries according to
// the variable specified with nameC and the input argument "mode".
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// Note : If mode=0 the value of nameC is irrelevant.
//
// The input argument "opt" represents the drawing option(s) for a TGraph.
//
// The default value is opt="AP".
//
// This facility is only available if the storage mode has been activated.

Definition at line 4782 of file NcSample.cxx.

◆ Animation() [4/4]

void NcSample::Animation ( TString nameA,
TString nameB,
TString nameC,
Int_t mode,
TString nameD,
Int_t delay,
TString opt = "PFB" )
// Animation of an (ordered) sampling with : X-axis=variable nameA, Y-axis=variable nameB and Z-axis=variable nameC.
//
// Every data entry is considered to occur at a step in time, and this member function
// displays an animated time development of the sampling of the specified 2D data points.
// The input argument "delay" represents the pause time (in ms) between every step.
//
// The time flow can be controlled by ordering the various entries according to
// the variable specified by nameD and the input argument "mode".
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// Note : If mode=0 the value of nameD is irrelevant.
//
// The input argument "opt" represents the drawing option(s) for a TGraph2D.
//
// The default value is opt="PFB".
//
// This facility is only available if the storage mode has been activated.

Definition at line 4901 of file NcSample.cxx.

◆ Clone()

TObject * NcSample::Clone ( const char * name = "") const
virtual
// Make a deep copy of the current object and provide the pointer to the copy.
// This memberfunction enables automatic creation of new objects of the
// correct type depending on the object type, a feature which may be very useful
// for containers like NcEvent when adding objects in case the
// container owns the objects.

Definition at line 6090 of file NcSample.cxx.

◆ Compute()

void NcSample::Compute ( )
protected
// Internal member function to compute the various statistical values
// after each entering or removing action on a certain sample.

Definition at line 1144 of file NcSample.cxx.

◆ DAC()

TArrayD NcSample::DAC ( Int_t nbits,
Double_t range,
Double_t Vbias = 0,
TArray * adcs = 0,
TArray * peds = 0,
TH1 * hist = 0,
Int_t B = 0,
Int_t C = 3 ) const
protected
// Internal member function for processing of a Digital to Analog Converter (DAC).
// Reconstruct the analog signals based on the discrete quantized digital data from an "nbits" ADC,
// based on the "range" for the analog signal and a bias voltage "Vbias" or array "peds" of pedestal values (see below).
// The digital input signals are provided by the TArray "adcs".
// The resulting analog values are returned in a TArrayD object.
//
// Note : Make sure to use the same units for "range" and "Vbias".
//
// The number of digital quantization levels is given by N=2^|nbits|, of which the lowest
// level represents the value 0. This implies a range [0,N-1] for the various digital adc values.
// The correspondance of an analog input voltage (Vin) to one of the quantization levels depends on the
// specified "range" and "Vbias" and whether we have a linear or Log DAC (see below).
//
// As outlined below, the range of the analog input voltage can be specified as the Full Scale
// voltage range (Vfs) corresponding to adc=N-1 or as the Reference voltage (Vref) corresponding to
// the hypothetical adc=N.
//
// The Least Significant Bit (LSB) represents the smallest analog input voltage interval
// that can reliably be resolved. In other words LSB=Voltage(adc=1)-Voltage(adc=0).
// For a linear DAC we have : LSB=Vfs/(N-1) or equivalently LSB=Vref/N.
// For a Log_B DAC (see below) we have : LSB=Vref*pow(B,-C)*(pow(B,C/N)-1).
//
// The formulas for the adc->Vin mapping with Vin=(Vbias+Vsig) are :
// Linear DAC : Vin=adc*LSB.
// Log_B DAC (see below) : Vin=Vref*pow(B,-C)*pow(B,C*adc/N)
//
// Which implies the following relations between Vref and Vfs :
// Linear DAC : Vref=Vfs+LSB.
// Log_B DAC (see below) : Vfs=Vref*pow(B,-C)*pow(B,C*(N-1)/N).
//
// The Dynamic Range (DR) is defined as the ratio of the largest and smallest analog voltages
// that can reliably be resolved.
// Expressed in decibel we have : DR=20*log_10(Vfs/LSB) dB.
//
// For details about the procedure, please refer to the excellent textbook :
// "The Scientist and Engineer's Guide to Digital Signal Processing" by Steven W. Smith,
// which is online available at http://www.dspguide.com/pdfbook.htm
//
// and the publication by Y. Sundarasaradula et al. :
// "A 6-bit, Two-step, Successive Approximation Logarithmic ADC for Biomedical Applications"
// which is online available at https://spiral.imperial.ac.uk/bitstream/10044/1/44156/2/2016_ICECS_LogADC_Camera.pdf.
//
// Input arguments :
// -----------------
// nbits : Digitial quantization was performed using an nbits ADC.
// range >0 : The full scale voltage range (Vfs) of the analog signal that corresponds to adc=N-1.
// <0 : |range| is the reference voltage (Vref) of the analog signal that corresponds to the hypothetical adc=N.
// Vbias : The bias voltage that was added to the analog input signal before digitization.
// If specified, the resulting analog signals will be corrected for the bias voltage.
// For a linear DAC the correction via Vbias will only be performed if no pedestal array "peds"
// is specified (see below). If the array "peds" is specified, Vbias will be ignored for a linear DAC.
// For a Log DAC the pedestal values will never be used and bias correction may only be obtained via Vbias.
// adcs : Array to contain the digital input signals.
// peds : (Optional) array to contain the pedestal values for the individual digital input signals.
// The array "peds" must contain (at least) the same number of values as the number of digital input signals.
// If the array "peds" is specified, the pedestals will be subtracted from the corresponding digital input signals
// before the conversion to analog signals is performed in case of a linear DAC.
// For a Log DAC the pedestal values will never be used and bias correction may only be obtained via Vbias.
// B >1 : Base for a Log DAC (e.g. B=10 emulates a Log_10 DAC).
// =0 : The DAC will be linear
// =1 : The DAC will be a Log_e DAC.
// C : Code efficiency factor that was used for a Log ADC.
// Rule of thumb : pow(B,-C) is about the smallest signal/|range| ratio that can be resolved.
// So, for a Log_10 ADC with C=3, the smallest signal that can be resolved is about |range|/1000.
// Note : It is required that C>0.
//
// Optional output arguments :
// ---------------------------
// hist : Histogram with the analog result
//
// Notes :
// -------
// 1) In case no "adcs" array is provided, just the DAC specs will be printed
// and in the TArrayD only the adc value corresponding to Vbias is returned.
// This allows to quickly investigate various scenarios without any data treatment.
//
// The maximum number of bits that is supported is 60 to guarantee identical functioning
// on all machines.
//
// In case of inconsistent input parameters, no processing is performed and an empty TArrayD is returned.
//
// The default values are Vbias=0, adcs=0, peds=0, hist=0, B=0 and C=3.

Definition at line 5426 of file NcSample.cxx.

◆ Data() [1/2]

void NcSample::Data ( Int_t i = 0,
Int_t j = 0 )
// Listing of statistics of all or selected variables.
//
// Meaning of the input arguments (i,j) :
// --------------------------------------
// (0,0) : List all statistics and correlations of all variables
// (i,0) : List statistics of the i-th variable (first is i=1)
// (i,j) : List correlation statistics of the variables i and j
//
// Note : The input (0,k) provides the same listing as (k,0).
//
// The default values are i=0 and j=0.

Definition at line 1474 of file NcSample.cxx.

◆ Data() [2/2]

void NcSample::Data ( TString nameA,
TString nameB = "-" )
// Listing of statistics of all or selected variables.
//
// Input arguments :
// -----------------
// nameA : Name of a variable to be selected
// nameB : Name of a variable to be selected
//
// Meaning of the input arguments (nameA,nameB) :
// ----------------------------------------------
// ("-","-") : List all statistics and correlations of all variables
// ("R","-") : List statistics of the variable with the name "R"
// ("Q","M") : List correlation statistics of the variables with names "Q" and "M"
//
// Notes :
// -------
// 1) The specification of names is case sensitive.
// 2) The input ("-","Time") provides the same listing as ("Time","-").
// 3) In case no match is found for a specified name, it is treated as "-".
// 4) Invokation of Data() corresponds to Data("-","-").
//
// The default value is nameB="-".

Definition at line 1568 of file NcSample.cxx.

◆ Digitize() [1/2]

Double_t NcSample::Digitize ( Int_t i,
Int_t nbits,
Double_t vcal,
Int_t mode )
// Digitize the values of the i-th variable according to an "nbits" ADC.
//
// **************************************************************************************
// *** This function has become obsolete and is only kept for backward compatibility. ***
// *** Please refer to the new, more flexible memberfunction Transmit(). ***
// **************************************************************************************
//
// Input arguments :
// -----------------
// i : Digitization of the i-th variable (first is i=1) will be performed.
// In case the value of "i" is out of range for this sample, just the specs
// of the specified ADC performance will be printed, but no digitization is performed.
// This allows to test various scenarios without modifying the data.
// nbits >0 : Digitization of the values will be performed using nbits.
// The digitized result (digval) will be stored to replace the original value.
// <0 : Digitization of the Log10 of the values will be performed using |nbits|.
// After digitization of the Log10 value, the digitized result (digval) is
// used to store the corresponding linear value via value=pow(10,digval).
// So, nbits<0 emulates a Log10 ADC to enhance the dynamic range.
// Note : When nbits<0 all values to be digitized should be positive.
// vcal : Range calibration value of the ADC according to "mode" as indicated below.
// mode =0 : Range for the digitized result (digval) will be set to [0,vcal] (or [vcal,0] if vcal<0).
// 1 : Full scale range for the digitized result (digval) will be set to [-|vcal|,|vcal|].
// 2 : A step size of |vcal| is used providing a digval interval of [0,scale] (or [-scale,0] if vcal<0).
// 3 : A step size of |vcal| is used providing a digval interval of [-scale,scale].
//
// Return argument :
// -----------------
// mode=0 or mode=1 --> The value of "step size" is returned.
// mode=2 or mode=3 --> The value of "scale" is returned.
//
// Notes :
// -------
// 1) The step size corresponds closely to the Least Significant Bit (LSB) precision for the
// digitized result (digval).
// For an n-bit ADC we have stepsize=range/(-1+2^n), whereas LSB=1/(2^n).
// 2) In case of a Log10 ADC, the value of "vcal" relates to the Log10 values.
// So, for a Log10 ADC, the "vcal" interval [-2,2] represents linear values [0.01,100].
// A step size of 0.0315 for an 8-bit Log10 ADC provides a Log10 interval of [-4,4]
// for mode=3, which corresponds to a linear value interval of [0.0001,10000].
// For mode=2 this would result in a Log10 interval of [0,8.0325], which corresponds
// to a linear value interval of [1,1.0777e8].
// A step size of 0.01 between the Log10 values corresponds to a multiplication factor
// of 10^0.01 (i.e. about 1.023) for the linear values at each step.
//
// The maximum number of bits that is supported is 60 to guarantee identical functioning
// on all machines.
//
// Warning :
// ---------
// This member function will change the contents of this sample
// concerning the values of the i-th variable.
// In case access to the original values is required, one should
// make a copy of the original sample before the digitization process.
//
// This facility is only available if the storage mode has been activated.
//
// In case of inconsistent input parameters, no digitization is performed and the value 0 is returned.

Definition at line 4935 of file NcSample.cxx.

◆ Digitize() [2/2]

Double_t NcSample::Digitize ( TString name,
Int_t nbits,
Double_t vcal,
Int_t mode )
// Digitize the values of the variable with the specified name according to an "nbits" ADC.
//
// **************************************************************************************
// *** This function has become obsolete and is only kept for backward compatibility. ***
// *** Please refer to the new, more flexible memberfunction Transmit(). ***
// **************************************************************************************
//
// Input arguments :
// -----------------
// name : Digitization of the variable with this name will be performed.
// In case the name is non-existent for this sample, just the specs
// of the specified ADC performance will be printed, but no digitization is performed.
// This allows to test various scenarios without modifying the data.
// nbits >0 : Digitization of the values will be performed using nbits.
// The digitized result (digval) will be stored to replace the original value.
// <0 : Digitization of the Log10 of the values will be performed using |nbits|.
// After digitization of the Log10 value, the digitized result (digval) is
// used to store the corresponding linear value via value=pow(10,digval).
// So, nbits<0 emulates a Log10 ADC to enhance the dynamic range.
// Note : When nbits<0 all values to be digitized should be positive.
// vcal : Range calibration value of the ADC according to "mode" as indicated below.
// mode =0 : Range for the digitized result (digval) will be set to [0,vcal] (or [vcal,0] if vcal<0).
// 1 : Full scale range for the digitized result (digval) will be set to [-|vcal|,|vcal|].
// 2 : A step size of |vcal| is used providing a digval interval of [0,scale] (or [-scale,0] if vcal<0).
// 3 : A step size of |vcal| is used providing a digval interval of [-scale,scale].
//
// Return argument :
// -----------------
// mode=0 or mode=1 --> The value of "step size" is returned.
// mode=2 or mode=3 --> The value of "scale" is returned.
//
// Notes :
// -------
// 1) The step size corresponds closely to the Least Significant Bit (LSB) precision for the
// digitized result (digval).
// For an n-bit ADC we have stepsize=range/(-1+2^n), whereas LSB=1/(2^n).
// 2) In case of a Log10 ADC, the value of "vcal" relates to the Log10 values.
// So, for a Log10 ADC, the "vcal" interval [-2,2] represents linear values [0.01,100].
// A step size of 0.0315 for an 8-bit Log10 ADC provides a Log10 interval of [-4,4]
// for mode=3, which corresponds to a linear value interval of [0.0001,10000].
// For mode=2 this would result in a Log10 interval of [0,8.0325], which corresponds
// to a linear value interval of [1,1.0777e8].
// A step size of 0.01 between the Log10 values corresponds to a multiplication factor
// of 10^0.01 (i.e. about 1.023) for the linear values at each step.
//
// The maximum number of bits that is supported is 60 to guarantee identical functioning
// on all machines.
//
// Warning :
// ---------
// This member function will change the contents of this sample
// concerning the values of the variable with the specified name.
// In case access to the original values is required, one should
// make a copy of the original sample before the digitization process.
//
// This facility is only available if the storage mode has been activated.
//
// In case of inconsistent input parameters, no digitization is performed and the value 0 is returned.

Definition at line 5139 of file NcSample.cxx.

◆ Enter() [1/4]

void NcSample::Enter ( Double_t x)
// Entering a value into a 1-dim. sample.
// In case of first entry the dimension is set to 1.

Definition at line 357 of file NcSample.cxx.

◆ Enter() [2/4]

void NcSample::Enter ( Double_t x,
Double_t y )
// Entering a pair (x,y) into a 2-dim. sample.
// In case of first entry the dimension is set to 2.

Definition at line 452 of file NcSample.cxx.

◆ Enter() [3/4]

void NcSample::Enter ( Double_t x,
Double_t y,
Double_t z )
// Entering a set (x,y,z) into a 3-dim. sample.
// In case of first entry the dimension is set to 3.

Definition at line 565 of file NcSample.cxx.

◆ Enter() [4/4]

void NcSample::Enter ( Double_t x,
Double_t y,
Double_t z,
Double_t t )
// Entering a set (x,y,z,t) into a 4-dim. sample.
// In case of first entry the dimension is set to 4.

Definition at line 700 of file NcSample.cxx.

◆ Get1DHistogram() [1/2]

TH1D NcSample::Get1DHistogram ( Int_t i,
Int_t j = 0,
Bool_t sumw2 = kFALSE,
Int_t nbx = 100,
TF1 * f = 0 )
// Provide a TH1D histogram with the values of variable i.
// If j>0 the corresponding value of variable j will be used as a weight.
// In case j>0 and also the 1-dimensional function "f" is specified,
// then the function value of variable j will be used as a weight.
// The input argument "sumw2" activates (kTRUE) TH1::Sumw2() option or not (kFALSE).
// The input argument "nbx" defines the number of bins on the X-axis.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default values are j=0, sumw2=kFALSE, nbx=100 and f=0.

Definition at line 2755 of file NcSample.cxx.

◆ Get1DHistogram() [2/2]

TH1D NcSample::Get1DHistogram ( TString nameA,
TString nameB = "-",
Bool_t sumw2 = kFALSE,
Int_t nbx = 100,
TF1 * f = 0 )
// Provide a TH1D histogram for the variable specified with nameA.
// If nameB is valid, the corresponding value of that variable will be used as a weight.
// In case nameB is valid and also the 1-dimensional function "f" is specified,
// then the function value of nameB will be used as a weight.
// The input argument "sumw2" activates (kTRUE) TH1::Sumw2() option or not (kFALSE).
// The input argument "nbx" defines the number of bins on the X-axis.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default values are nameB="-", sumw2=kFALSE, nbx=100 and f=0.

Definition at line 2837 of file NcSample.cxx.

◆ Get2DHistogram() [1/2]

TH2D NcSample::Get2DHistogram ( Int_t i,
Int_t j,
Int_t k = 0,
Bool_t sumw2 = kFALSE,
Int_t nbx = 100,
Int_t nby = 100,
TF1 * f = 0 )
// Provide a TH2D histogram for the values of variables i and j.
// If k>0 the corresponding value of variable k will be used as a weight.
// In case k>0 and also the 1-dimensional function "f" is specified,
// then the function value of variable k will be used as a weight.
// The input argument "sumw2" activates (kTRUE) TH1::Sumw2() option or not (kFALSE).
// The input arguments "nbx" and "nby" define the number of bins on the X-axis
// and Y-axis, respectively.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default values are k=0, sumw2=kFALSE, nbx=100, nby=100 and f=0.

Definition at line 2859 of file NcSample.cxx.

◆ Get2DHistogram() [2/2]

TH2D NcSample::Get2DHistogram ( TString nameA,
TString nameB,
TString nameC = "-",
Bool_t sumw2 = kFALSE,
Int_t nbx = 100,
Int_t nby = 100,
TF1 * f = 0 )
// Provide a TH2D histogram for the variables specified with nameA and nameB.
// If nameC is valid, the corresponding value of that variable will be used as a weight.
// In case nameC is valid and also the 1-dimensional function "f" is specified,
// then the function value of nameC will be used as a weight.
// The input argument "sumw2" activates (kTRUE) TH1::Sumw2() option or not (kFALSE).
// The input arguments "nbx" and "nby" define the number of bins on the X-axis
// and Y-axis, respectively.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default values are nameC="-", sumw2=kFALSE, nbx=100, nby=100 and f=0.

Definition at line 2953 of file NcSample.cxx.

◆ Get3DHistogram() [1/2]

TH3D NcSample::Get3DHistogram ( Int_t i,
Int_t j,
Int_t k,
Int_t m = 0,
Bool_t sumw2 = kFALSE,
Int_t nbx = 100,
Int_t nby = 100,
Int_t nbz = 100,
TF1 * f = 0 )
// Provide a TH3D histogram for the values of variables i, j and k.
// If m>0 the corresponding value of variable m will be used as a weight.
// In case m>0 and also the 1-dimensional function "f" is specified,
// then the function value of variable m will be used as a weight.
// The input argument "sumw2" activates (kTRUE) TH1::Sumw2() option or not (kFALSE).
// The input arguments "nbx", "nby" and "nbz" define the number of bins on the X-axis,
// Y-axis and Z-axis, respectively.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default values are m=0, sumw2=kFALSE, nbx=100, nby=100, nbz=100 and f=0.

Definition at line 2977 of file NcSample.cxx.

◆ Get3DHistogram() [2/2]

TH3D NcSample::Get3DHistogram ( TString nameA,
TString nameB,
TString nameC,
TString nameD = "-",
Bool_t sumw2 = kFALSE,
Int_t nbx = 100,
Int_t nby = 100,
Int_t nbz = 100,
TF1 * f = 0 )
// Provide a TH3D histogram for the variables specified with nameA, nameB and nameC.
// If nameD is valid, the corresponding value of that variable will be used as a weight.
// In case nameD is valid and also the 1-dimensional function "f" is specified,
// then the function value of nameD will be used as a weight.
// The input argument "sumw2" activates (kTRUE) TH1::Sumw2() option or not (kFALSE).
// The input arguments "nbx", "nby" and "nbz" define the number of bins on the X-axis,
// Y-axis and Z-axis, respectively.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default values are nameD="-", sumw2=kFALSE, nbx=100, nby=100, nbz=100 and f=0.

Definition at line 3080 of file NcSample.cxx.

◆ GetCor() [1/2]

Double_t NcSample::GetCor ( Int_t i,
Int_t j ) const
// Provide the correlation coefficient between variables i and j.
// The index of the first variable is 1.

Definition at line 1443 of file NcSample.cxx.

◆ GetCor() [2/2]

Double_t NcSample::GetCor ( TString nameA,
TString nameB ) const
// Provide the correlation coefficient the variables with the specified names.

Definition at line 1461 of file NcSample.cxx.

◆ GetCov() [1/2]

Double_t NcSample::GetCov ( Int_t i,
Int_t j ) const
// Provide the covariance between variables i and j.
// The index of the first variable is 1.

Definition at line 1412 of file NcSample.cxx.

◆ GetCov() [2/2]

Double_t NcSample::GetCov ( TString nameA,
TString nameB ) const
// Provide the covariance between the variables with the specified names.

Definition at line 1430 of file NcSample.cxx.

◆ GetCV() [1/2]

Double_t NcSample::GetCV ( Int_t i,
Int_t mode = 1 ) const
// Provide the Coefficient of Variation (CV) of the i-th variable.
// The first variable corresponds to i=1.
//
// As indicated below, the input argument "mode" allows to select use of
// the mean of the sample or the difference between the maximum and minimum value.
// The latter is best suited for bipolar transient signals, since their mean value
// may become (close to) zero, irrespective of the signal amplitude.
//
// Furthermore, the input argument "mode" also provides a selection to use
// the RMSdeviation of the sample (mode>0) or the standard deviation, sigma,
// of the underlying parent distribution (mode<0), as indicated below.
//
// mode : 1 --> CV=abs(RMSdeviation/mean)
// -1 --> CV=abs(sigma/mean)
// 2 --> CV=abs(2*RMSdeviation/(max-min))
// -2 --> CV=abs(2*sigma/(max-min))
//
// The default value is mode=1 for backward compatibility.
//
// In case of inconsistent data, the value -1 is returned.

Definition at line 4628 of file NcSample.cxx.

◆ GetCV() [2/2]

Double_t NcSample::GetCV ( TString name,
Int_t mode = 1 ) const
// Provide the Coefficient of Variation (CV) of the variable with the specified name.
//
// As indicated below, the input argument "mode" allows to select use of
// the mean of the sample or the difference between the maximum and minimum value.
// The latter is best suited for bipolar transient signals, since their mean value
// may become (close to) zero, irrespective of the signal amplitude.
//
// Furthermore, the input argument "mode" also provides a selection to use
// the RMSdeviation of the sample (mode>0) or the standard deviation, sigma,
// of the underlying parent distribution (mode<0), as indicated below.
//
// mode : 1 --> CV=abs(RMSdeviation/mean)
// -1 --> CV=abs(sigma/mean)
// 2 --> CV=abs(2*RMSdeviation/(max-min))
// -2 --> CV=abs(2*sigma/(max-min))
//
// The default value is mode=1 for backward compatibility.
//
// In case of inconsistent data, the value -1 is returned.

Definition at line 4671 of file NcSample.cxx.

◆ GetDimension()

Int_t NcSample::GetDimension ( ) const
// Provide the dimension of this sample.

Definition at line 1188 of file NcSample.cxx.

◆ GetDtSample() [1/2]

NcSample NcSample::GetDtSample ( Int_t i,
Int_t nc,
Int_t store = 1,
Int_t nmax = 0,
Int_t order = 0 )
// The i-th variable of the current sample is regarded as the recording of event times,
// and this memberfunction samples the time intervals (dt) between a certain fixed
// amount of time ordered consecutive entries for this i-th variable.
//
// Returned object : A single-variable NcSample object containing the corresponding dt values,
// with "Dt" as variable name.
//
// For this functionality the storage mode of the current sample has to be activated.
//
// Input arguments :
// -----------------
// i : The requested variable (1=first) of the current sample.
// nc : The step count to arrive at the required consecutive entry (see example below).
// store = 0 : The resulting dt values will not be stored, but the dt statistics will be recorded.
// 1 : In addition to recording the dt statistics, also the obtained dt values will be stored.
// nmax = 0 : No maximum is set for the number of stored dt entries.
// > 0 : The dt entries will be stored up to a maximum of "nmax" entries.
// order > 0 : Re-order the dt entries in increasing order before removing the first (=lowest value).
// = 0 : Re-order the dt entries in the order they were obtained before removing the first one.
// < 0 : Re-order the dt entries in decreasing order before removing the first (=highest value).
// When nmax=0 the value of "order" is irrelevant.
//
// Note :
// ------
// Specification of order=0 results in a regular First In First Out (FIFO) buffer performance,
// whereas for other "order" values it reflects a FIFO behaviour of removing the first entry
// after the requested ordering.
//
// The default values are store=1, nmax=0 and order=0.
//
// Example :
// ---------
// Specifying "nc=1" will provide the NcSample with the dt intervals between each consecutive event,
// i.e. the distribution of time intervals between the events (1,2), (2,3), (3,4) etc.
// Specifying "nc=2" will provide the NcSample with the dt intervals between every 2nd consecutive event,
// i.e. the distribution of time intervals between the events (1,3), (2,4), (3,5) etc.
// In case the input sample contained Poissonian distributed event times, the produced dt values represent
// so called Erlang distributions (see also class NcMath), for which each time interval contains
// exactly "nc" events of which the last event occurs right at the end of the interval.
//
// Note :
// ------
// In the text above the values of the current sample are regarded as observed event times,
// but actually any sampling of an observable with a well defined ordering can be used.

Definition at line 2502 of file NcSample.cxx.

◆ GetDtSample() [2/2]

NcSample NcSample::GetDtSample ( TString name,
Int_t nc,
Int_t store = 1,
Int_t nmax = 0,
Int_t order = 0 )
// The variable with the specified name of the current sample is regarded as the recording of event times,
// and this memberfunction samples the time intervals (dt) between a certain fixed amount of
// time ordered consecutive entries for the specified variable.
//
// Returned object : A single-variable NcSample object containing the corresponding dt values,
// with "Dt" as variable name.
//
// For this functionality the storage mode of the current sample has to be activated.
//
// Input arguments :
// -----------------
// name : The name of the requested variable of the current sample.
// nc : The step count to arrive at the required consecutive entry (see example below).
// store = 0 : The resulting dt values will not be stored, but the dt statistics will be recorded.
// 1 : In addition to recording the dt statistics, also the obtained dt values will be stored.
// nmax = 0 : No maximum is set for the number of stored dt entries.
// > 0 : The dt entries will be stored up to a maximum of "nmax" entries.
// order > 0 : Re-order the dt entries in increasing order before removing the first (=lowest value).
// = 0 : Re-order the dt entries in the order they were obtained before removing the first one.
// < 0 : Re-order the dt entries in decreasing order before removing the first (=highest value).
// When nmax=0 the value of "order" is irrelevant.
//
// Note :
// ------
// Specification of order=0 results in a regular First In First Out (FIFO) buffer performance,
// whereas for other "order" values it reflects a FIFO behaviour of removing the first entry
// after the requested ordering.
//
// The default values are store=1, nmax=0 and order=0.
//
// Example :
// ---------
// Specifying "nc=1" will provide the NcSample with the dt intervals between each consecutive event,
// i.e. the distribution of time intervals between the events (1,2), (2,3), (3,4) etc.
// Specifying "nc=2" will provide the NcSample with the dt intervals between every 2nd consecutive event,
// i.e. the distribution of time intervals between the events (1,3), (2,4), (3,5) etc.
// In case the input sample contained Poissonian distributed event times, the produced dt values represent
// so called Erlang distributions (see also class NcMath), for which each time interval contains
// exactly "nc" events of which the last event occurs right at the end of the interval.
//
// Note :
// ------
// In the text above the values of the current sample are regarded as observed event times,
// but actually any sampling of an observable with a well defined ordering can be used.

Definition at line 2592 of file NcSample.cxx.

◆ GetEntry() [1/2]

Double_t NcSample::GetEntry ( Int_t i,
Int_t j,
Int_t mode = 0,
Int_t k = 0 )
// Access the data entry at index "i" and provide the value of the j-th variable,
// after ordering w.r.t. the k-th variable.
// The first entry is indicated by the index i=1 and the first variable is j=1.
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// This facility is only available if the storage mode has been activated.
//
// Note : If mode=0 the value of "k" is irrelevant.
//
// The default values are mode=0 and k=0.

Definition at line 2340 of file NcSample.cxx.

◆ GetEntry() [2/2]

Double_t NcSample::GetEntry ( Int_t i,
TString nameA,
Int_t mode = 0,
TString nameB = "-" )
// Access the data entry at index "i" and provide the value of the variable
// specified with nameA, after ordering w.r.t. the variable specified with nameB.
// The first entry is indicated by the index i=1.
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// This facility is only available if the storage mode has been activated.
//
// Note : If mode=0 the value of nameB is irrelevant.
//
// The default values are mode=0 and nameB="-".

Definition at line 2411 of file NcSample.cxx.

◆ GetGraph() [1/12]

TGraph2D NcSample::GetGraph ( Int_t i,
Int_t j,
Int_t k,
TF1 * f = 0 )
// Provide a TGraph with : X-axis=variable i, Y-axis=variable j and Z-axis=variable k.
// In case the 1-dimensional function "f" is specified, the function value of variable k
// will be used as at the Z-axis.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default value is f=0.

Definition at line 3701 of file NcSample.cxx.

◆ GetGraph() [2/12]

TGraph2D NcSample::GetGraph ( Int_t i,
Int_t j,
Int_t k,
TString f )
// Provide a TGraph with : X-axis=variable i, Y-axis=variable j and Z-axis=f(variable k).
// The 1D function "f" has to be specified following the TF1 string format convention.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.

Definition at line 3779 of file NcSample.cxx.

◆ GetGraph() [3/12]

TGraphTime * NcSample::GetGraph ( Int_t i,
Int_t j,
Int_t mode,
Int_t k,
Bool_t smp = kTRUE )
// Provide a pointer to a TGraphTime with : X-axis=variable i and Y-axis=variable j.
// The first variable has index 1.
//
// Note :
// ------
// At every invokation of this member function, the existing TGraphTime will be deleted.
// In case you want to keep the produced graph(s) fur further analysis, you have to make
// a local copy (e.g. via the Clone() facility) of the produced TGraphTime object(s).
//
// Every data entry is considered to occur at a step in time, and the TGraphTime allows
// to display an animated time development of the sampling of the specified 2D data points.
// This can be achieved by setting the time step delay via TGraphTime::SetSleepTime()
// followed by TGraphTime::Draw().
//
// The time development of the various entries can be displayed in cumulative sampling mode
// (smp=kTRUE), which reflects an animation of the building up of the total data sample.
// When smp=kFALSE, only every single entry is displayed, which reflects an animation
// of a single point moving in time in 2 dimensions.
// The animations can be saved in an animated GIF file via TGraphTime::SaveAnimatedGif()
// after TGraphTime::Draw() has been invoked.
//
// The time flow can be controlled by ordering the various entries according to
// the specified k-th variable and the input argument "mode".
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// Note : If mode=0 the value of "k" is irrelevant.
//
// This facility is only available if the storage mode has been activated.
//
// In case of inconsistent data, the value 0 is returned.
//
// The default value is smp=kTRUE.

Definition at line 3546 of file NcSample.cxx.

◆ GetGraph() [4/12]

TGraph NcSample::GetGraph ( Int_t i,
Int_t j,
TF1 * f = 0 )
// Provide a TGraph with : X-axis=variable i and Y-axis=variable j.
// In case the 1-dimensional function "f" is specified, then the
// function value of variable j will be used as at the Y-axis.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default value is f=0.

Definition at line 3203 of file NcSample.cxx.

◆ GetGraph() [5/12]

TGraph NcSample::GetGraph ( Int_t i,
Int_t j,
TString f )
// Provide a TGraph with : X-axis=variable i and Y-axis=f(variable j).
// The 1D function "f" has to be specified following the TF1 string format convention,
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.

Definition at line 3269 of file NcSample.cxx.

◆ GetGraph() [6/12]

TGraph NcSample::GetGraph ( Int_t i,
TF1 * f = 0 )
// Provide a TGraph with : X-axis=sampling entry number and Y-axis=variable i.
// In case the 1-dimensional function "f" is specified, then the
// function value of variable i will be used as at the Y-axis.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default value is f=0.

Definition at line 3105 of file NcSample.cxx.

◆ GetGraph() [7/12]

TGraph NcSample::GetGraph ( Int_t i,
TString f )
// Provide a TGraph with : X-axis=sampling entry number and Y-axis=f(variable i).
// The 1D function "f" has to be specified following the TF1 string format convention,
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.

Definition at line 3168 of file NcSample.cxx.

◆ GetGraph() [8/12]

TGraph NcSample::GetGraph ( TString nameA,
TF1 * f = 0 )
// Provide a TGraph with : X-axis=sampling entry number and Y-axis=variable with nameA.
// In case the 1-dimensional function "f" is specified, then the
// function value of nameA will be used as at the Y-axis.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default value is f=0.

Definition at line 3185 of file NcSample.cxx.

◆ GetGraph() [9/12]

TGraphTime * NcSample::GetGraph ( TString nameA,
TString nameB,
Int_t mode,
TString nameC,
Bool_t smp = kTRUE )
// Provide a pointer to a TGraphTime with : X-axis=variable nameA and Y-axis=variable nameB.
//
// Note :
// ------
// At every invokation of this member function, the existing TGraphTime will be deleted.
// In case you want to keep the produced graph(s) fur further analysis, you have to make
// a local copy (e.g. via the Clone() facility) of the produced TGraphTime object(s).
//
// Every data entry is considered to occur at a step in time, and the TGraphTime allows
// to display an animated time development of the sampling of the specified 2D data points.
// This can be achieved by setting the time step delay via TGraphTime::SetSleepTime()
// followed by TGraphTime::Draw().
//
// The time development of the various entries can be displayed in cumulative sampling mode
// (smp=kTRUE), which reflects an animation of the building up of the total data sample.
// When smp=kFALSE, only every single entry is displayed, which reflects an animation
// of a single point moving in time in 2 dimensions.
// The animations can be saved in an animated GIF file via TGraphTime::SaveAnimatedGif()
// after TGraphTime::Draw() has been invoked.
//
// The time flow can be controlled by ordering the various entries according to
// the variable specified with nameC and the input argument "mode".
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// Note : If mode=0 the value of nameC is irrelevant.
//
// This facility is only available if the storage mode has been activated.
//
// In case of inconsistent data, the value 0 is returned.
//
// The default value is smp=kTRUE.

Definition at line 3654 of file NcSample.cxx.

◆ GetGraph() [10/12]

TGraph NcSample::GetGraph ( TString nameA,
TString nameB,
TF1 * f = 0 )
// Provide a TGraph with : X-axis=variable with nameA and Y-axis=variable with nameB.
// In case the 1-dimensional function "f" is specified, then the
// function value of nameB will be used as at the Y-axis.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default value is f=0.

Definition at line 3286 of file NcSample.cxx.

◆ GetGraph() [11/12]

TGraph2D NcSample::GetGraph ( TString nameA,
TString nameB,
TString nameC,
TF1 * f = 0 )
// Provide a TGraph with : X-axis=variable nameA, Y-axis=variable nameB and Z-axis=variable nameC.
// In case the 1-dimensional function "f" is specified, then the function value of nameC
// will be used as at the Z-axis.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default value is f=0.

Definition at line 3796 of file NcSample.cxx.

◆ GetGraph() [12/12]

TGraph2D NcSample::GetGraph ( TString nameA,
TString nameB,
TString nameC,
TString f )
// Provide a TGraph with : X-axis=variable nameA, Y-axis=variable nameB and Z-axis=f(variable nameC).
// The 1D function "f" has to be specified following the TF1 string format convention,
//
// Note : This facility is only available if the storage mode has been activated.

Definition at line 3816 of file NcSample.cxx.

◆ GetGraph2DErrors() [1/2]

TGraph2DErrors NcSample::GetGraph2DErrors ( TGraph2D * g,
Int_t ix = 0,
Int_t iy = 0,
Int_t iz = 0,
TF1 * fx = 0,
TF1 * fy = 0,
TF1 * fz = 0 )
// Provide a Graph2D with new c.q. modified errors.
// The returned object is a TGraph2DErrors and the provided input Graph2D is not modified.
//
// Input arguments :
// -----------------
// gr : Pointer to a TGraph2D or TGraph2DErrors object to provide the (X,Y,Z) data points
// ix : Index of the variable of this NcSample object of which the (fx function) values will be used to set the X-errors
// iy : Index of the variable of this NcSample object of which the (fy function) values will be used to set the Y-errors
// iz : Index of the variable of this NcSample object of which the (fy function) values will be used to set the Y-errors
// fx : 1-dimensional function to specify the X-errors as a function of either the actual X-value or specified "ix variable"
// fy : 1-dimensional function to specify the Y-errors as a function of either the actual Y-value or specified "iy variable"
// fz : 1-dimensional function to specify the Z-errors as a function of either the actual Z-value or specified "iz variable"
//
// Notes :
// -------
// 1) The error will always be stored as the absolute value of the specified variable or function value.
// 2) If the variable index and corresponding function pointer are both zero, the corresponding errors are all set to 0.
// 3) In case a non-zero value of ix, iy or iz is specified, the storage mode has to be active.
// 4) In case a non-zero value of ix,iy or iz is specified, the entries of this NcSample and Graph should sequentially match.
//
// Examples :
// ----------
// 1) ix=3, fx=0, iy=4, fy=0, iz=2, fz=0
// The X-errors will be set equal to the absolute values of the 3rd variable of this NcSample object,
// the Y-errors will be set to the absolute values of the 4th variable of this NcSample object
// and the Z-errors will be set to the absolute values of the 2nd variable of this NcSample object.
// 2) ix=3, fx=0, iy=0, fy="sqrt(x)", iz=2, fz=0
// The X-errors will be set equal to the absolute values of the 3rd variable of this NcSample object,
// the Y-errors will be set to the square root of the corresponding Y-values of the input graph
// and the Z-errors will be set to the absolute values of the 2nd variable of this NcSample object.
// 3) ix=3, fx="0.1*x", iy=4, fy="sqrt(x)", iz=0, fz="sqrt(x)"
// The X-errors will be set equal to the absolute value of 0.1 times the values of the 3rd variable of this NcSample object,
// the Y-errors will be set to the square root of the values of the 4th variable of this NcSample object
// and the Z-errors will be set to the square root of the corresponding Z-values of the input graph.
// 4) ix=0, fx=0, iy=4, fy="sqrt(abs(x))", iz=1, fz=0
// The X-errors will be set to 0, the Y-errors will be set to the square root of the absolute values of the 4th variable
// of this NcSample object, and the Z-errors will be set to the absolute values of the 1st variable of this NcSample object.
// 5) ix=0, fx="sqrt(x)", iy=0, fy="0.1*x", iz=0, fz=0
// The X-errors will be set to the square root of the corresponding X-values of the input graph, the Y-errors will be set to
// the absolute value of 0.1 times the corresponding Y-values of the input graph and the Z-errors will be set to 0.
//
// The defaults are ix=0, iy=0, iz=0, fx=0, fy=0 and fz=0.

Definition at line 3832 of file NcSample.cxx.

◆ GetGraph2DErrors() [2/2]

TGraph2DErrors NcSample::GetGraph2DErrors ( TGraph2D * g,
TString nameA,
TString nameB,
TString nameC,
TF1 * fx = 0,
TF1 * fy = 0,
TF1 * fz = 0 )
// Provide a Graph2D with new c.q. modified errors.
// The returned object is a TGraph2DErrors and the provided input Graph2D is not modified.
//
// Input arguments :
// -----------------
// gr : Pointer to a TGraph or TGraphErrors object to provide the (X,Y) data points
// nameA : Name of the variable of this NcSample object of which the (fx function) values will be used to set the X-errors
// nameB : Name of the variable of this NcSample object of which the (fy function) values will be used to set the Y-errors
// nameC : Name of the variable of this NcSample object of which the (fz function) values will be used to set the Z-errors
// fx : 1-dimensional function to specify the X-errors as a function of either the actual X-value or specified "nameA variable"
// fy : 1-dimensional function to specify the Y-errors as a function of either the actual Y-value or specified "nameB variable"
// fz : 1-dimensional function to specify the Z-errors as a function of either the actual Z-value or specified "nameC variable"
//
// Notes :
// -------
// 1) The error will always be stored as the absolute value of the specified variable or function value.
// 2) If the variable name doesn't exist and the corresponding function pointer is zero, the corresponding errors are all set to 0.
// 3) In case an existing variable name is specified, the storage mode has to be active.
// 4) In case an existing variable name is specified, the entries of this NcSample and Graph should sequentially match.
//
// Examples :
// ----------
// 1) nameA="Time", fx=0, nameB="Amp", fy=0, nameC="ADC", fz=0
// The X-errors will be set equal to the absolute values of the variable "Time" of this NcSample object,
// the Y-errors will be set to the absolute values of the variable "Amp" of this NcSample object
// and the Z-errors will be set to the absolute values of the variable "ADC" of this NcSample object
// 2) nameA="Time", fx=0, nameB="-", fy="sqrt(x)", nameC="ADC", fz=0
// The X-errors will be set equal to the absolute values of the variable "Time" of this NcSample object,
// the Y-errors will be set to the square root of the corresponding Y-values of the input graph
// and the Z-errors will be set to the absolute values of the variable "ADC" of this NcSample object
// 3) nameA="Time", fx="0.1*x", iy="Amp", fy="sqrt(x)", iz=0, fz="sqrt(x)"
// The X-errors will be set equal to the absolute value of 0.1 times the values of the "Time" variable of this NcSample object,
// the Y-errors will be set to the square root of the values of the "Amp" variable of this NcSample object
// and the Z-errors will be set to the square root of the corresponding Z-values of the input graph.
// 4) nameA="-", fx=0, nameB="Amp", fy="sqrt(abs(x))", nameC="ADC", fz=0
// The X-errors will be set to 0, the Y-errors will be set to the square root of the absolute values of the "Amp" variable
// of this NcSample object, and the Z-values will be set to the absolute values of the "ADC" variable of this NcSample object.
// 5) nameA="-", fx="sqrt(x)", nameB="-", fy="0.1*x", nameC="-", fz=0
// The X-errors will be set to the square root of the corresponding X-values of the input graph, the Y-errors will be set to
// the absolute value of 0.1 times the corresponding Y-values of the input graph and the Z-errors will be set to 0.
//
// The defaults are fx=0, fy=0 and fz=0.

Definition at line 4079 of file NcSample.cxx.

◆ GetGraphErrors() [1/2]

TGraphErrors NcSample::GetGraphErrors ( TGraph * g,
Int_t ix = 0,
Int_t iy = 0,
TF1 * fx = 0,
TF1 * fy = 0 )
// Provide a Graph with new c.q. modified errors.
// The returned object is a TGraphErrors and the provided input Graph is not modified.
//
// Input arguments :
// -----------------
// gr : Pointer to a TGraph or TGraphErrors object to provide the (X,Y) data points
// ix : Index of the variable of this NcSample object of which the (fx function) values will be used to set the X-errors
// iy : Index of the variable of this NcSample object of which the (fy function) values will be used to set the Y-errors
// fx : 1-dimensional function to specify the X-errors as a function of either the actual X-value or specified "ix variable"
// fy : 1-dimensional function to specify the Y-errors as a function of either the actual Y-value or specified "iy variable"
//
// Notes :
// -------
// 1) The error will always be stored as the absolute value of the specified variable or function value.
// 2) If the variable index and corresponding function pointer are both zero, the corresponding errors are all set to 0.
// 3) In case a non-zero value of ix or iy is specified, the storage mode has to be active.
// 4) In case a non-zero value of ix or iy is specified, the entries of this NcSample and Graph should sequentially match.
//
// Examples :
// ----------
// 1) ix=3, fx=0, iy=4, fy=0
// The X-errors will be set equal to the absolute values of the 3rd variable of this NcSample object
// and the Y-errors will be set to the absolute values of the 4th variable of this NcSample object.
// 2) ix=3, fx=0, iy=0, fy="sqrt(x)"
// The X-errors will be set equal to the absolute values of the 3rd variable of this NcSample object
// and the Y-errors will be set to the square root of the corresponding Y-value of the input graph.
// 3) ix=3, fx="0.1*x", iy=4, fy="sqrt(x)"
// The X-errors will be set equal to the absolute value of 0.1 times the values of the 3rd variable of this NcSample object
// and the Y-errors will be set to the square root of the values of the 4th variable of this NcSample object.
// 4) ix=0, fx=0, iy=4, fy="sqrt(abs(x))"
// The X-errors will be set to 0 and the Y-errors will be set to the square root of the absolute values of the 4th variable
// of this NcSample object.
// 5) ix=0, fx="sqrt(x)", iy=0, fy="0.1*x"
// The X-errors will be set to the square root of the corresponding X-value of the input graph and the Y-errors will be set to
// the absolute value of 0.1 times the corresponding Y-value of the input graph.
//
// The defaults are ix=0, iy=0, fx=0 and fy=0.

Definition at line 3305 of file NcSample.cxx.

◆ GetGraphErrors() [2/2]

TGraphErrors NcSample::GetGraphErrors ( TGraph * g,
TString nameA,
TString nameB,
TF1 * fx = 0,
TF1 * fy = 0 )
// Provide a Graph with new c.q. modified errors.
// The returned object is a TGraphErrors and the provided input Graph is not modified.
//
// Input arguments :
// -----------------
// gr : Pointer to a TGraph or TGraphErrors object to provide the (X,Y) data points
// nameA : Name of the variable of this NcSample object of which the (fx function) values will be used to set the X-errors
// nameB : Name of the variable of this NcSample object of which the (fy function) values will be used to set the Y-errors
// fx : 1-dimensional function to specify the X-errors as a function of either the actual X-value or specified "nameA variable"
// fy : 1-dimensional function to specify the Y-errors as a function of either the actual Y-value or specified "nameB variable"
//
// Notes :
// -------
// 1) The error will always be stored as the absolute value of the specified variable or function value.
// 2) If the variable name doesn't exist and the corresponding function pointer is zero, the corresponding errors are all set to 0.
// 3) In case an existing variable name is specified, the storage mode has to be active.
// 4) In case an existing variable name is specified, the entries of this NcSample and Graph should sequentially match.
//
// Examples :
// ----------
// 1) nameA="Time", fx=0, nameB="Amp", fy=0
// The X-errors will be set equal to the absolute values of the variable "Time" of this NcSample object
// and the Y-errors will be set to the absolute values of the variable "Amp" of this NcSample object.
// 2) nameA="Time", fx=0, nameB="-", fy="sqrt(x)"
// The X-errors will be set equal to the absolute values of the variable "Time" of this NcSample object
// and the Y-errors will be set to the square root of the corresponding Y-value of the input graph.
// 3) nameA="Time", fx="0.1*x", iy="Amp", fy="sqrt(x)"
// The X-errors will be set equal to the absolute value of 0.1 times the values of the "Time" variable of this NcSample object
// and the Y-errors will be set to the square root of the values of the "Amp" variable of this NcSample object.
// 4) nameA="-", fx=0, nameB="Amp", fy="sqrt(abs(x))"
// The X-errors will be set to 0 and the Y-errors will be set to the square root of the absolute values of the "Amp" variable
// of this NcSample object.
// 5) nameA="-", fx="sqrt(x)", nameB="-", fy="0.1*x"
// The X-errors will be set to the square root of the corresponding X-value of the input graph and the Y-errors will be set to
// the absolute value of 0.1 times the corresponding Y-value of the input graph.
//
// The defaults are fx=0 and fy=0.

Definition at line 3496 of file NcSample.cxx.

◆ GetIndex()

Int_t NcSample::GetIndex ( TString name) const
// Provide the index (1=first) of the specified variable name.
// In case of no match, the value 0 is returned.

Definition at line 1125 of file NcSample.cxx.

◆ GetMaximum() [1/2]

Double_t NcSample::GetMaximum ( Int_t i) const
// Provide the maximum value of the i-th variable (first is i=1).
// In case entries have been removed from the sample, a correct value can
// only be obtained if the storage mode has been activated.

Definition at line 2110 of file NcSample.cxx.

◆ GetMaximum() [2/2]

Double_t NcSample::GetMaximum ( TString name) const
// Provide the maximum value of the variable with the specified name.
// In case entries have been removed from the sample, a correct value can
// only be obtained if the storage mode has been activated.

Definition at line 2152 of file NcSample.cxx.

◆ GetMean() [1/2]

Double_t NcSample::GetMean ( Int_t i) const
// Provide the mean of the i-th variable (first is i=1).

Definition at line 1263 of file NcSample.cxx.

◆ GetMean() [2/2]

Double_t NcSample::GetMean ( TString name) const
// Provide the mean of the variable with the specified name.

Definition at line 1280 of file NcSample.cxx.

◆ GetMedian() [1/3]

Double_t NcSample::GetMedian ( Int_t i)
// Provide the median of the i-th variable (first is i=1).
// For this functionality the storage mode has to be activated.
//
// In the case of incompatible data the value 0 is returned.
//
// The median is determined by invokation of GetQuantile(0.5,i).
// Please refer to the documentation of the corresponding GetQuantile()
// memberfunction for further details.
//
// Note : For large datasets it is more efficient to determine the median
// via the specification of a histogram.
// See the other GetMedian memberfunction for details.

Definition at line 1925 of file NcSample.cxx.

◆ GetMedian() [2/3]

Double_t NcSample::GetMedian ( TH1 * histo,
Int_t mode = 0 ) const
// Provide the median of the variable X or Y from the specified 1D histogram.
// For this functionality it is not needed to activate the storage mode.
//
// In the case of incompatible data the value 0 is returned.
//
// The median is determined by invokation of GetQuantile(0.5,histo,mode).
// Please refer to the documentation of the corresponding GetQuantile()
// memberfunction for further details.

Definition at line 2242 of file NcSample.cxx.

◆ GetMedian() [3/3]

Double_t NcSample::GetMedian ( TString name)
// Provide the median of the variable with the specified name.
// For this functionality the storage mode has to be activated.
//
// In the case of incompatible data the value 0 is returned.
//
// The median is determined by invokation of GetQuantile(0.5,name).
// Please refer to the documentation of the corresponding GetQuantile()
// memberfunction for further details.
//
// Note : For large datasets it is more efficient to determine the median
// via the specification of a histogram.
// See the other GetMedian memberfunction for details.

Definition at line 1948 of file NcSample.cxx.

◆ GetMinimum() [1/2]

Double_t NcSample::GetMinimum ( Int_t i) const
// Provide the minimum value of the i-th variable (first is i=1).
// In case entries have been removed from the sample, a correct value can
// only be obtained if the storage mode has been activated.

Definition at line 2054 of file NcSample.cxx.

◆ GetMinimum() [2/2]

Double_t NcSample::GetMinimum ( TString name) const
// Provide the minimum value of the variable with the specified name.
// In case entries have been removed from the sample, a correct value can
// only be obtained if the storage mode has been activated.

Definition at line 2096 of file NcSample.cxx.

◆ GetN()

Int_t NcSample::GetN ( ) const
// Provide the number of entries of a certain sample.

Definition at line 1199 of file NcSample.cxx.

◆ GetQQplot() [1/2]

TGraphQQ NcSample::GetQQplot ( Int_t i,
Int_t j,
TF1 * f = 0 )
// Provide a QQ-plot (TGraphQQ) for the values of the variables i and j.
// The first variable has index 1.
// In case the function "f" is specified, it will replace the role of variable j.
// When the function "f" is specified, the value of "j" is irrelevant.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default is f=0.

Definition at line 4135 of file NcSample.cxx.

◆ GetQQplot() [2/2]

TGraphQQ NcSample::GetQQplot ( TString nameA,
TString nameB,
TF1 * f = 0 )
// Provide a QQ-plot (TGraphQQ) for the the variables specified by nameA and nameB.
// In case the function "f" is specified, it will replace the role of variable nameB.
// When the function "f" is specified, the value of nameB is irrelevant.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default is f=0.

Definition at line 4221 of file NcSample.cxx.

◆ GetQuantile() [1/3]

Double_t NcSample::GetQuantile ( Double_t f,
Int_t i )
// Provide the value of the i-th variable (first is i=1) that marks the
// quantile with fraction "f" of the sample.
// By definition "f" belongs to the interval [0,1] where f=0.5 indicates
// the median of the specified variable.
//
// For this functionality the storage mode has to be activated.
//
// In the case of incompatible data the value 0 is returned.
//
// Note : For large datasets it is more efficient to determine the quantile
// via the specification of a histogram.
// See the other GetQuantile memberfunction for details.

Definition at line 1836 of file NcSample.cxx.

◆ GetQuantile() [2/3]

Double_t NcSample::GetQuantile ( Double_t f,
TH1 * histo,
Int_t mode = 0 ) const
// Provide the value of the variable X or Y from the specified 1D histogram
// that marks the quantile with fraction "f" for the selected variable.
// By definition "f" belongs to the interval [0,1] where f=0.5 indicates
// the median of the specified variable.
// For this functionality it is not needed to activate the storage mode.
//
// In the case of incompatible data the value 0 is returned.
//
// In case of an X-quantile this facility uses TH1::GetQuantiles, which
// provides a value which in general is different from any of the
// central bin X values. The user may force the returned X-value to be
// the corresponding central bin X value via the "mode" input argument.
//
// mode = 0 ==> The pure TH1::GetQuantiles X-quantile value is returned.
// 1 ==> The corresponding central bin X value is returned as X-quantile.
// 2 ==> The Y-quantile value is returned.
//
// By default mode=0 will be used to agree with standard ROOT processing.

Definition at line 2166 of file NcSample.cxx.

◆ GetQuantile() [3/3]

Double_t NcSample::GetQuantile ( Double_t f,
TString name )
// Provide the value of the variable with the specified name that marks the
// quantile with fraction "f" of the sample.
// By definition "f" belongs to the interval [0,1] where f=0.5 indicates
// the median of the specified variable.
//
// For this functionality the storage mode has to be activated.
//
// In the case of incompatible data the value 0 is returned.
//
// Note : For large datasets it is more efficient to determine the quantile
// via the specification of a histogram.
// See the other GetQuantile memberfunction for details.

Definition at line 1902 of file NcSample.cxx.

◆ GetRMS() [1/2]

Double_t NcSample::GetRMS ( Int_t i) const
// Provide the Root Mean Square of the i-th variable (first is i=1).
//
// Note :
// ------
// This is NOT the RMS deviation defined as sqrt(variance).
// Use the memberfunction GetSigma() to obtain the RMS deviation.

Definition at line 1292 of file NcSample.cxx.

◆ GetRMS() [2/2]

Double_t NcSample::GetRMS ( TString name) const
// Provide the Root Mean Square of the variable with the specified name.
//
// Note :
// ------
// This is NOT the RMS deviation defined as sqrt(variance).
// Use the memberfunction GetSigma() to obtain the RMS deviation.

Definition at line 1318 of file NcSample.cxx.

◆ GetSamplingHistogram() [1/4]

TH1D NcSample::GetSamplingHistogram ( Int_t i,
TF1 * f = 0 )
// Provide a TH1D histogram with : X-axis=sampling entry number and Y-axis=variable i.
// In case the 1-dimensional function "f" is specified, then the
// function value of variable i will be used as at the Y-axis.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default value is f=0.

Definition at line 2649 of file NcSample.cxx.

◆ GetSamplingHistogram() [2/4]

TH1D NcSample::GetSamplingHistogram ( Int_t i,
TString f )
// Provide a TH1D with : X-axis=sampling entry number and Y-axis=f(variable i).
// The 1D function "f" has to be specified following the TF1 string format convention,
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.

Definition at line 2703 of file NcSample.cxx.

◆ GetSamplingHistogram() [3/4]

TH1D NcSample::GetSamplingHistogram ( TString nameA,
TF1 * f = 0 )
// Provide a TH1D with : X-axis=sampling entry number and Y-axis=variable with nameA.
// In case the 1-dimensional function "f" is specified, then the
// function value of nameA will be used as at the Y-axis.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default value is f=0.

Definition at line 2720 of file NcSample.cxx.

◆ GetSamplingHistogram() [4/4]

TH1D NcSample::GetSamplingHistogram ( TString nameA,
TString f )
// Provide a TH1D with : X-axis=sampling entry number and Y-axis=f(variable with nameA).
// The 1D function "f" has to be specified following the TF1 string format convention,
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.

Definition at line 2738 of file NcSample.cxx.

◆ GetSigma() [1/2]

Double_t NcSample::GetSigma ( Int_t i,
Int_t model = 0 ) const
// Provide the rms-deviation (model=0) or standard deviation sigma of the
// underlying parent distribution (model=1) of the i-th variable.
// The first variable corresponds to i=1.
//
// The default value is model=0.

Definition at line 1373 of file NcSample.cxx.

◆ GetSigma() [2/2]

Double_t NcSample::GetSigma ( TString name,
Int_t model = 0 ) const
// Provide the rms-deviation (model=0) or standard deviation sigma (model=1)
// of the variable with the specified name.
//
// The default value is model=0.

Definition at line 1397 of file NcSample.cxx.

◆ GetSNR() [1/2]

Double_t NcSample::GetSNR ( Int_t i,
Int_t mode = 2,
Bool_t db = kTRUE ) const
// Provide the Signal to Noise Ratio (SNR) of the i-th variable.
// The first variable corresponds to i=1.
//
// For a transient c.q. pulse signal, the SNR is defined as the ratio between
// the largest amplitude difference and the standard deviation of the sample.
// This is obtained via input argument "mode" with abs(mode)=3 or abs(mode)=4,
// as outlined below.
//
// For a continuous signal, the definition used here is SNR=(signal power)/(noise power).
// This implies that when the values of the i-th variable represent amplitudes related
// to a continuous signal, the squares of the (rms) values should be used.
// This can be specified via the input argument "mode" where abs(mode)=2 will
// invoke a conversion of amplitudes into power, whereas abs(mode)=1 will use
// the values of the i-th variable "as is", i.e. reflecting a direct power measurement.
//
// Furthermore, the input argument "mode" also provides a selection to use
// the variance of the sample (mode>0) or the standard deviation, sigma, of the underlying
// parent distribution (mode<0), as indicated below.
//
// Input arguments :
// -----------------
// mode : 1 --> Continuous (nearly) stable signal with data reflecting power and SNR=abs(mean/rms-deviation)
// -1 --> Continuous (nearly) stable signal with data reflecting power and SNR=abs(mean/sigma)
// 2 --> Continuous (nearly) stable signal with data reflecting amplitudes and SNR=(mean*mean)/variance
// -2 --> Continuous (nearly) stable signal with data reflecting amplitudes and SNR=(mean*mean)/(sigma*sigma)
// 3 --> Transient signal with data reflecting power or RMS amplitudes and SNR=(max-min)/rms-deviation
// -3 --> Transient signal with data reflecting power or RMS amplitudes and SNR=(max-min)/sigma
// 4 --> Transient signal with data reflecting bipolar amplitudes and SNR=(max-min)/(2*rms-deviation)
// -4 --> Transient signal with data reflecting bipolar amplitudes and SNR=(max-min)/(2*sigma)
// dB : kFALSE Provide the SNR as the above straight ratio
// kTRUE Provide the SNR in Decibel
//
// The default values are mode=2 and dB=kTRUE for backward compatibility.
//
// In case of inconsistent data, the value -9999 is returned.
//
// Derivation of the applied formulas for a continuous (nearly) stable signal :
// ----------------------------------------------------------------------------
// For each recorded sampling k we assume an amplitude contribution Sk of the signal and Nk of the noise.
//
// This leads to the expression :
//
// SNR=(average signal power)/(average noise power)=<Sk^2>/<Nk^2> (1)
//
// Using variance(y)=<y^2>-<y>^2 we can express the above formula in terms of the
// signal variance var(Sk), signal mean <Sk>, noise variance var(Nk) and noise mean <Nk> as follows :
//
// SNR=(var(Sk)+<Sk>^2)/(var(Nk)+<Nk>^2) (2)
//
// Furthermore, the mean of all the recorded samplings Mu is given by : Mu=<Sk+Nk>=<Sk>+<Nk> (3)
//
// In most cases we will have <Nk>=0, which implies that Mu=<Sk> (4)
//
// In other words : The mean of the observed samplings is equal to the signal mean,
// which implies that we can determine <Sk> directly from our data.
//
// Using Eq.(4) and <Nk>=0 in Eq.(2) leads us to : SNR=(var(Sk)+Mu^2)/var(Nk) (5)
//
// In case of a (nearly) stable signal, we have approximately var(Sk)=0,
// which implies that the total observed sampling variance S=var(Nk).
//
// This leads to the final expression for SNR in terms of observed sampling amplitudes :
//
// SNR=Mu^2/S (6)
//
// The above is based on the recorded sampling statistics.
//
// In terms of the standard deviation (sigma) of the underlying parent distribution,
// the above expression becomes :
//
// SNR=Mu^2/(sigma^2) (7)
//
// In case of a direct power measurement, the sqrt() of expression (6) or (7) should be used.

Definition at line 4409 of file NcSample.cxx.

◆ GetSNR() [2/2]

Double_t NcSample::GetSNR ( TString name,
Int_t mode = 2,
Bool_t db = kTRUE ) const
// Provide the Signal to Noise Ratio (SNR) of the variable with the specified name.
//
// For a transient c.q. pulse signal, the SNR is defined as the ratio between
// the largest amplitude difference and the standard deviation of the sample.
// This is obtained via input argument "mode" with abs(mode)=3 or abs(mode)=4,
// as outlined below.
//
// For a continuous signal, the definition used here is SNR=(signal power)/(noise power).
// This implies that when the values of the i-th variable represent amplitudes related
// to a continuous signal, the squares of the (rms) values should be used.
// This can be specified via the input argument "mode" where abs(mode)=2 will
// invoke a conversion of amplitudes into power, whereas abs(mode)=1 will use
// the values of the i-th variable "as is", i.e. reflecting a direct power measurement.
//
// Furthermore, the input argument "mode" also provides a selection to use
// the variance of the sample (mode>0) or the standard deviation, sigma, of the underlying
// parent distribution (mode<0), as indicated below.
//
// Input arguments :
// -----------------
// mode : 1 --> Continuous (nearly) stable signal with data reflecting power and SNR=abs(mean/rms-deviation)
// -1 --> Continuous (nearly) stable signal with data reflecting power and SNR=abs(mean/sigma)
// 2 --> Continuous (nearly) stable signal with data reflecting amplitudes and SNR=(mean*mean)/variance
// -2 --> Continuous (nearly) stable signal with data reflecting amplitudes and SNR=(mean*mean)/(sigma*sigma)
// 3 --> Transient signal with data reflecting power or RMS amplitudes and SNR=(max-min)/rms-deviation
// -3 --> Transient signal with data reflecting power or RMS amplitudes and SNR=(max-min)/sigma
// 4 --> Transient signal with data reflecting bipolar amplitudes and SNR=(max-min)/(2*rms-deviation)
// -4 --> Transient signal with data reflecting bipolar amplitudes and SNR=(max-min)/(2*sigma)
// dB : kFALSE Provide the SNR as the above straight ratio
// kTRUE Provide the SNR in Decibel
//
// The default values are mode=2 and dB=kTRUE for backward compatibility.
//
// In case of inconsistent data, the value -9999 is returned.
//
// Derivation of the applied formulas for a continuous (nearly) stable signal :
// ----------------------------------------------------------------------------
// For each recorded sampling k we assume an amplitude contribution Sk of the signal and Nk of the noise.
//
// This leads to the expression :
//
// SNR=(average signal power)/(average noise power)=<Sk^2>/<Nk^2> (1)
//
// Using variance(y)=<y^2>-<y>^2 we can express the above formula in terms of the
// signal variance var(Sk), signal mean <Sk>, noise variance var(Nk) and noise mean <Nk> as follows :
//
// SNR=(var(Sk)+<Sk>^2)/(var(Nk)+<Nk>^2) (2)
//
// Furthermore, the mean of all the recorded samplings Mu is given by : Mu=<Sk+Nk>=<Sk>+<Nk> (3)
//
// In most cases we will have <Nk>=0, which implies that Mu=<Sk> (4)
//
// In other words : The mean of the observed samplings is equal to the signal mean,
// which implies that we can determine <Sk> directly from our data.
//
// Using Eq.(4) and <Nk>=0 in Eq.(2) leads us to : SNR=(var(Sk)+Mu^2)/var(Nk) (5)
//
// In case of a (nearly) stable signal, we have approximately var(Sk)=0,
// which implies that the total observed sampling variance S=var(Nk).
//
// This leads to the final expression for SNR in terms of observed sampling amplitudes :
//
// SNR=Mu^2/S (6)
//
// The above is based on the recorded sampling statistics.
//
// In terms of the standard deviation (sigma) of the underlying parent distribution,
// the above expression becomes :
//
// SNR=Mu^2/(sigma^2) (7)
//
// In case of a direct power measurement, the sqrt() of expression (6) or (7) should be used.

Definition at line 4545 of file NcSample.cxx.

◆ GetSpread() [1/3]

Double_t NcSample::GetSpread ( Int_t i,
Int_t model = 0,
Double_t vref = 0 )
// Provide the spread w.r.t. some reference value of the i-th variable (first is i=1).
// The spread is defined as the average of |median-val(i)| when model=0,
// the average of |mean-val(i)| when model=1, or the average of |vref-val(i)| when model=2.
//
// In case model=0 or model=1, the value of "vref" is irrelevant.
//
// For this functionality the storage mode has to be activated.
//
// Note : For large datasets it is more efficient to determine the spread
// via the specification of a histogram.
// See the other GetSpread memberfunction for details.
//
// The default values are model=0 and vref=0 for backward compatibility.
//
// In case of inconsistent data, the value -1 is returned.

Definition at line 1971 of file NcSample.cxx.

◆ GetSpread() [2/3]

Double_t NcSample::GetSpread ( TH1 * histo,
Int_t mode = 0,
Int_t model = 0,
Double_t vref = 0 ) const
// Provide the spread w.r.t. some X or Y reference value for the specified 1D histogram.
// The spread is defined as the average of |median-val(i)| when model=0,
// the average of |mean-val(i)| when model=1, or the average of |vref-val(i)| when model=2.
//
// In case model=0 or model=1, the value of "vref" is irrelevant.
//
// For this functionality it is not needed to activate the storage mode.
//
// In the case of incompatible data the value -1 is returned.
//
// In case of X-spread w.r.t. the median, this facility uses TH1::GetQuantiles to determine
// the X-median, which provides a median value which in general is different
// from any of the central bin X values. The user may force the used X-median
// to be the corresponding central bin X value via the "mode" input argument.
//
// mode = 0 ==> The pure TH1::GetQuantiles X-median value is used when model=0
// 1 ==> The corresponding central bin X value is used as X-median when model=0
// 2 ==> The spread in Y-values will be provided
//
// By default mode=0 will be used to agree with standard ROOT processing.
//
// The default values are mode=0, model=0 and vref=0 for backward compatibility.

Definition at line 2261 of file NcSample.cxx.

◆ GetSpread() [3/3]

Double_t NcSample::GetSpread ( TString name,
Int_t model = 0,
Double_t vref = 0 )
// Provide the spread w.r.t. some reference value of the variable with the specified name.
// The spread is defined as the average of |median-val(i)| when model=0,
// the average of |mean-val(i)| when model=1, or the average of |vref-val(i)| when model=2.
//
// In case model=0 or model=1, the value of "vref" is irrelevant.
//
// For this functionality the storage mode has to be activated.
//
// Note : For large datasets it is more efficient to determine the spread
// via the specification of a histogram.
// See the other GetSpread memberfunction for details.
//
// The default values are model=0 and vref=0 for backward compatibility.
//
// In case of inconsistent data, the value -1 is returned.

Definition at line 2028 of file NcSample.cxx.

◆ GetStoreMode()

Int_t NcSample::GetStoreMode ( ) const
// Provide the storage mode.

Definition at line 1814 of file NcSample.cxx.

◆ GetStoreNmax()

Int_t NcSample::GetStoreNmax ( ) const
// Provide the maximum number of entries for storage.

Definition at line 1825 of file NcSample.cxx.

◆ GetSubset()

void NcSample::GetSubset ( NcSample * s,
Int_t ifirst,
Int_t ilast,
Int_t mode = 0,
Int_t k = 0 )
// Provide the [ifirst,ilast] entries, after ordering w.r.t. the k-th variable, via the output NcSample "s".
// The first entry is indicated by the index ifirst=1 and the first variable is k=1.
//
// Note : All previously stored data in the output NcSample "s" will be lost.
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// This facility is only available if the storage mode has been activated.
//
// Note : If mode=0 the value of "k" is irrelevant.
//
// The default values are mode=0 and k=0.

Definition at line 2436 of file NcSample.cxx.

◆ GetSum() [1/2]

Double_t NcSample::GetSum ( Int_t i) const
// Provide the sum of the i-th variable (first is i=1).

Definition at line 1232 of file NcSample.cxx.

◆ GetSum() [2/2]

Double_t NcSample::GetSum ( TString name) const
// Provide the sum of the variable with the specified name.

Definition at line 1251 of file NcSample.cxx.

◆ GetVar() [1/2]

Double_t NcSample::GetVar ( Int_t i,
Int_t model = 0 ) const
// Provide the variance of the i-th variable (first is i=1)
// as (rms-deviation)^2 when model=0 or as sigma^2 when model=1.
//
// The default value is model=0.

Definition at line 1335 of file NcSample.cxx.

◆ GetVar() [2/2]

Double_t NcSample::GetVar ( TString name,
Int_t model = 0 ) const
// Provide the variance of the variable with the specified name.
// as (rms-deviation)^2 when model=0 or as sigma^2 when model=1.
//
// The default value is model=0.

Definition at line 1358 of file NcSample.cxx.

◆ GetVariableName()

TString NcSample::GetVariableName ( Int_t i) const
// Provide the name of the i-th variable (first is i=1).

Definition at line 1210 of file NcSample.cxx.

◆ List() [1/2]

void NcSample::List ( Int_t i)
protected
// Internal member function to list the statistics of i-th variable.
// The index of the first variable is 1.

Definition at line 1704 of file NcSample.cxx.

◆ List() [2/2]

void NcSample::List ( Int_t i,
Int_t j ) const
protected
// Internal member function to list the covariance and correlation coefficient between variables i and j.
// The index of the first variable is 1.

Definition at line 1736 of file NcSample.cxx.

◆ ListOrdered() [1/2]

void NcSample::ListOrdered ( Int_t mode,
Int_t i )
// Provide a listing of all stored entries according to the specified ordering
// mode of the i-th variable (first is i=1).
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// For this functionality the storage mode has to be activated.
//
// Note : If mode=0 the value of "i" is irrelevant.

Definition at line 1601 of file NcSample.cxx.

◆ ListOrdered() [2/2]

void NcSample::ListOrdered ( Int_t mode,
TString name )
// Provide a listing of all stored entries according to the specified ordering
// mode of the variable with the specified name.
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// For this functionality the storage mode has to be activated.
//
// Note : If mode=0 the provided name is irrelevant.

Definition at line 1683 of file NcSample.cxx.

◆ Load() [1/4]

void NcSample::Load ( TArray * h,
Int_t clr = 1 )
// Load the data of a 1-dimensional data array.
//
// Input arguments :
// -----------------
// arr : Pointer to the 1-dimensional data array.
// clr : Flag to denote to first clear (1) the data storage or not (0).
//
// The default value is clr=1.

Definition at line 4370 of file NcSample.cxx.

◆ Load() [2/4]

void NcSample::Load ( TGraph * g,
Int_t clr = 1 )
// Load the data points of a TGraph object as 2-dimensional (x,y) data.
//
// Input arguments :
// -----------------
// g : Pointer to the TGraph object.
// clr : Flag to denote to first clear (1) the data storage or not (0).
//
// The default value is clr=1.

Definition at line 4240 of file NcSample.cxx.

◆ Load() [3/4]

void NcSample::Load ( TGraph2D * g,
Int_t clr = 1 )
// Load the data points of a TGraph2D object as 3-dimensional (x,y,z) data.
//
// Input arguments :
// -----------------
// g : Pointer to the TGraph2D object.
// clr : Flag to denote to first clear (1) the data storage or not (0).
//
// The default value is clr=1.

Definition at line 4281 of file NcSample.cxx.

◆ Load() [4/4]

void NcSample::Load ( TH1 * h,
Int_t clr = 1 )
// Load the data of a 1-dimensional histogram.
//
// Input arguments :
// -----------------
// h : Pointer to the 1-dimensional histogram.
// clr : Flag to denote to first clear (1) the data storage or not (0).
//
// The default value is clr=1.

Definition at line 4323 of file NcSample.cxx.

◆ Order()

void NcSample::Order ( Int_t mode,
Int_t i )
protected
// Internal member function to order the entries according to the i-th variable (first is i=1).
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// For this functionality the storage mode has to be activated.
//
// Note : If mode=0 the value of "i" is irrelevant, but i=1 will be used to obtain
// a correct setting of the ordering status word.

Definition at line 991 of file NcSample.cxx.

◆ Remove() [1/4]

void NcSample::Remove ( Double_t x)
// Removing a value from a 1-dim. sample.

Definition at line 410 of file NcSample.cxx.

◆ Remove() [2/4]

void NcSample::Remove ( Double_t x,
Double_t y )
// Removing a pair (x,y) from a 2-dim. sample.

Definition at line 515 of file NcSample.cxx.

◆ Remove() [3/4]

void NcSample::Remove ( Double_t x,
Double_t y,
Double_t z )
// Removing a set (x,y,z) from a 3-dim. sample.

Definition at line 640 of file NcSample.cxx.

◆ Remove() [4/4]

void NcSample::Remove ( Double_t x,
Double_t y,
Double_t z,
Double_t t )
// Removing a set (x,y,z,t) from a 4-dim. sample.

Definition at line 786 of file NcSample.cxx.

◆ RemoveEntry() [1/4]

void NcSample::RemoveEntry ( Int_t i,
Int_t j,
Int_t mode,
Int_t k )
// Remove the full data entries at the index interval [i,j] (1=first) after ordering
// w.r.t. the k-th variable (1=first).
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// For this functionality the storage mode has to be activated.
//
// Note : If mode=0 the value of "k" is irrelevant

Definition at line 945 of file NcSample.cxx.

◆ RemoveEntry() [2/4]

void NcSample::RemoveEntry ( Int_t i,
Int_t j,
Int_t mode,
TString name )
// Remove the full data entry at the index interval [i,j] (1=first) after ordering
// w.r.t. the variable with the specified name.
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// For this functionality the storage mode has to be activated.
//
// Note : If mode=0 the value of name is irrelevant

Definition at line 968 of file NcSample.cxx.

◆ RemoveEntry() [3/4]

void NcSample::RemoveEntry ( Int_t i,
Int_t mode,
Int_t j )
// Remove the full data entry at the index "i" (1=first) after ordering
// w.r.t. the j-th variable (1=first).
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// Warning :
// ---------
// After invokation of this member function, the indexing has changed.
// Always check the current indexing before removing 1 or more entries.
// To remove a range of consecutive entries from the index interval [m,n],
// please refer to the corresponding other RemoveEntry() member function.
//
// For this functionality the storage mode has to be activated.
//
// Note : If mode=0 the value of "j" is irrelevant

Definition at line 858 of file NcSample.cxx.

◆ RemoveEntry() [4/4]

void NcSample::RemoveEntry ( Int_t i,
Int_t mode,
TString name )
// Remove the full data entry at the index "i" (1=first) after ordering
// w.r.t. the variable with the specified name.
//
// mode : <0 --> Order in decreasing order
// 0 --> Order in the way the entries were entered
// >0 --> Order in increasing order
//
// Warning :
// ---------
// After invokation of this member function, the indexing has changed.
// Always check the current indexing before removing 1 or more entries.
// To remove a range of consecutive entries from the index interval [m,n],
// please refer to the corresponding other RemoveEntry() member function.
//
// For this functionality the storage mode has to be activated.
//
// Note : If mode=0 the value of name is irrelevant

Definition at line 917 of file NcSample.cxx.

◆ Reset()

void NcSample::Reset ( )
// Resetting the statistics values for this NcSample object.
// Also the variable names are reset to their (X,Y,Z,T) defaults.
// Dimension and storage parameters are NOT changed.

Definition at line 255 of file NcSample.cxx.

◆ SampleAndHold()

NcSample NcSample::SampleAndHold ( TF1 f,
Double_t step,
Double_t vmin,
Double_t vmax,
Int_t loc = -1 ) const
// Perform a Sample-And-Hold operation on the specified function "f"
// in the interval [vmin,vmax], using "step" as the sampling step size.
//
// If "f" can be regarded as a pulse generator in time, this mimics a
// sample and hold device with a lock time of "step" time units,
// or equivalently a sampling frequency of 1/step.
//
// The input argument "loc" determines whether the resulting data
// will be recorded at the start (loc<0), center (loc=0) or end (loc>0)
// of the sampling step size.
// However, in case the recording location of the last sampling step would
// exceed "vmax", the data will be recorded at the value of "vmax".
//
// The default value is loc=-1.

Definition at line 5890 of file NcSample.cxx.

◆ SampleAndSum() [1/2]

NcSample NcSample::SampleAndSum ( Int_t i,
Double_t step,
Int_t loc = 0,
Int_t j = 0,
Double_t vmin = 0,
Double_t vmax = -1 )
// Perform a Sample-And-Sum operation on the values of the i-th variable
// in the interval [vmin,vmax], using "step" as the sampling step size.
// If vmax<=vmin the minimum and maximum values of the i-th variable will be used.
//
// This procedure resembles a Sample-And-Hold operation, but instead of locking
// the data recording during the stepsize "step", the data that appear within "step"
// are summed.
//
// If the i-th variable can be regarded as sampling in time, this mimics a
// Switched Capacitor Array (SCA) with a time gate of "step" time units,
// or equivalently a sampling frequency of 1/step.
//
// The input argument "loc" determines whether the new values of the i-th variable
// will be recorded at the begin (loc<0), center (loc=0) or end (loc>0)
// of the sampling step size.
//
// If j>0 the corresponding value of variable j will be used as a weight.
// The first variable has index 1.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default values are loc=0, j=0, vmin=0 and vmax=-1.

Definition at line 5945 of file NcSample.cxx.

◆ SampleAndSum() [2/2]

NcSample NcSample::SampleAndSum ( TString nameA,
Double_t step,
Int_t loc = 0,
TString nameB = "-",
Double_t vmin = 0,
Double_t vmax = -1 )
// Perform a Sample-And-Sum operation on the values of the variable specified with nameA
// in the interval [vmin,vmax], using "step" as the sampling step size.
// If vmax<=vmin the minimum and maximum values of the variable with nameA will be used.
//
// This procedure resembles a Sample-And-Hold operation, but instead of locking
// the data recording during the stepsize "step", the data that appear within "step"
// are summed.
//
// If the variable with nameA can be regarded as sampling in time, this mimics a
// Switched Capacitor Array (SCA) with a time gate of "step" time units,
// or equivalently a sampling frequency of 1/step.
//
// The input argument "loc" determines whether the new values of the variable with nameA
// will be recorded at the begin (loc<0), center (loc=0) or end (loc>0)
// of the sampling step size.
//
// If nameB is valid, the corresponding value of that variable will be used as a weight.
//
// Note : This facility is only available if the storage mode has been activated.
//
// The default values are loc=0, nameB="-", vmin=0 and vmax=-1.

Definition at line 6056 of file NcSample.cxx.

◆ SetNames()

void NcSample::SetNames ( TString name1 = "X",
TString name2 = "Y",
TString name3 = "Z",
TString name4 = "T" )
// Specification of the names of the various variables.
//
// The user specified names will only be stored before the first entry has been entered.
// So, setting (new) names during a sampling process will have no effect.
// However, after invokation of Reset() the variables names can again be specified.
//
//
// Note : Specification of name="" and name="-" should not be used.
//
// The default values are : name1="X", name2="Y", name3="Z" and name4="T".

Definition at line 327 of file NcSample.cxx.

◆ SetStoreMode()

void NcSample::SetStoreMode ( Int_t mode = 1,
Int_t nmax = 0,
Int_t i = 0 )
// Set storage mode for entered data.
// The input parameter "nmax" allows to limit the number of stored entries,
// by removing every first entry after ordering w.r.t. the i-th variable (1=first)
// once a new entry is entered that would exceed "nmax".
//
// mode = 0 : Entered data will not be stored, but at each entry the statistics will be updated.
// 1 : Data will be stored as entered.
// nmax = 0 : No maximum is set for the number of stored entries.
// > 0 : Entries will be stored up to a maximum of "nmax" entries.
// i > 0 : Re-order the entries w.r.t. the i-th variable in increasing order before removing the first (=lowest value).
// = 0 : Re-order the entries in the order they were entered before removing the first one.
// < 0 : Re-order the entries w.r.t. the i-th variable in decreasing order before removing the first (=highest value).
// When nmax=0 the value of "i" is irrelevant.
//
// Notes :
// -------
// 1) For mode=0 or inconsistent input the values of "nmax" and "i" are both set to 0.
// 2) Specification of i=0 results in a regular First In First Out (FIFO) buffer performance,
// whereas for other "i" values it reflects a FIFO behaviour of removing the first entry
// after the requested ordering.
//
// By default the values of mode, nmax and i are set to 0 in the constructor of this class.
// The default at invokation of this memberfunction is mode=1, nmax=0 and i=0.
//
// For normal statistics evaluation (e.g. mean, sigma, covariance etc...)
// storage of entered data is not needed. This is the default mode
// of operation and is the most efficient w.r.t. cpu time and memory.
// However, when calculation of a median, minimum or maximum is required,
// then the data storage mode has be activated, unless the statistics
// are obtained from a specified input histogram.
//
// Note : Specification of storage mode can only be performed before the
// first data item is entered or after invokation of Reset().

Definition at line 1756 of file NcSample.cxx.

◆ Transmit() [1/2]

Long64_t NcSample::Transmit ( Int_t i,
Int_t nbits,
Double_t range,
Double_t Vbias = 0,
TArray * peds = 0,
TH1 * hist = 0,
Int_t B = 0,
Int_t C = 3 )
// Mimic signal transmission according to an "nbits" ADC-DAC chain.
// The values of the i-th variable are digitized via the discrete quantization levels of an "nbits" ADC,
// based on the "range" for the analog signal and a bias voltage "Vbias" or array "peds" of pedestal values (see below).
// After digitization, the digital signals are converted into analog signals via the corresponding "nbits" DAC.
// In this way the effect of digitization on the original input signals can be investigated, and can provide
// a guideline in selecting the most suitable ADC-DAC system for data transmission.
//
// Note :
// ------
// The resulting analog values will replace the corresponding values of the i-th variable.
// For investigation of the performance of various ADC-DAC scenarios without modification
// of the current NcSample data, the user can invoke the Transmit() or ADC() and DAC()
// processors of the class NcDSP.
//
// In case the index "i" is out of range for this sample or no data is available, just the specs
// of the specified ADC performance will be printed and no digitization is performed, but the
// return argument will contain the adc value corresponding to Vbias.
// This allows to test various scenarios without modifying the data.
// In all other cases the unphysical value -1 is returned.
//
// Note : Make sure to use the same units for "range" and "Vbias" as those of the i-th variable.
//
// For further details, please refer to the documentation of the memberfunctions ADC() and DAC() of class NcDSP.
//
// Warning :
// ---------
// This member function will change the contents of this sample concerning the values of the i-th variable.
// In case access to the original values is required, one should make a copy of the original sample
// before the digitization process or use the corresponding member function Transmit() of class NcDSP.
//
// This facility is only available if the storage mode has been activated.
//
// In case of inconsistent input parameters, no digitization is performed.
//
// Input arguments :
// -----------------
// i : Digitization of the i-th variable (first is i=1) will be performed.
// nbits : Digital quantization was performed using an nbits ADC.
// range >0 : The full scale voltage range (Vfs) of the analog signal that corresponds to adc=N-1.
// <0 : |range| is the reference voltage (Vref) of the analog signal that corresponds to the hypothetical adc=N.
// Vbias : The bias voltage that was added to the analog input signal before digitization.
// If specified, the resulting analog signals will be corrected for the bias voltage.
// For a linear DAC the correction via Vbias will only be performed if no pedestal array "peds"
// is specified (see below). If the array "peds" is specified, Vbias will be ignored for a linear DAC.
// For a Log DAC the pedestal values will never be used and bias correction may only be obtained via Vbias.
// peds : (Optional) array to contain the pedestal values for the individual digital signals.
// The array "peds" must contain (at least) the same number of values as the number of analog input signals.
// If the array "peds" is specified, the pedestals will be subtracted from the corresponding digital signals
// before the conversion to analog signals is performed in case of a linear DAC.
// For a Log DAC the pedestal values will never be used and bias correction may only be obtained via Vbias.
// B >1 : Base for a log ADC (e.g. B=10 emulates a Log_10 ADC).
// =0 : The ADC will be linear
// =1 : The ADC will be a Log_e ADC.
// Note : When B>0 all (Vbias+Vsig) input values should be positive.
// C : Code efficiency factor that was used for a Log ADC.
// Rule of thumb : pow(B,-C) is about the smallest signal/|range| ratio that can be resolved.
// So, for a Log_10 ADC with C=3, the smallest signal that can be resolved is about |range|/1000.
// Note : It is required that C>0.
//
// Optional output arguments :
// ---------------------------
// hist : Histogram with the analog result
//
// The maximum number of bits that is supported is 60 to guarantee identical functioning on all machines.
//
// In case of inconsistent input parameters, no processing is performed.
//
// The default values are Vbias=0, peds=0, hist=0, B=0 and C=3.

Definition at line 5655 of file NcSample.cxx.

◆ Transmit() [2/2]

Long64_t NcSample::Transmit ( TString name,
Int_t nbits,
Double_t range,
Double_t Vbias = 0,
TArray * peds = 0,
TH1 * hist = 0,
Int_t B = 0,
Int_t C = 3 )
// Mimic signal transmission according to an "nbits" ADC-DAC chain.
// The values of the variable "name" are digitized via the discrete quantization levels of an "nbits" ADC,
// based on the "range" for the analog signal and a bias voltage "Vbias" or array "peds" of pedestal values (see below).
// After digitization, the digital signals are converted into analog signals via the corresponding "nbits" DAC.
// In this way the effect of digitization on the original input signals can be investigated, and can provide
// a guideline in selecting the most suitable ADC-DAC system for data transmission.
//
// Note :
// ------
// The resulting analog values will replace the corresponding values of the variable "name".
// For investigation of the performance of various ADC-DAC scenarios, the user can also
// invoke the Transmit() or ADC() and DAC() processors of the class NcDSP.
// This will not modify the current NcSample data, and actually these NcDSP processors
// are used here to perform the various calculations.
//
// In case the variable "name" does not exist for this sample or no data is available, just the specs
// of the specified ADC performance will be printed and no digitization is performed, but the
// return argument will contain the adc value corresponding to Vbias.
// This allows to test various scenarios without modifying the data.
// In all other cases the unphysical value -1 is returned.
//
// Note : Make sure to use the same units for "range" and "Vbias" as those of the i-th variable.
//
// For further details, please refer to the documentation of the memberfunctions ADC() and DAC() of class NcDSP.
//
// Warning :
// ---------
// This member function will change the contents of this sample concerning the values of variable "name".
// In case access to the original values is required, one should make a copy of the original sample
// before the digitization process or use the corresponding member function Transmit() of class NcDSP.
//
// This facility is only available if the storage mode has been activated.
//
// In case of inconsistent input parameters, no digitization is performed.
//
// Input arguments :
// -----------------
// name : Name of the variable for which the digitization will be performed.
// nbits : Digital quantization was performed using an nbits ADC.
// range >0 : The full scale voltage range (Vfs) of the analog signal that corresponds to adc=N-1.
// <0 : |range| is the reference voltage (Vref) of the analog signal that corresponds to the hypothetical adc=N.
// Vbias : The bias voltage that was added to the analog input signal before digitization.
// If specified, the resulting analog signals will be corrected for the bias voltage.
// For a linear DAC the correction via Vbias will only be performed if no pedestal array "peds"
// is specified (see below). If the array "peds" is specified, Vbias will be ignored for a linear DAC.
// For a Log DAC the pedestal values will never be used and bias correction may only be obtained via Vbias.
// peds : (Optional) array to contain the pedestal values for the individual digital signals.
// The array "peds" must contain (at least) the same number of values as the number of analog input signals.
// If the array "peds" is specified, the pedestals will be subtracted from the corresponding digital signals
// before the conversion to analog signals is performed in case of a linear DAC.
// For a Log DAC the pedestal values will never be used and bias correction may only be obtained via Vbias.
// B >1 : Base for a log ADC (e.g. B=10 emulates a Log_10 ADC).
// =0 : The ADC will be linear
// =1 : The ADC will be a Log_e ADC.
// Note : When B>0 all (Vbias+Vsig) input values should be positive.
// C : Code efficiency factor that was used for a Log ADC.
// Rule of thumb : pow(B,-C) is about the smallest signal/|range| ratio that can be resolved.
// So, for a Log_10 ADC with C=3, the smallest signal that can be resolved is about |range|/1000.
// Note : It is required that C>0.
//
// Optional output arguments :
// ---------------------------
// hist : Histogram with the analog result
//
// The maximum number of bits that is supported is 60 to guarantee identical functioning on all machines.
//
// In case of inconsistent input parameters, no processing is performed.
//
// The default values are Vbias=0, peds=0, hist=0, B=0 and C=3.

Definition at line 5809 of file NcSample.cxx.

Member Data Documentation

◆ fAnimObject

TObject* NcSample::fAnimObject
protected

! Multi-purpose pointer for animation objects

Definition at line 166 of file NcSample.h.

◆ fArr

TArrayD* NcSample::fArr
protected

! Temp. storage array for ordered values

Definition at line 161 of file NcSample.h.

◆ fCanvas

TCanvas* NcSample::fCanvas
protected

! Multi-purpose canvas for e.g. animation displays

Definition at line 165 of file NcSample.h.

◆ fCor

Double_t NcSample::fCor[fMaxdim][fMaxdim]
protected

Definition at line 150 of file NcSample.h.

◆ fCov

Double_t NcSample::fCov[fMaxdim][fMaxdim]
protected

Definition at line 149 of file NcSample.h.

◆ fDim

Int_t NcSample::fDim
protected

Definition at line 140 of file NcSample.h.

◆ fGraphT

TGraphTime* NcSample::fGraphT
protected

! Temp. pointer to return a TGraphTime object

Definition at line 164 of file NcSample.h.

◆ fIndices

TArrayI* NcSample::fIndices
protected

! Temp. storage array for the indices of the ordered entries

Definition at line 162 of file NcSample.h.

◆ fMax

Double_t NcSample::fMax[fMaxdim]
protected

Definition at line 152 of file NcSample.h.

◆ fMean

Double_t NcSample::fMean[fMaxdim]
protected

Definition at line 146 of file NcSample.h.

◆ fMin

Double_t NcSample::fMin[fMaxdim]
protected

Definition at line 151 of file NcSample.h.

◆ fMoveVariable

Int_t NcSample::fMoveVariable
protected

Definition at line 156 of file NcSample.h.

◆ fN

Int_t NcSample::fN
protected

Definition at line 141 of file NcSample.h.

◆ fNames

TString NcSample::fNames[fMaxdim]
protected

Definition at line 143 of file NcSample.h.

◆ fNmax

Int_t NcSample::fNmax
protected

Definition at line 155 of file NcSample.h.

◆ fOrdered

Int_t NcSample::fOrdered
protected

! Indicator of the status of the current ordering

Definition at line 163 of file NcSample.h.

◆ fRemove

Int_t NcSample::fRemove
protected

Definition at line 153 of file NcSample.h.

◆ fRMSdev

Double_t NcSample::fRMSdev[fMaxdim]
protected

Definition at line 147 of file NcSample.h.

◆ fSigma

Double_t NcSample::fSigma[fMaxdim]
protected

Definition at line 148 of file NcSample.h.

◆ fStore

Int_t NcSample::fStore
protected

Definition at line 154 of file NcSample.h.

◆ fSum

Double_t NcSample::fSum[fMaxdim]
protected

Definition at line 144 of file NcSample.h.

◆ fSum2

Double_t NcSample::fSum2[fMaxdim][fMaxdim]
protected

Definition at line 145 of file NcSample.h.

◆ fT

TArrayD* NcSample::fT
protected

Definition at line 160 of file NcSample.h.

◆ fX

TArrayD* NcSample::fX
protected

Definition at line 157 of file NcSample.h.

◆ fY

TArrayD* NcSample::fY
protected

Definition at line 158 of file NcSample.h.

◆ fZ

TArrayD* NcSample::fZ
protected

Definition at line 159 of file NcSample.h.


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