23 {
24
25 if (argc < 5) {
26 ANA_MSG_ERROR (
"Usage: <exe> <DAOD> <JsonConfig> <TaggerName> <PCTName> <WP1,WP2,...>" );
27 return 1;
28 }
29
30 std::string inputDAOD =
argv[1];
31 std::string JsonConfigFile =
argv[2];
32 std::string taggerName =
argv[3];
33 std::string PCTName =
argv[4];
34 std::string objContainer = "AntiKt4EMPFlowJets";
35
36
37 std::vector<std::string> wpList;
38 if (argc > 5) {
39 std::string taggingWPs =
argv[5];
40 std::istringstream
ss(taggingWPs);
41 std::string token;
42 while (std::getline(
ss, token,
',')) {
43 if (!token.empty()) wpList.push_back(token);
44 }
45 }
46
48 StatusCode sf_code1 = sf_tool.setProperty( "TaggerName", taggerName);
49 StatusCode sf_code2 = sf_tool.setProperty( "JsonConfigFile", JsonConfigFile);
50 StatusCode sf_code3 = sf_tool.setProperty( "ObjContainer", objContainer);
51 StatusCode sf_code4 = sf_tool.setProperty( "PCTName", PCTName);
52 StatusCode sf_code5 = sf_tool.setProperty( "WorkingPoints",wpList);
53 StatusCode sf_code6 = sf_tool.initialize();
54 std::vector<StatusCode> sf_codes = { sf_code1, sf_code2, sf_code3, sf_code4, sf_code5, sf_code6};
55
56 for(const auto& code : sf_codes) {
57 if(code.isFailure()) {
59 return 1;
60 }
61 }
62
64 sysSet = sf_tool->recommendedSystematics();
65
68 std::unique_ptr<TFile> root_file {TFile::Open(inputDAOD.c_str(), "READ")};
69 if(!
event.readFrom(root_file.get()).isSuccess()) {
70 ANA_MSG_ERROR (
"Accessing events in input file " << inputDAOD <<
"failed! " );
71 return 1;
72 }
73
75 event.getEntry(entry);
76
78 if(!
event.retrieve(particles, objContainer).isSuccess()) {
80 return 1;
81 }
82
83 for (const auto particle : *particles) {
90 ANA_MSG_INFO(
"pb : pc : pl : ptau = " << pb <<
", " << pc <<
", " << pu <<
", " << ptau);
91 std::vector<int> wp_decision = sf_tool->inferWPs(particle);
92 for (
size_t i = 0;
i < wpList.size(); ++
i) {
93 ANA_MSG_INFO(
"decision_" << wpList[i] <<
": " << wp_decision[i]);
94 }
95
97 for (const auto& var : sysSet) {
104 } else {
106 }
107 }
108 }
109 }
110
111 root_file->Close();
112 root_file.reset();
113 return 0;
114}
Return value from object correction CP tools.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
Class to wrap a set of SystematicVariations.
Helper class to provide constant type-safe access to aux data.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.