|
DAS
3.0
Das Analysis System
|
|
void | applyConservativeVetoMap (const vector< fs::path > inputs, const fs::path output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0}) |
|
void | getConservativeMap (const fs::path &input, const fs::path &output, const pt::ptree &config, const int steering) |
|
◆ applyConservativeVetoMap()
void DAS::JetVeto::applyConservativeVetoMap |
( |
const vector< fs::path > |
inputs, |
|
|
const fs::path |
output, |
|
|
const pt::ptree & |
config, |
|
|
const int |
steering, |
|
|
const DT::Slice |
slice = {1,0} |
|
) |
| |
Remove regions that are not properly simulated both in data and simulation (fixed via unfolding at the end).
Maps are derived by Hannu (Helsinki), and should be downloaded and adapted.
- Parameters
-
inputs | input ROOT files (n-tuples) |
output | name of output root file containing the histograms |
config | config file from `DTOptions` |
steering | steering parameters from `DTOptions` |
slice | slices for running |
46 cout << __func__ <<
' ' << slice <<
" start" << endl;
50 auto tOut = unique_ptr<TTree>(tIn->CloneTree(0));
54 auto isMC = metainfo.Get<
bool>(
"flags",
"isMC");
56 const auto& jetveto_file =
config.get<fs::path>(
"corrections.jetvetomap.filename");
57 JetVeto::Conservative jetveto(jetveto_file);
58 metainfo.Set<fs::path>(
"corrections",
"jetvetomap",
"filename", jetveto_file);
60 RecEvent * recEvt =
nullptr;
61 GenEvent * genEvt =
nullptr;
62 tIn->SetBranchAddress(
"recEvent", &recEvt);
64 tIn->SetBranchAddress(
"genEvent", &genEvt);
66 vector<RecJet> * recJets =
nullptr;
67 tIn->SetBranchAddress(
"recJets", &recJets);
69 ControlPlots raw(
"raw");
70 ControlPlots
nominal(
"HotKillers");
72 for (
DT::Looper looper(tIn, slice); looper(); ++looper) {
76 auto ev_w = (
isMC ? genEvt->weights.front().v : 1) * recEvt->weights.front().v;
80 for (
auto& recJet: *recJets)
89 jetveto.Write(fOut.get());
90 raw.Write(fOut.get());
93 metainfo.Set<
bool>(
"git",
"complete",
true);
97 cout << __func__ <<
' ' << slice <<
" end" << endl;
◆ getConservativeMap()
void DAS::JetVeto::getConservativeMap |
( |
const fs::path & |
input, |
|
|
const fs::path & |
output, |
|
|
const pt::ptree & |
config, |
|
|
const int |
steering |
|
) |
| |
Maps the JetMET veto maps onto maps containing weights.
- Todo:
- make smart pointer? (last attempts led to seg)
- Parameters
-
input | name of input root file |
output | name of output root file |
config | config handled with `Darwin::Tools::Options` |
steering | parameters obtained from explicit options |
35 cout << __func__ <<
" start" << endl;
37 if (!fs::exists(
input))
38 BOOST_THROW_EXCEPTION( fs::filesystem_error(
"Jet veta map file does not exists.",
39 input, make_error_code(errc::no_such_file_or_directory)) );
40 auto fIn = make_unique<TFile>(
input.c_str(),
"READ");
41 auto histname =
config.get<
string>(
"corrections.jetvetomap.histname");
42 auto h = fIn->Get<TH2>(histname.c_str());
44 BOOST_THROW_EXCEPTION(
DE::BadInput(
"Can't find the efficiency map", fIn) );
48 auto fOut = make_unique<TFile>(output.c_str(),
"RECREATE");
50 for (
int x = 1; x <= h->GetNbinsX(); ++x)
51 for (
int y = 1; y <= h->GetNbinsY(); ++y) {
52 auto content = h->GetBinContent(x,y);
53 static const auto deps = numeric_limits<float>::epsilon();
54 content = (content <
deps);
55 h->SetBinContent(x,y,content);
57 h->GetXaxis()->SetTitle(
"#eta");
58 h->GetYaxis()->SetTitle(
"#phi");
59 h->GetZaxis()->SetRangeUser(0,1);
61 h->SetDirectory(fOut.get());
64 cout << __func__ <<
" end" << endl;
static bool verbose
Definition: Step.h:40
static const double deps
Definition: Greta.h:18
config
Definition: Ntupliser_cfg.py:260
const Variation nominal
Definition: Variation.h:109
input
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:35
string isMC
Definition: Ntupliser_cfg.py:59
def inputs
Definition: jercExample.py:118
#define DT_GetOutput(output)
Definition: FileUtils.h:222