ATLAS Offline Software
Loading...
Searching...
No Matches
computils.cxx
Go to the documentation of this file.
1
9
10// cppcheck-suppress-file stlIfStrFind; cannot use C++20 starts_with in this standalone code
11
12#include <stdlib.h>
13#include <sys/time.h>
14#include <sys/stat.h>
15#include <sys/types.h>
16#include <glob.h>
17#include <stdint.h>
18
19#include <iostream>
20#include <string>
21#include <vector>
22
23#include "label.h"
24#include "DrawLabel.h"
25
26#include "TFile.h"
27#include "TKey.h"
28#include "TTree.h"
29#include "TList.h"
30#include "TObject.h"
31#include "TDirectory.h"
32#include "TH1D.h"
33#include "TLine.h"
34
35#include "TLegend.h"
36#include "TColor.h"
37
38#include "computils.h"
39
40bool LINEF = true;
41bool LINES = false;
42
43
44bool JLflag = false;
45
46bool Plots::s_watermark = true;
47
48int colours[6] = { 1, 2, kBlue-4, 6, kCyan-2, kMagenta+2 };
49int markers[6] = { 20, 24, 25, 26, 25, 22 };
50double msizes[6] = { 0.85, 1, 1, 1, 1, 1 };
51
52
53void band_intersect( double& x0, double& x1, double& y0, double& y1, double ylo, double yhi ) {
54
55 double x0t = x0;
56 double x1t = x1;
57
58 double y0t = y0;
59 double y1t = y1;
60
61 if ( ylo!=-999 ) {
62 if ( y0>ylo && y1<ylo) {
63 double y = ylo;
64 double x = (ylo-y0)*(x1-x0)/(y1-y0)+x0;
65 x1t = x;
66 y1t = y;
67 }
68
69 if ( y0<ylo && y1>ylo) {
70 double y = ylo;
71 double x = x1-(y1-ylo)*(x1-x0)/(y1-y0);
72 x0t = x;
73 y0t = y;
74 }
75
76 if ( y0<ylo && y1<ylo) {
77 y0t = ylo;
78 y1t = ylo;
79 }
80
81 x0 = x0t;
82 x1 = x1t;
83 y0 = y0t;
84 y1 = y1t;
85
86 return;
87 }
88
89 if ( yhi!=-999 ) {
90 if ( y0<yhi && y1>yhi) {
91 double y = yhi;
92 double x = (yhi-y0)*(x1-x0)/(y1-y0)+x0;
93 x1t = x;
94 y1t = y;
95 }
96
97 if ( y0>yhi && y1<yhi) {
98 double y = yhi;
99 double x = x1-(y1-yhi)*(x1-x0)/(y1-y0);
100 x0t = x;
101 y0t = y;
102 }
103
104 x0 = x0t;
105 x1 = x1t;
106 y0 = y0t;
107 y1 = y1t;
108
109 return;
110 }
111
112}
113
114
115void band_plot( TH1* h, double xlo, double xhi, double ylo, double yhi ) {
116
117 // bool first = true;
118 bool last = true;
119
120 int ifirst = -1;
121 // int ilast = -1;
122
123 for ( int i=h->GetNbinsX()+1 ; i-- ; ) {
124 double yt = h->GetBinContent(i);
125 if ( last && ( yt<ylo || ( yt==0 && ylo==0 ) ) ) continue;
126 // ilast = i+1;
127 last = false;
128 break;
129 }
130
131 if ( JLflag ) {
132 // if ( contains( std::string(h->GetName()), "vs_mu") ) ilast = h->FindBin(80);
133 if ( contains( std::string(h->GetName()), "vs_mu") ) h->GetXaxis()->SetRangeUser( 18, 58 );
134 if ( contains( std::string(h->GetName()), "a0_eff") ) h->GetXaxis()->SetRangeUser( -190, 200 );
135 // if ( contains( std::string(h->GetName()), "a0") ) h->GetXaxis()->SetRangeUser( -200, 200 );
136 }
137
138 for ( int i=1 ; i<=h->GetNbinsX()+1 ; i++ ) {
139
140 double x0 = h->GetBinCenter(i);
141 double x1 = h->GetBinCenter(i+1);
142
143 if ( JLflag ) {
144 if ( contains( std::string(h->GetName()), "vs_mu") && x0<18 ) continue;
145 if ( contains( std::string(h->GetName()), "vs_mu") && x1>58 ) continue;
146
147 if ( contains( std::string(h->GetName()), "a0_eff") && x0<-200 ) continue;
148 if ( contains( std::string(h->GetName()), "a0_eff") && x1> 200 ) continue;
149 }
150
151 // if ( first && ( _y<ylo || ( _y==0 && ylo==0 ) ) ) continue;
152
153 if ( ifirst<0 ) ifirst = i;
154
155 // if ( ilast>0 && (i+1)>ilast ) continue;
156
157 // first = false;
158
159 double x0_1 = x0;
160 double x1_1 = x1;
161
162 if ( xlo!=-999 && x0<xlo ) continue;
163 if ( xhi!=-999 && x1>xhi ) continue;
164
165 double y0_up = h->GetBinContent(i) + h->GetBinError(i);
166 double y1_up = h->GetBinContent(i+1) + h->GetBinError(i+1);
167 double y0_lo = h->GetBinContent(i) - h->GetBinError(i);
168 double y1_lo = h->GetBinContent(i+1) - h->GetBinError(i+1);
169
170 band_intersect( x0, x1, y0_up, y1_up, ylo, yhi );
171 band_intersect( x0_1, x1_1, y0_lo, y1_lo, ylo, yhi );
172
173 TLine* t0 = new TLine( x0, y0_up, x1, y1_up );
174 TLine* t1 = new TLine( x0_1, y0_lo, x1_1, y1_lo );
175
176 t0->SetLineColor( h->GetLineColor() );
177 t0->Draw();
178
179 t1->SetLineColor( h->GetLineColor() );
180 t1->Draw();
181
182 // std::cout << h->GetName() << "\tx1: " << x1 << std::endl;
183
184 }
185
186 // if ( contains( std::string(h->GetName()), "vs_mu") ) ilast = h->FindBin(80);
187
188 // if ( ilast>0 && ifirst>0 ) h->GetXaxis()->SetRange( ifirst, ilast );
189
190 if ( h->GetLineColor()>10 ) h->SetFillStyle(3395);
191 else h->SetFillStyle(3354);
192
193 h->SetFillColor(h->GetLineColor());
194 // h->DrawCopy("same e3lhist" );
195
196
197}
198
199
200
201
202double Entries( TH1* h ) {
203 double n = 0;
204 for ( int i=h->GetNbinsX()+1 ; --i ; ) n += h->GetBinContent(i);
205 return n;
206}
207
208
209double integral( TH1* h ) {
210 double n=0;
211 for ( int i=h->GetNbinsX() ; i>0 ; i-- ) n += h->GetBinContent(i);
212 return n;
213}
214
215
216
217void Norm( TH1* h, double scale, double xmin, double xmax ) {
218 double n = 0;
219
220 if ( xmin==0 && xmax==0 ) {
221 for ( int i=h->GetNbinsX()+2 ; --i ; ) n += h->GetBinContent(i);
222 }
223 else {
224 for ( int i=h->GetNbinsX()+2 ; --i ; ) {
225 double x = h->GetBinCenter(i);
226 if ( x>xmin && x<xmax ) n += h->GetBinContent(i);
227 }
228 }
229
230 if ( n!=0 ) {
231 double in=scale/n;
232 for ( int i=h->GetNbinsX()+2 ; --i ; ) {
233 h->SetBinContent(i, h->GetBinContent(i)*in );
234 h->SetBinError(i, h->GetBinError(i)*in );
235 }
236 }
237
238}
239
240
241
243 m_mean(0), m_error(0) {
244
245 double f = 0;
246 double fx = 0;
247 double fx2 = 0;
248
249 for ( int i=0 ; i<h->GetNbinsX() ; i++ ) {
250 double w = h->GetBinLowEdge(i+2)-h->GetBinLowEdge(i+1);
251 f += h->GetBinContent(i+1)*w;
252 fx += h->GetBinContent(i+1)*w*h->GetBinCenter(i+1);
253 fx2 += h->GetBinContent(i+1)*w*h->GetBinCenter(i+1)*h->GetBinCenter(i+1);
254 }
255
256 if ( f!=0 ) {
257 m_mean = fx/f;
258 m_error = std::sqrt( (fx2/f - m_mean*m_mean )/f );
259 }
260
261}
262
263
264
265
266
267
268
269union floaty_t {
270 floaty_t( float n = 0.0f ) : f(n) {}
271
274 bool negative() const { return i < 0; }
275
277 int32_t raw_mantissa() const { return i & ((1 << 23) - 1); }
279 int32_t raw_exponent() const { return (i >> 23) & 0xff; }
280
281 int32_t i;
282 float f;
283};
284
285
286bool almost_equal( floaty_t a, floaty_t b, int max_diff ) {
287
288 // Check for trivial equality to make sure +0==-0
289 if ( a.f == b.f ) return true;
290
291 // Different signs means they do not match.
292 if ( a.negative() != b.negative() ) return false;
293
294 // Find the difference in last place units
295 int ulps_diff = std::abs( a.i - b.i );
296 if (ulps_diff <= max_diff) return true;
297
298 return false;
299}
300
301
302bool almost_equal( float a, float b, int max_diff ) {
303 return almost_equal( floaty_t(a), floaty_t(b), max_diff );
304}
305
306
309 return almost_equal( a, b, 5 );
310}
311
312
313void trim_tgraph( TH1* h, TGraphAsymmErrors* t ) {
314
315 double ylo = h->GetMinimum();
316
317 int ih=1;
318
319 for ( int i=0 ; i<t->GetN() && ih<=h->GetNbinsX() ; i++, ih++ ) {
320
321 double yt = 0;
322 double xt = 0;
323 double ye = 0;
324
325 t->GetPoint( i, xt, yt );
326 ye = t->GetErrorYlow( i );
327
328 double yh = h->GetBinContent(ih);
329 double xh = h->GetBinCenter(ih);
330
331 while( !almost_equal( xh, xt, 5 ) && ih<=h->GetNbinsX() ) {
332 ih++;
333 yh = h->GetBinContent(ih);
334 xh = h->GetBinCenter(ih);
335 }
336
337 if ( !almost_equal( yh, yt, 5 ) ) throw data_mismatch(std::string("for histogram ")+h->GetName());
338
339 if ( (yt-ye) < ylo ) {
340 h->SetBinContent(ih, ylo-100 );
341 t->SetPoint( i, xt, ylo-10000 );
342 }
343
344 }
345}
346
347
348void ATLASFORAPP_LABEL( double x, double y, int color, double size )
349{
350 TLatex* lat = new TLatex(); //lat.SetTextAlign(12); lat.SetTextSize(tsize);
351 lat->SetNDC();
352 lat->SetTextFont(72);
353 lat->SetTextColor(color);
354 lat->SetTextSize(size);
355 lat->DrawLatex(x,y,"ATLAS");
356
357 TLatex* lat2 = new TLatex(); //lat.SetTextAlign(12); lat.SetTextSize(tsize);
358 lat2->SetNDC();
359 lat2->SetTextFont(52);
360 lat2->SetTextColor(color);
361 lat2->SetTextSize(size); // this 0.13 should really be calculated as a ratio of the width of the canvas
362 lat2->DrawLatex(x+0.13,y,"For Approval");
363}
364
365void myText( Double_t x, Double_t y, Color_t color, const std::string& text, Double_t tsize) {
366 //Double_t tsize=0.05;
367 TLatex lat; lat.SetTextAlign(12); lat.SetTextSize(tsize);
368 lat.SetNDC();
369 lat.SetTextColor(color);
370 lat.DrawLatex(x,y,text.c_str());
371}
372
373
374std::string stime() {
375 time_t t;
376 time(&t);
377 return label("%s", ctime(&t) );
378}
379
380
382bool contains( const std::string& s, const std::string& p) {
383 return (s.find(p)!=std::string::npos);
384}
385
386
387bool contains( const std::string& s, char p) noexcept {
388 return (s.find(p)!=std::string::npos);
389}
390
391
393bool fcontains( const std::string& s, const std::string& p) {
394 return (s.find(p)==0);
395}
396
397
398double plotable( TH1* h ) { // , double xlo, double xhi ) {
399 double n = 0;
400
401 double xlo = h->GetBinLowEdge(1);
402 double xhi = h->GetBinLowEdge(h->GetNbinsX()+1);
403
404 // if ( xlo!=-999 ) _xlo = xlo;
405 // if ( xhi!=-999 ) _xhi = xhi;
406
407 for ( int i=h->GetNbinsX()+1 ; --i ; ) {
408 if ( h->GetBinCenter(i)>xlo && h->GetBinCenter(i)<xhi ) n += h->GetBinContent(i);
409 }
410 return n;
411}
412
413
414
415bool exists( const std::string& filename ) {
416 struct stat sb;
417 if ( stat( filename.c_str(), &sb)==0 ) return true; // && S_ISREG(sb.st_mode ))
418 else return false;
419}
420
421
422
423std::string globbed( const std::string& s ) {
426
427 glob_t glob_result;
428 glob( s.c_str(), GLOB_TILDE, 0, &glob_result );
429
430 std::vector<std::string> ret;
431 for( unsigned i=0 ; i<glob_result.gl_pathc ; i++ ){
432 ret.push_back( std::string(glob_result.gl_pathv[i]) );
433 }
434 globfree(&glob_result);
435
436
437 if ( ret.empty() ) {
438 std::cerr << "no matching file: " << s << std::endl;
439 return "";
440 }
441
442 if ( ret.size()>1 ) {
443 for ( unsigned i=0 ; i<ret.size() ; i++ ) {
444 std::cout << "matched " << ret[i] << std::endl;
445 }
446 }
447
448 return ret[0];
449}
450
451
452
453
454
455bool empty( TH1* h ) {
456 for ( int i=h->GetNbinsX() ; i>0 ; i-- ) if ( h->GetBinContent(i)!=0 ) return false;
457 return true;
458}
459
460
461std::string tail( std::string s, const std::string& pattern ) {
462 size_t pos = s.find(pattern);
463 while ( pos != std::string::npos ) {
464 s.erase( 0, pos+1 );
465 pos = s.find(pattern);
466 }
467 return s;
468}
469
470
471std::string head( std::string s, const std::string& pattern ) {
472 size_t pos = s.find_last_of(pattern);
473 if ( pos != std::string::npos ) {
474 s.erase( pos, s.size() );
475 }
476 return s;
477}
478
479
480void contents( std::vector<std::string>& keys, TDirectory* td,
481 const std::string& directory, const std::string& pattern, const std::string& path ) {
482 std::vector<std::string> patterns;
483 patterns.push_back(pattern);
484 contents( keys, td, directory, patterns, path );
485}
486
487
488
489
490void contents( std::vector<std::string>& keys, TDirectory* td,
491 const std::string& directory, const std::vector<std::string>& patterns, const std::string& path ) {
492
493 bool print = false;
494
495 TList* tl = td->GetListOfKeys();
496
497 for ( int i=tl->GetSize() ; i-- ; ) {
498
499 TKey* tobj = (TKey*)tl->At(i);
500
501 if ( tobj==0 ) continue;
502
503 if ( std::string(tobj->GetClassName()).find("TDirectory")!=std::string::npos ) {
504
505 TDirectory* tnd = (TDirectory*)tobj->ReadObj();
506
508 std::string dname = tnd->GetName();
509
510 std::string newpath = path+dname+"/";
511 contents( keys, tnd, directory, patterns, newpath );
512
513 }
514 else {
517 if ( directory == "" || contains( path, directory ) ) {
518
519
520 bool matched = true;
521 for ( size_t i=patterns.size() ; i-- ; ) {
522 std::string pattern = patterns[i];
523 if ( contains(std::string(tobj->GetName()), pattern ) ) matched &=true;
524 else matched = false;
525 }
526 if ( matched ) {
527 if ( print ) std::cout << "will process " << td->GetName() << " \t:: " << tobj->GetName() << "\tpatterns: " << patterns.size() << std::endl;
528 print = false;
529 keys.push_back( path+tobj->GetName() );
530 }
531 }
532 }
533 }
534}
535
536
537
538
539
540double realmax( TH1* h, bool include_error, double lo, double hi ) {
541
542 double rm = 0;
543 if ( h->GetNbinsX()==0 ) return 0;
544
545 bool first = true;
546 for ( int i=1 ; i<=h->GetNbinsX() ; i++ ) {
547
548 if ( lo!=hi ) {
549 double c = h->GetBinCenter(i);
550 if ( lo>c || hi<c ) continue;
551 }
552
553 double re = h->GetBinContent(i);
554 if ( include_error ) re += h->GetBinError(i);
555 if ( re!=0 ) {
556 if ( first || rm<re ) {
557 rm = re;
558 first = false;
559 }
560 }
561 }
562
563 return rm;
564}
565
566
567// double realmin( TH1* h, bool include_error, double lo, double hi ) {
568double realmin( TH1* h, bool , double lo, double hi ) {
569
570 if ( h->GetNbinsX()==0 ) return 0;
571
572 double rm = 0;
573
574 bool first = true;
575 for ( int i=1 ; i<=h->GetNbinsX() ; i++ ) {
576
577 if ( lo!=hi ) {
578 double c = h->GetBinCenter(i);
579 if ( lo>c || hi<c ) continue;
580 }
581
582 double re = h->GetBinContent(i);
583
584 if ( re!=0 ) {
585 // if ( include_error ) re -= h->GetBinError(i);
586 if ( first || rm>re ) rm = re;
587 first = false;
588 }
589 }
590
591 return rm;
592}
593
594
595double hmean( TH1* h ) {
596 double N = integral(h);
597 double n=0;
598 for ( int i=h->GetNbinsX() ; i>0 ; i-- ) {
599 n += h->GetBinContent(i);
600 if ( 2*n>N ) return h->GetBinCenter(i);
601 }
602 return 0;
603}
604
605
606
607
608std::vector<int> findxrange(TH1* h, bool symmetric ) {
609
610 int ilo = 1;
611 int ihi = h->GetNbinsX();
612
613 h->GetXaxis()->SetRange( ilo, ihi );
614
615 std::vector<int> limits(2,0);
616 limits[0] = ilo;
617 limits[1] = ihi;
618
619 if ( empty(h) ) return limits;
620
621#if 1
622
624 for ( ; ilo<=ihi ; ilo++ ) if ( h->GetBinContent(ilo)!=0 ) break;
625 for ( ; ihi>=ilo ; ihi-- ) if ( h->GetBinContent(ihi)!=0 ) break;
626
627#else
628
630
632
633 double icont = 1/content;
634
635 double flo = 0;
636 double fhi = 0;
637 for ( ; ilo<=ihi ; ilo++ ) {
638 flo += h->GetBinContent(ilo);
639 if ( (flo*icont)>0.0005 ) break;
640 }
641
642 for ( ; ihi>=ilo ; ihi-- ) {
643 fhi += h->GetBinContent(ihi);
644 if ( (fhi*icont)>0.0005 ) break;
645 }
646
647#endif
648
649 int delta_lo = ilo-1;
650 int delta_hi = h->GetNbinsX()-ihi;
651
652 if ( symmetric ) {
653 if ( delta_hi<delta_lo ) {
654 limits[0] = 1+delta_hi;
655 limits[1] = ihi;
656 }
657 else {
658 limits[0] = 1+delta_lo;
659 limits[1] = h->GetNbinsX()-delta_lo;
660 }
661 }
662 else {
663
664 if ( ilo>1 ) ilo--;
665 if ( ihi<h->GetNbinsX() ) ihi++;
666
667 limits[0] = ilo;
668 limits[1] = ihi;
669 }
670
671 return limits;
672
673}
674
675
676
677void xrange(TH1* h, bool symmetric ) {
678 std::vector<int> limits = findxrange( h, symmetric );
679 h->GetXaxis()->SetRange( limits[0], limits[1] );
680}
681
682
683
684
685std::vector<double> findxrangeuser(TH1* h, bool symmetric ) {
686
687 std::vector<int> limits = findxrange( h, symmetric );
688
689 std::vector<double> dlimits(2,0);
690
691 double dx = h->GetBinLowEdge(limits[1]+1)-h->GetBinLowEdge(limits[1]);
692
693 dlimits[0] = h->GetBinLowEdge(limits[0]);
694 dlimits[1] = h->GetBinLowEdge(limits[1]+1)-dx*1e-11;
695
696 return dlimits;
697}
698
699
700void xrangeuser(TH1* h, bool symmetric ) {
701 std::vector<double> limits = findxrangeuser( h, symmetric );
702 h->GetXaxis()->SetRangeUser( limits[0], limits[1] );
703}
704
705
706
707std::string findcell( std::string name, const std::string& regex, const std::string& splitex ) {
708
709 size_t posex = name.find( regex );
710
711 if ( posex==std::string::npos ) return "";
712
713 size_t pos = name.find_last_of( splitex );
714
715 std::string duff = name;
716
717 while ( pos!=std::string::npos && pos>posex+regex.size() ) {
718 name.resize(pos); //pos must be <=string length
719 pos = name.find_last_of( splitex );
720 }
721
722 pos = name.find( regex );
723
724 name = name.substr( pos, name.size() );
725
726 pos = name.find( splitex );
727
728 if ( pos!=std::string::npos ) return name.substr( 0, pos );
729
730 return name;
731}
732
733
734
735std::string findrun( TFile* f ) {
736
737 TDirectory* here = gDirectory;
738
739 f->cd();
740
741 std::cout << "gDirectory::GetName() " << gDirectory->GetName() << std::endl;
742
743 // gDirectory->pwd();
744
745 // gDirectory->ls();
746
747 TList* tl = gDirectory->GetListOfKeys();
748
750
751 for ( int i=0 ; i<tl->GetSize() ; i++ ) {
752
753 TKey* tobj = (TKey*)tl->At(i);
754
755 if ( tobj==0 ) continue;
756
757 if ( std::string(tobj->GetClassName()).find("TDirectory")!=std::string::npos ) {
758
759 TDirectory* tnd = (TDirectory*)tobj->ReadObj();
760
761 std::string name = tnd->GetName();
762
763 if ( name.find( "run_" )==0 ) {
764 here->cd();
765 return name;
766 }
767 }
768 }
769
770 here->cd();
771
772 return "";
773}
774
775
776
777
779
780void copyReleaseInfo( TFile* finput, TFile* foutdir ) {
781
782 std::vector<std::string> release_data;
783
784 if ( finput && foutdir ) {
785
786 TTree* tree = (TTree*)finput->Get("dataTree");
787 TTree* clone = tree->CloneTree();
788
789 foutdir->cd();
790 clone->Write("", TObject::kOverwrite);
791
792 delete clone;
793
794 }
795
796}
const std::regex re(r_e)
static Double_t a
static Double_t t0
size_t size() const
Number of registered mappings.
void print(char *figname, TCanvas *c1)
#define y
#define xt
#define yt
#define x
static const Attributes_t empty
Header file for AthHistogramAlgorithm.
static bool s_watermark
Definition computils.h:1559
true_mean(TH1F *h)
double m_mean
Definition computils.h:145
double m_error
Definition computils.h:146
bool LINES
Definition computils.cxx:41
int markers[6]
Definition computils.cxx:49
bool LINEF
Definition computils.cxx:40
int colours[6]
Definition computils.cxx:48
double plotable(TH1 *h)
std::string findcell(std::string name, const std::string &regex, const std::string &splitex)
bool contains(const std::string &s, const std::string &p)
contains a string
void band_intersect(double &x0, double &x1, double &y0, double &y1, double ylo, double yhi)
Definition computils.cxx:53
void copyReleaseInfo(TFile *finput, TFile *foutdir)
copy the release info TTree
std::vector< double > findxrangeuser(TH1 *h, bool symmetric)
void xrange(TH1 *h, bool symmetric)
std::string stime()
return the current data and time
void contents(std::vector< std::string > &keys, TDirectory *td, const std::string &directory, const std::string &pattern, const std::string &path)
double hmean(TH1 *h)
void xrangeuser(TH1 *h, bool symmetric)
bool operator==(floaty_t a, floaty_t b)
std::string globbed(const std::string &s)
match a file name
double realmax(TH1 *h, bool include_error, double lo, double hi)
void Norm(TH1 *h, double scale, double xmin, double xmax)
double Entries(TH1 *h)
std::string findrun(TFile *f)
bool exists(const std::string &filename)
does a file exist
std::string tail(std::string s, const std::string &pattern)
tail of a string
std::vector< int > findxrange(TH1 *h, bool symmetric)
automatically set the xrange on a histogram
double realmin(TH1 *h, bool, double lo, double hi)
bool JLflag
Definition computils.cxx:44
void band_plot(TH1 *h, double xlo, double xhi, double ylo, double yhi)
double msizes[6]
Definition computils.cxx:50
void ATLASFORAPP_LABEL(double x, double y, int color, double size)
double integral(TH1 *h)
void trim_tgraph(TH1 *h, TGraphAsymmErrors *t)
void myText(Double_t x, Double_t y, Color_t color, const std::string &text, Double_t tsize)
std::string head(std::string s, const std::string &pattern)
head of a string
bool almost_equal(floaty_t a, floaty_t b, int max_diff)
bool fcontains(const std::string &s, const std::string &p)
contains a string at the beginning of the string
std::string label(const std::string &format, int i)
Definition label.h:19
double xmax
Definition listroot.cxx:61
double xmin
Definition listroot.cxx:60
std::vector< std::string > patterns
Definition listroot.cxx:187
TChain * tree
int32_t raw_mantissa() const
float has 23 bit mentissa
floaty_t(float n=0.0f)
bool negative() const
portable extraction of components sign
int32_t i
int32_t raw_exponent() const
and an 8 bit exponent