45#define fit_funk_name "fitFunction"
52 const TString filename =
"data",
54 const Int_t deleteArrays = 0);
99 current_out <<
Form(
"utilites.h/ConstructFilesListInDirectory: collection ptr is NULL") << std::endl;
110 currFileName = filespath + (currFile->
GetName());
115 current_out <<
Form(
"utilites.h/ConstructFilesListInDirectory: found root file \"%s\"",
128 const Int_t lenght = 6;
131 for (
Int_t start = 0; start <= str.Sizeof() - lenght; start++) {
132 sub_str = str(start, lenght);
133 value = sub_str.
Atoi();
135 if (value < 999999 && 100000 < value)
163 current_out <<
Form(
"utilites.h/CollectRAWfilesInChain: collecting files from \"%s\"", filespath.
Data())
171 Int_t NfilesLoaded = 0;
173 currFileName = filespath + (currFile->
GetName());
175 rawTree->
AddFile(currFileName.
Data(), 0,
"t0tree");
177 current_out <<
Form(
"utilites.h/CollectRAWfilesInChain: %i file \"%s\" was added in chain",
178 NfilesLoaded, currFileName.
Data())
183 if (maxNfiles <= NfilesLoaded)
188 current_out <<
Form(
"utilites.h/CollectRAWfilesInChain: collected %d files, total events: %lld", NfilesLoaded,
215 currFileName = currFile->
GetName();
220 if (nfiles == max_num)
239 if (start_path ==
"") {
240 start_path = (
TString)array->GetName();
242 start_path +=
"/" + (
TString)array->GetName();
246 file->
cd(start_path.
Data());
250 while ((obj_ptr = (
TObjArray*)nx_iter())) {
256 file->
cd(start_path.
Data());
271 const Int_t deleteArrays)
276 current_out <<
Form(
"utilites.h/SaveArrayObjectsArrayInFile::ERROR: Array does NOT exist") << std::endl;
280 if (ObjectsArray->
GetLast() < 0) {
282 current_out <<
Form(
"utilites.h/SaveArrayObjectsArrayInFile: WARING: Objects array is empty") << std::endl;
286 TString resultfilename = filename;
287 if (!resultfilename.
EndsWith(
".root"))
288 resultfilename +=
".root";
290 TObject* pobjCurrObject = NULL;
297 current_out <<
Form(
"utilites.h/SaveArrayObjectsArrayInFile: Writing arrays in file \"%s\" ... ",
298 resultfilename.
Data())
302 current_out <<
Form(
"utilites.h/SaveArrayObjectsArrayInFile::ERROR: File \"%s\" was NOT opened for UPDATE",
303 resultfilename.
Data())
309 pobjCurrObject = ObjectsArray->
At(
n);
310 if (pobjCurrObject == NULL)
313 objectname = pobjCurrObject->
GetName();
315 current_out <<
Form(
"utilites.h/SaveArrayObjectsArrayInFile::Saving \"%s\" ...", objectname.
Data())
320 pobjCurrObject->
Write();
323 current_out <<
Form(
"utilites.h/SaveArrayObjectsArrayInFile::Object \"%s\" was successfully writed",
338 if (currArray == NULL)
340 objectname = currArray->
GetName();
342 current_out <<
Form(
"utilites.h/SaveArrayObjectsArrayInFile::Deleting \"%s\"", objectname.
Data())
346 ObjectsArray->
Clear();
361 const Double_t peakLeftMinValueRatio = 0.5;
368 histogramm->
SetAxisRange(PeakLeftEdge, PeakMax + peakRange);
371 FitHistogramm(histogramm, Mean,
Sigma, PeakLeftEdge - PeakRMS * 0.5, PeakMax + PeakRMS * peakRMSRange);
388 current_out <<
Form(
"utilites.h/FitHistogrammInRMSRange::ERROR: histogramm pointer is NULL") << std::endl;
392 if (RangeXmax <= RangeXmin) {
403 histogramm->
SetAxisRange(hist_start_Xmin, hist_start_Xmax);
405 Double_t fit_range_min = histMean - RMSrange * histRMS;
406 Double_t fit_range_max = histMean + RMSrange * histRMS;
408 if (fit_range_min < RangeXmin)
409 fit_range_min = RangeXmin;
410 if (fit_range_max > RangeXmax)
411 fit_range_max = RangeXmax;
413 return FitHistogramm(histogramm, mean, sigma, fit_range_min, fit_range_max);
425 current_out <<
Form(
"utilites.h/FitHistogrammInMaxPeak::ERROR: histogramm pointer is NULL") << std::endl;
429 if (RangeXmax <= RangeXmin) {
439 histogramm->
SetAxisRange(hist_start_Xmin, hist_start_Xmax);
441 Double_t FitRangeMin = PeakMax - PeakWidth * 0.5;
442 Double_t FitRangeMax = PeakMax + PeakWidth * 0.5;
444 FitRangeMin = (FitRangeMin < RangeXmin) ? RangeXmin : FitRangeMin;
445 FitRangeMax = (FitRangeMax > RangeXmax) ? RangeXmax : FitRangeMax;
449 "utilites.h/FitHistogrammInMaxPeak: Hsit: \"%s\" Maximum: %.2f, Peak Width: %.2f, Range:[%.2f, %.2f]",
450 histogramm->
GetName(), PeakMax, PeakWidth, FitRangeMin, FitRangeMax)
453 return FitHistogramm(histogramm, mean, sigma, FitRangeMin, FitRangeMax);
464 static const Int_t nSmooth = 1;
465 static const Double_t nSmoothRMScut = 1.;
470 current_out <<
Form(
"utilites.h/FitHistogrammSmartInMaxPeak::ERROR: histogramm pointer is NULL")
475 if (RangeXmax <= RangeXmin) {
483 TH1* tempSmoothProjection = (
TH1*)histogramm->
Clone(
"tempSmoothFitHist");
484 tempSmoothProjection->
Smooth(nSmooth);
485 tempSmoothProjection->
SetAxisRange(RangeXmin, RangeXmax);
490 if (
TMath::Abs(SmoothPeakMax - RangeXmax) < SmoothRMS * 0.5) {
491 RangeXmax += SmoothRMS * 0.5;
492 tempSmoothProjection->
SetAxisRange(RangeXmin, RangeXmax);
494 SmoothRMS = tempSmoothProjection->
GetRMS();
495 }
else if (
TMath::Abs(SmoothPeakMax - RangeXmin) < SmoothRMS * 0.5) {
496 RangeXmin -= SmoothRMS * 0.5;
497 tempSmoothProjection->
SetAxisRange(RangeXmin, RangeXmax);
499 SmoothRMS = tempSmoothProjection->
GetRMS();
502 tempSmoothProjection->
SetAxisRange(SmoothPeakMax - SmoothRMS * nSmoothRMScut,
503 SmoothPeakMax + SmoothRMS * nSmoothRMScut);
505 delete tempSmoothProjection;
507 Double_t FitRangeMin = SmoothPeakMax - SmoothRMSreal * nRMSfit;
508 Double_t FitRangeMax = SmoothPeakMax + SmoothRMSreal * nRMSfit;
510 FitRangeMin = (FitRangeMin < RangeXmin) ? RangeXmin : FitRangeMin;
511 FitRangeMax = (FitRangeMax > RangeXmax) ? RangeXmax : FitRangeMax;
514 current_out <<
Form(
"utilites.h/FitHistogrammSmartInMaxPeak: Hsit: \"%s\" Maximum: %.2f, SmoothRMS: %.2f, "
515 "SmoothRMSreal: %.2f, Range:[%.2f, %.2f]",
516 histogramm->
GetName(), SmoothPeakMax, SmoothRMS, SmoothRMSreal, FitRangeMin, FitRangeMax)
519 return FitHistogramm(histogramm, mean, sigma, FitRangeMin, FitRangeMax);
530 static const Int_t minFitEvents = 1;
531 static const Int_t EventsNoFit = 15;
533 TString fitoptions[] = {
"QR",
"QRL",
"QRI",
"END"};
537 current_out <<
Form(
"utilites.h/FitHistogramm::ERROR: histogramm pointer is NULL") << std::endl;
541 if (RangeXmax <= RangeXmin) {
551 if (integral < minFitEvents) {
553 current_out <<
Form(
"utilites.h/FitHistogramm::ERROR: Too low events in \"%s\" histogram: %i",
554 histogramm->
GetName(), integral)
560 current_out <<
Form(
"utilites.h/FitHistogramm::Fiting histogramm \"%s\"", histogramm->
GetName()) << std::endl;
568 histogramm->
SetAxisRange(hist_start_Xmin, hist_start_Xmax);
571 if (integral <= EventsNoFit) {
577 TF1* currfitfunction = NULL;
578 TF1* bestfitfunction = NULL;
579 Int_t bestOption = -111;
581 Double_t bestChisquare = -111., currChisquare = 0;
583 for (
Int_t opt = 0; !fitoptions[opt].
Contains(
"END"); opt++) {
587 histogramm->
Fit(currfitfunction, fitoptions[opt],
"", RangeXmin, RangeXmax);
591 current_out <<
Form(
"utilites.h/FitHistogramm: current fiting option: \"%s\", chi-square: %.1f",
592 fitoptions[opt].Data(), currChisquare)
594 if (((currChisquare < bestChisquare) && (currChisquare > 0.0001))
595 || ((bestChisquare < 0.) && (currChisquare > 0.0001)))
597 bestChisquare = currChisquare;
599 delete bestfitfunction;
600 bestfitfunction = currfitfunction;
604 delete currfitfunction;
608 if (0. < bestChisquare) {
609 histogramm->
Fit(bestfitfunction, fitoptions[bestOption],
"", RangeXmin, RangeXmax);
611 current_out <<
Form(
"utilites.h/FitHistogramm: best fit [%.2f, %.2f]: %.2f, option %i", RangeXmin,
612 RangeXmax, bestChisquare, bestOption)
621 current_out <<
Form(
"WARING: fitting failure for all options") << std::endl;
627 delete bestfitfunction;
639 else if (option.
Contains(
"recreate"))
644 "utilites.h/ResetArray::ERROR: array \"%s\" was NOT correctly deleted, wrong option \"%s\"",
645 (*array)->GetName(), option.
Data())
660 for (
Int_t element = 0; element <= (*array)->GetLast(); element++) {
661 currObject = (*array)->At(element);
691 maxElement = Array[0];
692 minElement = Array[0];
693 Amplitude = Mean = RMS = 0;
694 Double_t currElement = 0, SqSumm = 0;
696 for (
Int_t i = 0;
i < nElements;
i++) {
697 currElement = Array[
i];
698 if (maxElement < currElement)
699 maxElement = currElement;
700 if (currElement < minElement)
701 minElement = currElement;
706 Amplitude = maxElement - minElement;
708 for (
Int_t i = 0;
i < nElements;
i++) {
709 currElement = Array[
i];
710 SqSumm += (currElement - Mean) * (currElement - Mean);
721 const Float_t minbinevedge = 0.001,
722 const Int_t rebinX = 1,
723 const Int_t rebinY = 1,
724 Int_t ProjectionRebin = 5,
733 cout <<
Form(
"utilites.h/CreateSmartPojection::ERROR: hist pointer is NULL !!!\n") << endl;
737 static const Int_t minBinEvOnEdge = 5;
740 const Bool_t IsDrawSIGMA = option.Contains(
"SIGMA");
741 const Bool_t IsFitProjection = option.Contains(
"FIT");
744 cout <<
Form(
"utilites.h/CreateSmartPojection: Creating %s Projection%s for \"%s\" ... ",
745 (IsDrawSIGMA) ?
"sigma" :
"mean", (IsFitProjection) ?
" by fit" :
"", sourcehist->
GetName())
749 if (NumTotalEv < 1000) {
750 cout <<
Form(
"utilites.h/CreateSmartPojection::ERROR: Too low events in \"%s\" hist: %i", sourcehist->
GetName(),
758 if (option.Contains(
"s"))
765 Int_t AverageEvInBinX = 0, bincalculated = 0, integral;
766 for (
Int_t xbin = 1; xbin <= NumBinsX; xbin++) {
767 integral = rebinedhist->
Integral(xbin, xbin, 1, NumBinsY);
769 AverageEvInBinX += integral;
776 cout <<
Form(
"utilites.h/CreateSmartPojection: Average events in bin: %i", AverageEvInBinX) << endl;
779 Int_t firstBinX = -1, lastBinX = -1;
780 for (
Int_t xbin = 1; xbin <= NumBinsX; xbin++) {
782 if ((
ceil(minbinevedge * AverageEvInBinX) <= rebinedhist->
Integral(xbin, xbin, 1, NumBinsY))
783 && (minBinEvOnEdge <= rebinedhist->Integral(xbin, xbin, 1, NumBinsY)))
787 if ((
ceil(minbinevedge * AverageEvInBinX)
788 <= rebinedhist->
Integral(NumBinsX - xbin + 1, NumBinsX - xbin + 1, 1, NumBinsY))
789 && (minBinEvOnEdge <= rebinedhist->Integral(NumBinsX - xbin + 1, NumBinsX - xbin + 1, 1, NumBinsY)))
790 lastBinX = NumBinsX - xbin + 1;
792 if ((lastBinX > 0) && (firstBinX > 0))
797 cout <<
Form(
"utilites.h/CreateSmartPojection: FIRST BIN: %i, %.1f (%.1f ev); LAST BIN: %i, %.1f (%.1f ev)",
799 rebinedhist->
Integral(firstBinX, firstBinX, 1, NumBinsY), lastBinX,
801 rebinedhist->
Integral(lastBinX, lastBinX, 1, NumBinsY))
803 if (option.Contains(
"r"))
805 cout <<
Form(
"Bin before rebinning: %i", lastBinX - firstBinX) << endl;
809 Int_t eventsINbin = 0, numberOfBins = 0;
812 cout <<
Form(
"BINNING: ");
814 for (
Int_t xbin = firstBinX + 1; xbin <= lastBinX; xbin++) {
815 eventsINbin += rebinedhist->
Integral(xbin, xbin, 1, NumBinsY);
817 if ((eventsINbin >= AverageEvInBinX * minbinevX) || (xbin == lastBinX) || (!option.Contains(
"r"))) {
821 cout <<
Form(
"%.1f ", NewBinning[numberOfBins]);
827 if (option.Contains(
"r"))
829 cout <<
Form(
"Bin after rebining: %i", numberOfBins) << endl;
831 if (numberOfBins <= 0) {
833 cout <<
Form(
"utilites.h/CreateSmartPojection: Binning failure, number of bins: %i", numberOfBins) << endl;
838 TH1* ptrProjection =
new TH1F(
Form(
"%s_smProj_%s", sourcehist->
GetName(), (IsDrawSIGMA) ?
"sigma" :
"mean"),
839 "title", numberOfBins, 0, 1);
840 ptrProjection->
GetXaxis()->
Set(numberOfBins, NewBinning);
842 ptrProjection->
SetTitle(
Form(
"[%s projection%s] %s", (IsDrawSIGMA) ?
"SIGMA" :
"MEAN",
843 (IsFitProjection) ?
" by fit" :
"", sourcehist->
GetTitle()));
844 if (IsFitProjection && IsDrawSIGMA) {
848 Int_t firstbin, lastbin;
849 Double_t mean = 0., sigma = 0., sigmaERROR = 0., meanERROR = 0.;
851 static Int_t monitor_slices_number = 0;
853 for (
Int_t bin = 0; bin < numberOfBins; bin++) {
854 ptrProjectionY = NULL;
855 mean = sigma = sigmaERROR = 0.0001;
859 ptrProjectionY = rebinedhist->
ProjectionY(
Form(
"%i_%s_slice_bin%i_binmin%i_binmax%i", monitor_slices_number++,
860 (IsDrawSIGMA) ?
"SIGMA" :
"MEAN", bin, firstbin, lastbin),
862 ptrProjectionY->
SetTitle(
Form(
"[proj slice: minX %.2f, maxX %.2f] %s", NewBinning[bin], NewBinning[bin + 1],
865 if (ptrProjectionY) {
866 ptrProjectionY->
Rebin(ProjectionRebin);
868 if (IsFitProjection) {
877 mean = ptrProjectionY->
GetMean();
878 sigma = ptrProjectionY->
GetRMS();
883 if (monitor_slices_array)
884 monitor_slices_array->
Add(ptrProjectionY);
886 delete ptrProjectionY;
889 cout <<
Form(
"utilites.h/CreateSmartPojection: WARING: ProjectionY \"%s\" was NOT created",
890 Form(
"QTCCFDslice_bin_%i_%i", firstbin, lastbin))
894 ptrProjection->
SetBinContent(bin + 1, (IsDrawSIGMA) ? sigma : mean);
895 ptrProjection->
SetBinError(bin + 1, (IsDrawSIGMA) ? sigmaERROR * 0.5 : meanERROR * 0.5);
898 if (monitor_slices_array)
899 monitor_slices_array->Add(rebinedhist);
904 return ptrProjection;
922 int H_Last = Histogramms_arr->
GetLast();
938 if ((Leg == 2) && (Hr * Vt == 1))
942 name = Histogramms_arr->
GetName();
949 for (
int t =
min; t <=
max; t++) {
957 for (
int t =
min; t <=
max; t++) {
959 if (++flagD > Hr * Vt) {
961 sprintf(n_Canv,
"%s#%d", name.Data(), Canvas_arr->
GetLast() + 1);
962 Canvas_arr->
Add(
new TCanvas(n_Canv, n_Canv, 2000, 2000));
963 ((
TCanvas*)Canvas_arr->
Last())->Divide(Hr, Vt, 0.0001, 0.0001);
971 ((
TH1F*)Histogramms_arr->
At(t))->Draw(param.Data());
974 ((
TH1F*)Histogramms_arr->
At(t))->DrawNormalized(param.Data(), 1);
975 for (
int c_Pair = 1; c_Pair < Pair; c_Pair++) {
979 ((
TH1F*)Histogramms_arr->
At(t))->Draw(
"sames");
982 ((
TH1F*)Histogramms_arr->
At(t))->DrawNormalized(
"sames", 1);
986 if ((Leg == 2) && (flagD == 1)) {
987 gPad->BuildLegend(0, 0, 1, 1);
993 ((
TH1F*)Histogramms_arr->
At(t))->Draw(param.Data());
996 ((
TH1F*)Histogramms_arr->
At(t))->DrawNormalized(param.Data(), 1);
997 for (
int c_Pair = 1; c_Pair < Pair; c_Pair++) {
1001 ((
TH1F*)Histogramms_arr->
At(t))->Draw(
"sames");
1004 ((
TH1F*)Histogramms_arr->
At(t))->DrawNormalized(
"sames", 1);
Double_t Sigma(vector< Double_t > dist, vector< Double_t > w)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual Int_t FindBin(const char *label)
virtual Double_t GetBinCenter(Int_t bin) const
virtual Double_t GetBinLowEdge(Int_t bin) const
virtual void Set(Int_t nbins, const Double_t *xbins)
virtual Double_t GetBinUpEdge(Int_t bin) const
virtual Int_t AddFile(const char *name, Long64_t nentries=TTree::kMaxEntries, const char *tname="")
Long64_t GetEntries() const override
const char * GetName() const override
virtual void SetOwner(Bool_t enable=kTRUE)
virtual void Add(TObject *obj)=0
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
void rmdir(const char *name) override
virtual Double_t GetParameter(const TString &name) const
Double_t GetChisquare() const
virtual void SetRange(Double_t xmin, Double_t xmax)
virtual Double_t GetParError(const char *name) const
virtual Bool_t IsOpen() const
void Close(Option_t *option="") override
virtual void Smooth(Int_t ntimes=1, Option_t *option="")
virtual Double_t GetBinCenter(Int_t bin) const
virtual Bool_t Add(const TH1 *h, const TH1 *h2, Double_t c1=1, Double_t c2=1)
void SetTitle(const char *title) override
virtual Int_t GetNbinsY() const
virtual Double_t GetMean(Int_t axis=1) const
virtual Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Double_t GetRMSError(Int_t axis=1) const
virtual Int_t GetNbinsX() const
virtual void SetBinError(Int_t bin, Double_t error)
Double_t GetRMS(Int_t axis=1) const
virtual void SetBinContent(Int_t bin, Double_t content)
virtual Double_t GetEntries() const
virtual TF1 * GetFunction(const char *name) const
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr)
virtual Double_t GetMeanError(Int_t axis=1) const
virtual Double_t Integral(Int_t binx1, Int_t binx2, Option_t *option="") const
virtual Int_t GetMaximumBin() const
virtual Double_t GetBinContent(Int_t bin) const
virtual void SetOption(Option_t *option=" ")
virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="X")
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
TObject * Clone(const char *newname="") const override
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
virtual Double_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Option_t *option="") const
void Smooth(Int_t ntimes=1, Option_t *option="") override
virtual TH2 * Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="")
const char * GetName() const override
const char * GetTitle() const override
TObject * Last() const override
void Clear(Option_t *option="") override
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
Int_t GetLast() const override
void Add(TObject *obj) override
virtual const char * GetName() const
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual TList * GetListOfFiles() const
virtual Bool_t IsDirectory(const char *dir=nullptr) const
RVec< PromoteType< T > > ceil(const RVec< T > &v)
std::ostream & current_out
*brief user defined string literal for JSON values *sa std::size_t n
Int_t SaveArrayOfObjectsArraysInFile(TObjArray *ObjectsArray=0, const TString filename="data", const TString path="./", const Int_t deleteArrays=0)
Int_t SaveArrayStructInFile(TCollection *array, TFile *file, TString start_path="")
std::ostream & current_out
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)
Int_t CollectRAWfilesInChain(TChain *rawTree, const TString dirname, const Int_t maxNfiles=50)
Int_t FilesListFromDir(const TString filespath, TObjArray *const collection, Int_t max_num, TString content)
TObject * CreateXprofile(const TH1 *sourcehist)
Int_t RUNnumberInString(const TString &str)
Int_t FitHistogrammSmartInMaxPeak(TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t nRMSfit=2., Double_t RangeXmin=0., Double_t RangeXmax=0.)
void ResetArray(TObjArray **array, const TString option)
Int_t ConstructFilesListFromDirectory(const TString &Directory, TCollection *const collection)
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 FitHistogrammInMaxPeak(TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t PeakWidth, Double_t RangeXmin=0., Double_t RangeXmax=0.)
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)
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)
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)
Double_t Sqrt(Double_t x)