CbmRoot
CbmQaCanvas.cxx
Go to the documentation of this file.
1 
6 #include "CbmQaCanvas.h"
7 #include "TBuffer.h"
8 #include "TVirtualPad.h"
9 
11 
15 void CbmQaCanvas::Streamer(TBuffer& R__b) {
16 
17  // Save global gPad pointer,
18  // because it will be modified by TCanvas streamer
19  auto store = gPad;
20  if (R__b.IsReading()) {
21  R__b.ReadClassBuffer(CbmQaCanvas::Class(), this);
22  } else {
23  R__b.WriteClassBuffer(CbmQaCanvas::Class(), this);
24  }
25  // restore the global pointer
26  gPad = store;
27 }
28 
29 void CbmQaCanvas::Divide2D(int nPads) {
30  if (nPads < 1) nPads = 1;
31  int rows = (int) sqrt(nPads);
32  int cols = nPads / rows;
33  if (cols * rows < nPads) cols++;
34  TCanvas::Divide(cols, rows);
35 }
CbmQaCanvas::Divide2D
void Divide2D(int nPads)
Divide canvas into nPads in 2D in a nice way.
Definition: CbmQaCanvas.cxx:29
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmQaCanvas.h
Definition of the CbmQaCanvas class.
CbmQaCanvas
Definition: CbmQaCanvas.h:27
ClassImp
ClassImp(CbmQaCanvas)