CbmRoot
Loading...
Searching...
No Matches
CbmQaCanvas Class Reference

#include <CbmQaCanvas.h>

Inheritance diagram for CbmQaCanvas:
[legend]
Collaboration diagram for CbmQaCanvas:
[legend]

Public Member Functions

 CbmQaCanvas ()
 Default constructor needed by the ROOT streamer.
 
template<typename... Types>
 CbmQaCanvas (Types... args)
 
virtual ~CbmQaCanvas ()
 Destructor.
 
void Divide2D (int nPads)
 Divide canvas into nPads in 2D in a nice way.
 

Static Public Member Functions

static CbmQaCanvasGetDummyCanvas ()
 a static canvas for temporary drawing
 

Private Member Functions

template<typename... Types>
 CbmQaCanvas (MyBoolean oldBatchMode, Types... args)
 Constructor which calls TCanvas constructor and restores the bach mode.
 
 ClassDef (CbmQaCanvas, 1)
 

Static Private Member Functions

static MyBoolean SetBatchModeOn ()
 Set batch mode ON and return its old value.
 

Detailed Description

A modification of TCanvas which is helpful for storing canvases in a root file together with other objects.

  1. When ROOT reads a file which contains canvases, for no reason it sets global gPad to the last canvas in the file, thus deactivating the browser window. CbmQaCanvas modifies the standard TCanvas::Streamer() to suppress this feature.
  2. The CbmQaCanvas is created in the batch mode, i.e. it is not automatically displayed.
  3. Please use DrawCopy() methods instead of Draw(), to draw objects in the canvas. Otherwise the same object can be stored several times in the file; later this will cause crashes in the ROOT Browser for whatever reason.

Definition at line 31 of file CbmQaCanvas.h.

Constructor & Destructor Documentation

◆ CbmQaCanvas() [1/3]

CbmQaCanvas::CbmQaCanvas ( )
inline

Default constructor needed by the ROOT streamer.

Definition at line 34 of file CbmQaCanvas.h.

◆ CbmQaCanvas() [2/3]

template<typename... Types>
CbmQaCanvas::CbmQaCanvas ( Types... args)
inline

Reimplementation of any existing TCanvas constructor It sets the batch mode ON and then calls the constructor

Definition at line 39 of file CbmQaCanvas.h.

◆ ~CbmQaCanvas()

virtual CbmQaCanvas::~CbmQaCanvas ( )
inlinevirtual

Destructor.

Definition at line 44 of file CbmQaCanvas.h.

◆ CbmQaCanvas() [3/3]

template<typename... Types>
CbmQaCanvas::CbmQaCanvas ( MyBoolean oldBatchMode,
Types... args )
inlineprivate

Constructor which calls TCanvas constructor and restores the bach mode.

Definition at line 69 of file CbmQaCanvas.h.

Member Function Documentation

◆ ClassDef()

CbmQaCanvas::ClassDef ( CbmQaCanvas ,
1  )
private

◆ Divide2D()

void CbmQaCanvas::Divide2D ( int nPads)

◆ GetDummyCanvas()

static CbmQaCanvas & CbmQaCanvas::GetDummyCanvas ( )
inlinestatic

a static canvas for temporary drawing

the static variable will be initialised at the first call; deleted at the application end (c++11) Note: Sizes 1x1 to 3x3 pixels lead to crazy text size and an error under Debian 12 Note: Size 4x4 lead to a pad with size 0 and not statbox under Debian 12

Definition at line 51 of file CbmQaCanvas.h.

Referenced by CbmQaHist< HistTypeT >::Fit(), cbm::qa::util::GetHistStats(), and CbmQaHist< HistTypeT >::SetOptStatFit().

◆ SetBatchModeOn()

static MyBoolean CbmQaCanvas::SetBatchModeOn ( )
inlinestaticprivate

Set batch mode ON and return its old value.

Definition at line 79 of file CbmQaCanvas.h.


The documentation for this class was generated from the following files: