hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
IterativeCutSelector.h
Go to the documentation of this file.
1#ifndef ITERATIVECUTSELECTOR_H
2#define ITERATIVECUTSELECTOR_H
3
4#include <string>
5#include <iostream>
6#include <map>
7#include <memory>
8#include "BaseSelector.h"
9
10#include "TH1F.h"
11#include "json.hpp"
12
13// for convenience
14using json = nlohmann::json;
15
22
23 public:
24
26
27 IterativeCutSelector(const std::string& inputName);
28
29 IterativeCutSelector(const std::string& inputName, const std::string& cfgFile);
30
31 virtual ~IterativeCutSelector();
32
38 std::string getCutVar(std::string cutname);
39
47 bool isCutGreaterThan(std::string cutname);
48
55 void setCutValue(std::string cutname, double value);
56
65 bool passCutGTorLT(std::string cutname, double val);
66
71 void printCuts();
72
79 int getCutID(std::string cutname){return cuts[cutname].second;};
80
87 void filterCuts(std::vector<std::string> cut_variable_list);
88
93 std::map<std::string, std::pair<double,int>>* getPointerToCuts(){ return &cuts; }
94
95
96 private:
97 //When this variable value is encountered, do not apply cut to event
98 double skipCutVarValue_ = -9876543210.0; //Must match definition in MutableTTree
99};
100
101#endif
nlohmann::json json
brief description
std::map< std::string, std::pair< double, int > > cuts
description
bool isCutGreaterThan(std::string cutname)
is cut of type 'greater than'
std::string getCutVar(std::string cutname)
get cut variable from name
std::map< std::string, std::pair< double, int > > * getPointerToCuts()
get pointer to the base class cuts
void filterCuts(std::vector< std::string > cut_variable_list)
remove cuts that aren't specified in the list of cut variables
int getCutID(std::string cutname)
get cut ID
void setCutValue(std::string cutname, double value)
set cut value
void printCuts()
prints cuts and values
bool passCutGTorLT(std::string cutname, double val)
does value pass cut