GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
GRootCommands.cxx
Go to the documentation of this file.
1#include "GRootCommands.h"
2#include "Globals.h"
3#include <cstdio>
4//#include <string>
5#include <sstream>
6#include <fstream>
7
8#include "TRint.h"
9#include "TTree.h"
10#include "Getline.h"
11#include "TAxis.h"
12#include "TDirectory.h"
13#include "TFile.h"
14#include "TPolyMarker.h"
15#include "TSpectrum.h"
16#include "TText.h"
17#include "TExec.h"
18#include "TKey.h"
19#include "TObject.h"
20#include "TObjArray.h"
21#include "TH1.h"
22#ifdef HAS_CORRECT_PYTHON_VERSION
23#include "TPython.h"
24#endif
25#include "TTimer.h"
26#include "TF1.h"
27
28#include "GCanvas.h"
29#include "GPeak.h"
30#include "TPeak.h"
31#include "GGaus.h"
32#include "GH2D.h"
33#include "GH1D.h"
34#include "TGRSIOptions.h"
35#include "GNotifier.h"
36
37void Help()
38{
39 std::cout << "This is helpful information." << std::endl;
40}
41
43{
44 std::cout << "this is a list of useful commands." << std::endl;
45}
46
47void Prompt()
48{
49 Getlinem(EGetLineMode::kInit, (static_cast<TRint*>(gApplication))->GetPrompt());
50}
51
52void Version()
53{
54 int ret = system(Form("%s/bin/grsi-config --version", getenv("GRSISYS")));
55 if(ret == -1) {
56 std::cout << "Failed to call grsi-config!" << std::endl;
57 }
58}
59
60bool GetProjection(GH2D* hist, double low, double high, double bg_low, double bg_high)
61{
62 if(hist == nullptr) {
63 return false;
64 }
65 GCanvas* C_projections = nullptr;
66 GCanvas* C_gammagamma = nullptr;
67 if(gROOT->GetListOfCanvases()->FindObject("C_projections")) {
68 C_projections = static_cast<GCanvas*>(gROOT->GetListOfCanvases()->FindObject("C_projections"));
69 } else {
70 C_projections = new GCanvas("C_projections", "Projection Canvas", 0, 0, 1450, 600);
71 C_projections->Divide(2, 1);
72 }
73
74 if(gROOT->GetListOfCanvases()->FindObject("C_gammagamma")) {
75 C_gammagamma = static_cast<GCanvas*>(gROOT->GetListOfCanvases()->FindObject("C_gammagamma"));
76 } else {
77 C_gammagamma = new GCanvas("C_gammagamma", "Gamma-Gamma Canvas", 1700, 0, 650, 650);
78 }
79
80 C_gammagamma->cd();
81 hist->Draw();
82
83 C_projections->cd(1);
84 GH1D* Proj_x = hist->ProjectionX("Gamma_Gamma_xProjection");
85
86 GH1D* Proj_x_Clone = static_cast<GH1D*>(Proj_x->Clone());
87 GH1D* Proj_gated = nullptr;
88
89 if(bg_high > 0 && bg_low > 0) {
90 Proj_x->SetTitle(
91 Form("Projection with Gate From [%.01f,%.01f] and Background [%.01f,%.01f]", low, high, bg_low, bg_high));
92 } else {
93 Proj_x->SetTitle(Form("Projection with Gate From [%.01f,%.01f] NO background", low, high));
94 }
95 Proj_x->GetXaxis()->SetTitle("Energy [keV]");
96 Proj_x->GetYaxis()->SetTitle("Counts ");
97
98 double Grace = 300;
99 double ZoomHigh = high + Grace;
100 double ZoomLow = low - Grace;
101 if(bg_high > 0 && bg_high > high) {
102 ZoomHigh = bg_high + Grace;
103 }
104 if(bg_low > 0 && bg_low < low) {
105 ZoomLow = bg_low - Grace;
106 }
107
108 Proj_x->GetXaxis()->SetRangeUser(ZoomLow, ZoomHigh);
109 Proj_x->Draw();
110 double Projx_Max = Proj_x->GetMaximum();
111 double Projx_Min = Proj_x->GetMinimum();
112
113 auto* CutLow = new TLine(low, Projx_Min, low, Projx_Max);
114 auto* CutHigh = new TLine(high, Projx_Min, high, Projx_Max);
115 auto* BGLow = new TLine(bg_low, Projx_Min, bg_low, Projx_Max);
116 auto* BGHigh = new TLine(bg_high, Projx_Min, bg_high, Projx_Max);
117 CutLow->SetLineColor(kRed);
118 CutHigh->SetLineColor(kRed);
119 CutLow->SetLineWidth(2);
120 CutHigh->SetLineWidth(2);
121 BGLow->SetLineColor(kBlue);
122 BGHigh->SetLineColor(kBlue);
123 BGLow->SetLineWidth(2);
124 BGHigh->SetLineWidth(2);
125 BGLow->SetLineStyle(kDashed);
126 BGHigh->SetLineStyle(kDashed);
127 CutLow->Draw("same");
128 CutHigh->Draw("same");
129 if(bg_low > 0 && bg_high > 0) {
130 BGHigh->Draw("same");
131 BGLow->Draw("same");
132 Proj_gated = Proj_x_Clone->Project_Background(low, high, bg_low, bg_high, EBackgroundSubtraction::kRegionBackground);
133 } else {
134 Proj_gated = Proj_x_Clone->Project(low, high);
135 }
136
137 if(bg_high > 0 && bg_low > 0) {
138 Proj_gated->SetTitle(Form("Gate From [%.01f,%.01f] with Background [%.01f,%.01f]", low, high, bg_low, bg_high));
139 } else {
140 Proj_gated->SetTitle(Form("Gate From [%.01f,%.01f] NO Background", low, high));
141 }
142 Proj_gated->GetXaxis()->SetTitle("Energy [keV]");
143 Proj_gated->GetYaxis()->SetTitle("Counts");
144
145 C_projections->cd(2);
146 Proj_gated->Draw();
147 return true;
148}
149
150int LabelPeaks(TH1* hist, double sigma, double thresh, Option_t*)
151{
152 TSpectrum::StaticSearch(hist, sigma, "Qnodraw", thresh);
153 auto* polyMarker = static_cast<TPolyMarker*>(hist->GetListOfFunctions()->FindObject("TPolyMarker"));
154 if(polyMarker == nullptr) {
155 // something has gone wrong....
156 return 0;
157 }
158 auto* array = static_cast<TObjArray*>(hist->GetListOfFunctions()->FindObject("PeakLabels"));
159 if(array != nullptr) {
160 hist->GetListOfFunctions()->Remove(static_cast<TObject*>(array));
161 array->Delete();
162 }
163 array = new TObjArray();
164 array->SetName("PeakLabels");
165 int n = polyMarker->GetN();
166 if(n == 0) {
167 return n;
168 }
169 double* markerX = polyMarker->GetX();
170 for(int i = 0; i < n; i++) {
171 double y = 0;
172 for(double i_x = markerX[i] - 3; i_x < markerX[i] + 3; i_x++) {
173 if((hist->GetBinContent(hist->GetXaxis()->FindBin(i_x))) > y) {
174 y = hist->GetBinContent(hist->GetXaxis()->FindBin(i_x));
175 }
176 }
177 y += y * 0.1;
178 auto* text = new TText(markerX[i], y, Form("%.1f", markerX[i]));
179 text->SetTextSize(0.025);
180 text->SetTextAngle(90);
181 text->SetTextAlign(12);
182 text->SetTextFont(42);
183 text->SetTextColor(hist->GetLineColor());
184 array->Add(text);
185 }
186 hist->GetListOfFunctions()->Remove(polyMarker);
187 polyMarker->Delete();
188 hist->GetListOfFunctions()->Add(array);
189 return n;
190}
191
192bool ShowPeaks(TH1** hists, unsigned int nhists, double sigma, double thresh)
193{
194 int num_found = 0;
195 for(unsigned int i = 0; i < nhists; i++) {
196 if(TObject* obj = hists[i]->GetListOfFunctions()->FindObject("PeakLabels")) {
197 hists[i]->GetListOfFunctions()->Remove(obj);
198 (static_cast<TObjArray*>(obj))->Delete();
199 }
200 num_found += LabelPeaks(hists[i], sigma, thresh, "");
201 }
202 return num_found != 0;
203}
204
205bool RemovePeaks(TH1** hists, unsigned int nhists)
206{
207 bool flag = false;
208 for(unsigned int i = 0; i < nhists; i++) {
209 if(TObject* obj = hists[i]->GetListOfFunctions()->FindObject("PeakLabels")) {
210 hists[i]->GetListOfFunctions()->Remove(obj);
211 (static_cast<TObjArray*>(obj))->Delete();
212 flag = true;
213 }
214 }
215 return flag;
216}
217
218std::vector<TH1*> FindHists(int dim)
219{
220 std::vector<TH1*> tempVec;
221 for(auto* obj : *(gPad->GetListOfPrimitives())) {
222 if(obj->InheritsFrom(TH1::Class())) {
223 TH1* hist = static_cast<TH1*>(obj);
224 if(hist->GetDimension() == dim) {
225 tempVec.push_back(hist);
226 }
227 }
228 }
229 return tempVec;
230}
231
232bool Move1DHistogram(const Int_t& key, TH1* histogram)
233{
234 /// Moves displayed 1D histograms by 50% of the visible range left, right.
235 /// For "normal" TH1 histograms up/down scales the y-axis up/down by a factor of 2.
236 /// For GH1D histograms up/down selects the next (up) or previous (down) GH1D histogram.
237 bool edited = false;
238 std::vector<TH1*> hists;
239 if(histogram != nullptr) {
240 hists.push_back(histogram);
241 } else {
242 hists = FindHists(1);
243 }
244 if(hists.empty()) {
245 return edited;
246 }
247
248 // get first and last bin in current range
249 int first = hists.at(0)->GetXaxis()->GetFirst();
250 int last = hists.at(0)->GetXaxis()->GetLast();
251
252 // first is 1 if no range is defined but can be 0, last is fNbins if no range is defined but can be 0
253 // so min will always be 0, and max will always be fNbins+1
254 int min = std::min(first, 0);
255 int max = std::max(last, hists.at(0)->GetXaxis()->GetNbins() + 1);
256
257 int xdiff = last - first;
258 int mdiff = max - min - 2; // this will always be fNbins-1
259
260 // try and cast histogram to GH1D, will be a null pointer if the histogram is not a GH1D
261 GH1D* gHist = dynamic_cast<GH1D*>(hists.at(0));
262
263 // get current y-range
264 double yMin = hists.at(0)->GetMinimum();
265 double yMax = hists.at(0)->GetMaximum();
266
267 switch(key) {
268 case kGRSIArrowLeft:
269 if(mdiff > xdiff) {
270 // try and move left by half the current range
271 if(first == (min + 1)) {
272 // if first is 1 we can't go any further left
273 } else if((first - (xdiff / 2)) < min) {
274 first = min + 1;
275 last = min + (xdiff) + 1;
276 } else {
277 first = first - (xdiff / 2);
278 last = last - (xdiff / 2);
279 }
280 }
281 for(auto* hist : hists) {
282 hist->GetXaxis()->SetRange(first, last);
283 }
284 edited = true;
285 break;
286 case kGRSIArrowRight:
287 if(mdiff > xdiff) {
288 // try and move right by half the current range
289 if(last == (max - 1)) {
290 // last is fNbins so we can't move further right
291 } else if((last + (xdiff / 2)) > max) {
292 first = max - 1 - (xdiff);
293 last = max - 1;
294 } else {
295 last = last + (xdiff / 2);
296 first = first + (xdiff / 2);
297 }
298 }
299 for(auto* hist : hists) {
300 hist->GetXaxis()->SetRange(first, last);
301 }
302
303 edited = true;
304 break;
305 case kGRSIArrowUp:
306 if(gHist != nullptr) {
307 TH1* next = gHist->GetNext();
308 if(next != nullptr) {
309 next->GetXaxis()->SetRange(first, last);
310 next->Draw("");
311 edited = true;
312 }
313 } else {
314 for(auto* hist : hists) {
315 hist->GetYaxis()->SetRangeUser(yMin, yMin + (yMax - yMin) / 2.);
316 }
317 }
318 break;
319
320 case kGRSIArrowDown:
321 if(gHist != nullptr) {
322 TH1* prev = gHist->GetPrevious();
323 if(prev != nullptr) {
324 prev->GetXaxis()->SetRange(first, last);
325 prev->Draw("");
326 edited = true;
327 }
328 } else {
329 for(auto* hist : hists) {
330 hist->GetYaxis()->SetRangeUser(yMin, yMin + (yMax - yMin) * 2.);
331 }
332 }
333 break;
334 default:
335 std::cout << "Move1DHistogram: unknown key = " << key << hex(key) << std::endl;
336 break;
337 }
338 return edited;
339}
340
341bool Move2DHistogram(const Int_t& key, TH2* histogram)
342{
343 /// Moves displayed 2D histograms by 50% of the visible range left, right, up, or down
344
345 bool edited = false;
346 std::vector<TH1*> hists;
347 if(histogram != nullptr) {
348 hists.push_back(histogram);
349 } else {
350 hists = FindHists(2);
351 }
352
353 int firstX = hists.at(0)->GetXaxis()->GetFirst();
354 int lastX = hists.at(0)->GetXaxis()->GetLast();
355 int firstY = hists.at(0)->GetYaxis()->GetFirst();
356 int lastY = hists.at(0)->GetYaxis()->GetLast();
357
358 int minX = std::min(firstX, 0);
359 int maxX = std::max(lastX, hists.at(0)->GetXaxis()->GetNbins() + 1);
360 int minY = std::min(firstY, 0);
361 int maxY = std::max(lastY, hists.at(0)->GetYaxis()->GetNbins() + 1);
362
363 int xdiff = lastX - firstX;
364 int mxdiff = maxX - minX - 2;
365 int ydiff = lastY - firstY;
366 int mydiff = maxY - minY - 2;
367
368 switch(key) {
369 case kGRSIArrowLeft:
370 if(mxdiff > xdiff) {
371 if(firstX == (minX + 1)) {
372 } else if((firstX - (xdiff / 2)) < minX) {
373 firstX = minX + 1;
374 lastX = minX + (xdiff) + 1;
375 } else {
376 firstX = firstX - (xdiff / 2);
377 lastX = lastX - (xdiff / 2);
378 }
379 }
380 for(auto* hist : hists) {
381 hist->GetXaxis()->SetRange(firstX, lastX);
382 }
383
384 edited = true;
385 break;
386 case kGRSIArrowRight:
387 if(mxdiff > xdiff) {
388 if(lastX == (maxX - 1)) {
389 } else if((lastX + (xdiff / 2)) > maxX) {
390 firstX = maxX - 1 - (xdiff);
391 lastX = maxX - 1;
392 } else {
393 lastX = lastX + (xdiff / 2);
394 firstX = firstX + (xdiff / 2);
395 }
396 }
397 for(auto* hist : hists) {
398 hist->GetXaxis()->SetRange(firstX, lastX);
399 }
400
401 edited = true;
402 break;
403 case kGRSIArrowUp:
404 if(mydiff > ydiff) {
405 if(lastY == (maxY - 1)) {
406 } else if((lastY + (ydiff / 2)) > maxY) {
407 firstY = maxY - 1 - ydiff;
408 lastY = maxY - 1;
409 } else {
410 firstY = firstY + (ydiff / 2);
411 lastY = lastY + (ydiff / 2);
412 }
413 }
414 for(auto* hist : hists) {
415 hist->GetYaxis()->SetRange(firstY, lastY);
416 }
417
418 edited = true;
419 break;
420 case kGRSIArrowDown:
421 if(mydiff > ydiff) {
422 if(firstY == (minY + 1)) {
423 //
424 } else if((firstY - (ydiff / 2)) < minY) {
425 firstY = minY + 1;
426 lastY = minY + (ydiff) + 1;
427 } else {
428 firstY = firstY - (ydiff / 2);
429 lastY = lastY - (ydiff / 2);
430 }
431 }
432 for(auto* hist : hists) {
433 hist->GetYaxis()->SetRange(firstY, lastY);
434 }
435
436 edited = true;
437 break;
438 default:
439 std::cout << "Move2DHistogram: unknown key = " << key << hex(key) << std::endl;
440 break;
441 }
442 return edited;
443}
444
445// bool PeakFit(TH1 *hist,Double_t xlow, Double_t xhigh,Option_t *opt) {
446// if(!hist)
447// return;
448// TString option = opt;
449//}
450
451GGaus* GausFit(TH1* hist, double xlow, double xhigh, Option_t* opt)
452{
453 // bool edit = false;
454 if(hist == nullptr) {
455 return nullptr;
456 }
457 if(xlow > xhigh) {
458 std::swap(xlow, xhigh);
459 }
460
461 // std::cout<<"here."<<std::endl;
462
463 auto* mypeak = new GGaus(xlow, xhigh);
464 std::string options = opt;
465 options.append("Q+");
466 mypeak->Fit(hist, options.c_str());
467 // mypeak->Background()->Draw("SAME");
468 auto* bg = new TF1(*mypeak->Background());
469 hist->GetListOfFunctions()->Add(bg);
470 // edit = true;
471
472 return mypeak;
473}
474
475TF1* DoubleGausFit(TH1* hist, double, double, double xlow, double xhigh, Option_t* opt)
476{
477 if(hist == nullptr) {
478 return nullptr;
479 }
480 if(xlow > xhigh) {
481 std::swap(xlow, xhigh);
482 }
483
484 // std::cout<<"here."<<std::endl;
485
486 auto* mypeak = new GGaus(xlow, xhigh);
487 std::string options = opt;
488 options.append("Q+");
489 mypeak->Fit(hist, options.c_str());
490 // mypeak->Background()->Draw("SAME");
491 auto* bg = new TF1(*mypeak->Background());
492 hist->GetListOfFunctions()->Add(bg);
493 // edit = true;
494
495 return mypeak;
496}
497
498GPeak* PhotoPeakFit(TH1* hist, double xlow, double xhigh, Option_t* opt)
499{
500 // bool edit = 0;
501 if(hist == nullptr) {
502 return nullptr;
503 }
504 if(xlow > xhigh) {
505 std::swap(xlow, xhigh);
506 }
507
508 auto* mypeak = new GPeak((xlow + xhigh) / 2.0, xlow, xhigh);
509 std::string options = opt;
510 options.append("+");
511 mypeak->Fit(hist, options.c_str());
512 auto* bg = new TF1(*mypeak->Background());
513 hist->GetListOfFunctions()->Add(bg);
514
515 return mypeak;
516}
517
518TPeak* AltPhotoPeakFit(TH1* hist, double xlow, double xhigh, Option_t* opt)
519{
520 // bool edit = 0;
521 if(hist == nullptr) {
522 return nullptr;
523 }
524 if(xlow > xhigh) {
525 std::swap(xlow, xhigh);
526 }
527
528 // std::cout<<"here."<<std::endl;
529
530 auto* mypeak = new TPeak((xlow + xhigh) / 2.0, xlow, xhigh);
531 mypeak->Fit(hist, opt);
532 // mypeak->Background()->Draw("SAME");
533 auto* bg = new TF1(*mypeak->Background());
534 hist->GetListOfFunctions()->Add(bg);
535 // edit = true;
536
537 return mypeak;
538}
539
540std::string MergeStrings(const std::vector<std::string>& strings, char split)
541{
542 std::ostringstream ss;
543 for(auto it = strings.begin(); it != strings.end(); it++) {
544 ss << *it;
545
546 auto next = it;
547 next++;
548 if(next != strings.end()) {
549 ss << split;
550 }
551 }
552 return ss.str();
553}
554
555TH1* GrabHist(int i)
556{
557 // return the histogram from the current canvas, pad i.
558 TH1* hist = nullptr;
559 if(!gPad) {
560 return hist;
561 }
562 TIter iter(gPad->GetListOfPrimitives());
563 int j = 0;
564 while(TObject* obj = iter.Next()) {
565 if(obj->InheritsFrom(TH1::Class())) {
566 if(j == i) {
567 hist = static_cast<TH1*>(obj);
568 break;
569 }
570 j++;
571 }
572 }
573 return hist;
574}
575
576TF1* GrabFit(int i)
577{
578 // return the histogram from the current canvas, pad i.
579 TH1* hist = nullptr;
580 TF1* fit = nullptr;
581 if(!gPad) {
582 return fit;
583 }
584 TIter iter(gPad->GetListOfPrimitives());
585 int j = 0;
586 while(TObject* obj = iter.Next()) {
587 if(obj->InheritsFrom(TH1::Class())) {
588 hist = static_cast<TH1*>(obj);
589 TIter iter2(hist->GetListOfFunctions());
590 while(TObject* obj2 = iter2.Next()) {
591 if(obj2->InheritsFrom(TF1::Class())) {
592 if(j == i) {
593 fit = static_cast<TF1*>(obj2);
594 return fit;
595 }
596 j++;
597 }
598 }
599 }
600 }
601 return fit;
602}
603
604namespace {
605bool gui_is_running = false;
606}
607
608#ifdef HAS_CORRECT_PYTHON_VERSION
610{
611 std::string script_filename = Form("%s/pygui/grut-view.py", getenv("GRSISYS"));
612 std::ifstream script(script_filename);
613 std::string script_text((std::istreambuf_iterator<char>(script)), std::istreambuf_iterator<char>());
614 TPython::Exec(script_text.c_str());
615
616 auto* gui_timer = new TTimer(R"lit(TPython::Exec("update()");)lit", 10, true);
617 gui_timer->TurnOn();
618
619 gui_is_running = true;
620 for(int i = 0; i < gROOT->GetListOfFiles()->GetSize(); i++) {
621 TPython::Bind(static_cast<TFile*>(gROOT->GetListOfFiles()->At(i)), "tdir");
622 gROOT->ProcessLine(R"lit(TPython::Exec("window.AddDirectory(tdir)");)lit");
623 }
624}
625#else
626void StartGUI()
627{
628 std::cout << "Cannot start gui, requires ROOT compiled against python 2.7" << std::endl;
629}
630#endif
631
633{
634 return gui_is_running;
635}
636
637#ifdef HAS_CORRECT_PYTHON_VERSION
638void AddFileToGUI(TFile* file)
639{
640 // Pass the TFile to the python GUI.
641 if((file != nullptr) && GUIIsRunning()) {
642 TPython::Bind(file, "tdir");
643 gROOT->ProcessLine(R"lit(TPython::Exec("window.AddDirectory(tdir)");)lit");
644 }
645}
646#else
647void AddFileToGUI(TFile*)
648{
649}
650#endif
651
652TH2* AddOffset(TH2* mat, double offset, EAxis axis)
653{
654 TH2* toreturn = nullptr;
655 if(mat == nullptr) {
656 return toreturn;
657 }
658 // int dim = mat->GetDimension();
659 int xmax = mat->GetXaxis()->GetNbins() + 1;
660 int ymax = mat->GetYaxis()->GetNbins() + 1;
661 toreturn = static_cast<TH2*>(mat->Clone(Form("%s_offset", mat->GetName())));
662 toreturn->Reset();
663
664 for(int x = 0; x < xmax; x++) {
665 for(int y = 0; y < ymax; y++) {
666 double newx = mat->GetXaxis()->GetBinCenter(x);
667 double newy = mat->GetYaxis()->GetBinCenter(y);
668 ;
669 double bcont = mat->GetBinContent(x, y);
670 if((axis & EAxis::kXAxis) != static_cast<EAxis>(0)) {
671 newx += offset;
672 }
673 if((axis & EAxis::kYAxis) != static_cast<EAxis>(0)) {
674 newy += offset;
675 }
676 toreturn->Fill(newx, newy, bcont);
677 }
678 }
679 return toreturn;
680}
681
683{
684 return static_cast<EAxis>(
685 static_cast<std::underlying_type<EAxis>::type>(lhs) &
686 static_cast<std::underlying_type<EAxis>::type>(rhs));
687}
bool RemovePeaks(TH1 **hists, unsigned int nhists)
std::vector< TH1 * > FindHists(int dim)
TF1 * DoubleGausFit(TH1 *hist, double, double, double xlow, double xhigh, Option_t *opt)
void AddFileToGUI(TFile *file)
void Help()
EAxis operator&(EAxis lhs, EAxis rhs)
TH2 * AddOffset(TH2 *mat, double offset, EAxis axis)
TF1 * GrabFit(int i)
std::string MergeStrings(const std::vector< std::string > &strings, char split)
GPeak * PhotoPeakFit(TH1 *hist, double xlow, double xhigh, Option_t *opt)
void Prompt()
void Commands()
int LabelPeaks(TH1 *hist, double sigma, double thresh, Option_t *)
bool GetProjection(GH2D *hist, double low, double high, double bg_low, double bg_high)
bool Move1DHistogram(const Int_t &key, TH1 *histogram)
bool GUIIsRunning()
void StartGUI()
bool ShowPeaks(TH1 **hists, unsigned int nhists, double sigma, double thresh)
bool Move2DHistogram(const Int_t &key, TH2 *histogram)
TPeak * AltPhotoPeakFit(TH1 *hist, double xlow, double xhigh, Option_t *opt)
TH1 * GrabHist(int i)
GGaus * GausFit(TH1 *hist, double xlow, double xhigh, Option_t *opt)
void Version()
EAxis
@ kGRSIArrowLeft
@ kGRSIArrowRight
@ kGRSIArrowDown
@ kGRSIArrowUp
std::string hex(T val, int width=-1)
Definition Globals.h:129
TH2D * mat
Definition UserFillObj.h:12
TH1D * hist
Definition UserFillObj.h:3
Definition GGaus.h:9
Definition GH1D.h:17
GH1D * Project_Background(double value_low, double value_high, double bg_value_low, double bg_value_high, EBackgroundSubtraction mode=EBackgroundSubtraction::kRegionBackground) const
Definition GH1D.cxx:190
GH1D * GetNext(bool DrawEmpty=false) const
Definition GH1D.cxx:157
GH1D * GetPrevious(bool DrawEmpty=false) const
Definition GH1D.cxx:144
GH1D * Project(int bins=-1)
Definition GH1D.cxx:220
void Draw(Option_t *opt="") override
Definition GH1D.cxx:108
Definition GH2D.h:18
Definition GPeak.h:11
Definition TPeak.h:28