ROOTTools
Loading...
Searching...
No Matches
GUIDistrCutter2D.hpp File Reference

Contains structs and functions that can be used for providing GUI for removal of "bad"/"dead" areas from 2D distributions. More...

#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <fstream>
#include "TBox.h"
#include "TFrame.h"
#include "TPad.h"
#include "TH2.h"
#include "TLine.h"
#include "Buttons.h"

Go to the source code of this file.

Namespaces

namespace  GUIDistrCutter2D
 Stores various useful data and functions for functionality of GUI cutter. The only useful funtions for user are AddHistogram, ReadCutAreas, SetOutputFile, and Exec. Other functions and variables are employed automaticaly when needed.

Functions

void GUIDistrCutter2D::AddHistogram (TH2D *hist)
 Add histogram.
void GUIDistrCutter2D::ReadCutAreas (const std::string &fileName)
 Reads cut areas from the file.
void GUIDistrCutter2D::SetOutputFile (const std::string &fileName, const bool rewrite=false)
 Set the file in which cut areas will be written.
void GUIDistrCutter2D::Exec ()
 Executable to pass to TPad::AddExec(name, command) to start GUI session.
void GUIDistrCutter2D::SetLine (TLine &line, const double x1, const double y1, const double x2, const double y2, const Color_t color=kRed)
 Sets style to the provided TLine. This function is called automaticaly when needed.
void GUIDistrCutter2D::Draw (const bool isRangeFixed=false)
 Draws histogram with cuts applied. This function is called automaticaly when needed.
void GUIDistrCutter2D::ApplyCuts (TH2D *hist)
 Applies cuts to the passed distribution. This function is called automaticaly when needed.
void GUIDistrCutter2D::MouseMotionAction (const double x, const double y)
 Applies actions to kMouseMotion event. This function is called automaticaly when needed.
void GUIDistrCutter2D::Button1DownAction (const double x, const double y)
 Applies actions to kButton1Down event. This function is called automaticaly when needed.
void GUIDistrCutter2D::KeyPressAction (const int button)
 Applies actions to kKeyPress event. This function is called automaticaly when needed.
bool GUIDistrCutter2D::IsBinCut (const int binX, const int binY)
 Checks whether the bin is cut or not.
double GUIDistrCutter2D::Pol1 (const double x, const double par0, const double par1)
 Needed for angular cut mode. This function is called automaticaly when needed.

Variables

std::vector< TH2D * > GUIDistrCutter2D::hists
 stores added distributions
TH2D * GUIDistrCutter2D::histWithCuts
 stores current distribution to which cuts will be applied
std::vector< unsigned long > GUIDistrCutter2D::histsOrigIntegral
 stores integrals of added uncut hists
unsigned long GUIDistrCutter2D::currentHist = 0
 stores information about the index of the currently displayed histogram
std::vector< std::vector< bool > > GUIDistrCutter2D::inputFileCutAreas
 stores information about cut areas that were read from the input file
short GUIDistrCutter2D::currentCutMode = -1
 stores information about the current cut mode
std::vector< double > GUIDistrCutter2D::rectXMin
 stores minimum x values of the rectangular cut mode
std::vector< double > GUIDistrCutter2D::rectXMax
 stores maximum x values of the rectangular cut mode
std::vector< double > GUIDistrCutter2D::rectYMin
 stores minimum y values of the rectangular cut mode
std::vector< double > GUIDistrCutter2D::rectYMax
 stores maximum y values of the rectangular cut mode
std::vector< double > GUIDistrCutter2D::lineXMin
 stores minimum x values of x linear cut mode
std::vector< double > GUIDistrCutter2D::lineXMax
 stores maximum x values of x linear cut mode
std::vector< double > GUIDistrCutter2D::lineYMin
 stores minimum y values of y linear cut mode
std::vector< double > GUIDistrCutter2D::lineYMax
 stores maximum y values of y linear cut mode
std::vector< double > GUIDistrCutter2D::invRectXMin
 stores minimum x values of inverse rectangular cut mode
std::vector< double > GUIDistrCutter2D::invRectXMax
 stores maximum x values of inverse rectangular cut mode
std::vector< double > GUIDistrCutter2D::invRectYMin
 stores minimum y values of inverse rectangular cut mode
std::vector< double > GUIDistrCutter2D::invRectYMax
 stores maximum y values of inverse rectangular cut mode
std::vector< double > GUIDistrCutter2D::angledLine1X1
 stores x1 values of the 1st line of angled line cuts
std::vector< double > GUIDistrCutter2D::angledLine1X2
 stores x2 values of the 1st line of angled line cuts
std::vector< double > GUIDistrCutter2D::angledLine1Y1
 stores y1 values of the 1st line of angled line cuts
std::vector< double > GUIDistrCutter2D::angledLine1Y2
 stores y2 values of the 1st line of angled line cuts
std::vector< double > GUIDistrCutter2D::angledLine2X1
 stores x1 values of the 2nd line of angled line cuts
std::vector< double > GUIDistrCutter2D::angledLine2X2
 stores x2 values of the 2nd line of angled line cuts
std::vector< double > GUIDistrCutter2D::angledLine2Y1
 stores y1 values of the 2nd line of angled line cuts
std::vector< double > GUIDistrCutter2D::angledLine2Y2
 stores y2 values of the 2nd line of angled line cuts
std::vector< double > GUIDistrCutter2D::tanAlpha1
 stores tangent of alpha of the 1st line of angled line cuts
std::vector< double > GUIDistrCutter2D::tanAlpha2
 stores tangent of alpha of the 2nd line of angled line cuts
std::vector< double > GUIDistrCutter2D::shiftY1
 stores y shifts of the 1st line of angled line cuts
std::vector< double > GUIDistrCutter2D::shiftY2
 stores y shifts of the 2nd line of angled line cuts
std::vector< double > GUIDistrCutter2D::singleBinXCut
 stores x values of the single pixel cut mode
std::vector< double > GUIDistrCutter2D::singleBinYCut
 stores y values of the single pixel cut mode
std::vector< std::vector< int > > GUIDistrCutter2D::minThresholdCutBinsX
 stores x bins of points cut by minimum threshold cut
std::vector< std::vector< int > > GUIDistrCutter2D::minThresholdCutBinsY
 stores y bins of points cut by minimum threshold cut
std::vector< std::vector< int > > GUIDistrCutter2D::maxThresholdCutBinsX
 stores x bins of points cut by maximum threshold cut
std::vector< std::vector< int > > GUIDistrCutter2D::maxThresholdCutBinsY
 stores y bins of points cut by maximum threshold cut
std::array< bool, 5 > GUIDistrCutter2D::isMin = {true, true, true, true, true}
 stores information that shows whether the first point was chosen for the given cut mode
std::string GUIDistrCutter2D::outputFileName
 name of the file in which cuts will be written
bool GUIDistrCutter2D::isOutputFileSet = false
 shows whether the output file was set
bool GUIDistrCutter2D::isHistogramAdded = false
 shows whether at least one histogram was added
bool GUIDistrCutter2D::isFirstDraw = true
 checks if the histogram was drawn the first time
bool GUIDistrCutter2D::setMinimumToOne = false
 sets the minimum value along Z axis to 1 if this value is true

Detailed Description

Contains structs and functions that can be used for providing GUI for removal of "bad"/"dead" areas from 2D distributions.

This file is a part of a project ROOTTools (https://github.com/Sergeyir/ROOTTools).

Author
Sergei Antsupov (antsu.nosp@m.pov0.nosp@m.124@g.nosp@m.mail.nosp@m..com)