11 #ifdef XAOD_STANDALONE
13 #define TEVENT xAOD::TEvent
16 #define TEVENT POOL::TEvent
26 using namespace testBTagSelection;
30 const char* TEST_NAME =
argv[0];
34 ANA_MSG_ERROR (
"Usage: " << TEST_NAME <<
"[DAOD file name] [CDI path] [b-tagger name] [WP name]" );
38 std::string inputDAOD =
argv[1];
39 std::string CDIPath =
argv[2];
40 std::string taggerName =
argv[3];
41 std::string workingPointName =
argv[4];
42 std::string JetCollectionName =
"AntiKt4EMPFlowJets";
44 std::string EDMTaggerName;
45 if (taggerName.find(
"GN2v00") != std::string::npos) {
46 EDMTaggerName =
"GN2v00";
48 EDMTaggerName = taggerName;
52 StatusCode code1 =
tool.setProperty(
"FlvTagCutDefinitionsFileName", CDIPath);
54 StatusCode code3 =
tool.setProperty(
"OperatingPoint", workingPointName);
55 StatusCode code4 =
tool.setProperty(
"JetAuthor", JetCollectionName);
58 std::vector<StatusCode>
codes = {code1, code2, code3, code4, code5, code6};
60 if (
code != StatusCode::SUCCESS) {
70 TFile*
m_file = TFile::Open(inputDAOD.c_str(),
"read");
88 bool tagged =
static_cast<bool>(
tool->accept(*
jet));
92 if(
tool->getTaggerWeight( *
jet ,tagweight)!=CorrectionCode::Ok) {
97 if (workingPointName.find(
"Continuous") == std::string::npos) {
98 ANA_MSG_INFO (
"jet " << jet_index <<
" " << taggerName <<
" " << workingPointName <<
" is tagged " << tagged <<
" tag weight " << tagweight );
103 float jet_pb = btag->
auxdata<
float>(EDMTaggerName +
"_pb");
104 float jet_pc = btag->
auxdata<
float>(EDMTaggerName +
"_pc");
105 float jet_pu = btag->
auxdata<
float>(EDMTaggerName +
"_pu");
107 if (taggerName ==
"GN2v01") jet_ptau = btag->
auxdata<
float>(EDMTaggerName +
"_ptau");
109 if(
tool->getTaggerWeight(jet_pb,jet_pc,jet_pu, tagweight, jet_ptau) != CorrectionCode::Ok ){
116 double pT =
jet->pt();
121 tagged =
static_cast<bool>(
tool->accept(
pT,
eta,tagweight));
125 if(
tool->getCutValue(
jet->pt() , cutval)!=CorrectionCode::Ok ) {
129 ANA_MSG_INFO (
" tagged " << tagged <<
" cut value " << cutval );
131 int quantile =
tool->getQuantile(*
jet);
132 ANA_MSG_INFO (
"jet " << jet_index <<
" " << taggerName <<
" " << workingPointName <<
" tag weight " << tagweight <<
" quantile " << quantile );