20 StatusCode code2 =
tool.setProperty(
"OperatingPoint",
"FixedCutBEff_77");
21 StatusCode code3 =
tool.setProperty(
"JetAuthor",
"AntiKt4EMTopoJets");
22 StatusCode code4 =
tool.setProperty(
"ScaleFactorFileName",
"xAODBTaggingEfficiency/13TeV/2017-21-13TeV-MC16-CDI-2018-02-09_v1.root");
34 if (
code != StatusCode::SUCCESS || code2 != StatusCode::SUCCESS || code3 != StatusCode::SUCCESS || code4 != StatusCode::SUCCESS || code5 != StatusCode::SUCCESS ||
35 code6 != StatusCode::SUCCESS || code7 != StatusCode::SUCCESS || code8 != StatusCode::SUCCESS || code9 != StatusCode::SUCCESS || code10 != StatusCode::SUCCESS ) {
36 std::cout <<
"Initialization of tool " <<
tool->name() <<
" failed! " << std::endl;
40 std::cout <<
"Initialization of tool " <<
tool->name() <<
" finished." << std::endl;
44 std::vector<float>
pt = {44000., 66000., 77000.};
45 std::vector<float>
eta = {2.2, 1.6, 1.7};
46 std::vector<int> flav = {0,4,5};
47 std::vector<float> tagw = {0.3, 0.55, 0.99};
51 if(StatusCode::SUCCESS!=
tool->CalculateResults(
pt,
eta,flav,tagw,
results) ){
52 std::cout <<
"failed to compute truth tagging results! " << std::endl;
57 std::cout <<
"Direct tagged results: "<< std::endl;
58 for(
unsigned int i=0;
i<
results.is_tagged.size();
i++)
60 std::cout <<
"jet "<<
i <<
" is direct tagged: " <<
results.is_tagged.at(
i) << std::endl;
64 for(
unsigned int systindex=0; systindex<
results.syst_names.size(); systindex++){
65 std::string syst_name =
results.syst_names.at(systindex);
67 std::cout <<
"direct tag Event SF ( "<< syst_name <<
" ) = " <<
results.getEvtDirectTagSF(syst_name) << std::endl;
73 for(
int ntags=1; ntags<=3;ntags++){
75 std::cout <<
" for " << ntags <<
" tagged jets: " << std::endl;
76 std::cout <<
" --------------------------------- " << std::endl;
79 std::vector<bool> exclusive_permuation =
results.getEventPermutation(ntags,
true);
80 std::vector<int> exclusive_tagweightBin =
results.getEventQuantiles(ntags,
true);
82 std::vector<bool> inclusive_permuation =
results.getEventPermutation(ntags,
false);
83 std::vector<int> inclusive_tagweightBin =
results.getEventQuantiles(ntags,
false);
85 std::cout <<
" exclusive || inclusive" << std::endl;
86 std::cout <<
" tagged | bin || tagged | bin" << std::endl;
87 for(
unsigned int i=0;
i< exclusive_permuation.size();
i++)
89 std::cout <<
"jet "<<
i <<
" " << exclusive_permuation.at(
i) <<
" " << exclusive_tagweightBin.at(
i)
90 <<
" || " << inclusive_permuation.at(
i) <<
" " << inclusive_tagweightBin.at(
i) << std::endl;
93 std::cout <<
" Nominal event weight exclusive: " <<
results.getEventWeight(ntags,
true,
"Nominal") << std::endl;
94 std::cout <<
" Nominal event weight inclusive: " <<
results.getEventWeight(ntags,
false,
"Nominal") << std::endl;
95 std::cout <<
" ---------------------------------\n\n " << std::endl;