BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
utilites.h File Reference
#include <TBrowser.h>
#include <TCanvas.h>
#include <TChain.h>
#include <TCollection.h>
#include <TDirectory.h>
#include <TF1.h>
#include <TFile.h>
#include <TGraph.h>
#include <TH1.h>
#include <TH2.h>
#include <TList.h>
#include <TMath.h>
#include <TObjArray.h>
#include <TObjString.h>
#include <TProfile.h>
#include <TROOT.h>
#include <TStopwatch.h>
#include <TStyle.h>
#include <TSystem.h>
#include <TSystemDirectory.h>
#include <TSystemFile.h>
#include <TVectorD.h>
#include <fstream>
#include <iostream>
Include dependency graph for utilites.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OUTINFILE   0
#define uVERBOSE   1
#define fit_funk_name   "fitFunction"

Functions

Int_t FilesListFromDir (const TString filespath, TObjArray *const collection, Int_t max_num, TString content)
Int_t SaveArrayStructInFile (TCollection *array, TFile *file, TString start_path="")
Int_t SaveArrayOfObjectsArraysInFile (TObjArray *ObjectsArray=0, const TString filename="data", const TString path="./", const Int_t deleteArrays=0)
Int_t FitHistogramm (TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t RangeXmin=0., Double_t RangeXmax=0., TString fit_formula="gaus")
Int_t FitHistogrammInFirstMaxPeak (TH1 *histogramm, Double_t &Mean, Double_t &Sigma, Double_t peaksRangeMin, Double_t peaksRangeMax, Double_t peakRange, Double_t peakRMSRange=1.5)
Int_t FitHistogrammInRMSRange (TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t RMSrange, Double_t RangeXmin=0, Double_t RangeXmax=0)
Int_t FitHistogrammInMaxPeak (TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t PeakWidth, Double_t RangeXmin=0., Double_t RangeXmax=0.)
Int_t ArrayStat (const Int_t nElements, const Double_t *Array, Double_t &maxElement, Double_t &minElement, Double_t &Amplitude, Double_t &Mean, Double_t &RMS)
void ResetArray (TObjArray **array, const TString option)
Int_t ConstructFilesListFromDirectory (const TString &Directory, TCollection *const collection)
Int_t RUNnumberInString (const TString &str)
TObject * CreateXprofile (const TH1 *sourcehist)
Int_t CollectRAWfilesInChain (TChain *rawTree, const TString dirname, const Int_t maxNfiles=50)
Int_t FitHistogrammSmartInMaxPeak (TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t nRMSfit=2., Double_t RangeXmin=0., Double_t RangeXmax=0.)
Int_t ArrayStat (Int_t nElements, Double_t *Array, Double_t &maxElement, Double_t &minElement, Double_t &Amplitude, Double_t &Mean, Double_t &RMS)
TH1 * CreateSmartPojection (TH2 *sourcehist, TString option="n", const Float_t minbinevX=1, const Float_t minbinevedge=0.001, const Int_t rebinX=1, const Int_t rebinY=1, Int_t ProjectionRebin=5, Float_t projWidth=1.5, TObjArray *monitor_slices_array=NULL)
TObjArray * HDraw (const TObjArray *Histogramms_arr, TString name="", int Hr=4, int Vt=4, const int Pair=1, int min=0, int max=100, int Log=0, int Leg=0, const TString param="", int Norm=0)

Variables

std::ostream & current_out = std::cout

Macro Definition Documentation

◆ fit_funk_name

#define fit_funk_name   "fitFunction"

Definition at line 45 of file utilites.h.

◆ OUTINFILE

#define OUTINFILE   0

Definition at line 36 of file utilites.h.

◆ uVERBOSE

#define uVERBOSE   1

Definition at line 44 of file utilites.h.

Function Documentation

◆ ArrayStat() [1/2]

Int_t ArrayStat ( const Int_t nElements,
const Double_t * Array,
Double_t & maxElement,
Double_t & minElement,
Double_t & Amplitude,
Double_t & Mean,
Double_t & RMS )

◆ ArrayStat() [2/2]

Int_t ArrayStat ( Int_t nElements,
Double_t * Array,
Double_t & maxElement,
Double_t & minElement,
Double_t & Amplitude,
Double_t & Mean,
Double_t & RMS )

Definition at line 683 of file utilites.h.

References i, and TMath::Sqrt().

Here is the call graph for this function:

◆ CollectRAWfilesInChain()

Int_t CollectRAWfilesInChain ( TChain * rawTree,
const TString dirname,
const Int_t maxNfiles = 50 )

Definition at line 155 of file utilites.h.

References TChain::AddFile(), current_out, TString::Data(), TString::EndsWith(), TChain::GetEntries(), TSystemDirectory::GetListOfFiles(), TNamed::GetName(), TSystemFile::IsDirectory(), and uVERBOSE.

Here is the call graph for this function:

◆ ConstructFilesListFromDirectory()

Int_t ConstructFilesListFromDirectory ( const TString & Directory,
TCollection *const collection )

Definition at line 91 of file utilites.h.

References TCollection::Add(), current_out, TString::Data(), TString::EndsWith(), TSystemDirectory::GetListOfFiles(), TNamed::GetName(), TSystemFile::IsDirectory(), and uVERBOSE.

Here is the call graph for this function:

◆ CreateSmartPojection()

TH1 * CreateSmartPojection ( TH2 * sourcehist,
TString option = "n",
const Float_t minbinevX = 1,
const Float_t minbinevedge = 0.001,
const Int_t rebinX = 1,
const Int_t rebinY = 1,
Int_t ProjectionRebin = 5,
Float_t projWidth = 1.5,
TObjArray * monitor_slices_array = NULL )

◆ CreateXprofile()

TObject * CreateXprofile ( const TH1 * sourcehist)

Definition at line 143 of file utilites.h.

References current_out, TNamed::GetName(), TNamed::GetTitle(), TH1::SetTitle(), and uVERBOSE.

Here is the call graph for this function:

◆ FilesListFromDir()

Int_t FilesListFromDir ( const TString filespath,
TObjArray *const collection,
Int_t max_num,
TString content )

Definition at line 196 of file utilites.h.

References TObjArray::Add(), TString::Contains(), current_out, TString::Data(), TString::EndsWith(), TSystemDirectory::GetListOfFiles(), TNamed::GetName(), and TSystemFile::IsDirectory().

Here is the call graph for this function:

◆ FitHistogramm()

Int_t FitHistogramm ( TH1 * histogramm,
Double_t & mean,
Double_t & sigma,
Double_t RangeXmin = 0.,
Double_t RangeXmax = 0.,
TString fit_formula = "gaus" )

Definition at line 523 of file utilites.h.

References TString::Contains(), current_out, TString::Data(), TH1::FindBin(), TH1::Fit(), fit_funk_name, TF1::GetChisquare(), TH1::GetFunction(), TH1::GetMean(), TNamed::GetName(), TF1::GetParameter(), TH1::GetRMS(), TH1::GetXaxis(), TAxis::GetXmax(), TAxis::GetXmin(), TH1::Integral(), TH1::SetAxisRange(), TF1::SetRange(), and uVERBOSE.

Referenced by FitHistogrammInFirstMaxPeak(), FitHistogrammInMaxPeak(), FitHistogrammInRMSRange(), and FitHistogrammSmartInMaxPeak().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FitHistogrammInFirstMaxPeak()

Int_t FitHistogrammInFirstMaxPeak ( TH1 * histogramm,
Double_t & Mean,
Double_t & Sigma,
Double_t peaksRangeMin,
Double_t peaksRangeMax,
Double_t peakRange,
Double_t peakRMSRange = 1.5 )

Definition at line 353 of file utilites.h.

References TH1::FindFirstBinAbove(), FitHistogramm(), TH1::GetBinCenter(), TH1::GetBinContent(), TH1::GetMaximumBin(), TH1::GetRMS(), TH1::SetAxisRange(), and Sigma().

Here is the call graph for this function:

◆ FitHistogrammInMaxPeak()

Int_t FitHistogrammInMaxPeak ( TH1 * histogramm,
Double_t & mean,
Double_t & sigma,
Double_t PeakWidth,
Double_t RangeXmin = 0.,
Double_t RangeXmax = 0. )

Definition at line 416 of file utilites.h.

References current_out, FitHistogramm(), TH1::GetBinCenter(), TH1::GetMaximumBin(), TNamed::GetName(), TH1::GetXaxis(), TAxis::GetXmax(), TAxis::GetXmin(), TH1::SetAxisRange(), and uVERBOSE.

Here is the call graph for this function:

◆ FitHistogrammInRMSRange()

Int_t FitHistogrammInRMSRange ( TH1 * histogramm,
Double_t & mean,
Double_t & sigma,
Double_t RMSrange,
Double_t RangeXmin = 0,
Double_t RangeXmax = 0 )

Definition at line 379 of file utilites.h.

References current_out, FitHistogramm(), TH1::GetMean(), TH1::GetRMS(), TH1::GetXaxis(), TAxis::GetXmax(), TAxis::GetXmin(), TH1::SetAxisRange(), and uVERBOSE.

Here is the call graph for this function:

◆ FitHistogrammSmartInMaxPeak()

Int_t FitHistogrammSmartInMaxPeak ( TH1 * histogramm,
Double_t & mean,
Double_t & sigma,
Double_t nRMSfit = 2.,
Double_t RangeXmin = 0.,
Double_t RangeXmax = 0. )

Definition at line 457 of file utilites.h.

References TMath::Abs(), TH1::Clone(), current_out, FitHistogramm(), TH1::GetBinCenter(), TH1::GetMaximumBin(), TNamed::GetName(), TH1::GetRMS(), TH1::GetXaxis(), TAxis::GetXmax(), TAxis::GetXmin(), TH1::SetAxisRange(), TH1::Smooth(), and uVERBOSE.

Referenced by CreateSmartPojection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HDraw()

TObjArray * HDraw ( const TObjArray * Histogramms_arr,
TString name = "",
int Hr = 4,
int Vt = 4,
const int Pair = 1,
int min = 0,
int max = 100,
int Log = 0,
int Leg = 0,
const TString param = "",
int Norm = 0 )

Definition at line 907 of file utilites.h.

References TObjArray::Add(), TObjArray::At(), TObjArray::GetLast(), TCollection::GetName(), TObjArray::Last(), max(), min(), and TCollection::SetOwner().

Here is the call graph for this function:

◆ ResetArray()

void ResetArray ( TObjArray ** array,
const TString option )

Definition at line 631 of file utilites.h.

References TString::Contains(), current_out, TString::Data(), TObject::GetName(), and uVERBOSE.

Referenced by SaveArrayOfObjectsArraysInFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RUNnumberInString()

Int_t RUNnumberInString ( const TString & str)

Definition at line 126 of file utilites.h.

References TString::Atoi().

Here is the call graph for this function:

◆ SaveArrayOfObjectsArraysInFile()

Int_t SaveArrayOfObjectsArraysInFile ( TObjArray * ObjectsArray = 0,
const TString filename = "data",
const TString path = "./",
const Int_t deleteArrays = 0 )

Definition at line 268 of file utilites.h.

References TObjArray::At(), TDirectory::cd(), TObjArray::Clear(), TFile::Close(), current_out, TString::Data(), TString::EndsWith(), TObjArray::GetEntries(), TObjArray::GetLast(), TCollection::GetName(), TObject::GetName(), TFile::IsOpen(), TDirectoryFile::mkdir(), n, ResetArray(), TDirectoryFile::rmdir(), uVERBOSE, and TObject::Write().

Here is the call graph for this function:

◆ SaveArrayStructInFile()

Int_t SaveArrayStructInFile ( TCollection * array,
TFile * file,
TString start_path = "" )

Definition at line 229 of file utilites.h.

References TDirectoryFile::cd(), current_out, TString::Data(), TObject::GetName(), TDirectoryFile::mkdir(), SaveArrayStructInFile(), uVERBOSE, and TObject::Write().

Referenced by SaveArrayStructInFile().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ current_out

std::ostream& current_out = std::cout

Definition at line 41 of file utilites.h.