Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpotMonDraw Class Reference

#include <OnlMon/blob/main/subsystems/tpot/TpotMonDraw.h>

+ Inheritance diagram for TpotMonDraw:
+ Collaboration diagram for TpotMonDraw:

Public Types

using sample_window_t = std::pair< int, int >
 

Public Member Functions

 TpotMonDraw (const std::string &name)
 constructor
 
 ~TpotMonDraw () override=default
 destructor
 
int Init () override
 
int Draw (const std::string &what="ALL") override
 
int MakeHtml (const std::string &what="ALL") override
 
int SavePlot (const std::string &what="ALL", const std::string &type="png") override
 
std::vector< std::string > get_detnames_sphenix () const
 
void set_sample_window_signal (const sample_window_t &value)
 
- Public Member Functions inherited from OnlMonDraw
 OnlMonDraw (const std::string &name="NONE")
 
virtual ~OnlMonDraw ()
 
virtual int MakePS (const std::string &what="ALL")
 
const std::string Name () const
 
void Verbosity (const int i)
 
int Verbosity () const
 

Private Types

enum  DrawOptions {
  None = 0, Logx = 1<<0, Logy = 1<<1, Logz = 1<<2,
  Colz = 1<<3
}
 
using histogram_array_t = std::array< TH1 *, MicromegasDefs::m_nfee >
 

Private Member Functions

int DrawDeadServer (TPad *) override
 
void draw_time (TPad *)
 
TCanvas * get_canvas (const std::string &name, bool clear=true)
 
TCanvas * create_canvas (const std::string &name)
 
int draw_counters ()
 
int draw_detector_occupancy ()
 
int draw_resist_occupancy ()
 
TH1 * get_histogram (const std::string &name) const
 get histogram by name
 
histogram_array_t get_histograms (const std::string &name) const
 get detector dependent histogram array from base name
 
TH1 * get_ref_histogram (const std::string &name) const
 get histogram by name
 
histogram_array_t get_ref_histograms (const std::string &name) const
 get detector dependent histogram array from base name
 
histogram_array_t get_ref_histograms_scaled (const std::string &name) const
 get detector dependent histogram array from base name
 
double get_ref_scale_factor () const
 get scale factor for reference histograms
 
TH1 * normalize (TH1 *, double scale=1) const
 normalize reference histogram
 
int draw_array (const std::string &name, const histogram_array_t &array, unsigned int options=DrawOptions::None)
 draw histogram array
 
int draw_array (const std::string &name, const histogram_array_t &, const histogram_array_t &, unsigned int=DrawOptions::None)
 draw histogram array and reference histgorams
 
void draw_detnames_sphenix (const std::string &suffix=std::string())
 draw detector names in current canvas
 

Private Attributes

MicromegasMapping m_mapping
 mapping
 
MicromegasGeometry m_geometry
 geometry
 
std::vector< std::string > m_detnames_sphenix
 detector names
 
int TimeOffsetTicks = -1
 needed to get time axis right
 
sample_window_t m_sample_window_signal = {20, 40}
 
std::string m_ref_histograms_filename
 
std::unique_ptr< TFile > m_ref_histograms_tfile
 
std::vector< TCanvas * > m_canvas
 
std::unique_ptr< OnlMonDBdbvars
 

Additional Inherited Members

- Protected Attributes inherited from OnlMonDraw
std::string ThisName
 
int verbosity = 0
 

Detailed Description

Definition at line 21 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 21 of file TpotMonDraw.h

Member Typedef Documentation

using TpotMonDraw::histogram_array_t = std::array<TH1*, MicromegasDefs::m_nfee>
private

Definition at line 60 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 60 of file TpotMonDraw.h

using TpotMonDraw::sample_window_t = std::pair<int, int>

Definition at line 41 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 41 of file TpotMonDraw.h

Member Enumeration Documentation

Enumerator:
None 
Logx 
Logy 
Logz 
Colz 

Definition at line 63 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 63 of file TpotMonDraw.h

Constructor & Destructor Documentation

TpotMonDraw::TpotMonDraw ( const std::string &  name)

constructor

Definition at line 115 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 115 of file TpotMonDraw.cc

References dbvars, MicromegasMapping::get_detname_sphenix(), MicromegasMapping::get_fee_id_list(), m_detnames_sphenix, m_mapping, m_ref_histograms_filename, m_ref_histograms_tfile, OnlMonDraw::ThisName, and TimeOffsetTicks.

+ Here is the call graph for this function:

TpotMonDraw::~TpotMonDraw ( )
overridedefault

destructor

Member Function Documentation

TCanvas * TpotMonDraw::create_canvas ( const std::string &  name)
private

Definition at line 198 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 198 of file TpotMonDraw.cc

References OnlMonClient::GetDisplaySizeX(), OnlMonClient::GetDisplaySizeY(), i, OnlMonClient::instance(), m_canvas, and OnlMonDraw::Verbosity().

Referenced by get_canvas().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpotMonDraw::Draw ( const std::string &  what = "ALL")
overridevirtual

Reimplemented from OnlMonDraw.

Definition at line 308 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 308 of file TpotMonDraw.cc

References channel(), draw_array(), draw_counters(), draw_detector_occupancy(), draw_resist_occupancy(), physmon_vertexing::events, get_canvas(), get_histogram(), get_histograms(), get_ref_histograms_scaled(), i, TpotMonDefs::kEventCounter, TpotMonDefs::kValidEventCounter, line, m_sample_window_signal, and OnlMonDraw::Verbosity().

Referenced by MakeHtml(), and SavePlot().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpotMonDraw::draw_array ( const std::string &  name,
const histogram_array_t array,
unsigned int  options = DrawOptions::None 
)
inlineprivate

draw histogram array

Definition at line 98 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 98 of file TpotMonDraw.h

References draw_array(), and ckf::options.

Referenced by Draw(), and draw_array().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpotMonDraw::draw_array ( const std::string &  name,
const histogram_array_t histograms,
const histogram_array_t ref_histograms,
unsigned int  options = DrawOptions::None 
)
private

draw histogram array and reference histgorams

Definition at line 747 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 747 of file TpotMonDraw.cc

References draw_time(), DrawDeadServer(), get_canvas(), h, i, and OnlMonDraw::Verbosity().

+ Here is the call graph for this function:

int TpotMonDraw::draw_counters ( )
private

Definition at line 513 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 513 of file TpotMonDraw.cc

References draw_time(), DrawDeadServer(), get_canvas(), get_histogram(), get_ref_histogram(), get_ref_scale_factor(), normalize(), and OnlMonDraw::Verbosity().

Referenced by Draw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpotMonDraw::draw_detector_occupancy ( )
private

Definition at line 557 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 557 of file TpotMonDraw.cc

References draw_detnames_sphenix(), draw_time(), DrawDeadServer(), get_canvas(), get_histogram(), h, and OnlMonDraw::Verbosity().

Referenced by Draw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TpotMonDraw::draw_detnames_sphenix ( const std::string &  suffix = std::string())
private

draw detector names in current canvas

only works if canvas contains one of the properly formated TH2Poly histograms

Definition at line 653 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 653 of file TpotMonDraw.cc

References MicromegasGeometry::get_detname_sphenix(), MicromegasGeometry::get_ntiles(), MicromegasGeometry::get_tile_center(), i, m_geometry, MicromegasGeometry::m_tile_length, MicromegasGeometry::m_tile_width, text(), ambiguity_solver_full_chain::x, and y.

Referenced by draw_detector_occupancy(), and draw_resist_occupancy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpotMonDraw::draw_resist_occupancy ( )
private

Definition at line 606 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 606 of file TpotMonDraw.cc

References draw_detnames_sphenix(), draw_time(), DrawDeadServer(), get_canvas(), get_histogram(), h, and OnlMonDraw::Verbosity().

Referenced by Draw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TpotMonDraw::draw_time ( TPad *  pad)
private

Definition at line 160 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 160 of file TpotMonDraw.cc

References OnlMonClient::instance(), OnlMonDraw::ThisName, and OnlMonDraw::Verbosity().

Referenced by draw_array(), draw_counters(), draw_detector_occupancy(), and draw_resist_occupancy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpotMonDraw::DrawDeadServer ( TPad *  pad)
overrideprivatevirtual

Reimplemented from OnlMonDraw.

Definition at line 147 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 147 of file TpotMonDraw.cc

References OnlMonDraw::DrawDeadServer(), and OnlMonDraw::Verbosity().

Referenced by draw_array(), draw_counters(), draw_detector_occupancy(), and draw_resist_occupancy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TCanvas * TpotMonDraw::get_canvas ( const std::string &  name,
bool  clear = true 
)
private

Definition at line 189 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 189 of file TpotMonDraw.cc

References create_canvas().

Referenced by Draw(), draw_array(), draw_counters(), draw_detector_occupancy(), and draw_resist_occupancy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector<std::string> TpotMonDraw::get_detnames_sphenix ( ) const
inline

Definition at line 37 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 37 of file TpotMonDraw.h

References m_detnames_sphenix.

TH1 * TpotMonDraw::get_histogram ( const std::string &  name) const
private

get histogram by name

Definition at line 668 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 668 of file TpotMonDraw.cc

References OnlMonClient::instance().

Referenced by Draw(), draw_counters(), draw_detector_occupancy(), draw_resist_occupancy(), get_histograms(), and get_ref_scale_factor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TpotMonDraw::histogram_array_t TpotMonDraw::get_histograms ( const std::string &  name) const
private

get detector dependent histogram array from base name

Definition at line 675 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 675 of file TpotMonDraw.cc

References get_histogram(), i, m_detnames_sphenix, out, and OnlMonDraw::Verbosity().

Referenced by Draw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TH1 * TpotMonDraw::get_ref_histogram ( const std::string &  name) const
private

get histogram by name

Definition at line 691 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 691 of file TpotMonDraw.cc

References m_ref_histograms_tfile.

Referenced by draw_counters(), get_ref_histograms(), and get_ref_scale_factor().

+ Here is the caller graph for this function:

TpotMonDraw::histogram_array_t TpotMonDraw::get_ref_histograms ( const std::string &  name) const
private

get detector dependent histogram array from base name

Definition at line 695 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 695 of file TpotMonDraw.cc

References get_ref_histogram(), i, m_detnames_sphenix, out, and OnlMonDraw::Verbosity().

Referenced by get_ref_histograms_scaled().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TpotMonDraw::histogram_array_t TpotMonDraw::get_ref_histograms_scaled ( const std::string &  name) const
private

get detector dependent histogram array from base name

Definition at line 711 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 711 of file TpotMonDraw.cc

References get_ref_histograms(), get_ref_scale_factor(), i, normalize(), out, and parse_cmake_options::source.

Referenced by Draw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double TpotMonDraw::get_ref_scale_factor ( ) const
private

get scale factor for reference histograms

the normaliztion factor is based on the ratio of number of events in the event counters histogram

Definition at line 724 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 724 of file TpotMonDraw.cc

References get_histogram(), get_ref_histogram(), TpotMonDefs::kFullEventCounter, and m_ref_histograms_tfile.

Referenced by draw_counters(), and get_ref_histograms_scaled().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpotMonDraw::Init ( )
overridevirtual

Reimplemented from OnlMonDraw.

Definition at line 143 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 143 of file TpotMonDraw.cc

int TpotMonDraw::MakeHtml ( const std::string &  what = "ALL")
overridevirtual

Reimplemented from OnlMonDraw.

Definition at line 464 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 464 of file TpotMonDraw.cc

References Draw(), i, OnlMonClient::instance(), m_canvas, out, and utils::status.

+ Here is the call graph for this function:

TH1 * TpotMonDraw::normalize ( TH1 *  source,
double  scale = 1 
) const
private

normalize reference histogram

Definition at line 737 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 737 of file TpotMonDraw.cc

Referenced by draw_counters(), and get_ref_histograms_scaled().

+ Here is the caller graph for this function:

int TpotMonDraw::SavePlot ( const std::string &  what = "ALL",
const std::string &  type = "png" 
)
overridevirtual

Reimplemented from OnlMonDraw.

Definition at line 443 of file TpotMonDraw.cc.

View newest version in sPHENIX GitHub at line 443 of file TpotMonDraw.cc

References Draw(), filename, i, OnlMonClient::instance(), m_canvas, OnlMonDraw::ThisName, and to_string().

+ Here is the call graph for this function:

void TpotMonDraw::set_sample_window_signal ( const sample_window_t value)
inline

Definition at line 42 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 42 of file TpotMonDraw.h

References m_sample_window_signal, and value.

Member Data Documentation

std::unique_ptr<OnlMonDB> TpotMonDraw::dbvars
private

Definition at line 131 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 131 of file TpotMonDraw.h

Referenced by TpotMonDraw().

std::vector<TCanvas*> TpotMonDraw::m_canvas
private

Definition at line 130 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 130 of file TpotMonDraw.h

Referenced by create_canvas(), MakeHtml(), and SavePlot().

std::vector<std::string> TpotMonDraw::m_detnames_sphenix
private

detector names

Definition at line 115 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 115 of file TpotMonDraw.h

Referenced by get_detnames_sphenix(), get_histograms(), get_ref_histograms(), and TpotMonDraw().

MicromegasGeometry TpotMonDraw::m_geometry
private

geometry

Definition at line 112 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 112 of file TpotMonDraw.h

Referenced by draw_detnames_sphenix().

MicromegasMapping TpotMonDraw::m_mapping
private

mapping

Definition at line 109 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 109 of file TpotMonDraw.h

Referenced by TpotMonDraw().

std::string TpotMonDraw::m_ref_histograms_filename
private

Definition at line 124 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 124 of file TpotMonDraw.h

Referenced by TpotMonDraw().

std::unique_ptr<TFile> TpotMonDraw::m_ref_histograms_tfile
private

Definition at line 127 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 127 of file TpotMonDraw.h

Referenced by get_ref_histogram(), get_ref_scale_factor(), and TpotMonDraw().

sample_window_t TpotMonDraw::m_sample_window_signal = {20, 40}
private

Definition at line 121 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 121 of file TpotMonDraw.h

Referenced by Draw(), and set_sample_window_signal().

int TpotMonDraw::TimeOffsetTicks = -1
private

needed to get time axis right

Definition at line 118 of file TpotMonDraw.h.

View newest version in sPHENIX GitHub at line 118 of file TpotMonDraw.h

Referenced by TpotMonDraw().


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