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. More...
Functions | |
| void | AddHistogram (TH2D *hist) |
| Add histogram. | |
| void | ReadCutAreas (const std::string &fileName) |
| Reads cut areas from the file. | |
| void | SetOutputFile (const std::string &fileName, const bool rewrite=false) |
| Set the file in which cut areas will be written. | |
| void | Exec () |
| Executable to pass to TPad::AddExec(name, command) to start GUI session. | |
| void | 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 | Draw (const bool isRangeFixed=false) |
| Draws histogram with cuts applied. This function is called automaticaly when needed. | |
| void | ApplyCuts (TH2D *hist) |
| Applies cuts to the passed distribution. This function is called automaticaly when needed. | |
| void | MouseMotionAction (const double x, const double y) |
| Applies actions to kMouseMotion event. This function is called automaticaly when needed. | |
| void | Button1DownAction (const double x, const double y) |
| Applies actions to kButton1Down event. This function is called automaticaly when needed. | |
| void | KeyPressAction (const int button) |
| Applies actions to kKeyPress event. This function is called automaticaly when needed. | |
| bool | IsBinCut (const int binX, const int binY) |
| Checks whether the bin is cut or not. | |
| double | 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 * > | hists |
| stores added distributions | |
| TH2D * | histWithCuts |
| stores current distribution to which cuts will be applied | |
| std::vector< unsigned long > | histsOrigIntegral |
| stores integrals of added uncut hists | |
| unsigned long | currentHist = 0 |
| stores information about the index of the currently displayed histogram | |
| std::vector< std::vector< bool > > | inputFileCutAreas |
| stores information about cut areas that were read from the input file | |
| short | currentCutMode = -1 |
| stores information about the current cut mode | |
| std::vector< double > | rectXMin |
| stores minimum x values of the rectangular cut mode | |
| std::vector< double > | rectXMax |
| stores maximum x values of the rectangular cut mode | |
| std::vector< double > | rectYMin |
| stores minimum y values of the rectangular cut mode | |
| std::vector< double > | rectYMax |
| stores maximum y values of the rectangular cut mode | |
| std::vector< double > | lineXMin |
| stores minimum x values of x linear cut mode | |
| std::vector< double > | lineXMax |
| stores maximum x values of x linear cut mode | |
| std::vector< double > | lineYMin |
| stores minimum y values of y linear cut mode | |
| std::vector< double > | lineYMax |
| stores maximum y values of y linear cut mode | |
| std::vector< double > | invRectXMin |
| stores minimum x values of inverse rectangular cut mode | |
| std::vector< double > | invRectXMax |
| stores maximum x values of inverse rectangular cut mode | |
| std::vector< double > | invRectYMin |
| stores minimum y values of inverse rectangular cut mode | |
| std::vector< double > | invRectYMax |
| stores maximum y values of inverse rectangular cut mode | |
| std::vector< double > | angledLine1X1 |
| stores x1 values of the 1st line of angled line cuts | |
| std::vector< double > | angledLine1X2 |
| stores x2 values of the 1st line of angled line cuts | |
| std::vector< double > | angledLine1Y1 |
| stores y1 values of the 1st line of angled line cuts | |
| std::vector< double > | angledLine1Y2 |
| stores y2 values of the 1st line of angled line cuts | |
| std::vector< double > | angledLine2X1 |
| stores x1 values of the 2nd line of angled line cuts | |
| std::vector< double > | angledLine2X2 |
| stores x2 values of the 2nd line of angled line cuts | |
| std::vector< double > | angledLine2Y1 |
| stores y1 values of the 2nd line of angled line cuts | |
| std::vector< double > | angledLine2Y2 |
| stores y2 values of the 2nd line of angled line cuts | |
| std::vector< double > | tanAlpha1 |
| stores tangent of alpha of the 1st line of angled line cuts | |
| std::vector< double > | tanAlpha2 |
| stores tangent of alpha of the 2nd line of angled line cuts | |
| std::vector< double > | shiftY1 |
| stores y shifts of the 1st line of angled line cuts | |
| std::vector< double > | shiftY2 |
| stores y shifts of the 2nd line of angled line cuts | |
| std::vector< double > | singleBinXCut |
| stores x values of the single pixel cut mode | |
| std::vector< double > | singleBinYCut |
| stores y values of the single pixel cut mode | |
| std::vector< std::vector< int > > | minThresholdCutBinsX |
| stores x bins of points cut by minimum threshold cut | |
| std::vector< std::vector< int > > | minThresholdCutBinsY |
| stores y bins of points cut by minimum threshold cut | |
| std::vector< std::vector< int > > | maxThresholdCutBinsX |
| stores x bins of points cut by maximum threshold cut | |
| std::vector< std::vector< int > > | maxThresholdCutBinsY |
| stores y bins of points cut by maximum threshold cut | |
| std::array< bool, 5 > | isMin = {true, true, true, true, true} |
| stores information that shows whether the first point was chosen for the given cut mode | |
| std::string | outputFileName |
| name of the file in which cuts will be written | |
| bool | isOutputFileSet = false |
| shows whether the output file was set | |
| bool | isHistogramAdded = false |
| shows whether at least one histogram was added | |
| bool | isFirstDraw = true |
| checks if the histogram was drawn the first time | |
| bool | setMinimumToOne = false |
| sets the minimum value along Z axis to 1 if this value is true | |
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.
| void GUIDistrCutter2D::AddHistogram | ( | TH2D * | hist | ) |
Add histogram.
| [in] | hist | histogram to be added. All added histograms must have the same number of bins and ranges of X and Y axis. |
| void GUIDistrCutter2D::ApplyCuts | ( | TH2D * | hist | ) |
Applies cuts to the passed distribution. 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::Draw | ( | const bool | isRangeFixed = false | ) |
Draws histogram with cuts applied. This function is called automaticaly when needed.
| void GUIDistrCutter2D::Exec | ( | ) |
Executable to pass to TPad::AddExec(name, command) to start GUI session.
| bool GUIDistrCutter2D::IsBinCut | ( | const int | binX, |
| const int | binY ) |
Checks whether the bin is cut or not.
| void GUIDistrCutter2D::KeyPressAction | ( | const int | button | ) |
Applies actions to kKeyPress event. 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.
|
inline |
Needed for angular cut mode. This function is called automaticaly when needed.
| void GUIDistrCutter2D::ReadCutAreas | ( | const std::string & | fileName | ) |
Reads cut areas from the file.
The cuts from the file will be applied to all added histograms. If no histograms were added prior error will be written and exit(1) will be called.
| [in] | fileName | name of the file to read the info from |
|
inline |
Sets style to the provided TLine. This function is called automaticaly when needed.
| void GUIDistrCutter2D::SetOutputFile | ( | const std::string & | fileName, |
| const bool | rewrite = false ) |
Set the file in which cut areas will be written.
Data will be written for output file for every bin 0 or 1, i.e. whether the bin was or was not cut. Additionaly, in the beginning of the file number of x bins, x range, number of y bins, y range are written.
| [in] | fileName | name of the output file in which the data will be written. |
| [in] | rewrite | if true the file will be rewritten without warning. Else if the file with the same name exists, the old file will be renamed to (fileName + ".backup") and the data will be written into file (fileName). |
| 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
| short GUIDistrCutter2D::currentCutMode = -1 |
stores information about the current cut mode
| unsigned long GUIDistrCutter2D::currentHist = 0 |
stores information about the index of the currently displayed histogram
| std::vector<TH2D *> GUIDistrCutter2D::hists |
stores added distributions
| std::vector<unsigned long> GUIDistrCutter2D::histsOrigIntegral |
stores integrals of added uncut hists
| TH2D* GUIDistrCutter2D::histWithCuts |
stores current distribution to which cuts will be applied
| std::vector<std::vector<bool> > GUIDistrCutter2D::inputFileCutAreas |
stores information about cut areas that were read from the input file
| std::vector<double> GUIDistrCutter2D::invRectXMax |
stores maximum x values of inverse rectangular cut mode
| std::vector<double> GUIDistrCutter2D::invRectXMin |
stores minimum x values of inverse rectangular cut mode
| std::vector<double> GUIDistrCutter2D::invRectYMax |
stores maximum y values of inverse rectangular cut mode
| std::vector<double> GUIDistrCutter2D::invRectYMin |
stores minimum y values of inverse rectangular cut mode
| bool GUIDistrCutter2D::isFirstDraw = true |
checks if the histogram was drawn the first time
| bool GUIDistrCutter2D::isHistogramAdded = false |
shows whether at least one histogram was added
| 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
| bool GUIDistrCutter2D::isOutputFileSet = false |
shows whether the output file was set
| std::vector<double> GUIDistrCutter2D::lineXMax |
stores maximum x values of x linear cut mode
| std::vector<double> GUIDistrCutter2D::lineXMin |
stores minimum x values of x linear cut mode
| std::vector<double> GUIDistrCutter2D::lineYMax |
stores maximum y values of y linear cut mode
| std::vector<double> GUIDistrCutter2D::lineYMin |
stores minimum y values of y linear cut mode
| 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::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::string GUIDistrCutter2D::outputFileName |
name of the file in which cuts will be written
| std::vector<double> GUIDistrCutter2D::rectXMax |
stores maximum x values of the rectangular cut mode
| std::vector<double> GUIDistrCutter2D::rectXMin |
stores minimum x values of the rectangular cut mode
| std::vector<double> GUIDistrCutter2D::rectYMax |
stores maximum y values of the rectangular cut mode
| std::vector<double> GUIDistrCutter2D::rectYMin |
stores minimum y values of the rectangular cut mode
| bool GUIDistrCutter2D::setMinimumToOne = false |
sets the minimum value along Z axis to 1 if this value is true
| 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<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