7 for (
auto& cutname :
cutlist.second) {
11 if (!tx.
hasBranch<
float>(cutname +
"_weight"))
26 std::vector<float> rtnwgt;
27 std::vector<bool> rtn;
32 float wgt = tx.
getBranch<
float>(cutname +
"_weight");
35 rtnwgt.push_back(wgtall);
36 rtn.push_back(passall);
38 return std::make_tuple(rtn, rtnwgt);
43 std::vector<bool> cutflow;
44 std::vector<float> cutflow_weight;
47 bool passall = cutflow.back();
48 float wgtall = cutflow_weight.back();
49 return std::make_pair(passall, wgtall);
54 std::vector<bool> cutflow;
55 std::vector<float> cutflow_weight;
57 for (
unsigned int i = 0;
i < cutflow.size(); ++
i)
59 h->Fill(
i, cutflow[
i] * cutflow_weight[
i]);
66 std::vector<bool> cutflow;
67 std::vector<float> cutflow_weight;
69 for (
unsigned int i = 0;
i < cutflow.size(); ++
i)
77 std::tuple<std::map<CUTFLOWMAPSTRING, THist*>, std::map<CUTFLOWMAPSTRING, THist*>>
84 std::tuple<std::map<CUTFLOWMAPSTRING, THist*>, std::map<CUTFLOWMAPSTRING, THist*>>
86 std::map<CUTFLOWMAPSTRING, THist*> cutflows;
87 std::map<CUTFLOWMAPSTRING, THist*> rawcutflows;
88 for (
auto&
cutlist : cutlists) {
89 cutflows[(
cutlist.first + syst).Data()] =
91 rawcutflows[(
cutlist.first + syst).Data()] =
93 cutflows[(
cutlist.first + syst).Data()]->Sumw2();
94 rawcutflows[(
cutlist.first + syst).Data()]->Sumw2();
95 cutflows[(
cutlist.first + syst).Data()]->SetDirectory(0);
96 rawcutflows[(
cutlist.first + syst).Data()]->SetDirectory(0);
97 for (
unsigned int i = 0;
i <
cutlist.second.size(); ++
i) {
98 cutflows[(
cutlist.first + syst).Data()]->GetXaxis()->SetBinLabel(
i + 1,
cutlist.second[
i]);
99 rawcutflows[(
cutlist.first + syst).Data()]->GetXaxis()->SetBinLabel(
i + 1,
cutlist.second[
i]);
102 return std::make_tuple(cutflows, rawcutflows);
124 std::map<CUTFLOWMAPSTRING, THist*>& rawcutflows) {
125 for (
auto& cutflow : cutflows)
126 cutflow.second->Write();
127 for (
auto& rawcutflow : rawcutflows)
128 rawcutflow.second->Write();
void fillCutflow(std::vector< TString > cutlist, RooUtil::TTreeX &tx, TH1D *h)
std::tuple< std::map< TString, TH1D * >, std::map< TString, TH1D * > > createCutflowHistograms(CutNameListMap &cutlists, TString syst="")
void fillRawCutflow(std::vector< TString > cutlist, RooUtil::TTreeX &tx, TH1D *h)
const T & getBranch(TString, bool=true)
void saveCutflowHistograms(std::map< TString, TH1D *> &cutflows, std::map< TString, TH1D *> &rawcutflows)
std::tuple< std::vector< bool >, std::vector< float > > getCutflow(std::vector< TString > cutlist, RooUtil::TTreeX &tx)
void createBranch(TString, bool=true)
void createCutflowBranches(CutNameListMap &cutlists, RooUtil::TTreeX &tx)
std::map< TString, std::vector< TString > > getStdVersion()
std::pair< bool, float > passCuts(std::vector< TString > cutlist, RooUtil::TTreeX &tx)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.