BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
utilites.h
Go to the documentation of this file.
1// utilities for ROOT macro analysis
2// Author: Dmitry Finogeev, dmitry.finogeev@cern.ch
3
4#ifndef UTILITES_H
5#define UTILITES_H
6// header what include most popular root classes
7
8// #include "CanvasShow/canvasshow.h"
9// #include "CanvasShow/canvasshow.cxx"
10
11#include <TBrowser.h>
12#include <TCanvas.h>
13#include <TChain.h>
14#include <TCollection.h>
15#include <TDirectory.h>
16#include <TF1.h>
17#include <TFile.h>
18#include <TGraph.h>
19#include <TH1.h>
20#include <TH2.h>
21#include <TList.h>
22#include <TMath.h>
23#include <TObjArray.h>
24#include <TObjString.h>
25#include <TProfile.h>
26#include <TROOT.h>
27#include <TStopwatch.h>
28#include <TStyle.h>
29#include <TSystem.h>
30#include <TSystemDirectory.h>
31#include <TSystemFile.h>
32#include <TVectorD.h>
33#include <fstream>
34#include <iostream>
35
36#define OUTINFILE 0
37
38#if OUTINFILE
39std::ofstream current_out("CurrentLog.txt");
40#else
41std::ostream& current_out = std::cout;
42#endif
43
44#define uVERBOSE 1 // 1 - errors; 2 - results; 3 - details; 4 - debugging; 5 - flood
45#define fit_funk_name "fitFunction"
46
47using namespace std;
48
49Int_t FilesListFromDir(const TString filespath, TObjArray* const collection, Int_t max_num, TString content);
50Int_t SaveArrayStructInFile(TCollection* array, TFile* file, TString start_path = "");
52 const TString filename = "data",
53 const TString path = "./",
54 const Int_t deleteArrays = 0);
55
56Int_t FitHistogramm(TH1* histogramm,
57 Double_t& mean,
58 Double_t& sigma,
59 Double_t RangeXmin = 0.,
60 Double_t RangeXmax = 0.,
61 TString fit_formula = "gaus");
63 Double_t& Mean,
65 Double_t peaksRangeMin,
66 Double_t peaksRangeMax,
67 Double_t peakRange,
68 Double_t peakRMSRange = 1.5);
70 Double_t& mean,
71 Double_t& sigma,
72 Double_t RMSrange,
73 Double_t RangeXmin = 0,
74 Double_t RangeXmax = 0);
76 Double_t& mean,
77 Double_t& sigma,
78 Double_t PeakWidth,
79 Double_t RangeXmin = 0.,
80 Double_t RangeXmax = 0.);
81
82Int_t ArrayStat(const Int_t nElements,
83 const Double_t* Array,
84 Double_t& maxElement,
85 Double_t& minElement,
86 Double_t& Amplitude,
87 Double_t& Mean,
88 Double_t& RMS);
89void ResetArray(TObjArray** array, const TString option);
90
91Int_t ConstructFilesListFromDirectory(const TString& Directory, TCollection* const collection)
92{
93 TString filespath = Directory;
94 if (!filespath.EndsWith("/"))
95 filespath += "/";
96
97 if (!collection) {
98 if (uVERBOSE >= 1)
99 current_out << Form("utilites.h/ConstructFilesListInDirectory: collection ptr is NULL") << std::endl;
100 return 0;
101 }
102
103 TSystemFile* currFile;
104 TString currFileName;
105 TSystemDirectory SDirectory(filespath, filespath);
106 TIter nextfile(SDirectory.GetListOfFiles());
107
108 Int_t nfiles = 0;
109 while ((currFile = (TSystemFile*)nextfile())) {
110 currFileName = filespath + (currFile->GetName());
111 if (!currFile->IsDirectory() && currFileName.EndsWith("root")) {
112 collection->Add(new TObjString(currFileName.Data()));
113
114 if (uVERBOSE >= 3)
115 current_out << Form("utilites.h/ConstructFilesListInDirectory: found root file \"%s\"",
116 currFileName.Data())
117 << std::endl;
118 nfiles++;
119 }
120 }
121
122 return nfiles;
123}
124
125///////////////////////////////////////////////////////////////////////////////////////////////////
127{
128 const Int_t lenght = 6;
129 Int_t value;
130 TString sub_str;
131 for (Int_t start = 0; start <= str.Sizeof() - lenght; start++) {
132 sub_str = str(start, lenght);
133 value = sub_str.Atoi();
134 // printf("debug:start = %i; strpath = %s; value = %i\n",start, sub_str.Data(), value);
135 if (value < 999999 && 100000 < value)
136 return value;
137 }
138
139 return 0;
140}
141
142///////////////////////////////////////////////////////////////////////////////////////////////////
143TObject* CreateXprofile(const TH1* sourcehist)
144{
145 TProfile* profile = ((TH2*)sourcehist)->ProfileX(Form("%s_prof", sourcehist->GetName()), 1, -1, "o");
146 profile->SetTitle(sourcehist->GetTitle());
147 if (uVERBOSE >= 2)
148 current_out << Form("utilites.h/CreateXprofile: profile \"%s\" was created", sourcehist->GetName())
149 << std::endl;
150
151 return (TObject*)profile;
152}
153
154///////////////////////////////////////////////////////////////////////////////////////////////////
155Int_t CollectRAWfilesInChain(TChain* rawTree, const TString dirname, const Int_t maxNfiles = 50)
156{
157
158 TString filespath = dirname;
159 if (!filespath.EndsWith("/"))
160 filespath += "/";
161
162 if (uVERBOSE >= 2)
163 current_out << Form("utilites.h/CollectRAWfilesInChain: collecting files from \"%s\"", filespath.Data())
164 << std::endl;
165
166 TSystemFile* currFile;
167 TString currFileName;
168 TSystemDirectory SDirectory(filespath, filespath);
169 TIter nextfile(SDirectory.GetListOfFiles());
170
171 Int_t NfilesLoaded = 0;
172 while ((currFile = (TSystemFile*)nextfile())) {
173 currFileName = filespath + (currFile->GetName());
174 if (!currFile->IsDirectory() && currFileName.EndsWith("root")) {
175 rawTree->AddFile(currFileName.Data(), 0, "t0tree");
176 if (uVERBOSE >= 4)
177 current_out << Form("utilites.h/CollectRAWfilesInChain: %i file \"%s\" was added in chain",
178 NfilesLoaded, currFileName.Data())
179 << std::endl;
180 NfilesLoaded++;
181 }
182
183 if (maxNfiles <= NfilesLoaded)
184 break;
185 }
186
187 if (uVERBOSE >= 2)
188 current_out << Form("utilites.h/CollectRAWfilesInChain: collected %d files, total events: %lld", NfilesLoaded,
189 rawTree->GetEntries())
190 << std::endl;
191
192 return NfilesLoaded;
193}
194
195///////////////////////////////////////////////////////////////////////////////////////////////////
196Int_t FilesListFromDir(const TString Directory, TObjArray* const collection, Int_t max_num, TString content)
197{
198 TString filespath = Directory;
199
200 if (!filespath.EndsWith("/"))
201 filespath += "/";
202
203 if (!collection) {
204 current_out << Form("ERROR: Collection ptr is NULL") << std::endl;
205 return 0;
206 }
207
208 TSystemFile* currFile;
209 TString currFileName;
210 TSystemDirectory SDirectory(filespath, filespath);
211 TIter nextfile(SDirectory.GetListOfFiles());
212
213 Int_t nfiles = 0;
214 while ((currFile = (TSystemFile*)nextfile())) {
215 currFileName = currFile->GetName();
216 if (!currFile->IsDirectory() && currFileName.Contains(content)) {
217 collection->Add(new TObjString(currFileName.Data()));
218 nfiles++;
219 if (max_num > 0)
220 if (nfiles == max_num)
221 break;
222 }
223 }
224
225 return nfiles;
226}
227
228///////////////////////////////////////////////////////////////////////////////////////////////////
230{
231 // if(start_path = "") start_path = "/";
232 // file->cd(start_path.Data());
233
234 // file->mkdir(array->GetName());
235
236 if (array == 0)
237 return 0;
238
239 if (start_path == "") {
240 start_path = (TString)array->GetName();
241 } else {
242 start_path += "/" + (TString)array->GetName();
243 }
244
245 file->mkdir(start_path.Data());
246 file->cd(start_path.Data());
247
248 TIter nx_iter((TCollection*)(array));
249 TObject* obj_ptr;
250 while ((obj_ptr = (TObjArray*)nx_iter())) {
251 if (obj_ptr == 0)
252 continue;
253
254 if (TCollection* new_coll = dynamic_cast<TCollection*>(obj_ptr)) {
255 SaveArrayStructInFile(new_coll, file, start_path);
256 file->cd(start_path.Data());
257 } else {
258 if (uVERBOSE >= 2)
259 current_out << Form("Writing %s object", obj_ptr->GetName()) << std::endl;
260 obj_ptr->Write();
261 }
262 }
263
264 return 1;
265}
266
267///////////////////////////////////////////////////////////////////////////////////////////////////
269 const TString filename,
270 const TString path,
271 const Int_t deleteArrays)
272{
273 // TList *ObjectsArray = (TList*)ObjectsArray_;
274 if (!ObjectsArray) {
275 if (uVERBOSE >= 1)
276 current_out << Form("utilites.h/SaveArrayObjectsArrayInFile::ERROR: Array does NOT exist") << std::endl;
277 return 0;
278 }
279
280 if (ObjectsArray->GetLast() < 0) {
281 if (uVERBOSE >= 1)
282 current_out << Form("utilites.h/SaveArrayObjectsArrayInFile: WARING: Objects array is empty") << std::endl;
283 return 0;
284 }
285
286 TString resultfilename = filename;
287 if (!resultfilename.EndsWith(".root"))
288 resultfilename += ".root";
289
290 TObject* pobjCurrObject = NULL;
291 TString objectname;
292
293 TFile* file = new TFile(resultfilename.Data(), "UPDATE");
294
295 if (file->IsOpen()) {
296 if (uVERBOSE >= 2)
297 current_out << Form("utilites.h/SaveArrayObjectsArrayInFile: Writing arrays in file \"%s\" ... ",
298 resultfilename.Data())
299 << std::endl;
300 } else {
301 if (uVERBOSE >= 1)
302 current_out << Form("utilites.h/SaveArrayObjectsArrayInFile::ERROR: File \"%s\" was NOT opened for UPDATE",
303 resultfilename.Data())
304 << std::endl;
305 return 0;
306 }
307
308 for (Int_t n = 0; n < ObjectsArray->GetEntries(); n++) {
309 pobjCurrObject = ObjectsArray->At(n);
310 if (pobjCurrObject == NULL)
311 continue;
312
313 objectname = pobjCurrObject->GetName();
314 if (uVERBOSE >= 3)
315 current_out << Form("utilites.h/SaveArrayObjectsArrayInFile::Saving \"%s\" ...", objectname.Data())
316 << std::endl;
317 file->rmdir(objectname.Data()); // delete old data to rewrite
318 TDirectory* CurrDir = file->mkdir(objectname.Data());
319 CurrDir->cd();
320 pobjCurrObject->Write();
321
322 if (uVERBOSE >= 2)
323 current_out << Form("utilites.h/SaveArrayObjectsArrayInFile::Object \"%s\" was successfully writed",
324 objectname.Data())
325 << std::endl;
326 }
327
328 file->Close();
329 delete file;
330
331 gDirectory->cd("Rint:/");
332
333 TObjArray* currArray = NULL;
334 if (deleteArrays) //
335 {
336 for (Int_t n = 0; n < ObjectsArray->GetEntries(); n++) {
337 currArray = (TObjArray*)ObjectsArray->At(n);
338 if (currArray == NULL)
339 continue;
340 objectname = currArray->GetName();
341 if (uVERBOSE >= 2)
342 current_out << Form("utilites.h/SaveArrayObjectsArrayInFile::Deleting \"%s\"", objectname.Data())
343 << std::endl;
344 ResetArray(&currArray, "delete");
345 }
346 ObjectsArray->Clear();
347 }
348
349 return 1;
350}
351
352///////////////////////////////////////////////////////////////////////////////////////////////////
354 Double_t& Mean,
356 Double_t peaksRangeMin,
357 Double_t peaksRangeMax,
358 Double_t peakRange,
359 Double_t peakRMSRange)
360{
361 const Double_t peakLeftMinValueRatio = 0.5;
362
363 histogramm->SetAxisRange(peaksRangeMin, peaksRangeMax); // cutting saturation peak
364 Double_t PeakMax = histogramm->GetBinCenter(histogramm->GetMaximumBin());
365 Double_t PeakMaxValue = histogramm->GetBinContent(histogramm->GetMaximumBin());
366 Double_t PeakLeftEdge =
367 histogramm->GetBinCenter(histogramm->FindFirstBinAbove(PeakMaxValue * peakLeftMinValueRatio) - 2);
368 histogramm->SetAxisRange(PeakLeftEdge, PeakMax + peakRange); // cutting saturation peak
369 Double_t PeakRMS = histogramm->GetRMS();
370
371 FitHistogramm(histogramm, Mean, Sigma, PeakLeftEdge - PeakRMS * 0.5, PeakMax + PeakRMS * peakRMSRange);
372
373 histogramm->SetAxisRange(peaksRangeMin, peaksRangeMax); // cutting saturation peak
374
375 return 1;
376}
377
378///////////////////////////////////////////////////////////////////////////////////////////////////
380 Double_t& mean,
381 Double_t& sigma,
382 Double_t RMSrange,
383 Double_t RangeXmin,
384 Double_t RangeXmax)
385{
386 if (!histogramm) {
387 if (uVERBOSE >= 1)
388 current_out << Form("utilites.h/FitHistogrammInRMSRange::ERROR: histogramm pointer is NULL") << std::endl;
389 return 0;
390 }
391
392 if (RangeXmax <= RangeXmin) {
393 RangeXmin = histogramm->GetXaxis()->GetXmin();
394 RangeXmax = histogramm->GetXaxis()->GetXmax();
395 }
396
397 Double_t hist_start_Xmin = histogramm->GetXaxis()->GetXmin();
398 Double_t hist_start_Xmax = histogramm->GetXaxis()->GetXmax();
399
400 histogramm->SetAxisRange(RangeXmin, RangeXmax);
401 Double_t histMean = histogramm->GetMean();
402 Double_t histRMS = histogramm->GetRMS();
403 histogramm->SetAxisRange(hist_start_Xmin, hist_start_Xmax);
404
405 Double_t fit_range_min = histMean - RMSrange * histRMS;
406 Double_t fit_range_max = histMean + RMSrange * histRMS;
407
408 if (fit_range_min < RangeXmin)
409 fit_range_min = RangeXmin;
410 if (fit_range_max > RangeXmax)
411 fit_range_max = RangeXmax;
412
413 return FitHistogramm(histogramm, mean, sigma, fit_range_min, fit_range_max);
414}
415///////////////////////////////////////////////////////////////////////////////////////////////////
417 Double_t& mean,
418 Double_t& sigma,
419 Double_t PeakWidth,
420 Double_t RangeXmin,
421 Double_t RangeXmax)
422{
423 if (!histogramm) {
424 if (uVERBOSE >= 1)
425 current_out << Form("utilites.h/FitHistogrammInMaxPeak::ERROR: histogramm pointer is NULL") << std::endl;
426 return 0;
427 }
428
429 if (RangeXmax <= RangeXmin) {
430 RangeXmin = histogramm->GetXaxis()->GetXmin();
431 RangeXmax = histogramm->GetXaxis()->GetXmax();
432 }
433
434 Double_t hist_start_Xmin = histogramm->GetXaxis()->GetXmin();
435 Double_t hist_start_Xmax = histogramm->GetXaxis()->GetXmax();
436
437 histogramm->SetAxisRange(RangeXmin, RangeXmax);
438 Double_t PeakMax = histogramm->GetBinCenter(histogramm->GetMaximumBin());
439 histogramm->SetAxisRange(hist_start_Xmin, hist_start_Xmax);
440
441 Double_t FitRangeMin = PeakMax - PeakWidth * 0.5;
442 Double_t FitRangeMax = PeakMax + PeakWidth * 0.5;
443
444 FitRangeMin = (FitRangeMin < RangeXmin) ? RangeXmin : FitRangeMin;
445 FitRangeMax = (FitRangeMax > RangeXmax) ? RangeXmax : FitRangeMax;
446
447 if (uVERBOSE >= 4)
448 current_out << Form(
449 "utilites.h/FitHistogrammInMaxPeak: Hsit: \"%s\" Maximum: %.2f, Peak Width: %.2f, Range:[%.2f, %.2f]",
450 histogramm->GetName(), PeakMax, PeakWidth, FitRangeMin, FitRangeMax)
451 << std::endl;
452
453 return FitHistogramm(histogramm, mean, sigma, FitRangeMin, FitRangeMax);
454}
455
456///////////////////////////////////////////////////////////////////////////////////////////////////
458 Double_t& mean,
459 Double_t& sigma,
460 Double_t nRMSfit = 2.,
461 Double_t RangeXmin = 0.,
462 Double_t RangeXmax = 0.)
463{
464 static const Int_t nSmooth = 1;
465 static const Double_t nSmoothRMScut = 1.;
466 // static const Double_t nRMSfit = 2;
467
468 if (!histogramm) {
469 if (uVERBOSE >= 1)
470 current_out << Form("utilites.h/FitHistogrammSmartInMaxPeak::ERROR: histogramm pointer is NULL")
471 << std::endl;
472 return 0;
473 }
474
475 if (RangeXmax <= RangeXmin) {
476 RangeXmin = histogramm->GetXaxis()->GetXmin();
477 RangeXmax = histogramm->GetXaxis()->GetXmax();
478 }
479
480 histogramm->SetAxisRange(RangeXmin, RangeXmax);
481
482 // searching fit ranges
483 TH1* tempSmoothProjection = (TH1*)histogramm->Clone("tempSmoothFitHist");
484 tempSmoothProjection->Smooth(nSmooth);
485 tempSmoothProjection->SetAxisRange(RangeXmin, RangeXmax);
486 Double_t SmoothPeakMax = tempSmoothProjection->GetBinCenter(tempSmoothProjection->GetMaximumBin());
487 Double_t SmoothRMS = tempSmoothProjection->GetRMS();
488
489 // maximum on hist edge:
490 if (TMath::Abs(SmoothPeakMax - RangeXmax) < SmoothRMS * 0.5) {
491 RangeXmax += SmoothRMS * 0.5;
492 tempSmoothProjection->SetAxisRange(RangeXmin, RangeXmax);
493 SmoothPeakMax = tempSmoothProjection->GetBinCenter(tempSmoothProjection->GetMaximumBin());
494 SmoothRMS = tempSmoothProjection->GetRMS();
495 } else if (TMath::Abs(SmoothPeakMax - RangeXmin) < SmoothRMS * 0.5) {
496 RangeXmin -= SmoothRMS * 0.5;
497 tempSmoothProjection->SetAxisRange(RangeXmin, RangeXmax);
498 SmoothPeakMax = tempSmoothProjection->GetBinCenter(tempSmoothProjection->GetMaximumBin());
499 SmoothRMS = tempSmoothProjection->GetRMS();
500 }
501
502 tempSmoothProjection->SetAxisRange(SmoothPeakMax - SmoothRMS * nSmoothRMScut,
503 SmoothPeakMax + SmoothRMS * nSmoothRMScut);
504 Double_t SmoothRMSreal = tempSmoothProjection->GetRMS();
505 delete tempSmoothProjection;
506
507 Double_t FitRangeMin = SmoothPeakMax - SmoothRMSreal * nRMSfit;
508 Double_t FitRangeMax = SmoothPeakMax + SmoothRMSreal * nRMSfit;
509
510 FitRangeMin = (FitRangeMin < RangeXmin) ? RangeXmin : FitRangeMin;
511 FitRangeMax = (FitRangeMax > RangeXmax) ? RangeXmax : FitRangeMax;
512
513 if (uVERBOSE >= 3)
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)
517 << std::endl;
518 // return NULL;
519 return FitHistogramm(histogramm, mean, sigma, FitRangeMin, FitRangeMax);
520}
521
522///////////////////////////////////////////////////////////////////////////////////////////////////
524 Double_t& mean,
525 Double_t& sigma,
526 Double_t RangeXmin,
527 Double_t RangeXmax,
528 TString fit_formula)
529{
530 static const Int_t minFitEvents = 1; // minimum events in range for fitting
531 static const Int_t EventsNoFit = 15;
532
533 TString fitoptions[] = {"QR", "QRL", "QRI", "END"};
534
535 if (!histogramm) {
536 if (uVERBOSE >= 1)
537 current_out << Form("utilites.h/FitHistogramm::ERROR: histogramm pointer is NULL") << std::endl;
538 return 0;
539 }
540
541 if (RangeXmax <= RangeXmin) {
542 RangeXmin = histogramm->GetXaxis()->GetXmin();
543 RangeXmax = histogramm->GetXaxis()->GetXmax();
544 }
545
546 // if too low events for fitting returning 0
547 Int_t intBinMin = histogramm->FindBin(RangeXmin);
548 Int_t intBinMax = histogramm->FindBin(RangeXmax);
549 Int_t integral = histogramm->Integral(intBinMin, intBinMax);
550
551 if (integral < minFitEvents) {
552 if (uVERBOSE >= 1)
553 current_out << Form("utilites.h/FitHistogramm::ERROR: Too low events in \"%s\" histogram: %i",
554 histogramm->GetName(), integral)
555 << std::endl;
556 return 0;
557 }
558
559 if (uVERBOSE >= 2)
560 current_out << Form("utilites.h/FitHistogramm::Fiting histogramm \"%s\"", histogramm->GetName()) << std::endl;
561
562 Double_t hist_start_Xmin = histogramm->GetXaxis()->GetXmin();
563 Double_t hist_start_Xmax = histogramm->GetXaxis()->GetXmax();
564
565 histogramm->SetAxisRange(RangeXmin, RangeXmax);
566 Double_t histMean = histogramm->GetMean();
567 Double_t histRMS = histogramm->GetRMS();
568 histogramm->SetAxisRange(hist_start_Xmin, hist_start_Xmax);
569
570 // if low events, only RMS and mean;
571 if (integral <= EventsNoFit) {
572 mean = histMean;
573 sigma = histRMS;
574 return 2;
575 }
576
577 TF1* currfitfunction = NULL;
578 TF1* bestfitfunction = NULL;
579 Int_t bestOption = -111;
580
581 Double_t bestChisquare = -111., currChisquare = 0;
582
583 for (Int_t opt = 0; !fitoptions[opt].Contains("END"); opt++) {
584
585 currfitfunction = new TF1(fit_funk_name, fit_formula.Data(), RangeXmin, RangeXmax);
586
587 histogramm->Fit(currfitfunction, fitoptions[opt], "", RangeXmin, RangeXmax);
588 currChisquare = currfitfunction->GetChisquare();
589
590 if (uVERBOSE >= 3)
591 current_out << Form("utilites.h/FitHistogramm: current fiting option: \"%s\", chi-square: %.1f",
592 fitoptions[opt].Data(), currChisquare)
593 << std::endl;
594 if (((currChisquare < bestChisquare) && (currChisquare > 0.0001))
595 || ((bestChisquare < 0.) && (currChisquare > 0.0001)))
596 {
597 bestChisquare = currChisquare;
598 if (bestfitfunction)
599 delete bestfitfunction;
600 bestfitfunction = currfitfunction;
601 bestOption = opt;
602 } else {
603 if (currfitfunction)
604 delete currfitfunction;
605 }
606 }
607
608 if (0. < bestChisquare) {
609 histogramm->Fit(bestfitfunction, fitoptions[bestOption], "", RangeXmin, RangeXmax);
610 if (uVERBOSE >= 2)
611 current_out << Form("utilites.h/FitHistogramm: best fit [%.2f, %.2f]: %.2f, option %i", RangeXmin,
612 RangeXmax, bestChisquare, bestOption)
613 << std::endl;
614 histogramm->GetFunction(fit_funk_name)
615 ->SetRange(RangeXmin, RangeXmax); // to see selected range on func at hist
616
617 mean = bestfitfunction->GetParameter(1);
618 sigma = bestfitfunction->GetParameter(2);
619 } else {
620 if (uVERBOSE >= 1)
621 current_out << Form("WARING: fitting failure for all options") << std::endl;
622 mean = histMean;
623 sigma = histRMS;
624 }
625
626 if (bestfitfunction)
627 delete bestfitfunction;
628 return 1;
629}
630///////////////////////////////////////////////////////////////////////////////////////////////////
631void ResetArray(TObjArray** array, TString option)
632{
633 Int_t ioption;
634 TObject* currObject = NULL;
635
636 // if option is incorrect
637 if (option.Contains("delete"))
638 ioption = 0;
639 else if (option.Contains("recreate"))
640 ioption = 1;
641 else {
642 if (uVERBOSE >= 1)
643 current_out << Form(
644 "utilites.h/ResetArray::ERROR: array \"%s\" was NOT correctly deleted, wrong option \"%s\"",
645 (*array)->GetName(), option.Data())
646 << std::endl;
647 return;
648 }
649
650 // if array is empty
651 if (!(*array)) {
652 if (ioption == 1) {
653 *array = new TObjArray();
654 return;
655 }
656 if (ioption == 0)
657 return;
658 }
659
660 for (Int_t element = 0; element <= (*array)->GetLast(); element++) {
661 currObject = (*array)->At(element);
662 if (!currObject)
663 continue;
664 if (uVERBOSE >= 4)
665 current_out << Form("utilites.h/ResetArray::Deleting object \"%s\"", currObject->GetName()) << std::endl;
666 delete currObject;
667 }
668
669 (*array)->Clear();
670
671 delete *array;
672
673 if (ioption == 1) {
674 *array = new TObjArray();
675 return;
676 }
677 if (ioption == 0) {
678 *array = NULL;
679 return;
680 }
681}
682///////////////////////////////////////////////////////////////////////////////////////////////////
684 Double_t* Array,
685 Double_t& maxElement,
686 Double_t& minElement,
687 Double_t& Amplitude,
688 Double_t& Mean,
689 Double_t& RMS)
690{
691 maxElement = Array[0];
692 minElement = Array[0];
693 Amplitude = Mean = RMS = 0;
694 Double_t currElement = 0, SqSumm = 0;
695
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;
702 Mean += currElement;
703 }
704
705 Mean /= (Double_t)nElements;
706 Amplitude = maxElement - minElement;
707
708 for (Int_t i = 0; i < nElements; i++) {
709 currElement = Array[i];
710 SqSumm += (currElement - Mean) * (currElement - Mean);
711 }
712
713 RMS = TMath::Sqrt(SqSumm / (Double_t)nElements);
714
715 return 1;
716}
717///////////////////////////////////////////////////////////////////////////////////////////////////
719 TString option = "n",
720 const Float_t minbinevX = 1,
721 const Float_t minbinevedge = 0.001,
722 const Int_t rebinX = 1,
723 const Int_t rebinY = 1,
724 Int_t ProjectionRebin = 5,
725 Float_t projWidth = 1.5,
726 TObjArray* monitor_slices_array = NULL)
727{
728 // options: "SIGMA" - draw sigma (RMS) else mean; "FIT" - fit projection, else mean and RMS; "s" - smooth; "n" -
729 // no rebin ; "r" - rebin
730
731 if (!sourcehist) {
732 if (uVERBOSE >= 1)
733 cout << Form("utilites.h/CreateSmartPojection::ERROR: hist pointer is NULL !!!\n") << endl;
734 return NULL;
735 }
736
737 static const Int_t minBinEvOnEdge = 5;
738 // static const Int_t ProjectionRebin = 5;
739
740 const Bool_t IsDrawSIGMA = option.Contains("SIGMA");
741 const Bool_t IsFitProjection = option.Contains("FIT");
742
743 if (uVERBOSE >= 2)
744 cout << Form("utilites.h/CreateSmartPojection: Creating %s Projection%s for \"%s\" ... ",
745 (IsDrawSIGMA) ? "sigma" : "mean", (IsFitProjection) ? " by fit" : "", sourcehist->GetName())
746 << endl;
747
748 Int_t NumTotalEv = sourcehist->GetEntries();
749 if (NumTotalEv < 1000) {
750 cout << Form("utilites.h/CreateSmartPojection::ERROR: Too low events in \"%s\" hist: %i", sourcehist->GetName(),
751 NumTotalEv)
752 << endl;
753 return NULL;
754 }
755
756 TH2* rebinedhist = sourcehist->Rebin2D(rebinX, rebinY, Form("%s_rebin", sourcehist->GetName()));
757
758 if (option.Contains("s"))
759 rebinedhist->Smooth(3);
760
761 Int_t NumBinsY = rebinedhist->GetNbinsY(); // number of bin along Y
762 Int_t NumBinsX = rebinedhist->GetNbinsX(); // number of bin along X
763
764 // average events in bin, does not calculated empty bins
765 Int_t AverageEvInBinX = 0, bincalculated = 0, integral; // events in bin (X axis) on the averages
766 for (Int_t xbin = 1; xbin <= NumBinsX; xbin++) {
767 integral = rebinedhist->Integral(xbin, xbin, 1, NumBinsY);
768 if (0 < integral) {
769 AverageEvInBinX += integral;
770 bincalculated++;
771 }
772 }
773 AverageEvInBinX = ceil((Float_t)AverageEvInBinX / (Float_t)bincalculated);
774
775 if (uVERBOSE >= 4)
776 cout << Form("utilites.h/CreateSmartPojection: Average events in bin: %i", AverageEvInBinX) << endl;
777
778 // fist and last bin with minbinevedge*AverageEvInBinX
779 Int_t firstBinX = -1, lastBinX = -1;
780 for (Int_t xbin = 1; xbin <= NumBinsX; xbin++) {
781 if (firstBinX < 0)
782 if ((ceil(minbinevedge * AverageEvInBinX) <= rebinedhist->Integral(xbin, xbin, 1, NumBinsY))
783 && (minBinEvOnEdge <= rebinedhist->Integral(xbin, xbin, 1, NumBinsY)))
784 firstBinX = xbin;
785
786 if (lastBinX < 0)
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;
791
792 if ((lastBinX > 0) && (firstBinX > 0))
793 break;
794 }
795
796 if (uVERBOSE >= 4)
797 cout << Form("utilites.h/CreateSmartPojection: FIRST BIN: %i, %.1f (%.1f ev); LAST BIN: %i, %.1f (%.1f ev)",
798 firstBinX, rebinedhist->GetXaxis()->GetBinCenter(firstBinX),
799 rebinedhist->Integral(firstBinX, firstBinX, 1, NumBinsY), lastBinX,
800 rebinedhist->GetXaxis()->GetBinCenter(lastBinX),
801 rebinedhist->Integral(lastBinX, lastBinX, 1, NumBinsY))
802 << endl;
803 if (option.Contains("r"))
804 if (uVERBOSE >= 4)
805 cout << Form("Bin before rebinning: %i", lastBinX - firstBinX) << endl;
806
807 // finding bins: in each bin minimum minQTCCFDbinEv*QTCCFDnumEvInBinXAverage events
808 Float_t* NewBinning = new Float_t[lastBinX - firstBinX + 2];
809 Int_t eventsINbin = 0, numberOfBins = 0;
810
811 if (uVERBOSE >= 5)
812 cout << Form("BINNING: ");
813 NewBinning[0] = rebinedhist->GetXaxis()->GetBinLowEdge(firstBinX);
814 for (Int_t xbin = firstBinX + 1; xbin <= lastBinX; xbin++) {
815 eventsINbin += rebinedhist->Integral(xbin, xbin, 1, NumBinsY);
816
817 if ((eventsINbin >= AverageEvInBinX * minbinevX) || (xbin == lastBinX) || (!option.Contains("r"))) {
818 numberOfBins++;
819 NewBinning[numberOfBins] = rebinedhist->GetXaxis()->GetBinUpEdge(xbin);
820 if (uVERBOSE >= 5)
821 cout << Form("%.1f ", NewBinning[numberOfBins]);
822 eventsINbin = 0;
823 }
824 } // for sbin
825 if (uVERBOSE >= 4)
826 cout << "" << endl;
827 if (option.Contains("r"))
828 if (uVERBOSE >= 4)
829 cout << Form("Bin after rebining: %i", numberOfBins) << endl;
830
831 if (numberOfBins <= 0) {
832 if (uVERBOSE >= 1)
833 cout << Form("utilites.h/CreateSmartPojection: Binning failure, number of bins: %i", numberOfBins) << endl;
834 return NULL;
835 }
836
837 // filling 1D histograms with mean and errors by gauss fit
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);
841 ptrProjection->SetOption("E1");
842 ptrProjection->SetTitle(Form("[%s projection%s] %s", (IsDrawSIGMA) ? "SIGMA" : "MEAN",
843 (IsFitProjection) ? " by fit" : "", sourcehist->GetTitle()));
844 if (IsFitProjection && IsDrawSIGMA) {
845 ptrProjection->SetMarkerStyle(22);
846 }
847
848 Int_t firstbin, lastbin;
849 Double_t mean = 0., sigma = 0., sigmaERROR = 0., meanERROR = 0.;
850 TH1* ptrProjectionY;
851 static Int_t monitor_slices_number = 0;
852
853 for (Int_t bin = 0; bin < numberOfBins; bin++) {
854 ptrProjectionY = NULL;
855 mean = sigma = sigmaERROR = 0.0001;
856 firstbin = rebinedhist->GetXaxis()->FindBin(NewBinning[bin]);
857 lastbin = rebinedhist->GetXaxis()->FindBin(NewBinning[bin + 1]);
858
859 ptrProjectionY = rebinedhist->ProjectionY(Form("%i_%s_slice_bin%i_binmin%i_binmax%i", monitor_slices_number++,
860 (IsDrawSIGMA) ? "SIGMA" : "MEAN", bin, firstbin, lastbin),
861 firstbin, lastbin);
862 ptrProjectionY->SetTitle(Form("[proj slice: minX %.2f, maxX %.2f] %s", NewBinning[bin], NewBinning[bin + 1],
863 ptrProjection->GetTitle()));
864
865 if (ptrProjectionY) {
866 ptrProjectionY->Rebin(ProjectionRebin);
867
868 if (IsFitProjection) {
869 // FitHistogrammInMaxPeak(ptrProjectionY,mean,sigma, projWidth); //width = 1.5
870 FitHistogrammSmartInMaxPeak(ptrProjectionY, mean, sigma); // width = 1.5
871
872 if (ptrProjectionY->GetFunction(fit_funk_name)) {
873 meanERROR = ptrProjectionY->GetFunction(fit_funk_name)->GetParError(1);
874 sigmaERROR = ptrProjectionY->GetFunction(fit_funk_name)->GetParError(2);
875 }
876 } else {
877 mean = ptrProjectionY->GetMean();
878 sigma = ptrProjectionY->GetRMS();
879 meanERROR = ptrProjectionY->GetMeanError();
880 sigmaERROR = ptrProjectionY->GetRMSError();
881 }
882
883 if (monitor_slices_array)
884 monitor_slices_array->Add(ptrProjectionY);
885 else
886 delete ptrProjectionY;
887
888 } else {
889 cout << Form("utilites.h/CreateSmartPojection: WARING: ProjectionY \"%s\" was NOT created",
890 Form("QTCCFDslice_bin_%i_%i", firstbin, lastbin))
891 << endl;
892 }
893
894 ptrProjection->SetBinContent(bin + 1, (IsDrawSIGMA) ? sigma : mean);
895 ptrProjection->SetBinError(bin + 1, (IsDrawSIGMA) ? sigmaERROR * 0.5 : meanERROR * 0.5);
896 }
897
898 if (monitor_slices_array)
899 monitor_slices_array->Add(rebinedhist);
900 else
901 delete rebinedhist;
902
903 delete[] NewBinning;
904 return ptrProjection;
905}
906///////////////////////////////////////////////////////////////////////////////////////////////////
907TObjArray* HDraw(const TObjArray* Histogramms_arr,
908 TString name = "",
909 int Hr = 4,
910 int Vt = 4,
911 const int Pair = 1,
912 int min = 0,
913 int max = 100,
914 int Log = 0,
915 int Leg = 0,
916 const TString param = "",
917 int Norm = 0)
918{
919 gStyle->SetPalette(1);
920
921 // name, HxV,number paired hits, min, max,log (1 - y, 2 - z), legend (0-no, 1-all, 2-first pad)
922 int H_Last = Histogramms_arr->GetLast();
923 if (H_Last <= 0)
924 return NULL;
925
926 if (min < 0)
927 min = 0;
928 if (min > H_Last)
929 min = H_Last;
930 if (max < 0)
931 max = 0;
932 if (max > H_Last)
933 max = H_Last;
934 if (Hr < 1)
935 Hr = 1;
936 if (Vt < 1)
937 Vt = 1;
938 if ((Leg == 2) && (Hr * Vt == 1))
939 Leg = 0;
940
941 if (name == "")
942 name = Histogramms_arr->GetName();
943
944 TObjArray* Canvas_arr = new TObjArray();
945 Canvas_arr->SetOwner();
946
947 int flagD = Hr * Vt;
948
949 for (int t = min; t <= max; t++) {
950 //((TH1F*)Histogramms_arr->At(t)) -> SetLineWidth(3);
951 // ((TH1F*)Histogramms_arr->At(t)) -> SetLineColor(t%Pair +1);
952 //((TH1F*)Histogramms_arr->At(t)) -> SetFillColor(t%Pair +1);
953 //((TH1F*)Histogramms_arr->At(t)) -> SetFillStyle(3001);
954 //((TH1F*)Histogramms_arr->At(t)) -> SetMarkerColor(t%Pair +1);
955 }
956
957 for (int t = min; t <= max; t++) {
958
959 if (++flagD > Hr * Vt) {
960 char n_Canv[30];
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);
964 flagD = 1;
965 }
966
967 int t_0 = t;
968 ((TCanvas*)Canvas_arr->Last())->cd(flagD);
969 // if(Histogramms_arr->At(t) != NULL)
970 if (!Norm) {
971 ((TH1F*)Histogramms_arr->At(t))->Draw(param.Data());
972 } else
973 // if(Histogramms_arr->At(t) != NULL)
974 ((TH1F*)Histogramms_arr->At(t))->DrawNormalized(param.Data(), 1);
975 for (int c_Pair = 1; c_Pair < Pair; c_Pair++) {
976 t++;
977 // if(Histogramms_arr->At(t) != NULL)
978 if (!Norm) {
979 ((TH1F*)Histogramms_arr->At(t))->Draw("sames");
980 } else
981 // if(Histogramms_arr->At(t) != NULL)
982 ((TH1F*)Histogramms_arr->At(t))->DrawNormalized("sames", 1);
983 }
984
985 // to build big legend on 1st pad drawing hist set twice
986 if ((Leg == 2) && (flagD == 1)) {
987 gPad->BuildLegend(0, 0, 1, 1);
988 flagD++;
989 t = t_0;
990 ((TCanvas*)Canvas_arr->Last())->cd(flagD);
991 // if(Histogramms_arr->At(t) != NULL)
992 if (!Norm)
993 ((TH1F*)Histogramms_arr->At(t))->Draw(param.Data());
994 else
995 // if(Histogramms_arr->At(t) != NULL)
996 ((TH1F*)Histogramms_arr->At(t))->DrawNormalized(param.Data(), 1);
997 for (int c_Pair = 1; c_Pair < Pair; c_Pair++) {
998 t++;
999 // if(Histogramms_arr->At(t) != NULL)
1000 if (!Norm)
1001 ((TH1F*)Histogramms_arr->At(t))->Draw("sames");
1002 else
1003 // if(Histogramms_arr->At(t) != NULL)
1004 ((TH1F*)Histogramms_arr->At(t))->DrawNormalized("sames", 1);
1005 }
1006 }
1007
1008 if (Log == 1)
1009 gPad->SetLogy(1);
1010 if (Log == 2)
1011 gPad->SetLogz(1);
1012
1013 // if(Leg == 1) ;//gPad -> BuildLegend();
1014 }
1015
1016 return Canvas_arr;
1017}
1018///////////////////////////////////////////////////////////////////////////////////////////////////
1019#endif // UTILITES_H
Double_t Sigma(vector< Double_t > dist, vector< Double_t > w)
Definition BmnMath.cxx:890
int i
Definition P4_F32vec4.h:22
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:30
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:31
bool Bool_t
int Int_t
float Float_t
double Double_t
#define gDirectory
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
#define gPad
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual Int_t FindBin(const char *label)
virtual Double_t GetBinCenter(Int_t bin) const
Double_t GetXmax() const
virtual Double_t GetBinLowEdge(Int_t bin) const
Double_t GetXmin() 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
Bool_t cd() override
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
void rmdir(const char *name) override
virtual Bool_t cd()
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
TAxis * GetXaxis()
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)
Int_t Atoi() const
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
Definition utilites.h:41
#define uVERBOSE
Definition utilites.h:44
#define fit_funk_name
Definition utilites.h:45
*brief user defined string literal for JSON values *sa std::size_t n
Definition json.hpp:20362
Int_t SaveArrayOfObjectsArraysInFile(TObjArray *ObjectsArray=0, const TString filename="data", const TString path="./", const Int_t deleteArrays=0)
Definition utilites.h:268
Int_t SaveArrayStructInFile(TCollection *array, TFile *file, TString start_path="")
Definition utilites.h:229
std::ostream & current_out
Definition utilites.h:41
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)
Definition utilites.h:155
Int_t FilesListFromDir(const TString filespath, TObjArray *const collection, Int_t max_num, TString content)
Definition utilites.h:196
TObject * CreateXprofile(const TH1 *sourcehist)
Definition utilites.h:143
Int_t RUNnumberInString(const TString &str)
Definition utilites.h:126
Int_t FitHistogrammSmartInMaxPeak(TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t nRMSfit=2., Double_t RangeXmin=0., Double_t RangeXmax=0.)
Definition utilites.h:457
void ResetArray(TObjArray **array, const TString option)
Definition utilites.h:631
Int_t ConstructFilesListFromDirectory(const TString &Directory, TCollection *const collection)
Definition utilites.h:91
Int_t FitHistogramm(TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t RangeXmin=0., Double_t RangeXmax=0., TString fit_formula="gaus")
Definition utilites.h:523
Int_t FitHistogrammInMaxPeak(TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t PeakWidth, Double_t RangeXmin=0., Double_t RangeXmax=0.)
Definition utilites.h:416
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 utilites.h:907
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 utilites.h:353
Int_t FitHistogrammInRMSRange(TH1 *histogramm, Double_t &mean, Double_t &sigma, Double_t RMSrange, Double_t RangeXmin=0, Double_t RangeXmax=0)
Definition utilites.h:379
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)
Definition utilites.h:718
Double_t Sqrt(Double_t x)
Double_t Abs(Double_t d)
Definition json.hpp:4446