CbmRoot
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. More...
 
template<typename... Types>
 CbmQaCanvas (Types... args)
 
virtual ~CbmQaCanvas ()
 Destructor. More...
 
void Divide2D (int nPads)
 Divide canvas into nPads in 2D in a nice way. More...
 

Private Member Functions

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

Static Private Member Functions

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

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 27 of file CbmQaCanvas.h.

Constructor & Destructor Documentation

◆ CbmQaCanvas() [1/3]

CbmQaCanvas::CbmQaCanvas ( )
inline

Default constructor needed by the ROOT streamer.

Definition at line 30 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 35 of file CbmQaCanvas.h.

◆ ~CbmQaCanvas()

virtual CbmQaCanvas::~CbmQaCanvas ( )
inlinevirtual

Destructor.

Definition at line 38 of file CbmQaCanvas.h.

◆ CbmQaCanvas() [3/3]

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

Constructor which calls TCanvas constructor and restores the bach mode.

Use a specific type name in order to avoid ambiguities when unrolling templates

Definition at line 50 of file CbmQaCanvas.h.

Member Function Documentation

◆ ClassDef()

CbmQaCanvas::ClassDef ( CbmQaCanvas  ,
 
)
private

◆ Divide2D()

void CbmQaCanvas::Divide2D ( int  nPads)

Divide canvas into nPads in 2D in a nice way.

Definition at line 29 of file CbmQaCanvas.cxx.

References sqrt().

Referenced by CbmMuchTransportQa::InitCanvases(), and CbmMuchDigitizerQa::InitCanvases().

◆ SetBatchModeOn()

static MyBoolean CbmQaCanvas::SetBatchModeOn ( )
inlinestaticprivate

Set batch mode ON and return its old value.

Definition at line 59 of file CbmQaCanvas.h.


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