Visualizer.h 1.49 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/** @file Visualizer.h
 *  @brief Class to have a simple visualization of plots through JZCaPA. If you want to plot something, just define here a child method and use it recursively, w/o filling the code with canvases et al. 
 *
 *  @author Riccardo Longo
 *  @bug No known bugs.
 */

#ifndef VISUALIZER_H
#define VISUALIZER_H

#include "TH1.h"
#include "TStyle.h"

#include <iostream>
#include <vector>

class Visualizer {

    public :
Chad Lantz's avatar
Chad Lantz committed
20
    Visualizer();
21
22
23
24
    Visualizer( std::string _style );

    //Styles (so fa only ATLAS)
    TStyle* AtlasStyle();
Riccardo Longo's avatar
Riccardo Longo committed
25
    //Methods to set a given style
26
27
    void SetAtlasStyle();

Riccardo Longo's avatar
Riccardo Longo committed
28
29
30
    /** @brief allow the user to define the extension of the plots once they're printed. ".pdf" by default */
    void SetPlotExtension( std::string _extension ) { m_extension = _extension; }

31
    /** @brief make the argument true to activate the debug mode. False to deactivate it*/
Riccardo Longo's avatar
Riccardo Longo committed
32
    void   SetDebugMode   ( bool _isDebugon ) { m_debug = _isDebugon; }
33
34

    //Special plot treatments
Riccardo Longo's avatar
Riccardo Longo committed
35
    void   OverlayHistos  ( TH1 *h1, TH1 *h2 , TVirtualPad* pad);
36
37

    //Main visualization methods
Riccardo Longo's avatar
Riccardo Longo committed
38
    void   ManyPadsPlot   ( std::vector< TH1* > _first_form, std::vector< TH1* > _second_form, int _ncol, int _nrow, std::string _out_name, std::string _treatment );
39
40
41
42
43
44
45


    private :
    /** String identifying the style to be applied */
    std::string m_style;
    /** Debug flag */
    bool m_debug = false;
Riccardo Longo's avatar
Riccardo Longo committed
46
47
    /** String defining the extension used to print the plots */
    std::string m_extension = ".pdf";
48
49
50
};

#endif