78{
80
81 auto NInputTaus = Monitored::Scalar<int>("NInputTaus", -1);
82 auto passedCuts = Monitored::Scalar<int>("CutCounter", 0);
83 auto PtAccepted = Monitored::Scalar<float>("PtAccepted", -1);
84 auto NTracksAccepted = Monitored::Scalar<int>("NTracksAccepted", -1);
85 auto NIsoTracksAccepted = Monitored::Scalar<int>("NIsoTracksAccepted", -1);
86
87 std::map<std::string, Monitored::Scalar<float>> monitoredIdVariables;
89 monitoredIdVariables.emplace(key + "_TauJetScoreAccepted_0p", Monitored::Scalar<float>(key + "_TauJetScoreAccepted_0p", -1));
90 monitoredIdVariables.emplace(key + "_TauJetScoreTransAccepted_0p", Monitored::Scalar<float>(key + "_TauJetScoreTransAccepted_0p", -1));
91 monitoredIdVariables.emplace(key + "_TauJetScoreAccepted_1p", Monitored::Scalar<float>(key + "_TauJetScoreAccepted_1p", -1));
92 monitoredIdVariables.emplace(key + "_TauJetScoreTransAccepted_1p", Monitored::Scalar<float>(key + "_TauJetScoreTransAccepted_1p", -1));
93 monitoredIdVariables.emplace(key + "_TauJetScoreAccepted_mp", Monitored::Scalar<float>(key + "_TauJetScoreAccepted_mp", -1));
94 monitoredIdVariables.emplace(key + "_TauJetScoreTransAccepted_mp", Monitored::Scalar<float>(key + "_TauJetScoreTransAccepted_mp", -1));
95 }
96
97 std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> monVars = {
98 std::ref(NInputTaus), std::ref(passedCuts), std::ref(PtAccepted), std::ref(NTracksAccepted), std::ref(NIsoTracksAccepted)
99 };
100 for(auto& [key, var] : monitoredIdVariables) monVars.push_back(std::ref(var));
101 auto monitorIt = Monitored::Group(
m_monTool, monVars);
102
103
104
105 bool pass = false;
106
108 pass = true;
109 ATH_MSG_DEBUG(
"AcceptAll property is set: taking all events");
110 }
111
112
114
116 NInputTaus = TauContainer->
size();
117
120
121 float pT =
Tau->pt();
122
123
124
125
127
129 passedCuts++;
130 PtAccepted =
pT / Gaudi::Units::GeV;
131
132
133
134
135
136 int numTrack = 0, numIsoTrack = 0;
138
139
142 }
145 }
146 } else {
147
148 numTrack =
Tau->nTracks();
149 numIsoTrack =
Tau->nTracksIsolation();
150 }
151
154
155
157
161 }
162
165 }
166 }
167
168
169 passedCuts++;
170 NTracksAccepted = numTrack;
171 NIsoTracksAccepted = numIsoTrack;
172
173
174
175
176
178
179
182
184
187 ATH_MSG_WARNING(
" RNNJetScoreSigTrans not available. Make sure the TauWPDecorator is run for the RNN Tau ID!");
188 }
189
192 continue;
194 continue;
196 continue;
198 continue;
199 }
200 }
201
203 const static SG::ConstAccessor<char> tauid_veryloose(
m_idWPNames[0]);
204 const static SG::ConstAccessor<char> tauid_loose(
m_idWPNames[1]);
205 const static SG::ConstAccessor<char> tauid_medium(
m_idWPNames[2]);
206 const static SG::ConstAccessor<char> tauid_tight(
m_idWPNames[3]);
207
208 if(!tauid_veryloose.isAvailable(*Tau) || !tauid_loose.isAvailable(*Tau) || !tauid_medium.isAvailable(*Tau) || !tauid_tight.isAvailable(*Tau))
209 ATH_MSG_WARNING(
"The TauID WP variables for the current configuration are missing! Make sure the correct inferences are included in the chain reconstruction sequence!");
210
213 continue;
214 }
else if(local_idWP ==
IDWP::Loose && !tauid_loose(*Tau)) {
215 continue;
216 }
else if(local_idWP ==
IDWP::Medium && !tauid_medium(*Tau)) {
217 continue;
218 }
else if(local_idWP ==
IDWP::Tight && !tauid_tight(*Tau)) {
219 continue;
220 }
221 }
222
223
224 }
225
226
228 if(!
p.first.isAvailable(*Tau))
229 ATH_MSG_WARNING(
"TauID Score " <<
m_monitoredIdScores.value().at(key).first <<
" is not available. Make sure the correct inferences are included in the chain reconstruction sequence!");
230
231 if(!
p.second.isAvailable(*Tau))
232 ATH_MSG_WARNING(
"TauID ScoreSigTrans " <<
m_monitoredIdScores.value().at(key).second <<
" is not available. Make sure the correct inferences are included in the chain reconstruction sequence!");
233
234 ATH_MSG_DEBUG(
" TauID \"" << key <<
"\" ScoreSigTrans: " <<
p.second(*Tau));
235
236
237 if(
Tau->nTracks() == 0) {
238 monitoredIdVariables.at(key +
"_TauJetScoreAccepted_0p") =
p.first(*Tau);
239 monitoredIdVariables.at(key +
"_TauJetScoreTransAccepted_0p") =
p.second(*Tau);
240 }
else if(
Tau->nTracks() == 1) {
241 monitoredIdVariables.at(key +
"_TauJetScoreAccepted_1p") =
p.first(*Tau);
242 monitoredIdVariables.at(key +
"_TauJetScoreTransAccepted_1p") =
p.second(*Tau);
243 } else {
244 monitoredIdVariables.at(key +
"_TauJetScoreAccepted_mp") =
p.first(*Tau);
245 monitoredIdVariables.at(key +
"_TauJetScoreTransAccepted_mp") =
p.second(*Tau);
246 }
247 }
248
249 passedCuts++;
250
251
252
253
254
255 pass = true;
256
258 }
259
260 return pass;
261}
#define ATH_MSG_WARNING(x)
size_type size() const noexcept
Returns the number of elements in the collection.
@ Tau
The object is a tau (jet)
@ RNNJetScoreSigTrans
RNN score which is signal transformed/flattened.
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".