NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcBlocks.h
Go to the documentation of this file.
1#ifndef NcBlocks_h
2#define NcBlocks_h
3
4// Copyright(c) 2021 NCFS/IIHE, All Rights Reserved.
5// See cxx source for full Copyright notice.
6
7#include "TGraphErrors.h"
8#include "TMath.h"
9#include "TList.h"
10#include "TLegend.h"
11
12#include "NcSample.h"
13
15
17{
18 public:
19 NcBlocks(); // Default constructor
20 virtual ~NcBlocks(); // Default destructor
21 NcBlocks(const NcBlocks& q); // Copy constructor
22 Double_t GetBlocks(TH1* hin,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for binned data c.q. a histogram
23 Double_t GetBlocks(NcSample s,Int_t i,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for the i-th variable of an NcSample
24 Double_t GetBlocks(NcSample s,TString name,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for the named variable of an NcSample
25 Double_t GetBlocks(Int_t n,Double_t* arr,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for the given data array
26 Double_t GetBlocks(Int_t n,Float_t* arr,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for the given data array
27 Double_t GetBlocks(TGraphErrors gr,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for measurements of an observable
28 Double_t GetBlocks(TGraph gr,TF1 f,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for measurements of an observable
29 Double_t GetBlocks(TGraph gr,TString f,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for measurements of an observable
30 Double_t GetBlocks(TGraph gr,Double_t nrms,Double_t fpr,TH1* hout,Int_t ntrig=0); // Get Bayesian Block partitions for measurements of an observable
31 Int_t GetBlocks(TH1* hin,TH1* hout,Int_t n,Int_t mode=0); // Get block partitions of "n" consecutive bins of binned data c.q. a histogram
32 Int_t GetBlocks(NcSample s,Int_t i,TH1* hout,Int_t n,Int_t mode=0); // Get block partitions of "n" consecutive samplings for the i-th variable of an NcSample
33 Int_t GetBlocks(NcSample s,TString name,TH1* hout,Int_t n,Int_t mode=0); // Get block partitions of "n" consecutive samplings for the named variable of an NcSample
34 Int_t GetBlocks(Int_t nr,Double_t* arr,TH1* hout,Int_t n,Int_t mode=0); // Get block partitions of "n" consecutive recrodings for the given data array
35 Int_t GetBlocks(Int_t nr,Float_t* arr,TH1* hout,Int_t n,Int_t mode=0); // Get block partitions of "n" consecutive recrodings for the given data array
36 Int_t GetBlocks(TGraph* gr,TH1* hout,Int_t n,Int_t mode=0); // Get block partitions of "n" consecutive samples of measurements of an observable
37 Int_t Add(TH1* h1,TH1* h2,TH1* hout,Bool_t scale,Double_t c,Double_t d=0); // Provide the histogram hout=h1+c*h2+d
38 Int_t Add(TGraph* gr,TH1* h,TGraph* gout,Double_t c,Double_t d=0); // Provide the graph gout=gr+c*h+d
39 Int_t Divide(TH1* h1,TH1* h2,TH1* hout,Bool_t scale,Double_t c,Double_t d=0); // Provide the histogram hout=d+h1/(c*h2)
40 Int_t Divide(TGraph* gr,TH1* h,TGraph* gout,Double_t c,Double_t d=0); // Provide the graph gout=d+gr/(c*h)
41 Int_t Rebin(TH1* hin,TH1* hout,Bool_t scale,Int_t nbins=0,Double_t xmin=0,Double_t xmax=-1); // Provide the histogram hout as an equally binned version of hin
42
43 protected:
44 Int_t fMode; // The Data Mode
45 Double_t GetPrior(Int_t n,Double_t fpr); // Provide the prior fitness value for each block
46 Double_t GetBlockFitness(Double_t n,Double_t len); // Provide the block fitness for Data Modes 1 and 2
47
48 ClassDef(NcBlocks,10) // (Bayesian) Block treatment of sequential data
49};
50#endif
Double_t GetBlockFitness(Double_t n, Double_t len)
Definition NcBlocks.cxx:490
virtual ~NcBlocks()
Definition NcBlocks.cxx:406
Double_t GetPrior(Int_t n, Double_t fpr)
Definition NcBlocks.cxx:426
Int_t Rebin(TH1 *hin, TH1 *hout, Bool_t scale, Int_t nbins=0, Double_t xmin=0, Double_t xmax=-1)
Int_t fMode
Definition NcBlocks.h:44
Int_t Divide(TH1 *h1, TH1 *h2, TH1 *hout, Bool_t scale, Double_t c, Double_t d=0)
Int_t Add(TH1 *h1, TH1 *h2, TH1 *hout, Bool_t scale, Double_t c, Double_t d=0)
Double_t GetBlocks(TH1 *hin, Double_t fpr, TH1 *hout, Int_t ntrig=0)
Definition NcBlocks.cxx:523
Sampling and statistics tools for various multi-dimensional data samples.
Definition NcSample.h:28