ATLAS Offline Software
TrigMETMonitorAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
6 #include <TVector3.h>
7 #include <cmath>
8 
9 TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
10  : AthMonitorAlgorithm(name,pSvcLocator)
11 {
12 }
13 
14 
16 
17 
20  ATH_CHECK( m_offline_met_key.initialize() );
22  ATH_CHECK( m_hlt_muon_key.initialize() );
25  ATH_CHECK( m_vertex_key.initialize() );
26  ATH_CHECK( m_offline_vertex_key.initialize() );
27  ATH_CHECK( m_lvl1_roi_key.initialize() );
28  ATH_CHECK( m_l1_jFexMet_key.initialize() );
29  ATH_CHECK( m_l1_jFexSumEt_key.initialize() );
30  ATH_CHECK( m_l1_gFexJwojScalar_key.initialize() );
34  ATH_CHECK( m_l1_gFexNCMETScalar_key.initialize() );
36  ATH_CHECK( m_l1_gFexRhoMETScalar_key.initialize() );
38  ATH_CHECK( m_hlt_cell_met_key.initialize() );
39  ATH_CHECK( m_hlt_mht_met_key.initialize() );
40  ATH_CHECK( m_hlt_tc_met_key.initialize() );
41  ATH_CHECK( m_hlt_tc_em_met_key.initialize() );
42  ATH_CHECK( m_hlt_tcpufit_met_key.initialize() );
43  ATH_CHECK( m_hlt_tcpufit_sig30_met_key.initialize() );
44  ATH_CHECK( m_hlt_trkmht_met_key.initialize() );
45  ATH_CHECK( m_hlt_pfsum_met_key.initialize() );
46  ATH_CHECK( m_hlt_pfopufit_met_key.initialize() );
48  ATH_CHECK( m_hlt_cvfpufit_met_key.initialize() );
49  ATH_CHECK( m_hlt_mhtpufit_pf_met_key.initialize() );
50  ATH_CHECK( m_hlt_mhtpufit_em_met_key.initialize() );
51  ATH_CHECK( m_hlt_met_nn_key.initialize() );
52  ATH_CHECK( m_hlt_pfsum_cssk_met_key.initialize() );
53  ATH_CHECK( m_hlt_pfsum_vssk_met_key.initialize() );
54 
56 }
57 
58 
59 StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
60  using namespace Monitored;
61 
62  // access event info container
64  if (! eventInfo.isValid() ){
65  ATH_MSG_DEBUG("Container "<< eventInfo << " does not exist");
66  }
67 
68  // access lepton containers
70  if (! hlt_electron_cont.isValid() ) {
71  ATH_MSG_DEBUG("Container "<< m_hlt_electron_key << " does not exist");
72  }
73 
75  if (! hlt_muon_cont.isValid() ) {
76  ATH_MSG_DEBUG("Container "<< m_hlt_muon_key << " does not exist");
77  }
78 
79  // access topoclusters container
81  if (! hlt_topoclusters_cont.isValid() ) {
82  ATH_MSG_DEBUG("Container "<< m_topoclusters_key << " does not exist");
83  }
84 
85  // access tracks container
87  if (! hlt_tracks_cont.isValid() ) {
88  ATH_MSG_DEBUG("Container "<< m_tracks_key << " does not exist");
89  }
90 
91  // access vertex container
93  if (! hlt_vertex_cont.isValid() ) {
94  ATH_MSG_DEBUG("Container "<< m_vertex_key << " does not exist");
95  }
96 
98  if (! offline_vertex_cont.isValid() ) {
99  ATH_MSG_DEBUG("Container "<< m_offline_vertex_key << " does not exist");
100  }
101 
102  // access offline met containers
104  if (! offline_met_cont.isValid() ) {
105  ATH_MSG_DEBUG("Container "<< m_offline_met_key << " does not exist");
106  }
107 
108  // access L1 met containers
110  if (! l1_roi_cont.isValid() ) {
111  ATH_MSG_DEBUG("Container "<< m_lvl1_roi_key << " does not exist");
112  }
113 
114  // access L1 Fex met containers
116  if (! l1_jFexMet_cont.isValid() ) {
117  ATH_MSG_DEBUG("Container "<< m_l1_jFexMet_key << " does not exist");
118  }
120  if (! l1_jFexSumEt_cont.isValid() ) {
121  ATH_MSG_DEBUG("Container "<< m_l1_jFexSumEt_key << " does not exist");
122  }
124  if (! l1_gFexJwojScalar_cont.isValid() ) {
125  ATH_MSG_DEBUG("Container "<< m_l1_gFexJwojScalar_key << " does not exist");
126  }
128  if (! l1_gFexJwojMETComponents_cont.isValid() ) {
129  ATH_MSG_DEBUG("Container "<< m_l1_gFexJwojMETComponents_key << " does not exist");
130  }
132  if (! l1_gFexJwojMHTComponents_cont.isValid() ) {
133  ATH_MSG_DEBUG("Container "<< m_l1_gFexJwojMHTComponents_key << " does not exist");
134  }
136  if (! l1_gFexJwojMSTComponents_cont.isValid() ) {
137  ATH_MSG_DEBUG("Container "<< m_l1_gFexJwojMSTComponents_key << " does not exist");
138  }
140  if (! l1_gFexNCMETScalar_cont.isValid() ) {
141  ATH_MSG_DEBUG("Container "<< m_l1_gFexNCMETScalar_key << " does not exist");
142  }
144  if (! l1_gFexNCMETComponents_cont.isValid() ) {
145  ATH_MSG_DEBUG("Container "<< m_l1_gFexNCMETComponents_key << " does not exist");
146  }
148  if (! l1_gFexRhoMETScalar_cont.isValid() ) {
149  ATH_MSG_DEBUG("Container "<< m_l1_gFexRhoMETScalar_key << " does not exist");
150  }
152  if (! l1_gFexRhoMETComponents_cont.isValid() ) {
153  ATH_MSG_DEBUG("Container "<< m_l1_gFexRhoMETComponents_key << " does not exist");
154  }
155 
156  // access HLT met containers
158  if (! hlt_cell_met_cont.isValid() ) {
159  ATH_MSG_DEBUG("Container "<< m_hlt_cell_met_key << " does not exist");
160  }
161 
163  if (! hlt_mht_met_cont.isValid() ) {
164  ATH_MSG_DEBUG("Container "<< m_hlt_mht_met_key << " does not exist");
165  }
166 
168  if (! hlt_tc_met_cont.isValid() ) {
169  ATH_MSG_DEBUG("Container "<< m_hlt_tc_met_key << " does not exist");
170  }
171 
173  if (! hlt_tc_em_met_cont.isValid() ) {
174  ATH_MSG_DEBUG("Container "<< m_hlt_tc_em_met_key << " does not exist");
175  }
176 
178  if (! hlt_tcpufit_met_cont.isValid() ) {
179  ATH_MSG_DEBUG("Container "<< m_hlt_tcpufit_met_key << " does not exist");
180  }
181 
183  if (! hlt_tcpufit_sig30_met_cont.isValid() ) {
184  ATH_MSG_DEBUG("Container "<< m_hlt_tcpufit_sig30_met_key << " does not exist");
185  }
186 
188  if (! hlt_trkmht_met_cont.isValid() ) {
189  ATH_MSG_DEBUG("Container "<< m_hlt_trkmht_met_key << " does not exist");
190  }
191 
193  if (! hlt_pfsum_met_cont.isValid() ) {
194  ATH_MSG_DEBUG("Container "<< m_hlt_pfsum_met_key << " does not exist");
195  }
196 
198  if (! hlt_pfsum_cssk_met_cont.isValid() ) {
199  ATH_MSG_DEBUG("Container "<< m_hlt_pfsum_cssk_met_key << " does not exist");
200  }
201 
203  if (! hlt_pfsum_vssk_met_cont.isValid() ) {
204  ATH_MSG_DEBUG("Container "<< m_hlt_pfsum_vssk_met_key << " does not exist");
205  }
206 
208  if (! hlt_pfopufit_met_cont.isValid() ) {
209  ATH_MSG_DEBUG("Container "<< m_hlt_pfopufit_met_key << " does not exist");
210  }
211 
213  if (! hlt_pfopufit_sig30_met_cont.isValid() ) {
214  ATH_MSG_DEBUG("Container "<< m_hlt_pfopufit_sig30_met_key << " does not exist");
215  }
216 
218  if (! hlt_cvfpufit_met_cont.isValid() ) {
219  ATH_MSG_DEBUG("Container "<< m_hlt_cvfpufit_met_key << " does not exist");
220  }
221 
223  if (! hlt_mhtpufit_pf_met_cont.isValid() ) {
224  ATH_MSG_DEBUG("Container "<< m_hlt_mhtpufit_pf_met_key << " does not exist");
225  }
226 
228  if (! hlt_mhtpufit_em_met_cont.isValid() ) {
229  ATH_MSG_DEBUG("Container "<< m_hlt_mhtpufit_em_met_key << " does not exist");
230  }
231 
233  if (! hlt_met_nn_cont.isValid() ) {
234  ATH_MSG_DEBUG("Container "<< m_hlt_met_nn_key << " does not exist");
235  }
236 
237  // define variables
238  auto act_IPBC = Monitored::Scalar<float>("act_IPBC",0.0);
239  auto hlt_el_mult = Monitored::Scalar<int>("hlt_el_mult",0.0);
240  auto hlt_el_pt = Monitored::Scalar<float>("hlt_el_pt",0.0);
241  auto hlt_mu_mult = Monitored::Scalar<int>("hlt_mu_mult",0.0);
242  auto hlt_mu_pt = Monitored::Scalar<float>("hlt_mu_pt",0.0);
243 
244  auto hlt_topoclusters_mult = Monitored::Scalar<int>("hlt_topoclusters_mult",0.0);
245  auto hlt_topoclusters_pt = Monitored::Scalar<float>("hlt_topoclusters_pt",0.0);
246  auto hlt_tracks_mult = Monitored::Scalar<int>("hlt_tracks_mult",0.0);
247  auto hlt_tracks_pt = Monitored::Scalar<float>("hlt_tracks_pt",0.0);
248  auto hlt_tracks_phi = Monitored::Scalar<float>("hlt_tracks_phi",0.0);
249  auto hlt_tracks_eta = Monitored::Scalar<float>("hlt_tracks_eta",0.0);
250  auto hlt_tracks_leading_pt = Monitored::Scalar<float>("hlt_tracks_leading_pt",0.0);
251  auto hlt_tracks_vec_sumPt = Monitored::Scalar<float>("hlt_tracks_vec_sumPt",0.0);
252  auto hlt_tracks_sca_sumPt = Monitored::Scalar<float>("hlt_tracks_sca_sumPt",0.0);
253  auto hlt_vertex_mult = Monitored::Scalar<int>("hlt_vertex_mult",0.0);
254  auto hlt_vertex_mult_mu = Monitored::Scalar<int>("hlt_vertex_mult_mu",0.0);
255  auto hlt_vertex_z = Monitored::Scalar<float>("hlt_vertex_z",0.0);
256  auto hlt_vertex_z_diff = Monitored::Scalar<float>("hlt_vertex_z_diff",0.0);
257 
258  auto offline_Ex = Monitored::Scalar<float>("offline_Ex",0.0);
259  auto offline_Ey = Monitored::Scalar<float>("offline_Ey",0.0);
260  auto offline_Et = Monitored::Scalar<float>("offline_Et",0.0);
261  auto offline_sumEt = Monitored::Scalar<float>("offline_sumEt",0.0);
262  auto offline_Et_eff = Monitored::Scalar<float>("offline_Et_eff",0.0);
263  auto offline_NoMu_Ex = Monitored::Scalar<float>("offline_NoMu_Ex",0.0);
264  auto offline_NoMu_Ey = Monitored::Scalar<float>("offline_NoMu_Ey",0.0);
265  auto offline_NoMu_Et = Monitored::Scalar<float>("offline_NoMu_Et",0.0);
266  auto offline_NoMu_sumEt = Monitored::Scalar<float>("offline_NoMu_sumEt",0.0);
267  auto offline_NoMu_Et_eff = Monitored::Scalar<float>("offline_NoMu_Et_eff",0.0);
268 
269  auto HLT_MET_status = Monitored::Scalar<int>("HLT_MET_status",0.0);
270  auto MET_status = Monitored::Scalar<float>("MET_status",0.0);
271  auto HLT_MET_component = Monitored::Scalar<int>("HLT_MET_component",0.0);
272  auto component_Et = Monitored::Scalar<float>("component_Et",0.0);
273  auto component = Monitored::Scalar<int>("component",0.0);
274  auto component_status = Monitored::Scalar<int>("component_status",0.0);
275  auto component_status_weight = Monitored::Scalar<int>("component_status_weight",0.0);
276 
277  // constant floor for log plots
278  double epsilon = 1.189;
279 
280  // for histogram filling
281  // Fill. First argument is the tool (GMT) name as defined in the py file,
282  // all others are the variables to be saved.
283  auto tool = getGroup("TrigMETMonitor");
284 
285  // access pileup <mu>
286  act_IPBC = eventInfo->actualInteractionsPerCrossing();
287 
288  // access lepton values
289  // access events with electron passing primary single electron chain
290  bool passedPrimaryEl = false;
291  for (const std::string& chain : m_hltChainEl){
292  if(getTrigDecisionTool()->isPassed(chain)){
293  passedPrimaryEl = true;
294  break;
295  }
296  }
297  if ( hlt_electron_cont.isValid() && passedPrimaryEl ){
298  hlt_el_mult = hlt_electron_cont->size();
299  fill(tool,hlt_el_mult);
300  if( hlt_electron_cont->size() > 0 ) {
301  for (auto Electron: *hlt_electron_cont) {
302  hlt_el_pt = Electron->pt()/Gaudi::Units::GeV;
303  fill(tool, hlt_el_pt);
304  }
305  }
306  }
307 
308  // access events with muon passing primary single muon chain
309  bool passedPrimaryMu = false;
310  for (const std::string& chain : m_hltChainMu){
311  if(getTrigDecisionTool()->isPassed(chain)){
312  passedPrimaryMu = true;
313  break;
314  }
315  }
316  if( hlt_muon_cont.isValid() &&passedPrimaryMu ){
317  hlt_mu_mult = hlt_muon_cont->size();
318  fill(tool,hlt_mu_mult);
319  if ( hlt_muon_cont->size() > 0 ){
320  for(auto Muon : *hlt_muon_cont){
321  hlt_mu_pt = Muon->pt()/Gaudi::Units::GeV;
322  fill(tool, hlt_mu_pt);
323  }
324  }
325  }
326 
327  // access topoclusters container
328  if(hlt_topoclusters_cont.isValid() && hlt_topoclusters_cont->size() > 0){
329  hlt_topoclusters_mult = hlt_topoclusters_cont->size();
330  for(auto topoclusters : *hlt_topoclusters_cont){
331  hlt_topoclusters_pt = topoclusters->pt()/Gaudi::Units::GeV;
332  if(hlt_topoclusters_pt > 0){
333  fill(tool, hlt_topoclusters_pt);
334  }
335  }
336 
337  if(hlt_topoclusters_mult > 0){
338  fill(tool, hlt_topoclusters_mult);
339  }
340  }
341 
342  // access tracks container
343  if( hlt_tracks_cont.isValid() && hlt_tracks_cont->size() > 0){
344  hlt_tracks_mult = hlt_tracks_cont->size();
345  float scalarSumPt = 0.0;
346  float scalarSumPx = 0.0;
347  float scalarSumPy = 0.0;
348  for(auto tracks : *hlt_tracks_cont){
349  float i_track_pt = tracks->pt()/Gaudi::Units::GeV;
350  hlt_tracks_pt = i_track_pt;
351  scalarSumPt += i_track_pt;
352  scalarSumPx += (tracks->p4().Px());
353  scalarSumPy += (tracks->p4().Py());
354 
355  if(hlt_tracks_pt > hlt_tracks_leading_pt){
356  hlt_tracks_leading_pt = i_track_pt;
357  }
358 
359  if(hlt_tracks_pt > 0){
360  fill(tool, hlt_tracks_pt);
361  }
362 
363  if(hlt_tracks_pt > 3){
364  hlt_tracks_eta = (tracks->eta());
365  hlt_tracks_phi = (tracks->phi());
366  fill(tool, hlt_tracks_eta, hlt_tracks_phi);
367  }
368  }
369 
370  hlt_tracks_vec_sumPt = std::sqrt(scalarSumPx*scalarSumPx + scalarSumPy*scalarSumPy)/Gaudi::Units::GeV;
371  hlt_tracks_sca_sumPt = scalarSumPt;
372 
373  fill(tool, hlt_tracks_mult, hlt_tracks_leading_pt, hlt_tracks_vec_sumPt, hlt_tracks_sca_sumPt);
374  }
375 
376  // access vertex container
377  if(hlt_vertex_cont.isValid() && hlt_vertex_cont->size() > 0){
378  hlt_vertex_mult = hlt_vertex_cont->size();
379  hlt_vertex_mult_mu = hlt_vertex_cont->size();
380  const xAOD::Vertex_v1* hlt_vertex = nullptr;
381  for(auto vertex : *hlt_vertex_cont){
382  if(vertex->vertexType() == xAOD::VxType::VertexType::PriVtx){
383  hlt_vertex = vertex;
384  break;
385  }
386  }
387 
388  if(hlt_vertex){
389  hlt_vertex_z = hlt_vertex->z();
390  fill(tool, hlt_vertex_z);
391 
392  if(offline_vertex_cont.isValid() && offline_vertex_cont->size() > 0){
393  const xAOD::Vertex_v1* offline_vertex = nullptr;
394  for(auto vertex : *offline_vertex_cont){
395  if(vertex->vertexType() == xAOD::VxType::VertexType::PriVtx){
396  offline_vertex = vertex;
397  break;
398  }
399  }
400 
401  if(offline_vertex){
402  hlt_vertex_z_diff = hlt_vertex_z - offline_vertex->z();
403  fill(tool, hlt_vertex_z_diff);
404  }
405  }
406  }
407  }else{
408  hlt_vertex_mult = -1;
409  hlt_vertex_mult_mu = 1;
410  act_IPBC = -1.;
411  }
412  fill(tool, hlt_vertex_mult);
413  fill(tool, act_IPBC, hlt_vertex_mult_mu);
414 
415  // access offline MET values
416  const xAOD::MissingET *finalTrkMET = 0;
417  const xAOD::MissingET *muonsMET = 0;
418  if ( offline_met_cont.isValid() && offline_met_cont->size() > 0 ) {
419  finalTrkMET = ((*offline_met_cont)["FinalTrk"]);
420  muonsMET = ((*offline_met_cont)["Muons"]);
421 
422  if(finalTrkMET) {
423  offline_Ex = - finalTrkMET->mpx()/Gaudi::Units::GeV;
424  offline_Ey = - finalTrkMET->mpy()/Gaudi::Units::GeV;
425  offline_sumEt = finalTrkMET->sumet()/Gaudi::Units::GeV;
426  offline_Et = std::sqrt(offline_Ex*offline_Ex + offline_Ey*offline_Ey);
427  offline_Et_eff = std::sqrt(offline_Ex*offline_Ex + offline_Ey*offline_Ey);
428  fill(tool,offline_Ex,offline_Ey,offline_Et,offline_sumEt);
429 
430  if(muonsMET){
431  xAOD::MissingET finalTrkNoMuMET = *finalTrkMET - *muonsMET;
432  offline_NoMu_Ex = - finalTrkNoMuMET.mpx()/Gaudi::Units::GeV;
433  offline_NoMu_Ey = - finalTrkNoMuMET.mpy()/Gaudi::Units::GeV;
434  offline_NoMu_sumEt = finalTrkNoMuMET.sumet()/Gaudi::Units::GeV;
435  offline_NoMu_Et = std::sqrt(offline_NoMu_Ex*offline_NoMu_Ex + offline_NoMu_Ey*offline_NoMu_Ey);
436  offline_NoMu_Et_eff = std::sqrt(offline_NoMu_Ex*offline_NoMu_Ex + offline_NoMu_Ey*offline_NoMu_Ey);
437  fill(tool,offline_NoMu_Ex,offline_NoMu_Ey,offline_NoMu_Et,offline_NoMu_sumEt);
438  }
439  }
440  }
441 
442  // access L1 MET values
443  for (const std::string& alg : m_algsL1) {
445  if (alg == "roi" && l1_roi_cont.isValid()) {
446  l1_met_cont = l1_roi_cont;
447  }
448 
449  if ( l1_met_cont.isValid() ) {
450  if ((l1_met_cont->energyX())>-9e12 && (l1_met_cont->energyX())<9e12 && (l1_met_cont->energyY())>-9e12 && (l1_met_cont->energyY())<9e12) {
451  float L1_met_Ex = - l1_met_cont->energyX()/Gaudi::Units::GeV;
452  float L1_met_Ey = - l1_met_cont->energyY()/Gaudi::Units::GeV;
453  float L1_met_Et = std::sqrt(L1_met_Ex*L1_met_Ex + L1_met_Ey*L1_met_Ey);
454  float L1_met_sumEt = l1_met_cont->energyT()/Gaudi::Units::GeV;
455  float L1_met_Ex_log = signed_log(L1_met_Ex, epsilon);
456  float L1_met_Ey_log = signed_log(L1_met_Ey, epsilon);
457  float L1_met_Et_log = signed_log(L1_met_Et, epsilon);
458  float L1_met_sumEt_log = signed_log(L1_met_sumEt, epsilon);
459  TVector3 v(L1_met_Ex, L1_met_Ey, 0.0);
460  float L1_met_phi = v.Phi();
461 
462  auto L1_Ex = Monitored::Scalar<float>("L1_"+alg+"_Ex", static_cast<float>(L1_met_Ex));
463  auto L1_Ey = Monitored::Scalar<float>("L1_"+alg+"_Ey", static_cast<float>(L1_met_Ey));
464  auto L1_Et = Monitored::Scalar<float>("L1_"+alg+"_Et", static_cast<float>(L1_met_Et));
465  auto L1_sumEt = Monitored::Scalar<float>("L1_"+alg+"_sumEt", static_cast<float>(L1_met_sumEt));
466  auto L1_Ex_log = Monitored::Scalar<float>("L1_"+alg+"_Ex_log", static_cast<float>(L1_met_Ex_log));
467  auto L1_Ey_log = Monitored::Scalar<float>("L1_"+alg+"_Ey_log", static_cast<float>(L1_met_Ey_log));
468  auto L1_Et_log = Monitored::Scalar<float>("L1_"+alg+"_Et_log", static_cast<float>(L1_met_Et_log));
469  auto L1_sumEt_log = Monitored::Scalar<float>("L1_"+alg+"_sumEt_log", static_cast<float>(L1_met_sumEt_log));
470  auto L1_phi = Monitored::Scalar<float>("L1_"+alg+"_phi", static_cast<float>(L1_met_phi));
471  fill(tool, L1_Ex, L1_Ey, L1_Et, L1_sumEt,
472  L1_Ex_log, L1_Ey_log, L1_Et_log, L1_sumEt_log, L1_phi);
473  }
474  }
475  }
476 
477  // access L1 jFex MET values
478  if (l1_jFexMet_cont.isValid() && l1_jFexMet_cont->size() > 0) {
479  float L1_met_Ex = 0;
480  float L1_met_Ey = 0;
481  for (const auto l1_jmet: *l1_jFexMet_cont) {
482  L1_met_Ex += l1_jmet->Ex()/Gaudi::Units::GeV;
483  L1_met_Ey += l1_jmet->Ey()/Gaudi::Units::GeV;
484  }
485  float L1_met_Et = std::sqrt(L1_met_Ex*L1_met_Ex + L1_met_Ey*L1_met_Ey);
486  float L1_met_Ex_log = signed_log(L1_met_Ex, epsilon);
487  float L1_met_Ey_log = signed_log(L1_met_Ey, epsilon);
488  float L1_met_Et_log = signed_log(L1_met_Et, epsilon);
489  TVector3 v(L1_met_Ex, L1_met_Ey, 0.0);
490  float L1_met_phi = v.Phi();
491  auto L1_Ex = Monitored::Scalar<float>("L1_jFex_Ex", static_cast<float>(L1_met_Ex));
492  auto L1_Ey = Monitored::Scalar<float>("L1_jFex_Ey", static_cast<float>(L1_met_Ey));
493  auto L1_Et = Monitored::Scalar<float>("L1_jFex_Et", static_cast<float>(L1_met_Et));
494  auto L1_Ex_log = Monitored::Scalar<float>("L1_jFex_Ex_log", static_cast<float>(L1_met_Ex_log));
495  auto L1_Ey_log = Monitored::Scalar<float>("L1_jFex_Ey_log", static_cast<float>(L1_met_Ey_log));
496  auto L1_Et_log = Monitored::Scalar<float>("L1_jFex_Et_log", static_cast<float>(L1_met_Et_log));
497  auto L1_phi = Monitored::Scalar<float>("L1_jFex_phi", static_cast<float>(L1_met_phi));
498  fill(tool, L1_Ex, L1_Ey, L1_Et, L1_Ex_log, L1_Ey_log, L1_Et_log, L1_phi);
499  }
500  if (l1_jFexSumEt_cont.isValid() && l1_jFexSumEt_cont->size() > 0) {
501  float L1_met_sumEt = 0;
502  for (const auto l1_jsumEt: *l1_jFexSumEt_cont) {
503  L1_met_sumEt += l1_jsumEt->Et_lower()/Gaudi::Units::GeV + l1_jsumEt->Et_upper()/Gaudi::Units::GeV;
504  }
505  float L1_met_sumEt_log = signed_log(L1_met_sumEt, epsilon);
506  auto L1_sumEt = Monitored::Scalar<float>("L1_jFex_sumEt", static_cast<float>(L1_met_sumEt));
507  auto L1_sumEt_log = Monitored::Scalar<float>("L1_jFex_sumEt_log", static_cast<float>(L1_met_sumEt_log));
508  fill(tool, L1_sumEt, L1_sumEt_log);
509  }
510 
511  // define L1 gFex MET object
512  const xAOD::gFexGlobalRoI *l1_gmet;
513 
514  // access L1 gFex MET values
515  // This will be properly implemented when it's ready
516  if (l1_gFexJwojScalar_cont.isValid() && l1_gFexJwojScalar_cont->size() > 0) {
517  l1_gmet = l1_gFexJwojScalar_cont->at(0);
518  float L1_met_Et = l1_gmet->METquantityOne()/Gaudi::Units::GeV;
519  float L1_met_sumEt = l1_gmet->METquantityTwo()/Gaudi::Units::GeV;
520  float L1_met_Et_log = signed_log(L1_met_Et, epsilon);
521  float L1_met_sumEt_log = signed_log(L1_met_sumEt, epsilon);
522  auto L1_Et = Monitored::Scalar<float>("L1_gFexJwoj_Et", static_cast<float>(L1_met_Et));
523  auto L1_Et_log = Monitored::Scalar<float>("L1_gFexJwoj_Et_log", static_cast<float>(L1_met_Et_log));
524  auto L1_sumEt = Monitored::Scalar<float>("L1_gFexJwoj_sumEt", static_cast<float>(L1_met_sumEt));
525  auto L1_sumEt_log = Monitored::Scalar<float>("L1_gFexJwoj_sumEt_log", static_cast<float>(L1_met_sumEt_log));
526  fill(tool, L1_Et, L1_Et_log, L1_sumEt, L1_sumEt_log);
527  }
528 
529  if (l1_gFexJwojMETComponents_cont.isValid() && l1_gFexJwojMETComponents_cont->size() > 0) {
530  l1_gmet = l1_gFexJwojMETComponents_cont->at(0);
531  float L1_met_Ex = l1_gmet->METquantityOne()/Gaudi::Units::GeV;
532  float L1_met_Ex_log = signed_log(L1_met_Ex, epsilon);
533  float L1_met_Ey = l1_gmet->METquantityTwo()/Gaudi::Units::GeV;
534  float L1_met_Ey_log = signed_log(L1_met_Ey, epsilon);
535  TVector3 v(L1_met_Ex, L1_met_Ey, 0.0);
536  float L1_met_phi = v.Phi();
537  auto L1_Ex = Monitored::Scalar<float>("L1_gFexJwoj_Ex", static_cast<float>(L1_met_Ex));
538  auto L1_Ey = Monitored::Scalar<float>("L1_gFexJwoj_Ey", static_cast<float>(L1_met_Ey));
539  auto L1_Ex_log = Monitored::Scalar<float>("L1_gFexJwoj_Ex_log", static_cast<float>(L1_met_Ex_log));
540  auto L1_Ey_log = Monitored::Scalar<float>("L1_gFexJwoj_Ey_log", static_cast<float>(L1_met_Ey_log));
541  auto L1_phi = Monitored::Scalar<float>("L1_gFexJwoj_phi", static_cast<float>(L1_met_phi));
542  fill(tool, L1_Ex, L1_Ey, L1_Ex_log, L1_Ey_log, L1_phi);
543  }
544 
545  if (l1_gFexJwojMHTComponents_cont.isValid() && l1_gFexJwojMHTComponents_cont->size() > 0) {
546  l1_gmet = l1_gFexJwojMHTComponents_cont->at(0);
547  float L1_met_HT_Ex = l1_gmet->METquantityOne()/Gaudi::Units::GeV;
548  float L1_met_HT_Ex_log = signed_log(L1_met_HT_Ex, epsilon);
549  float L1_met_HT_Ey = l1_gmet->METquantityTwo()/Gaudi::Units::GeV;
550  float L1_met_HT_Ey_log = signed_log(L1_met_HT_Ey, epsilon);
551  TVector3 v(L1_met_HT_Ex, L1_met_HT_Ey, 0.0);
552  float L1_met_HT_phi = v.Phi();
553  auto L1_HT_Ex = Monitored::Scalar<float>("L1_gFexJwoj_HT_Ex", static_cast<float>(L1_met_HT_Ex));
554  auto L1_HT_Ey = Monitored::Scalar<float>("L1_gFexJwoj_HT_Ey", static_cast<float>(L1_met_HT_Ey));
555  auto L1_HT_Ex_log = Monitored::Scalar<float>("L1_gFexJwoj_HT_Ex_log", static_cast<float>(L1_met_HT_Ex_log));
556  auto L1_HT_Ey_log = Monitored::Scalar<float>("L1_gFexJwoj_HT_Ey_log", static_cast<float>(L1_met_HT_Ey_log));
557  auto L1_HT_phi = Monitored::Scalar<float>("L1_gFexJwoj_HT_phi", static_cast<float>(L1_met_HT_phi));
558  fill(tool, L1_HT_Ex, L1_HT_Ey, L1_HT_Ex_log, L1_HT_Ey_log, L1_HT_phi);
559  }
560 
561  if (l1_gFexJwojMSTComponents_cont.isValid() && l1_gFexJwojMSTComponents_cont->size() > 0) {
562  l1_gmet = l1_gFexJwojMSTComponents_cont->at(0);
563  float L1_met_ST_Ex = l1_gmet->METquantityOne()/Gaudi::Units::GeV;
564  float L1_met_ST_Ex_log = signed_log(L1_met_ST_Ex, epsilon);
565  float L1_met_ST_Ey = l1_gmet->METquantityTwo()/Gaudi::Units::GeV;
566  float L1_met_ST_Ey_log = signed_log(L1_met_ST_Ey, epsilon);
567  TVector3 v(L1_met_ST_Ex, L1_met_ST_Ey, 0.0);
568  float L1_met_ST_phi = v.Phi();
569  auto L1_ST_Ex = Monitored::Scalar<float>("L1_gFexJwoj_ST_Ex", static_cast<float>(L1_met_ST_Ex));
570  auto L1_ST_Ey = Monitored::Scalar<float>("L1_gFexJwoj_ST_Ey", static_cast<float>(L1_met_ST_Ey));
571  auto L1_ST_Ex_log = Monitored::Scalar<float>("L1_gFexJwoj_ST_Ex_log", static_cast<float>(L1_met_ST_Ex_log));
572  auto L1_ST_Ey_log = Monitored::Scalar<float>("L1_gFexJwoj_ST_Ey_log", static_cast<float>(L1_met_ST_Ey_log));
573  auto L1_ST_phi = Monitored::Scalar<float>("L1_gFexJwoj_ST_phi", static_cast<float>(L1_met_ST_phi));
574  fill(tool, L1_ST_Ex, L1_ST_Ey, L1_ST_Ex_log, L1_ST_Ey_log, L1_ST_phi);
575  }
576 
577  if (l1_gFexNCMETScalar_cont.isValid() && l1_gFexNCMETScalar_cont->size() > 0) {
578  l1_gmet = l1_gFexNCMETScalar_cont->at(0);
579  float L1_met_Et = l1_gmet->METquantityOne()/Gaudi::Units::GeV;
580  float L1_met_sumEt = l1_gmet->METquantityTwo()/Gaudi::Units::GeV;
581  float L1_met_Et_log = signed_log(L1_met_Et, epsilon);
582  float L1_met_sumEt_log = signed_log(L1_met_sumEt, epsilon);
583  auto L1_Et = Monitored::Scalar<float>("L1_gFexNC_Et", static_cast<float>(L1_met_Et));
584  auto L1_Et_log = Monitored::Scalar<float>("L1_gFexNC_Et_log", static_cast<float>(L1_met_Et_log));
585  auto L1_sumEt = Monitored::Scalar<float>("L1_gFexNC_sumEt", static_cast<float>(L1_met_sumEt));
586  auto L1_sumEt_log = Monitored::Scalar<float>("L1_gFexNC_sumEt_log", static_cast<float>(L1_met_sumEt_log));
587  fill(tool, L1_Et, L1_Et_log, L1_sumEt, L1_sumEt_log);
588  }
589 
590  if (l1_gFexNCMETComponents_cont.isValid() && l1_gFexNCMETComponents_cont->size() > 0) {
591  l1_gmet = l1_gFexNCMETComponents_cont->at(0);
592  float L1_met_Ex = l1_gmet->METquantityOne()/Gaudi::Units::GeV;
593  float L1_met_Ex_log = signed_log(L1_met_Ex, epsilon);
594  float L1_met_Ey = l1_gmet->METquantityTwo()/Gaudi::Units::GeV;
595  float L1_met_Ey_log = signed_log(L1_met_Ey, epsilon);
596  TVector3 v(L1_met_Ex, L1_met_Ey, 0.0);
597  float L1_met_phi = v.Phi();
598  auto L1_Ex = Monitored::Scalar<float>("L1_gFexNC_Ex", static_cast<float>(L1_met_Ex));
599  auto L1_Ey = Monitored::Scalar<float>("L1_gFexNC_Ey", static_cast<float>(L1_met_Ey));
600  auto L1_Ex_log = Monitored::Scalar<float>("L1_gFexNC_Ex_log", static_cast<float>(L1_met_Ex_log));
601  auto L1_Ey_log = Monitored::Scalar<float>("L1_gFexNC_Ey_log", static_cast<float>(L1_met_Ey_log));
602  auto L1_phi = Monitored::Scalar<float>("L1_gFexNC_phi", static_cast<float>(L1_met_phi));
603  fill(tool, L1_Ex, L1_Ey, L1_Ex_log, L1_Ey_log, L1_phi);
604  }
605 
606  if (l1_gFexRhoMETScalar_cont.isValid() && l1_gFexRhoMETScalar_cont->size() > 0) {
607  l1_gmet = l1_gFexRhoMETScalar_cont->at(0);
608  float L1_met_Et = l1_gmet->METquantityOne()/Gaudi::Units::GeV;
609  float L1_met_sumEt = l1_gmet->METquantityTwo()/Gaudi::Units::GeV;
610  float L1_met_Et_log = signed_log(L1_met_Et, epsilon);
611  float L1_met_sumEt_log = signed_log(L1_met_sumEt, epsilon);
612  auto L1_Et = Monitored::Scalar<float>("L1_gFexRho_Et", static_cast<float>(L1_met_Et));
613  auto L1_Et_log = Monitored::Scalar<float>("L1_gFexRho_Et_log", static_cast<float>(L1_met_Et_log));
614  auto L1_sumEt = Monitored::Scalar<float>("L1_gFexRho_sumEt", static_cast<float>(L1_met_sumEt));
615  auto L1_sumEt_log = Monitored::Scalar<float>("L1_gFexRho_sumEt_log", static_cast<float>(L1_met_sumEt_log));
616  fill(tool, L1_Et, L1_Et_log, L1_sumEt, L1_sumEt_log);
617  }
618 
619  if (l1_gFexRhoMETComponents_cont.isValid() && l1_gFexRhoMETComponents_cont->size() > 0) {
620  l1_gmet = l1_gFexRhoMETComponents_cont->at(0);
621  float L1_met_Ex = l1_gmet->METquantityOne()/Gaudi::Units::GeV;
622  float L1_met_Ex_log = signed_log(L1_met_Ex, epsilon);
623  float L1_met_Ey = l1_gmet->METquantityTwo()/Gaudi::Units::GeV;
624  float L1_met_Ey_log = signed_log(L1_met_Ey, epsilon);
625  TVector3 v(L1_met_Ex, L1_met_Ey, 0.0);
626  float L1_met_phi = v.Phi();
627  auto L1_Ex = Monitored::Scalar<float>("L1_gFexRho_Ex", static_cast<float>(L1_met_Ex));
628  auto L1_Ey = Monitored::Scalar<float>("L1_gFexRho_Ey", static_cast<float>(L1_met_Ey));
629  auto L1_Ex_log = Monitored::Scalar<float>("L1_gFexRho_Ex_log", static_cast<float>(L1_met_Ex_log));
630  auto L1_Ey_log = Monitored::Scalar<float>("L1_gFexRho_Ey_log", static_cast<float>(L1_met_Ey_log));
631  auto L1_phi = Monitored::Scalar<float>("L1_gFexRho_phi", static_cast<float>(L1_met_phi));
632  fill(tool, L1_Ex, L1_Ey, L1_Ex_log, L1_Ey_log, L1_phi);
633  }
634 
635  // define TrigMissingET object
636  const xAOD::TrigMissingET *hlt_met = 0;
637 
638  // status, component from HLT cell
639  int nComponent = m_compNames.size();
640  int nStatus = m_bitNames.size();
641  if ( hlt_cell_met_cont.isValid() && hlt_cell_met_cont->size() > 0 ) {
642  hlt_met = hlt_cell_met_cont->at(0);
643  for (int j=0; j<nStatus; ++j) { //status loop
644  unsigned mask = (1u<<j);
645  if (hlt_met->flag() & mask) {
646  MET_status = 1.;
647  } else {
648  MET_status = 0;
649  }
650  auto mon1 = Monitored::Scalar<std::string>( "HLT_MET_status",m_bitNames[j]);
651  fill(tool,mon1,MET_status);
652  }
653 
654  for (int i=0; i<nComponent; ++i) { //component loop
655  float ex = hlt_met->exComponent(i)/Gaudi::Units::GeV;
656  float ey = hlt_met->eyComponent(i)/Gaudi::Units::GeV;
657  component_Et = sqrt(ex*ex+ey*ey);
658  auto mon2 = Monitored::Scalar<std::string>( "HLT_MET_component",m_compNames[i]);
659  fill(tool,mon2,component_Et);
660  }
661 
662  for (int i=0; i<nComponent; ++i) { //component loop
663  for (int j=0; j<nStatus; ++j) { //status loop
664  unsigned mask = (1u<<j);
665  if (hlt_met->statusComponent(i) & mask) {
666  component_status_weight = 1.;
667  } else {
668  component_status_weight = 0;
669  }
670  auto mon_bit = Monitored::Scalar<std::string>( "component_status",m_bitNames[j]);
671  auto mon_comp = Monitored::Scalar<std::string>( "component",m_compNames[i]);
672  fill(tool,mon_comp,mon_bit,component_status_weight);
673  }
674  }
675  }
676 
677  // get L1 MET for pre-selection
678  float L1_roiMet_Et = 0;
679  if ( l1_roi_cont.isValid() ) {
680  if ((l1_roi_cont->energyX())>-9e12 && (l1_roi_cont->energyX())<9e12 && (l1_roi_cont->energyY())>-9e12 && (l1_roi_cont->energyY())<9e12) {
681  float Ex = - l1_roi_cont->energyX()/Gaudi::Units::GeV;
682  float Ey = - l1_roi_cont->energyY()/Gaudi::Units::GeV;
683  L1_roiMet_Et = std::sqrt(Ex*Ex + Ey*Ey);
684  }
685  }
686  float L1_jFexMet_Et = 0;
687  if (l1_jFexMet_cont.isValid() && l1_jFexMet_cont->size() > 0) {
688  float L1_met_Ex = 0;
689  float L1_met_Ey = 0;
690  for (const auto l1_jmet: *l1_jFexMet_cont) {
691  L1_met_Ex += l1_jmet->Ex()/Gaudi::Units::GeV;
692  L1_met_Ey += l1_jmet->Ey()/Gaudi::Units::GeV;
693  }
694  L1_jFexMet_Et = std::sqrt(L1_met_Ex*L1_met_Ex + L1_met_Ey*L1_met_Ey);
695  }
696  float L1_gFexJWOJMet_Et = 0;
697 
698  float L1_PreSelMet_Et = L1_roiMet_Et;
699  if (m_L1MetAlg == 1) L1_PreSelMet_Et = L1_jFexMet_Et;
700  if (m_L1MetAlg == 2) L1_PreSelMet_Et = L1_gFexJWOJMet_Et;
701 
702  // access HLT MET values
703  for (const std::string& alg : m_algsHLT) {
704  if (alg == "cell" && hlt_cell_met_cont.isValid() && hlt_cell_met_cont->size() > 0) {
705  hlt_met = hlt_cell_met_cont->at(0);
706  } else if (alg == "mht" && hlt_mht_met_cont.isValid() && hlt_mht_met_cont->size() > 0) {
707  hlt_met = hlt_mht_met_cont->at(0);
708  } else if (alg == "tc" && hlt_tc_met_cont.isValid() && hlt_tc_met_cont->size() > 0) {
709  hlt_met = hlt_tc_met_cont->at(0);
710  } else if (alg == "tc_em" && hlt_tc_em_met_cont.isValid() && hlt_tc_em_met_cont->size() > 0) {
711  hlt_met = hlt_tc_em_met_cont->at(0);
712  } else if (alg == "tcpufit" && hlt_tcpufit_met_cont.isValid() && hlt_tcpufit_met_cont->size() > 0) {
713  hlt_met = hlt_tcpufit_met_cont->at(0);
714  } else if (alg == "tcpufit_sig30" && hlt_tcpufit_sig30_met_cont.isValid() && hlt_tcpufit_sig30_met_cont->size() > 0) {
715  hlt_met = hlt_tcpufit_sig30_met_cont->at(0);
716  } else if (alg == "trkmht" && hlt_trkmht_met_cont.isValid() && hlt_trkmht_met_cont->size() > 0) {
717  hlt_met = hlt_trkmht_met_cont->at(0);
718  } else if (alg == "pfsum" && hlt_pfsum_met_cont.isValid() && hlt_pfsum_met_cont->size() > 0) {
719  hlt_met = hlt_pfsum_met_cont->at(0);
720  } else if (alg == "pfsum_cssk" && hlt_pfsum_cssk_met_cont.isValid() && hlt_pfsum_cssk_met_cont->size() > 0) {
721  hlt_met = hlt_pfsum_cssk_met_cont->at(0);
722  } else if (alg == "pfsum_vssk" && hlt_pfsum_vssk_met_cont.isValid() && hlt_pfsum_vssk_met_cont->size() > 0) {
723  hlt_met = hlt_pfsum_vssk_met_cont->at(0);
724  } else if (alg == "pfopufit" && hlt_pfopufit_met_cont.isValid() && hlt_pfopufit_met_cont->size() > 0) {
725  hlt_met = hlt_pfopufit_met_cont->at(0);
726  } else if (alg == "pfopufit_sig30" && hlt_pfopufit_sig30_met_cont.isValid() && hlt_pfopufit_sig30_met_cont->size() > 0) {
727  hlt_met = hlt_pfopufit_sig30_met_cont->at(0);
728  } else if (alg == "cvfpufit" && hlt_cvfpufit_met_cont.isValid() && hlt_cvfpufit_met_cont->size() > 0) {
729  hlt_met = hlt_cvfpufit_met_cont->at(0);
730  } else if (alg == "mhtpufit_pf" && hlt_mhtpufit_pf_met_cont.isValid() && hlt_mhtpufit_pf_met_cont->size() > 0) {
731  hlt_met = hlt_mhtpufit_pf_met_cont->at(0);
732  } else if (alg == "mhtpufit_em" && hlt_mhtpufit_em_met_cont.isValid() && hlt_mhtpufit_em_met_cont->size() > 0) {
733  hlt_met = hlt_mhtpufit_em_met_cont->at(0);
734  } else if (alg == "met_nn" && hlt_met_nn_cont.isValid() && hlt_met_nn_cont->size() > 0) {
735  hlt_met = hlt_met_nn_cont->at(0);
736  } else {
737  hlt_met = 0;
738  }
739 
740  if ( hlt_met ) {
741  float hlt_Ex = hlt_met->ex()/Gaudi::Units::GeV;
742  float hlt_Ey = hlt_met->ey()/Gaudi::Units::GeV;
743  float hlt_Ez = hlt_met->ez()/Gaudi::Units::GeV;
744  float hlt_Et = std::sqrt(hlt_Ex*hlt_Ex + hlt_Ey*hlt_Ey);
745  float hlt_sumEt = hlt_met->sumEt()/Gaudi::Units::GeV;
746  float hlt_Ex_log = signed_log(hlt_Ex, epsilon);
747  float hlt_Ey_log = signed_log(hlt_Ey, epsilon);
748  float hlt_Et_log = signed_log(hlt_Et, epsilon);
749  float hlt_sumEt_log = signed_log(hlt_sumEt, epsilon);
750  TVector3 v(hlt_Ex, hlt_Ey, hlt_Ez);
751  float hlt_eta = v.Eta();
752  float hlt_phi = v.Phi();
753 
754  auto met_Ex = Monitored::Scalar<float>(alg+"_Ex", static_cast<float>(hlt_Ex));
755  auto met_Ey = Monitored::Scalar<float>(alg+"_Ey", static_cast<float>(hlt_Ey));
756  auto met_Et = Monitored::Scalar<float>(alg+"_Et", static_cast<float>(hlt_Et));
757  auto met_sumEt = Monitored::Scalar<float>(alg+"_sumEt", static_cast<float>(hlt_sumEt));
758  auto met_Ex_log = Monitored::Scalar<float>(alg+"_Ex_log", static_cast<float>(hlt_Ex_log));
759  auto met_Ey_log = Monitored::Scalar<float>(alg+"_Ey_log", static_cast<float>(hlt_Ey_log));
760  auto met_Et_log = Monitored::Scalar<float>(alg+"_Et_log", static_cast<float>(hlt_Et_log));
761  auto met_sumEt_log = Monitored::Scalar<float>(alg+"_sumEt_log", static_cast<float>(hlt_sumEt_log));
762  auto met_eta = Monitored::Scalar<float>(alg+"_eta", static_cast<float>(hlt_eta));
763  auto met_phi = Monitored::Scalar<float>(alg+"_phi", static_cast<float>(hlt_phi));
764  fill(tool,met_Ex,met_Ey,met_Et,met_sumEt,
765  met_Ex_log,met_Ey_log,met_Et_log,met_sumEt_log,
766  met_eta,met_phi);
767 
768  }
769  }
770 
771  // access HLT pre-selection MET values
772  for (const std::string& alg : m_algsHLTPreSel) {
773  if (alg == "cell" && hlt_cell_met_cont.isValid() && hlt_cell_met_cont->size() > 0) {
774  hlt_met = hlt_cell_met_cont->at(0);
775  } else if (alg == "mht" && hlt_mht_met_cont.isValid() && hlt_mht_met_cont->size() > 0) {
776  hlt_met = hlt_mht_met_cont->at(0);
777  } else if (alg == "tc" && hlt_tc_met_cont.isValid() && hlt_tc_met_cont->size() > 0) {
778  hlt_met = hlt_tc_met_cont->at(0);
779  } else if (alg == "tc_em" && hlt_tc_em_met_cont.isValid() && hlt_tc_em_met_cont->size() > 0) {
780  hlt_met = hlt_tc_em_met_cont->at(0);
781  } else if (alg == "tcpufit" && hlt_tcpufit_met_cont.isValid() && hlt_tcpufit_met_cont->size() > 0) {
782  hlt_met = hlt_tcpufit_met_cont->at(0);
783  } else if (alg == "tcpufit_sig30" && hlt_tcpufit_sig30_met_cont.isValid() && hlt_tcpufit_sig30_met_cont->size() > 0) {
784  hlt_met = hlt_tcpufit_sig30_met_cont->at(0);
785  } else if (alg == "trkmht" && hlt_trkmht_met_cont.isValid() && hlt_trkmht_met_cont->size() > 0) {
786  hlt_met = hlt_trkmht_met_cont->at(0);
787  } else if (alg == "pfsum" && hlt_pfsum_met_cont.isValid() && hlt_pfsum_met_cont->size() > 0) {
788  hlt_met = hlt_pfsum_met_cont->at(0);
789  } else if (alg == "pfsum_cssk" && hlt_pfsum_cssk_met_cont.isValid() && hlt_pfsum_cssk_met_cont->size() > 0) {
790  hlt_met = hlt_pfsum_cssk_met_cont->at(0);
791  } else if (alg == "pfsum_vssk" && hlt_pfsum_vssk_met_cont.isValid() && hlt_pfsum_vssk_met_cont->size() > 0) {
792  hlt_met = hlt_pfsum_vssk_met_cont->at(0);
793  } else if (alg == "pfopufit" && hlt_pfopufit_met_cont.isValid() && hlt_pfopufit_met_cont->size() > 0) {
794  hlt_met = hlt_pfopufit_met_cont->at(0);
795  } else if (alg == "pfopufit_sig30" && hlt_pfopufit_sig30_met_cont.isValid() && hlt_pfopufit_sig30_met_cont->size() > 0) {
796  hlt_met = hlt_pfopufit_sig30_met_cont->at(0);
797  } else if (alg == "cvfpufit" && hlt_cvfpufit_met_cont.isValid() && hlt_cvfpufit_met_cont->size() > 0) {
798  hlt_met = hlt_cvfpufit_met_cont->at(0);
799  } else if (alg == "mhtpufit_pf" && hlt_mhtpufit_pf_met_cont.isValid() && hlt_mhtpufit_pf_met_cont->size() > 0) {
800  hlt_met = hlt_mhtpufit_pf_met_cont->at(0);
801  } else if (alg == "mhtpufit_em" && hlt_mhtpufit_em_met_cont.isValid() && hlt_mhtpufit_em_met_cont->size() > 0) {
802  hlt_met = hlt_mhtpufit_em_met_cont->at(0);
803  } else if (alg == "met_nn" && hlt_met_nn_cont.isValid() && hlt_met_nn_cont->size() > 0) {
804  hlt_met = hlt_met_nn_cont->at(0);
805  } else {
806  hlt_met = 0;
807  }
808 
809  if ( hlt_met ) {
810  float hlt_Ex = hlt_met->ex()/Gaudi::Units::GeV;
811  float hlt_Ey = hlt_met->ey()/Gaudi::Units::GeV;
812  float hlt_Et = std::sqrt(hlt_Ex*hlt_Ex + hlt_Ey*hlt_Ey);
813  if (L1_PreSelMet_Et > m_L1MetCut && !std::isnan(hlt_Et)) {
814  auto met_presel_Et = Monitored::Scalar<float>(alg+"_presel_Et", hlt_Et);
815  fill(tool,met_presel_Et);
816  }
817  }
818  }
819 
820  for (const std::string& alg : m_LArNoiseBurstVetoAlgs) {
821  if (alg == "cell" && hlt_cell_met_cont.isValid() && hlt_cell_met_cont->size() > 0) {
822  hlt_met = hlt_cell_met_cont->at(0);
823  } else if (alg == "mht" && hlt_mht_met_cont.isValid() && hlt_mht_met_cont->size() > 0) {
824  hlt_met = hlt_mht_met_cont->at(0);
825  } else if (alg == "tc" && hlt_tc_met_cont.isValid() && hlt_tc_met_cont->size() > 0) {
826  hlt_met = hlt_tc_met_cont->at(0);
827  } else if (alg == "tc_em" && hlt_tc_em_met_cont.isValid() && hlt_tc_em_met_cont->size() > 0) {
828  hlt_met = hlt_tc_em_met_cont->at(0);
829  } else if (alg == "tcpufit" && hlt_tcpufit_met_cont.isValid() && hlt_tcpufit_met_cont->size() > 0) {
830  hlt_met = hlt_tcpufit_met_cont->at(0);
831  } else if (alg == "trkmht" && hlt_trkmht_met_cont.isValid() && hlt_trkmht_met_cont->size() > 0) {
832  hlt_met = hlt_trkmht_met_cont->at(0);
833  } else if (alg == "pfsum" && hlt_pfsum_met_cont.isValid() && hlt_pfsum_met_cont->size() > 0) {
834  hlt_met = hlt_pfsum_met_cont->at(0);
835  } else if (alg == "pfsum_cssk" && hlt_pfsum_cssk_met_cont.isValid() && hlt_pfsum_cssk_met_cont->size() > 0) {
836  hlt_met = hlt_pfsum_cssk_met_cont->at(0);
837  } else if (alg == "pfsum_vssk" && hlt_pfsum_vssk_met_cont.isValid() && hlt_pfsum_vssk_met_cont->size() > 0) {
838  hlt_met = hlt_pfsum_vssk_met_cont->at(0);
839  } else if (alg == "pfopufit" && hlt_pfopufit_met_cont.isValid() && hlt_pfopufit_met_cont->size() > 0) {
840  hlt_met = hlt_pfopufit_met_cont->at(0);
841  } else if (alg == "cvfpufit" && hlt_cvfpufit_met_cont.isValid() && hlt_cvfpufit_met_cont->size() > 0) {
842  hlt_met = hlt_cvfpufit_met_cont->at(0);
843  } else if (alg == "mhtpufit_pf" && hlt_mhtpufit_pf_met_cont.isValid() && hlt_mhtpufit_pf_met_cont->size() > 0) {
844  hlt_met = hlt_mhtpufit_pf_met_cont->at(0);
845  } else if (alg == "mhtpufit_em" && hlt_mhtpufit_em_met_cont.isValid() && hlt_mhtpufit_em_met_cont->size() > 0) {
846  hlt_met = hlt_mhtpufit_em_met_cont->at(0);
847  } else {
848  hlt_met = 0;
849  }
850 
851  if ( hlt_met ) {
852  float hlt_Ex = hlt_met->ex()/Gaudi::Units::GeV;
853  float hlt_Ey = hlt_met->ey()/Gaudi::Units::GeV;
854  float hlt_Ez = hlt_met->ez()/Gaudi::Units::GeV;
855  float hlt_Et = std::sqrt(hlt_Ex*hlt_Ex + hlt_Ey*hlt_Ey);
856  float hlt_sumEt = hlt_met->sumEt()/Gaudi::Units::GeV;
857  float hlt_Ex_log = signed_log(hlt_Ex, epsilon);
858  float hlt_Ey_log = signed_log(hlt_Ey, epsilon);
859  float hlt_Et_log = signed_log(hlt_Et, epsilon);
860  float hlt_sumEt_log = signed_log(hlt_sumEt, epsilon);
861  TVector3 v(hlt_Ex, hlt_Ey, hlt_Ez);
862  float hlt_eta = v.Eta();
863  float hlt_phi = v.Phi();
864 
865 
866  // LAr noiseburst Veto
868  if (!LArNoiseBurst){
869  auto met_Ex = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_Ex", static_cast<float>(hlt_Ex));
870  auto met_Ey = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_Ey", static_cast<float>(hlt_Ey));
871  auto met_Et = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_Et", static_cast<float>(hlt_Et));
872  auto met_sumEt = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_sumEt", static_cast<float>(hlt_sumEt));
873  auto met_Ex_log = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_Ex_log", static_cast<float>(hlt_Ex_log));
874  auto met_Ey_log = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_Ey_log", static_cast<float>(hlt_Ey_log));
875  auto met_Et_log = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_Et_log", static_cast<float>(hlt_Et_log));
876  auto met_sumEt_log = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_sumEt_log", static_cast<float>(hlt_sumEt_log));
877  auto met_phi = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_phi", static_cast<float>(hlt_phi));
878  auto met_eta = Monitored::Scalar<float>(alg+"_LArNoiseBurstVeto_eta", static_cast<float>(hlt_eta));
879  fill(tool,met_Ex,met_Ey,met_Et,met_sumEt,
880  met_Ex_log,met_Ey_log,met_Et_log,met_sumEt_log,
881  met_eta,met_phi);
882  }
883  }
884  }
885 
886 
887  for (const std::string& alg : m_signalLepAlgs) {
888  if (alg == "cell" && hlt_cell_met_cont.isValid() && hlt_cell_met_cont->size() > 0) {
889  hlt_met = hlt_cell_met_cont->at(0);
890  } else if (alg == "mht" && hlt_mht_met_cont.isValid() && hlt_mht_met_cont->size() > 0) {
891  hlt_met = hlt_mht_met_cont->at(0);
892  } else if (alg == "tc" && hlt_tc_met_cont.isValid() && hlt_tc_met_cont->size() > 0) {
893  hlt_met = hlt_tc_met_cont->at(0);
894  } else if (alg == "tc_em" && hlt_tc_em_met_cont.isValid() && hlt_tc_em_met_cont->size() > 0) {
895  hlt_met = hlt_tc_em_met_cont->at(0);
896  } else if (alg == "tcpufit" && hlt_tcpufit_met_cont.isValid() && hlt_tcpufit_met_cont->size() > 0) {
897  hlt_met = hlt_tcpufit_met_cont->at(0);
898  } else if (alg == "trkmht" && hlt_trkmht_met_cont.isValid() && hlt_trkmht_met_cont->size() > 0) {
899  hlt_met = hlt_trkmht_met_cont->at(0);
900  } else if (alg == "pfsum" && hlt_pfsum_met_cont.isValid() && hlt_pfsum_met_cont->size() > 0) {
901  hlt_met = hlt_pfsum_met_cont->at(0);
902  } else if (alg == "pfsum_cssk" && hlt_pfsum_cssk_met_cont.isValid() && hlt_pfsum_cssk_met_cont->size() > 0) {
903  hlt_met = hlt_pfsum_cssk_met_cont->at(0);
904  } else if (alg == "pfsum_vssk" && hlt_pfsum_vssk_met_cont.isValid() && hlt_pfsum_vssk_met_cont->size() > 0) {
905  hlt_met = hlt_pfsum_vssk_met_cont->at(0);
906  } else if (alg == "pfopufit" && hlt_pfopufit_met_cont.isValid() && hlt_pfopufit_met_cont->size() > 0) {
907  hlt_met = hlt_pfopufit_met_cont->at(0);
908  } else if (alg == "cvfpufit" && hlt_cvfpufit_met_cont.isValid() && hlt_cvfpufit_met_cont->size() > 0) {
909  hlt_met = hlt_cvfpufit_met_cont->at(0);
910  } else if (alg == "mhtpufit_pf" && hlt_mhtpufit_pf_met_cont.isValid() && hlt_mhtpufit_pf_met_cont->size() > 0) {
911  hlt_met = hlt_mhtpufit_pf_met_cont->at(0);
912  } else if (alg == "mhtpufit_em" && hlt_mhtpufit_em_met_cont.isValid() && hlt_mhtpufit_em_met_cont->size() > 0) {
913  hlt_met = hlt_mhtpufit_em_met_cont->at(0);
914  } else {
915  hlt_met = 0;
916  }
917 
918  if ( hlt_met ) {
919  float hlt_Ex = hlt_met->ex()/Gaudi::Units::GeV;
920  float hlt_Ey = hlt_met->ey()/Gaudi::Units::GeV;
921  float hlt_Ez = hlt_met->ez()/Gaudi::Units::GeV;
922  float hlt_Et = std::sqrt(hlt_Ex*hlt_Ex + hlt_Ey*hlt_Ey);
923  float hlt_sumEt = hlt_met->sumEt()/Gaudi::Units::GeV;
924  float hlt_Ex_log = signed_log(hlt_Ex, epsilon);
925  float hlt_Ey_log = signed_log(hlt_Ey, epsilon);
926  float hlt_Et_log = signed_log(hlt_Et, epsilon);
927  float hlt_sumEt_log = signed_log(hlt_sumEt, epsilon);
928  TVector3 v(hlt_Ex, hlt_Ey, hlt_Ez);
929  float hlt_eta = v.Eta();
930  float hlt_phi = v.Phi();
931 
932 // access events with electron passing primary single electron chain
933  if(passedPrimaryEl){
934  auto met_Ex = Monitored::Scalar<float>(alg+"_SigEl_Ex", static_cast<float>(hlt_Ex));
935  auto met_Ey = Monitored::Scalar<float>(alg+"_SigEl_Ey", static_cast<float>(hlt_Ey));
936  auto met_Et = Monitored::Scalar<float>(alg+"_SigEl_Et", static_cast<float>(hlt_Et));
937  auto met_sumEt = Monitored::Scalar<float>(alg+"_SigEl_sumEt", static_cast<float>(hlt_sumEt));
938  auto met_Ex_log = Monitored::Scalar<float>(alg+"_SigEl_Ex_log", static_cast<float>(hlt_Ex_log));
939  auto met_Ey_log = Monitored::Scalar<float>(alg+"_SigEl_Ey_log", static_cast<float>(hlt_Ey_log));
940  auto met_Et_log = Monitored::Scalar<float>(alg+"_SigEl_Et_log", static_cast<float>(hlt_Et_log));
941  auto met_sumEt_log = Monitored::Scalar<float>(alg+"_SigEl_sumEt_log", static_cast<float>(hlt_sumEt_log));
942  auto met_eta = Monitored::Scalar<float>(alg+"_SigEl_eta", static_cast<float>(hlt_eta));
943  auto met_phi = Monitored::Scalar<float>(alg+"_SigEl_phi", static_cast<float>(hlt_phi));
944  fill(tool,met_Ex,met_Ey,met_Et,met_sumEt,
945  met_Ex_log,met_Ey_log,met_Et_log,met_sumEt_log,
946  met_eta,met_phi);
947  }
948 
949 // access events with muon passing primary single muon chain
950  if(passedPrimaryMu){
951  auto met_Ex = Monitored::Scalar<float>(alg+"_SigMu_Ex", static_cast<float>(hlt_Ex));
952  auto met_Ey = Monitored::Scalar<float>(alg+"_SigMu_Ey", static_cast<float>(hlt_Ey));
953  auto met_Et = Monitored::Scalar<float>(alg+"_SigMu_Et", static_cast<float>(hlt_Et));
954  auto met_sumEt = Monitored::Scalar<float>(alg+"_SigMu_sumEt", static_cast<float>(hlt_sumEt));
955  auto met_Ex_log = Monitored::Scalar<float>(alg+"_SigMu_Ex_log", static_cast<float>(hlt_Ex_log));
956  auto met_Ey_log = Monitored::Scalar<float>(alg+"_SigMu_Ey_log", static_cast<float>(hlt_Ey_log));
957  auto met_Et_log = Monitored::Scalar<float>(alg+"_SigMu_Et_log", static_cast<float>(hlt_Et_log));
958  auto met_sumEt_log = Monitored::Scalar<float>(alg+"_SigMu_sumEt_log", static_cast<float>(hlt_sumEt_log));
959  auto met_eta = Monitored::Scalar<float>(alg+"_SigMu_eta", static_cast<float>(hlt_eta));
960  auto met_phi = Monitored::Scalar<float>(alg+"_SigMu_phi", static_cast<float>(hlt_phi));
961  fill(tool,met_Ex,met_Ey,met_Et,met_sumEt,
962  met_Ex_log,met_Ey_log,met_Et_log,met_sumEt_log,
963  met_eta,met_phi);
964  }
965  }
966  }
967 
968  // access HLT MET Expert values
969  for (const std::string& alg : m_algsHLTExpert) {
970  if (alg == "cell" && hlt_cell_met_cont.isValid() && hlt_cell_met_cont->size() > 0) {
971  hlt_met = hlt_cell_met_cont->at(0);
972  } else if (alg == "mht" && hlt_mht_met_cont.isValid() && hlt_mht_met_cont->size() > 0) {
973  hlt_met = hlt_mht_met_cont->at(0);
974  } else if (alg == "tc" && hlt_tc_met_cont.isValid() && hlt_tc_met_cont->size() > 0) {
975  hlt_met = hlt_tc_met_cont->at(0);
976  } else if (alg == "tc_em" && hlt_tc_em_met_cont.isValid() && hlt_tc_em_met_cont->size() > 0) {
977  hlt_met = hlt_tc_em_met_cont->at(0);
978  } else if (alg == "tcpufit" && hlt_tcpufit_met_cont.isValid() && hlt_tcpufit_met_cont->size() > 0) {
979  hlt_met = hlt_tcpufit_met_cont->at(0);
980  } else if (alg == "tcpufit_sig30" && hlt_tcpufit_sig30_met_cont.isValid() && hlt_tcpufit_sig30_met_cont->size() > 0) {
981  hlt_met = hlt_tcpufit_sig30_met_cont->at(0);
982  } else if (alg == "trkmht" && hlt_trkmht_met_cont.isValid() && hlt_trkmht_met_cont->size() > 0) {
983  hlt_met = hlt_trkmht_met_cont->at(0);
984  } else if (alg == "pfsum" && hlt_pfsum_met_cont.isValid() && hlt_pfsum_met_cont->size() > 0) {
985  hlt_met = hlt_pfsum_met_cont->at(0);
986  } else if (alg == "pfsum_cssk" && hlt_pfsum_cssk_met_cont.isValid() && hlt_pfsum_cssk_met_cont->size() > 0) {
987  hlt_met = hlt_pfsum_cssk_met_cont->at(0);
988  } else if (alg == "pfsum_vssk" && hlt_pfsum_vssk_met_cont.isValid() && hlt_pfsum_vssk_met_cont->size() > 0) {
989  hlt_met = hlt_pfsum_vssk_met_cont->at(0);
990  } else if (alg == "pfopufit" && hlt_pfopufit_met_cont.isValid() && hlt_pfopufit_met_cont->size() > 0) {
991  hlt_met = hlt_pfopufit_met_cont->at(0);
992  } else if (alg == "pfopufit_sig30" && hlt_pfopufit_sig30_met_cont.isValid() && hlt_pfopufit_sig30_met_cont->size() > 0) {
993  hlt_met = hlt_pfopufit_sig30_met_cont->at(0);
994  } else if (alg == "cvfpufit" && hlt_cvfpufit_met_cont.isValid() && hlt_cvfpufit_met_cont->size() > 0) {
995  hlt_met = hlt_cvfpufit_met_cont->at(0);
996  } else if (alg == "mhtpufit_pf" && hlt_mhtpufit_pf_met_cont.isValid() && hlt_mhtpufit_pf_met_cont->size() > 0) {
997  hlt_met = hlt_mhtpufit_pf_met_cont->at(0);
998  } else if (alg == "mhtpufit_em" && hlt_mhtpufit_em_met_cont.isValid() && hlt_mhtpufit_em_met_cont->size() > 0) {
999  hlt_met = hlt_mhtpufit_em_met_cont->at(0);
1000  } else if (alg == "met_nn" && hlt_met_nn_cont.isValid() && hlt_met_nn_cont->size() > 0) {
1001  hlt_met = hlt_met_nn_cont->at(0);
1002  } else {
1003  hlt_met = 0;
1004  }
1005 
1006  if ( hlt_met ) {
1007  float hlt_Ex = hlt_met->ex()/Gaudi::Units::GeV;
1008  float hlt_Ey = hlt_met->ey()/Gaudi::Units::GeV;
1009  float hlt_Et = std::sqrt(hlt_Ex*hlt_Ex + hlt_Ey*hlt_Ey);
1010  float hlt_sumEt = hlt_met->sumEt()/Gaudi::Units::GeV;
1011  if (!std::isnan(hlt_Et)) {
1012  auto met_Ex = Monitored::Scalar<float>(alg+"_Ex", static_cast<float>(hlt_Ex));
1013  auto met_Ey = Monitored::Scalar<float>(alg+"_Ey", static_cast<float>(hlt_Ey));
1014  auto met_Et = Monitored::Scalar<float>(alg+"_Et", static_cast<float>(hlt_Et));
1015  auto met_sumEt = Monitored::Scalar<float>(alg+"_sumEt", static_cast<float>(hlt_sumEt));
1016  fill(tool,met_Ex,met_Ey,met_Et,met_sumEt);
1017  ATH_MSG_DEBUG(alg << ": hlt_Et = " << hlt_Et);
1018  if (L1_roiMet_Et > 50.) {
1019  auto met_presel_Et = Monitored::Scalar<float>(alg+"_presel_Et", static_cast<float>(hlt_Et));
1020  fill(tool,met_presel_Et);
1021  }
1022  }
1023  }
1024  }
1025 
1026  // Make 2D tcpufit MET distributions wrt track-based MET
1027  const xAOD::TrigMissingET *hlt_tcpufit_met = 0;
1028  for (const std::string& alg : m_algsMET2d_tcpufit) {
1029  if (alg == "cell" && hlt_cell_met_cont.isValid() && hlt_cell_met_cont->size() > 0) {
1030  hlt_met = hlt_cell_met_cont->at(0);
1031  } else if (alg == "mht" && hlt_mht_met_cont.isValid() && hlt_mht_met_cont->size() > 0) {
1032  hlt_met = hlt_mht_met_cont->at(0);
1033  } else if (alg == "tc" && hlt_tc_met_cont.isValid() && hlt_tc_met_cont->size() > 0) {
1034  hlt_met = hlt_tc_met_cont->at(0);
1035  } else if (alg == "tc_em" && hlt_tc_em_met_cont.isValid() && hlt_tc_em_met_cont->size() > 0) {
1036  hlt_met = hlt_tc_em_met_cont->at(0);
1037  } else if (alg == "trkmht_pf" && hlt_trkmht_met_cont.isValid() && hlt_trkmht_met_cont->size() > 0) {
1038  hlt_met = hlt_trkmht_met_cont->at(0);
1039  } else if (alg == "pfsum" && hlt_pfsum_met_cont.isValid() && hlt_pfsum_met_cont->size() > 0) {
1040  hlt_met = hlt_pfsum_met_cont->at(0);
1041  } else if (alg == "pfsum_cssk" && hlt_pfsum_cssk_met_cont.isValid() && hlt_pfsum_cssk_met_cont->size() > 0) {
1042  hlt_met = hlt_pfsum_cssk_met_cont->at(0);
1043  } else if (alg == "pfsum_vssk" && hlt_pfsum_vssk_met_cont.isValid() && hlt_pfsum_vssk_met_cont->size() > 0) {
1044  hlt_met = hlt_pfsum_vssk_met_cont->at(0);
1045  } else if (alg == "pfopufit" && hlt_pfopufit_met_cont.isValid() && hlt_pfopufit_met_cont->size() > 0) {
1046  hlt_met = hlt_pfopufit_met_cont->at(0);
1047  } else if (alg == "cvfpufit" && hlt_cvfpufit_met_cont.isValid() && hlt_cvfpufit_met_cont->size() > 0) {
1048  hlt_met = hlt_cvfpufit_met_cont->at(0);
1049  } else if (alg == "mhtpufit_pf" && hlt_mhtpufit_pf_met_cont.isValid() && hlt_mhtpufit_pf_met_cont->size() > 0) {
1050  hlt_met = hlt_mhtpufit_pf_met_cont->at(0);
1051  } else if (alg == "mhtpufit_em" && hlt_mhtpufit_em_met_cont.isValid() && hlt_mhtpufit_em_met_cont->size() > 0) {
1052  hlt_met = hlt_mhtpufit_em_met_cont->at(0);
1053  } else {
1054  hlt_met = 0;
1055  }
1056 
1057  if(hlt_met && hlt_tcpufit_met_cont.isValid() && hlt_tcpufit_met_cont->size() > 0){
1058  hlt_tcpufit_met = hlt_tcpufit_met_cont->at(0);
1059  float hlt_Ex = hlt_met->ex()/Gaudi::Units::GeV;
1060  float hlt_Ey = hlt_met->ey()/Gaudi::Units::GeV;
1061  float hlt_Et = std::sqrt(hlt_Ex*hlt_Ex + hlt_Ey*hlt_Ey);
1062  auto met_Et = Monitored::Scalar<float>(alg+"_2D_Et", static_cast<float>(hlt_Et));
1063 
1064  float hlt_tcpufit_Ex = hlt_tcpufit_met->ex()/Gaudi::Units::GeV;
1065  float hlt_tcpufit_Ey = hlt_tcpufit_met->ey()/Gaudi::Units::GeV;
1066  float hlt_tcpufit_Et = std::sqrt(hlt_tcpufit_Ex*hlt_tcpufit_Ex + hlt_tcpufit_Ey*hlt_tcpufit_Ey);
1067  auto tcpufit_met_Et = Monitored::Scalar<float>("tcpufit_2D_Et", static_cast<float>(hlt_tcpufit_Et));
1068  fill(tool, met_Et, tcpufit_met_Et);
1069  }
1070  }
1071 
1072  // efficiency plots
1073  for (const std::string& chain : m_l1Chains) {
1074  auto pass_chain = Monitored::Scalar<float>("pass_" + chain, static_cast<float>(getTrigDecisionTool()->isPassed(chain)));
1075  fill(tool, pass_chain,offline_NoMu_Et_eff);
1076  }
1077  for (const std::string& chain : m_hltChains) {
1078  auto pass_chain = Monitored::Scalar<float>("pass_" + chain, static_cast<float>(getTrigDecisionTool()->isPassed(chain)));
1079  fill(tool, pass_chain,offline_NoMu_Et_eff);
1080  }
1081  for (const std::string& chain : m_hltChainsVal) {
1082  auto pass_chain = Monitored::Scalar<float>("pass_" + chain, static_cast<float>(getTrigDecisionTool()->isPassed(chain)));
1083  fill(tool, pass_chain,offline_NoMu_Et_eff);
1084  }
1085  for (const std::string& chain : m_hltChainsT0) {
1086  auto pass_chain = Monitored::Scalar<float>("pass_" + chain, static_cast<float>(getTrigDecisionTool()->isPassed(chain)));
1087  fill(tool, pass_chain,offline_NoMu_Et_eff);
1088  }
1089 
1090  return StatusCode::SUCCESS;
1091 }
1092 
1093 
1094 double TrigMETMonitorAlgorithm::signed_log(double e, double epsilon) const {
1095 
1096 
1097  double e_log = -9e9;
1098  if (std::abs(e) > epsilon)
1099  e_log = std::copysign(std::log10(std::abs(e)), e);
1100  else
1101  e_log = 0.01;
1102 
1103  return e_log;
1104 }
TrigMETMonitorAlgorithm::m_hlt_pfopufit_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_pfopufit_met_key
Definition: TrigMETMonitorAlgorithm.h:80
TrigMETMonitorAlgorithm::signed_log
double signed_log(double e, double epsilon) const
Definition: TrigMETMonitorAlgorithm.cxx:1094
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
xAOD::TrigMissingET_v1::sumEt
float sumEt() const
Get the sum of the ET of the missing energy.
xAOD::TrigMissingET_v1::exComponent
float exComponent(unsigned int index) const
Get the x component fo the energy of a component.
Definition: TrigMissingET_v1.cxx:119
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
TrigMETMonitorAlgorithm::m_hlt_met_nn_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_met_nn_key
Definition: TrigMETMonitorAlgorithm.h:85
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TrigMETMonitorAlgorithm::m_hlt_trkmht_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_trkmht_met_key
Definition: TrigMETMonitorAlgorithm.h:76
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrigMETMonitorAlgorithm::m_algsMET2d_tcpufit
Gaudi::Property< std::vector< std::string > > m_algsMET2d_tcpufit
Definition: TrigMETMonitorAlgorithm.h:99
TrigMETMonitorAlgorithm::m_hltChainsT0
Gaudi::Property< std::vector< std::string > > m_hltChainsT0
Definition: TrigMETMonitorAlgorithm.h:90
TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm
TrigMETMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigMETMonitorAlgorithm.cxx:9
xAOD::TrigMissingET_v1::statusComponent
short statusComponent(unsigned int index) const
Get Status.
Definition: TrigMissingET_v1.cxx:207
xAOD::MissingET_v1::sumet
float sumet() const
Returns.
TrigMETMonitorAlgorithm::m_signalLepAlgs
Gaudi::Property< std::vector< std::string > > m_signalLepAlgs
Definition: TrigMETMonitorAlgorithm.h:110
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TrigMETMonitorAlgorithm::m_hlt_cell_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_cell_met_key
Definition: TrigMETMonitorAlgorithm.h:70
xAOD::EnergySumRoI_v2::energyT
float energyT() const
The deposited total transverse energy.
AthMonitorAlgorithm::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Key for retrieving EventInfo from StoreGate.
Definition: AthMonitorAlgorithm.h:362
AthMonitorAlgorithm::getTrigDecisionTool
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
Definition: AthMonitorAlgorithm.cxx:189
xAOD::gFexGlobalRoI_v1
Class describing properties of a LVL1 gFEX global Trigger Object (TOB) in the xAOD format.
Definition: gFexGlobalRoI_v1.h:25
TrigMETMonitorAlgorithm::m_l1_gFexJwojScalar_key
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_l1_gFexJwojScalar_key
Definition: TrigMETMonitorAlgorithm.h:61
xAOD::TrigMissingET_v1::ex
float ex() const
Get the x component of the missing energy.
TrigMETMonitorAlgorithm::m_hlt_cvfpufit_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_cvfpufit_met_key
Definition: TrigMETMonitorAlgorithm.h:82
xAOD::TrigMissingET_v1::flag
int flag() const
Get the status flag.
xAOD::gFexGlobalRoI_v1::METquantityOne
float METquantityOne() const
retrieves the Et index from the 32-bit word
xAOD::EnergySumRoI_v2::energyY
float energyY() const
The total energy deposited in the Y direction.
TrigMETMonitorAlgorithm::m_LArNoiseBurstVetoAlgs
Gaudi::Property< std::vector< std::string > > m_LArNoiseBurstVetoAlgs
Definition: TrigMETMonitorAlgorithm.h:96
TrigMETMonitorAlgorithm::m_hltChainEl
Gaudi::Property< std::vector< std::string > > m_hltChainEl
Definition: TrigMETMonitorAlgorithm.h:91
TrigMETMonitorAlgorithm::m_hlt_pfopufit_sig30_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_pfopufit_sig30_met_key
Definition: TrigMETMonitorAlgorithm.h:81
TrigMETMonitorAlgorithm::m_hlt_pfsum_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_pfsum_met_key
Definition: TrigMETMonitorAlgorithm.h:77
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
TrigMETMonitorAlgorithm::m_l1Chains
Gaudi::Property< std::vector< std::string > > m_l1Chains
Definition: TrigMETMonitorAlgorithm.h:87
TrigMETMonitorAlgorithm::m_hlt_tcpufit_sig30_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_tcpufit_sig30_met_key
Definition: TrigMETMonitorAlgorithm.h:75
xAOD::EventInfo_v1::LAr
@ LAr
The LAr calorimeter.
Definition: EventInfo_v1.h:335
TrigMETMonitorAlgorithm::m_l1_gFexJwojMSTComponents_key
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_l1_gFexJwojMSTComponents_key
Definition: TrigMETMonitorAlgorithm.h:64
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
LArEventBitInfo.h
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
TrigMETMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: TrigMETMonitorAlgorithm.cxx:59
xAOD::gFexGlobalRoI_v1::METquantityTwo
float METquantityTwo() const
floating point value (GeV, TOB scale)
TrigMETMonitorAlgorithm::m_bitNames
Gaudi::Property< std::vector< std::string > > m_bitNames
Definition: TrigMETMonitorAlgorithm.h:101
TrigMETMonitorAlgorithm::m_l1_gFexNCMETComponents_key
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_l1_gFexNCMETComponents_key
Definition: TrigMETMonitorAlgorithm.h:66
LArEventBitInfo::NOISEBURSTVETO
@ NOISEBURSTVETO
Definition: LArEventBitInfo.h:13
TrigMETMonitorAlgorithm::~TrigMETMonitorAlgorithm
virtual ~TrigMETMonitorAlgorithm()
Definition: TrigMETMonitorAlgorithm.cxx:15
TrigMETMonitorAlgorithm::m_l1_gFexJwojMHTComponents_key
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_l1_gFexJwojMHTComponents_key
Definition: TrigMETMonitorAlgorithm.h:63
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigMETMonitorAlgorithm::m_hlt_mhtpufit_pf_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_mhtpufit_pf_met_key
Definition: TrigMETMonitorAlgorithm.h:83
TrigMETMonitorAlgorithm::m_algsHLTExpert
Gaudi::Property< std::vector< std::string > > m_algsHLTExpert
Definition: TrigMETMonitorAlgorithm.h:98
Monitored
Generic monitoring tool for athena components.
Definition: GenericMonitoringTool.h:30
TrigMETMonitorAlgorithm::m_l1_gFexJwojMETComponents_key
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_l1_gFexJwojMETComponents_key
Definition: TrigMETMonitorAlgorithm.h:62
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigMETMonitorAlgorithm::m_hlt_mhtpufit_em_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_mhtpufit_em_met_key
Definition: TrigMETMonitorAlgorithm.h:84
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
xAOD::MissingET_v1::mpx
float mpx() const
Returns .
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigMETMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: TrigMETMonitorAlgorithm.cxx:18
TrigMETMonitorAlgorithm::m_l1_jFexMet_key
SG::ReadHandleKey< xAOD::jFexMETRoIContainer > m_l1_jFexMet_key
Definition: TrigMETMonitorAlgorithm.h:59
TrigMETMonitorAlgorithm::m_algsHLT
Gaudi::Property< std::vector< std::string > > m_algsHLT
Definition: TrigMETMonitorAlgorithm.h:94
TrigMETMonitorAlgorithm::m_hltChainsVal
Gaudi::Property< std::vector< std::string > > m_hltChainsVal
Definition: TrigMETMonitorAlgorithm.h:89
TrigMETMonitorAlgorithm::m_L1MetAlg
Gaudi::Property< int > m_L1MetAlg
Definition: TrigMETMonitorAlgorithm.h:103
xAOD::Vertex_v1::z
float z() const
Returns the z position.
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TrigMETMonitorAlgorithm::m_hlt_electron_key
SG::ReadHandleKey< xAOD::ElectronContainer > m_hlt_electron_key
Definition: TrigMETMonitorAlgorithm.h:49
TrigMETMonitorAlgorithm::m_hlt_tc_em_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_tc_em_met_key
Definition: TrigMETMonitorAlgorithm.h:73
Electron
TrigMETMonitorAlgorithm::m_hlt_pfsum_cssk_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_pfsum_cssk_met_key
Definition: TrigMETMonitorAlgorithm.h:78
xAOD::EnergySumRoI_v2::energyX
float energyX() const
The total energy deposited in the X direction.
TrigMETMonitorAlgorithm::m_l1_gFexRhoMETScalar_key
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_l1_gFexRhoMETScalar_key
Definition: TrigMETMonitorAlgorithm.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TrigMETMonitorAlgorithm::m_lvl1_roi_key
SG::ReadHandleKey< xAOD::EnergySumRoI > m_lvl1_roi_key
Definition: TrigMETMonitorAlgorithm.h:57
TrigMETMonitorAlgorithm::m_hlt_tc_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_tc_met_key
Definition: TrigMETMonitorAlgorithm.h:72
TrigMETMonitorAlgorithm::m_offline_vertex_key
SG::ReadHandleKey< xAOD::VertexContainer > m_offline_vertex_key
Definition: TrigMETMonitorAlgorithm.h:55
TrigMETMonitorAlgorithm::m_hltChains
Gaudi::Property< std::vector< std::string > > m_hltChains
Definition: TrigMETMonitorAlgorithm.h:88
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
TrigMETMonitorAlgorithm::m_hlt_tcpufit_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_tcpufit_met_key
Definition: TrigMETMonitorAlgorithm.h:74
TrigMETMonitorAlgorithm::m_vertex_key
SG::ReadHandleKey< xAOD::VertexContainer > m_vertex_key
Definition: TrigMETMonitorAlgorithm.h:54
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
python.PyAthena.v
v
Definition: PyAthena.py:154
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
TrigMETMonitorAlgorithm::m_l1_gFexNCMETScalar_key
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_l1_gFexNCMETScalar_key
Definition: TrigMETMonitorAlgorithm.h:65
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
TrigMETMonitorAlgorithm::m_l1_gFexRhoMETComponents_key
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_l1_gFexRhoMETComponents_key
Definition: TrigMETMonitorAlgorithm.h:68
TrigMETMonitorAlgorithm::m_hlt_mht_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_mht_met_key
Definition: TrigMETMonitorAlgorithm.h:71
TrigMETMonitorAlgorithm::m_compNames
Gaudi::Property< std::vector< std::string > > m_compNames
Definition: TrigMETMonitorAlgorithm.h:100
xAOD::TrigMissingET_v1
Class holding the Missing ET trigger fex results.
Definition: TrigMissingET_v1.h:32
xAOD::TrigMissingET_v1::eyComponent
float eyComponent(unsigned int index) const
Get the y component fo the energy of a component.
Definition: TrigMissingET_v1.cxx:130
xAOD::TrigMissingET_v1::ey
float ey() const
Get the y component of the missing energy.
TrigMETMonitorAlgorithm.h
xAOD::EventInfo_v1::isEventFlagBitSet
bool isEventFlagBitSet(EventFlagSubDet subDet, size_t bit) const
Check one particular bit of one particular sub-detector.
Definition: EventInfo_v1.cxx:703
xAOD::TrigMissingET_v1::ez
float ez() const
Get the z component of the missing energy.
TrigMETMonitorAlgorithm::m_algsL1
Gaudi::Property< std::vector< std::string > > m_algsL1
Definition: TrigMETMonitorAlgorithm.h:93
TrigMETMonitorAlgorithm::m_topoclusters_key
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_topoclusters_key
Definition: TrigMETMonitorAlgorithm.h:52
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigMETMonitorAlgorithm::m_algsHLTPreSel
Gaudi::Property< std::vector< std::string > > m_algsHLTPreSel
Definition: TrigMETMonitorAlgorithm.h:95
xAOD::MissingET_v1::mpy
float mpy() const
Returns .
TrigMETMonitorAlgorithm::m_l1_jFexSumEt_key
SG::ReadHandleKey< xAOD::jFexSumETRoIContainer > m_l1_jFexSumEt_key
Definition: TrigMETMonitorAlgorithm.h:60
TrigMETMonitorAlgorithm::m_hlt_muon_key
SG::ReadHandleKey< xAOD::MuonContainer > m_hlt_muon_key
Definition: TrigMETMonitorAlgorithm.h:50
TrigMETMonitorAlgorithm::m_hlt_pfsum_vssk_met_key
SG::ReadHandleKey< xAOD::TrigMissingETContainer > m_hlt_pfsum_vssk_met_key
Definition: TrigMETMonitorAlgorithm.h:79
TrigMETMonitorAlgorithm::m_hltChainMu
Gaudi::Property< std::vector< std::string > > m_hltChainMu
Definition: TrigMETMonitorAlgorithm.h:92
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigMETMonitorAlgorithm::m_tracks_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracks_key
Definition: TrigMETMonitorAlgorithm.h:53
AthMonitorAlgorithm::getGroup
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
Definition: AthMonitorAlgorithm.cxx:164
TrigMETMonitorAlgorithm::m_offline_met_key
SG::ReadHandleKey< xAOD::MissingETContainer > m_offline_met_key
Definition: TrigMETMonitorAlgorithm.h:47
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
TrigMETMonitorAlgorithm::m_L1MetCut
Gaudi::Property< double > m_L1MetCut
Definition: TrigMETMonitorAlgorithm.h:104