ATLAS Offline Software
PhysValMET.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // PhysValMET.cxx
8 // Implementation file for class PhysValMET
9 // Author: Daniel Buescher <daniel.buescher@cern.ch>, Philipp Mogg <philipp.mogg@cern.ch>
11 
12 // PhysVal includes
13 #include "PhysValMET.h"
14 
15 // STL includes
16 #include <cmath>
17 #include <map>
18 #include <vector>
19 
20 // FrameWork includes
21 #include "GaudiKernel/IToolSvc.h"
23 #include "xAODMissingET/MissingET.h"
30 
31 #include "xAODJet/JetContainer.h"
32 #include "xAODMuon/MuonContainer.h"
36 
37 #include "xAODTracking/Vertex.h"
40 #include "PATCore/AcceptData.h"
42 
43 using namespace xAOD;
44 
45 namespace MissingEtDQA {
46 
48  // Public methods:
50 
51  // Constructors
53 
54  PhysValMET::PhysValMET( const std::string& type,
55  const std::string& name,
56  const IInterface* parent) :
58  m_metmaker(nullptr)
59  {
60  declareProperty( "InputElectrons", m_eleColl = "Electrons" );
61  declareProperty( "InputPhotons", m_gammaColl = "Photons" );
62  declareProperty( "InputTaus", m_tauColl = "TauJets" );
63  declareProperty( "InputMuons", m_muonColl = "Muons" );
64  declareProperty( "DoTruth", m_doTruth = false );
65  declareProperty( "InputIsDAOD", m_inputIsDAOD = false );
66  declareProperty( "DoMETRefPlots", m_doMETRefPlots = false );
67  declareProperty( "METMapName", m_mapname = "METAssoc" );
68  declareProperty( "METCoreName", m_corename = "MET_Core" );
69  }
70 
71  // Destructor
74  {
75  m_names.clear();
76  m_types.clear();
77  m_terms.clear();
78  m_MET_Ref.clear();
79  m_MET_Ref_x.clear();
80  m_MET_Ref_y.clear();
81  m_MET_Ref_phi.clear();
82  m_MET_Ref_sum.clear();
83  m_MET_Diff_Ref.clear();
84  m_MET_Diff_Ref_x.clear();
85  m_MET_Diff_Ref_y.clear();
86  m_MET_Diff_Ref_phi.clear();
87  m_MET_Diff_Ref_sum.clear();
88  m_MET_Cumu_Ref.clear();
89  m_MET_Resolution_Ref.clear();
90  m_MET_Significance_Ref.clear();
91  m_MET_dPhi_Ref.clear();
92  m_MET_CorrFinalTrk_Ref.clear();
94  m_MET_Reb.clear();
95  m_MET_Reb_x.clear();
96  m_MET_Reb_y.clear();
97  m_MET_Reb_phi.clear();
98  m_MET_Reb_sum.clear();
99  m_MET_Diff_Reb.clear();
100  m_MET_Diff_Reb_x.clear();
101  m_MET_Diff_Reb_y.clear();
102  m_MET_Diff_Reb_phi.clear();
103  m_MET_Diff_Reb_sum.clear();
104  m_MET_Cumu_Reb.clear();
105  m_MET_Resolution_Reb.clear();
106  m_MET_Significance_Reb.clear();
107  m_MET_dPhi_Reb.clear();
108  m_MET_CorrFinalTrk_Reb.clear();
109  m_MET_CorrFinalClus_Reb.clear();
110 }
111 
112  // Athena algtool's Hooks
115  {
116  ATH_MSG_INFO ("Initializing " << name() << "...");
118 
119  m_names.clear();
120  m_names["RefEle"] = "Electron term";
121  m_names["RefGamma"] = "Photon term";
122  m_names["RefTau"] = "Tau term";
123  m_names["Muons"] = "Muon term";
124  m_names["RefJet"] = "Jet term";
125  m_names["SoftClus"] = "Cluster-based soft term";
126  m_names["PVSoftTrk"] = "Track-based soft term (PV-matched)";
127  m_names["FinalTrk"] = "Total MET with TST";
128  m_names["FinalClus"] = "Total MET with CST";
129  m_names["Track"] = "Track MET, loose selection";
130  m_names["PVTrack_Nominal"] = "Track MET for highest sum p_{T}^{2} PV";
131  m_names["PVTrack_Pileup"] = "Track MET for each pileup vertex";
132 
133  m_types.clear();
134  m_types.emplace_back("AntiKt4EMTopo");
135  m_types.emplace_back("AntiKt4EMPFlow");
136 
137  m_terms.clear();
138  m_terms.emplace_back("RefEle");
139  m_terms.emplace_back("RefGamma");
140  m_terms.emplace_back("RefTau");
141  m_terms.emplace_back("Muons");
142  m_terms.emplace_back("RefJet");
143  m_terms.emplace_back("SoftClus");
144  m_terms.emplace_back("PVSoftTrk");
145  m_terms.emplace_back("FinalTrk");
146  m_terms.emplace_back("FinalClus");
147 
148  ATH_MSG_INFO("Retrieving tools...");
149 
150  ATH_CHECK( m_metmakerTopo.retrieve() );
151  ATH_CHECK( m_metmakerPFlow.retrieve() );
152  ATH_CHECK( m_muonSelTool.retrieve() );
153  ATH_CHECK( m_elecSelLHTool.retrieve() );
154  ATH_CHECK( m_photonSelIsEMTool.retrieve() );
155  ATH_CHECK( m_tauSelTool.retrieve() );
156  ATH_CHECK( m_jvtToolEM.retrieve() );
157  ATH_CHECK( m_jvtToolPFlow.retrieve() );
158  m_MET_Ref.clear();
159  m_MET_Ref_x.clear();
160  m_MET_Ref_y.clear();
161  m_MET_Ref_phi.clear();
162  m_MET_Ref_sum.clear();
163  m_MET_Diff_Ref.clear();
164  m_MET_Diff_Ref_x.clear();
165  m_MET_Diff_Ref_y.clear();
166  m_MET_Diff_Ref_phi.clear();
167  m_MET_Diff_Ref_sum.clear();
168  m_MET_Cumu_Ref.clear();
169  m_MET_Resolution_Ref.clear();
170  m_MET_Significance_Ref.clear();
171  m_MET_dPhi_Ref.clear();
172  m_MET_CorrFinalTrk_Ref.clear();
173  m_MET_CorrFinalClus_Ref.clear();
174  m_MET_Reb.clear();
175  m_MET_Reb_x.clear();
176  m_MET_Reb_y.clear();
177  m_MET_Reb_phi.clear();
178  m_MET_Reb_sum.clear();
179  m_MET_Diff_Reb.clear();
180  m_MET_Diff_Reb_x.clear();
181  m_MET_Diff_Reb_y.clear();
182  m_MET_Diff_Reb_phi.clear();
183  m_MET_Diff_Reb_sum.clear();
184  m_MET_Cumu_Reb.clear();
185  m_MET_Resolution_Reb.clear();
186  m_MET_Significance_Reb.clear();
187  m_MET_dPhi_Reb.clear();
188  m_MET_CorrFinalTrk_Reb.clear();
189  m_MET_CorrFinalClus_Reb.clear();
190 
191  return StatusCode::SUCCESS;
192  }
193 
195  {
196  ATH_MSG_INFO ("Booking hists " << name() << "...");
197 
198  // Physics validation plots are level 10
199 
200  int nbinp = 100;
201  int nbinpxy = 100;
202  int nbinphi = 63;
203  int nbinE = 100;
204  double suptmi = 500.;
205  double suptmixy = 250.;
206  double binphi = 3.15;
207  double lowET = 0.;
208  double suET = 2500.;
209 
210  if (m_detailLevel >= 10) {
211 
212  for (const auto& type : m_types){
213  std::string name_met;
214  std::string name_sub;
215  std::vector<std::string> corrClus_names;
216  std::vector<std::string> corrTrk_names;
217  std::vector<std::string> sum_names;
218  std::string dir;
219 
220  corrClus_names.emplace_back("RefEle");
221  corrClus_names.emplace_back("RefGamma");
222  corrClus_names.emplace_back("RefTau");
223  corrClus_names.emplace_back("Muons");
224  corrClus_names.emplace_back("RefJet");
225  corrClus_names.emplace_back("SoftClus");
226 
227  corrTrk_names.emplace_back("RefEle");
228  corrTrk_names.emplace_back("RefGamma");
229  corrTrk_names.emplace_back("RefTau");
230  corrTrk_names.emplace_back("Muons");
231  corrTrk_names.emplace_back("RefJet");
232  corrTrk_names.emplace_back("PVSoftTrk");
233 
234  sum_names.emplace_back("RefEle");
235  sum_names.emplace_back("RefGamma");
236  sum_names.emplace_back("RefTau");
237  sum_names.emplace_back("Muons");
238  sum_names.emplace_back("RefJet");
239 
240  //-------------------------------------------------------------------------------------
241  // First set-up Reference MET histograms (if we want them)
242  if (m_doMETRefPlots){
243  name_met = "MET_Reference_" + type;
244  m_dir_met.clear();
245  std::vector<TH1D*> v_MET_Ref;
246  std::vector<TH1D*> v_MET_Ref_x;
247  std::vector<TH1D*> v_MET_Ref_y;
248  std::vector<TH1D*> v_MET_Ref_phi;
249  std::vector<TH1D*> v_MET_Ref_sum;
250  std::vector<TH1D*> v_MET_Cumu_Ref;
251  std::vector<TH1D*> v_MET_Resolution_Ref;
252  std::vector<TH1D*> v_MET_Significance_Ref;
253  std::vector<TH1D*> v_MET_dPhi_Ref;
254  std::vector<TH2D*> v_MET_CorrFinalTrk_Ref;
255  std::vector<TH2D*> v_MET_CorrFinalClus_Ref;
256  std::vector<TH1D*> v_MET_Diff_Ref;
257  std::vector<TH1D*> v_MET_Diff_Ref_x;
258  std::vector<TH1D*> v_MET_Diff_Ref_y;
259  std::vector<TH1D*> v_MET_Diff_Ref_phi;
260  std::vector<TH1D*> v_MET_Diff_Ref_sum;
261 
262  for(const auto& term : m_terms) {
263  v_MET_Ref.push_back( new TH1D((name_met + "_" + term).c_str(), (name_met + " " + m_names[term] + "; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi) );
264  v_MET_Ref_x.push_back( new TH1D((name_met + "_" + term +"_x").c_str(), (name_met + " " + m_names[term] + " x; E_{x}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
265  v_MET_Ref_y.push_back( new TH1D((name_met + "_" + term + "_y").c_str(), (name_met + " " + m_names[term] + " y; E_{y}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
266  v_MET_Ref_phi.push_back( new TH1D((name_met + "_" + term + "_phi").c_str(), (name_met + " " + m_names[term] + " phi; #Phi; Entries / 0.1").c_str(), nbinphi,-binphi,binphi) );
267  v_MET_Ref_sum.push_back( new TH1D((name_met + "_" + term + "_sum").c_str(), (name_met + " " + m_names[term] + " sum; E_{T}^{sum} [GeV]; Entries / 25 GeV").c_str(), nbinE, lowET, suET) );
268  m_dir_met.push_back("MET/" + name_met + "/Terms/" + term + "/");
269  }
270 
271  m_MET_Ref[type] = v_MET_Ref;
272  m_MET_Ref_x[type] = v_MET_Ref_x;
273  m_MET_Ref_y[type] = v_MET_Ref_y;
274  m_MET_Ref_phi[type] = v_MET_Ref_phi;
275  m_MET_Ref_sum[type] = v_MET_Ref_sum;
276 
277  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Ref.size(); ++i) {
283  }
284 
285  name_sub = name_met + "/Cumulative";
286  v_MET_Cumu_Ref.push_back( new TH1D((name_met + "_Cumulative_FinalClus").c_str(), (name_met + " CST MET cumulative; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi) );
287  v_MET_Cumu_Ref.push_back( new TH1D((name_met + "_Cumulative_FinalTrk").c_str(), (name_met + " TST MET cumulative; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi) );
288 
289  m_MET_Cumu_Ref[type] = v_MET_Cumu_Ref;
290 
291  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Cumu_Ref.size(); ++i) {
292  ATH_CHECK(regHist(m_MET_Cumu_Ref[type].at(i),"MET/" + name_sub + "/",all));
293  }
294 
295  name_sub = name_met + "/Residuals";
296  v_MET_Resolution_Ref.push_back( new TH1D((name_met + "_Resolution_FinalClus_x").c_str(), ("x-Residual of CST MET in " + name_met + "; #Delta(E_{T,CST}^{miss}, E_{T,truth}^{miss})_{x} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
297  v_MET_Resolution_Ref.push_back( new TH1D((name_met + "_Resolution_FinalClus_y").c_str(), ("y-Residual of CST MET in " + name_met + "; #Delta(E_{T,CST}^{miss}, E_{T,truth}^{miss})_{y} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
298  v_MET_Resolution_Ref.push_back( new TH1D((name_met + "_Resolution_FinalTrk_x").c_str(), ("x-Residual of TST MET in " + name_met + "; #Delta(E_{T,TST}^{miss}, E_{T,truth}^{miss})_{x} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
299  v_MET_Resolution_Ref.push_back( new TH1D((name_met + "_Resolution_FinalTrk_y").c_str(), ("y-Residual of TST MET in " + name_met + "; #Delta(E_{T,TST}^{miss}, E_{T,truth}^{miss})_{y} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
300 
301  m_MET_Resolution_Ref[type] = v_MET_Resolution_Ref;
302 
303  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Resolution_Ref.size(); ++i) {
304  ATH_CHECK(regHist(m_MET_Resolution_Ref[type].at(i),"MET/" + name_sub + "/",all));
305  }
306 
307  name_sub = name_met + "/Significance";
308  v_MET_Significance_Ref.push_back( new TH1D((name_met + "_Significance_FinalClus").c_str(), ("MET / sqrt(sumet) for " + name_met + " CST; MET/#sqrt{SET} [#sqrt{GeV}]; Entries / 0.25 #sqrt{GeV}").c_str(), nbinp, 0., 25.) );
309  v_MET_Significance_Ref.push_back( new TH1D((name_met + "_Significance_FinalTrk").c_str(), ("MET / sqrt(sumet) for " + name_met + " TST; MET/#sqrt{SET} [#sqrt{GeV}]; Entries / 0.25 #sqrt{GeV}").c_str(), nbinp, 0., 25.) );
310 
311  m_MET_Significance_Ref[type] = v_MET_Significance_Ref;
312 
313  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Significance_Ref.size(); ++i) {
314  ATH_CHECK(regHist(m_MET_Significance_Ref[type].at(i),"MET/" + name_sub + "/",all));
315  }
316 
317  name_sub = name_met + "/dPhi";
318  v_MET_dPhi_Ref.push_back( new TH1D((name_met + "_dPhi_leadJetMET_FinalClus").c_str(), ("MET deltaPhi vs leading jet for " + name_met + " CST; #Delta#Phi(leadJet, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
319  v_MET_dPhi_Ref.push_back( new TH1D((name_met + "_dPhi_subleadJetMET_FinalClus").c_str(), ("MET deltaPhi vs subleading jet for " + name_met + " CST; #Delta#Phi(subleadJet, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
320  v_MET_dPhi_Ref.push_back( new TH1D((name_met + "_dPhi_leadLepMET_FinalClus").c_str(), ("MET deltaPhi vs leading lepton for " + name_met + " CST; #Delta#Phi(leadLep, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
321  v_MET_dPhi_Ref.push_back( new TH1D((name_met + "_dPhi_leadJetMET_FinalTrk").c_str(), ("MET deltaPhi vs leading jet for " + name_met + " TST; #Delta#Phi(leadJet, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
322  v_MET_dPhi_Ref.push_back( new TH1D((name_met + "_dPhi_subleadJetMET_FinalTrk").c_str(), ("MET deltaPhi vs subleading jet for " + name_met + " TST; #Delta#Phi(subleadJet, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
323  v_MET_dPhi_Ref.push_back( new TH1D((name_met + "_dPhi_leadLepMET_FinalTrk").c_str(), ("MET deltaPhi vs leading lepton for " + name_met + " TST; #Delta#Phi(leadLep, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
324 
325  m_MET_dPhi_Ref[type] = v_MET_dPhi_Ref;
326 
327  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_dPhi_Ref.size(); ++i) {
328  ATH_CHECK(regHist(m_MET_dPhi_Ref[type].at(i),"MET/" + name_sub + "/",all));
329  }
330 
331  name_sub = name_met + "/Correlations";
332 
333  v_MET_CorrFinalClus_Ref.reserve(corrClus_names.size());
334 
335  for(const auto& it : corrClus_names) {
336  v_MET_CorrFinalClus_Ref.push_back( new TH2D((name_met + "_" + it + "_FinalClus").c_str(), (name_met + " " + m_names[it] + " vs. CST MET; E_{T," + it + "}^{miss} [GeV]; E_{T,CST}^{miss} [GeV]; Entries").c_str(), nbinp, 0., suptmi, nbinp, 0., suptmi) );
337  }
338  v_MET_CorrFinalTrk_Ref.reserve(corrTrk_names.size());
339 
340  for(const auto& it : corrTrk_names) {
341  v_MET_CorrFinalTrk_Ref.push_back( new TH2D((name_met + "_" + it + "_FinalTrk").c_str(), (name_met + " " + m_names[it] + " vs. TST MET; E_{T," + it + "}^{miss} [GeV]; E_{T,TST}^{miss} [GeV]; Entries").c_str(), nbinp, 0., suptmi, nbinp, 0., suptmi) );
342  }
343 
344  m_MET_CorrFinalClus_Ref[type] = v_MET_CorrFinalClus_Ref;
345  m_MET_CorrFinalTrk_Ref[type] = v_MET_CorrFinalTrk_Ref;
346 
347  for(std::vector<TH2D*>::size_type i = 0; i < v_MET_CorrFinalTrk_Ref.size(); ++i) {
348  ATH_CHECK(regHist(m_MET_CorrFinalTrk_Ref[type].at(i),"MET/" + name_sub + "/",all));
349  }
350  for(std::vector<TH2D*>::size_type i = 0; i < v_MET_CorrFinalClus_Ref.size(); ++i) {
351  ATH_CHECK(regHist(m_MET_CorrFinalClus_Ref[type].at(i),"MET/" + name_sub + "/",all));
352  }
353 
354  m_dir_met.clear();
355 
356  for(const auto& it : sum_names) {
357  v_MET_Diff_Ref.push_back( new TH1D((name_met + "_Diff_" + it).c_str(), ("MET_Diff " + m_names[it] + " in " + name_met +"; E_{T}^{miss} - #Sigma p_{T} [GeV]; Entries / 3 GeV").c_str(), nbinpxy, -150, 150));
358  v_MET_Diff_Ref_x.push_back( new TH1D((name_met + "_Diff_" + it +"_x").c_str(), ("MET_Diff x " + m_names[it] + " in " + name_met +"; E_{x}^{miss} - #Sigma p_{x} [GeV]; Entries / 3 GeV").c_str(), nbinpxy, -150, 150) );
359  v_MET_Diff_Ref_y.push_back( new TH1D((name_met + "_Diff_" + it +"_y").c_str(), ("MET_Diff y " + m_names[it] + " in " + name_met +"; E_{y}^{miss} - #Sigma p_{y} [GeV]; Entries / 3 GeV").c_str(), nbinpxy, -150, 150) );
360  v_MET_Diff_Ref_phi.push_back( new TH1D((name_met + "_Diff_" + it +"_phi").c_str(), ("MET_Diff phi " + m_names[it] + " in " + name_met +"; #Delta#Phi(E_{T}^{miss},#Sigma p_{T}); Entries / 0.1").c_str(), nbinphi,-binphi,binphi) );
361  v_MET_Diff_Ref_sum.push_back( new TH1D((name_met + "_Diff_" + it +"_sum").c_str(), ("MET_Diff sumet " + m_names[it] + " in " + name_met +"; E_{T}^{sum} - #Sigma |p_{T}| [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -250, 250) );
362  m_dir_met.push_back("MET/" + name_met + "/Differences/" + it + "/");
363  }
364 
365  m_MET_Diff_Ref[type] = v_MET_Diff_Ref;
366  m_MET_Diff_Ref_x[type] = v_MET_Diff_Ref_x;
367  m_MET_Diff_Ref_y[type] = v_MET_Diff_Ref_y;
368  m_MET_Diff_Ref_phi[type] = v_MET_Diff_Ref_phi;
369  m_MET_Diff_Ref_sum[type] = v_MET_Diff_Ref_sum;
370 
371  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Diff_Ref.size(); ++i) {
377  }
378  // End of if-statement (m_doMETRefPlots)
379  }
380 
381  //-------------------------------------------------------------------------------------
382  // Now the same for Rebuilt MET
383 
384  name_met = "MET_Rebuilt_" + type;
385  m_dir_met.clear();
386  std::vector<TH1D*> v_MET_Reb;
387  std::vector<TH1D*> v_MET_Reb_x;
388  std::vector<TH1D*> v_MET_Reb_y;
389  std::vector<TH1D*> v_MET_Reb_phi;
390  std::vector<TH1D*> v_MET_Reb_sum;
391  std::vector<TH1D*> v_MET_Cumu_Reb;
392  std::vector<TH1D*> v_MET_Resolution_Reb;
393  std::vector<TH1D*> v_MET_Significance_Reb;
394  std::vector<TH1D*> v_MET_dPhi_Reb;
395  std::vector<TH2D*> v_MET_CorrFinalTrk_Reb;
396  std::vector<TH2D*> v_MET_CorrFinalClus_Reb;
397  std::vector<TH1D*> v_MET_Diff_Reb;
398  std::vector<TH1D*> v_MET_Diff_Reb_x;
399  std::vector<TH1D*> v_MET_Diff_Reb_y;
400  std::vector<TH1D*> v_MET_Diff_Reb_phi;
401  std::vector<TH1D*> v_MET_Diff_Reb_sum;
402 
403  for(const auto& term : m_terms) {
404  v_MET_Reb.push_back( new TH1D((name_met + "_" + term).c_str(), (name_met + " " + m_names[term] + "; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi) );
405  v_MET_Reb_x.push_back( new TH1D((name_met + "_" + term + "_x").c_str(), (name_met + " " + m_names[term] + " x; E_{x}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
406  v_MET_Reb_y.push_back( new TH1D((name_met + "_" + term + "_y").c_str(), (name_met + " " + m_names[term] + " y; E_{y}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
407  v_MET_Reb_phi.push_back( new TH1D((name_met + "_" + term + "_phi").c_str(), (name_met + " " + m_names[term] + " phi; #Phi; Entries / 0.1").c_str(), nbinphi,-binphi,binphi) );
408  v_MET_Reb_sum.push_back( new TH1D((name_met + "_" + term + "_sum").c_str(), (name_met + " " + m_names[term] + " sum; E_{T}^{sum} [GeV]; Entries / 25 GeV").c_str(), nbinE, lowET, suET) );
409  m_dir_met.push_back("MET/" + name_met + "/Terms/" + term + "/");
410  }
411 
412  m_MET_Reb[type] = v_MET_Reb;
413  m_MET_Reb_x[type] = v_MET_Reb_x;
414  m_MET_Reb_y[type] = v_MET_Reb_y;
415  m_MET_Reb_phi[type] = v_MET_Reb_phi;
416  m_MET_Reb_sum[type] = v_MET_Reb_sum;
417 
418  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Reb.size(); ++i) {
424  }
425 
426  name_sub = name_met + "/Cumulative";
427  v_MET_Cumu_Reb.push_back( new TH1D((name_met + "_Cumulative_FinalClus").c_str(), (name_met + " CST MET cumulative; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi) );
428  v_MET_Cumu_Reb.push_back( new TH1D((name_met + "_Cumulative_FinalTrk").c_str(), (name_met + " TST MET cumulative; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi) );
429 
430  m_MET_Cumu_Reb[type] = v_MET_Cumu_Reb;
431 
432  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Cumu_Reb.size(); ++i) {
433  ATH_CHECK(regHist(m_MET_Cumu_Reb[type].at(i),"MET/" + name_sub + "/",all));
434  }
435 
436  name_sub = name_met + "/Residuals";
437  v_MET_Resolution_Reb.push_back( new TH1D((name_met + "_Resolution_FinalClus_x").c_str(), ("x-Residual of CST MET in " + name_met + "; #Delta(E_{T,CST}^{miss}, E_{T,truth}^{miss})_{x} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
438  v_MET_Resolution_Reb.push_back( new TH1D((name_met + "_Resolution_FinalClus_y").c_str(), ("y-Residual of CST MET in " + name_met + "; #Delta(E_{T,CST}^{miss}, E_{T,truth}^{miss})_{y} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
439  v_MET_Resolution_Reb.push_back( new TH1D((name_met + "_Resolution_FinalTrk_x").c_str(), ("x-Residual of TST MET in " + name_met + "; #Delta(E_{T,TST}^{miss}, E_{T,truth}^{miss})_{x} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
440  v_MET_Resolution_Reb.push_back( new TH1D((name_met + "_Resolution_FinalTrk_y").c_str(), ("y-Residual of TST MET in " + name_met + "; #Delta(E_{T,TST}^{miss}, E_{T,truth}^{miss})_{y} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy) );
441  m_MET_Resolution_Reb[type] = v_MET_Resolution_Reb;
442 
443  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Resolution_Reb.size(); ++i) {
444  ATH_CHECK(regHist(m_MET_Resolution_Reb[type].at(i),"MET/" + name_sub + "/",all));
445  }
446 
447  name_sub = name_met + "/Significance";
448  v_MET_Significance_Reb.push_back( new TH1D((name_met + "_Significance_FinalClus").c_str(), ("MET / sqrt(sumet) for " + name_met + " CST; MET/#sqrt{SET} [#sqrt{GeV}]; Entries / 0.25 #sqrt{GeV}").c_str(), nbinp, 0., 25.) );
449  v_MET_Significance_Reb.push_back( new TH1D((name_met + "_Significance_FinalTrk").c_str(), ("MET / sqrt(sumet) for " + name_met + " TST; MET/sqrt{SET} [#sqrt{GeV}]; Entries / 0.25 #sqrt{GeV}").c_str(), nbinp, 0., 25.) );
450 
451  m_MET_Significance_Reb[type] = v_MET_Significance_Reb;
452 
453  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Significance_Reb.size(); ++i) {
454  ATH_CHECK(regHist(m_MET_Significance_Reb[type].at(i),"MET/" + name_sub + "/",all));
455  }
456 
457  name_sub = name_met + "/dPhi";
458  v_MET_dPhi_Reb.push_back( new TH1D((name_met + "_dPhi_leadJetMET_FinalClus").c_str(), ("MET deltaPhi vs leading jet for " + name_met + " CST; #Delta#Phi(leadJet, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
459  v_MET_dPhi_Reb.push_back( new TH1D((name_met + "_dPhi_subleadJetMET_FinalClus").c_str(), ("MET deltaPhi vs subleading jet for " + name_met + " CST; #Delta#Phi(subleadJet, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
460  v_MET_dPhi_Reb.push_back( new TH1D((name_met + "_dPhi_leadLepMET_FinalClus").c_str(), ("MET deltaPhi vs leading lepton for " + name_met + " CST; #Delta#Phi(leadLep, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
461  v_MET_dPhi_Reb.push_back( new TH1D((name_met + "_dPhi_leadJetMET_FinalTrk").c_str(), ("MET deltaPhi vs leading jet for " + name_met + " TST; #Delta#Phi(leadJet, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
462  v_MET_dPhi_Reb.push_back( new TH1D((name_met + "_dPhi_subleadJetMET_FinalTrk").c_str(), ("MET deltaPhi vs subleading jet for " + name_met + " TST; #Delta#Phi(subleadJet, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
463  v_MET_dPhi_Reb.push_back( new TH1D((name_met + "_dPhi_leadLepMET_FinalTrk").c_str(), ("MET deltaPhi vs leading lepton for " + name_met + " TST; #Delta#Phi(leadLep, MET); Entries / 0.05").c_str(), nbinphi, 0., binphi) );
464 
465  m_MET_dPhi_Reb[type] = v_MET_dPhi_Reb;
466 
467  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_dPhi_Reb.size(); ++i) {
468  ATH_CHECK(regHist(m_MET_dPhi_Reb[type].at(i),"MET/" + name_sub + "/",all));
469  }
470 
471  name_sub = name_met + "/Correlations";
472  v_MET_CorrFinalClus_Reb.reserve(corrClus_names.size());
473 
474  for(const auto& it : corrClus_names) {
475  v_MET_CorrFinalClus_Reb.push_back( new TH2D((name_met + "_" + it + "_FinalClus").c_str(), (name_met + " " + m_names[it] + " vs. CST MET; E_{T," + it + "}^{miss} [GeV]; E_{T,CST}^{miss} [GeV]; Entries").c_str(), nbinp, 0., suptmi, nbinp, 0., suptmi) );
476  }
477  v_MET_CorrFinalTrk_Reb.reserve(corrTrk_names.size());
478 
479  for(const auto& it : corrTrk_names) {
480  v_MET_CorrFinalTrk_Reb.push_back( new TH2D((name_met + "_" + it + "_FinalTrk").c_str(), (name_met + " " + m_names[it] + " vs. TST MET; E_{T," + it + "}^{miss} [GeV]; E_{T,TST}^{miss} [GeV]; Entries").c_str(), nbinp, 0., suptmi, nbinp, 0., suptmi) );
481  }
482 
483  m_MET_CorrFinalClus_Reb[type] = v_MET_CorrFinalClus_Reb;
484  m_MET_CorrFinalTrk_Reb[type] = v_MET_CorrFinalTrk_Reb;
485 
486  for(std::vector<TH2D*>::size_type i = 0; i < v_MET_CorrFinalTrk_Reb.size(); ++i) {
487  ATH_CHECK(regHist(m_MET_CorrFinalTrk_Reb[type].at(i),"MET/" + name_sub + "/",all));
488  }
489  for(std::vector<TH2D*>::size_type i = 0; i < v_MET_CorrFinalClus_Reb.size(); ++i) {
490  ATH_CHECK(regHist(m_MET_CorrFinalClus_Reb[type].at(i),"MET/" + name_sub + "/",all));
491  }
492 
493  m_dir_met.clear();
494 
495  for(const auto& it : sum_names) {
496  v_MET_Diff_Reb.push_back( new TH1D((name_met + "_Diff_" + it).c_str(), ("MET_Diff " + m_names[it] + " in " + name_met +"; E_{T}^{miss} - #Sigma p_{T} [GeV]; Entries / 3 GeV").c_str(), nbinpxy, -150, 150));
497  v_MET_Diff_Reb_x.push_back( new TH1D((name_met + "_Diff_" + it + "_x").c_str(), ("MET_Diff x " + m_names[it] + " in " + name_met +"; E_{x}^{miss} - #Sigma p_{x} [GeV]; Entries / 3 GeV").c_str(), nbinpxy, -150, 150) );
498  v_MET_Diff_Reb_y.push_back( new TH1D((name_met + "_Diff_" + it + "_y").c_str(), ("MET_Diff y " + m_names[it] + " in " + name_met +"; E_{y}^{miss} - #Sigma p_{y} [GeV]; Entries / 3 GeV").c_str(), nbinpxy, -150, 150) );
499  v_MET_Diff_Reb_phi.push_back( new TH1D((name_met + "_Diff_" + it + "_phi").c_str(), ("MET_Diff phi " + m_names[it] + " in " + name_met +"; #Delta#Phi(E_{T}^{miss}, #Sigma p_{T}); Entries / 0.1").c_str(), nbinphi,-binphi,binphi) );
500  v_MET_Diff_Reb_sum.push_back( new TH1D((name_met + "_Diff_" + it + "_sum").c_str(), ("MET_Diff sumet " + m_names[it] + " in " + name_met +"; E_{T}^{sum} - #Sigma |p_{T}| [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -250, 250) );
501  m_dir_met.push_back("MET/" + name_met + "/Differences/" + it + "/");
502  }
503 
504  m_MET_Diff_Reb[type] = v_MET_Diff_Reb;
505  m_MET_Diff_Reb_x[type] = v_MET_Diff_Reb_x;
506  m_MET_Diff_Reb_y[type] = v_MET_Diff_Reb_y;
507  m_MET_Diff_Reb_phi[type] = v_MET_Diff_Reb_phi;
508  m_MET_Diff_Reb_sum[type] = v_MET_Diff_Reb_sum;
509 
510  for(std::vector<TH1D*>::size_type i = 0; i < v_MET_Diff_Reb.size(); ++i) {
516  }
517  }
518 
519  //-------------------------------------------------------------------------------------
520  // Now MET_Track (only built if METRef is too)
521  if (m_doMETRefPlots){
522  std::string name_met = "MET_Track";
523  std::string dir = "MET/" + name_met + "/";
524  std::string sub_dir;
525 
526  sub_dir = dir + "Track/";
527  ATH_CHECK(regHist(m_MET_Track = new TH1D("Track", (name_met + " " + m_names["Track"] + "; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi), sub_dir, all));
528  ATH_CHECK(regHist(m_MET_Track_x = new TH1D("Track_x", (name_met + " " + m_names["Track"] + " x; E_{x}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy), sub_dir, all));
529  ATH_CHECK(regHist(m_MET_Track_y = new TH1D("Track_y", (name_met + " " + m_names["Track"] + " y; E_{y}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy), sub_dir, all));
530  ATH_CHECK(regHist(m_MET_Track_phi = new TH1D("Track_phi", (name_met + " " + m_names["Track"] + " phi; #Phi; Entries / 0.1").c_str(), nbinphi,-binphi,binphi), sub_dir, all));
531  ATH_CHECK(regHist(m_MET_Track_sum = new TH1D("Track_sum", (name_met + " " + m_names["Track"] + " sum; E_{T}^{sum} [GeV]; Entries / 25 GeV").c_str(), nbinE, lowET, suET), sub_dir, all));
532 
533  sub_dir = dir + "PVTrack_Nominal/";
534  ATH_CHECK(regHist(m_MET_PVTrack_Nominal = new TH1D("PVTrack_Nominal", (name_met + " " + m_names["PVTrack_Nominal"] + " ; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi), sub_dir, all));
535  ATH_CHECK(regHist(m_MET_PVTrack_Nominal_x = new TH1D("PVTrack_Nominal_x", (name_met + " " + m_names["PVTrack_Nominal"] + " x; E_{x}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy), sub_dir, all));
536  ATH_CHECK(regHist(m_MET_PVTrack_Nominal_y = new TH1D("PVTrack_Nominal_y", (name_met + " " + m_names["PVTrack_Nominal"] + " y; E_{y}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy), sub_dir, all));
537  ATH_CHECK(regHist(m_MET_PVTrack_Nominal_phi = new TH1D("PVTrack_Nominal_phi", (name_met + " " + m_names["PVTrack_Nominal"] + " phi; #Phi; Entries / 0.1").c_str(), nbinphi,-binphi,binphi), sub_dir, all));
538  ATH_CHECK(regHist(m_MET_PVTrack_Nominal_sum = new TH1D("PVTrack_Nominal_sum", (name_met + " " + m_names["PVTrack_Nominal"] + " sum; E_{T}^{sum} [GeV]; Entries / 25 GeV").c_str(), nbinE, lowET, suET), sub_dir, all));
539 
540  sub_dir = dir + "PVTrack_Pileup/";
541  ATH_CHECK(regHist(m_MET_PVTrack_Pileup = new TH1D("PVTrack_Pileup", (name_met + " " + m_names["PVTrack_Pileup"] + "; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi), sub_dir, all));
542  ATH_CHECK(regHist(m_MET_PVTrack_Pileup_x = new TH1D("PVTrack_Pileup_x", (name_met + " " + m_names["PVTrack_Pileup"] + " x; E_{x}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy), sub_dir, all));
543  ATH_CHECK(regHist(m_MET_PVTrack_Pileup_y = new TH1D("PVTrack_Pileup_y", (name_met +" " + m_names["PVTrack_Pileup"] + " y; E_{y}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy), sub_dir, all));
544  ATH_CHECK(regHist(m_MET_PVTrack_Pileup_phi = new TH1D("PVTrack_Pileup_phi", (name_met + " " + m_names["PVTrack_Pileup"] + " phi; #Phi; Entries / 0.1").c_str(), nbinphi,-binphi,binphi), sub_dir, all));
545  ATH_CHECK(regHist(m_MET_PVTrack_Pileup_sum = new TH1D("PVTrack_Pileup_sum", (name_met + " " + m_names["PVTrack_Pileup"] + " sum; E_{T}^{sum} [GeV]; Entries / 25 GeV").c_str(), nbinE, lowET, suET), sub_dir, all));
546  }
547 
548  //-------------------------------------------------------------------------------------
549  //Now MET_Calo
550 
551  std::string name_met = "MET_Calo";
552  std::string dir = "MET/" + name_met + "/";
553 
554  ATH_CHECK(regHist(m_MET_Calo = new TH1D("Calo", (name_met + " " + m_names["Calo"] + "; E_{T}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinp, 0., suptmi), dir, all));
555  ATH_CHECK(regHist(m_MET_Calo_x = new TH1D("Calo_x", (name_met + " " + m_names["Calo"] + " x; E_{x}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy), dir, all));
556  ATH_CHECK(regHist(m_MET_Calo_y = new TH1D("Calo_y", (name_met + " " + m_names["Calo"] + " y; E_{y}^{miss} [GeV]; Entries / 5 GeV").c_str(), nbinpxy, -suptmixy, suptmixy), dir, all));
557  ATH_CHECK(regHist(m_MET_Calo_phi = new TH1D("Calo_phi", (name_met + " " + m_names["Calo"] + " phi; #Phi; Entries / 0.1").c_str(), nbinphi,-binphi,binphi), dir, all));
558  ATH_CHECK(regHist(m_MET_Calo_sum = new TH1D("Calo_sum", (name_met + " " + m_names["Calo"] + " sum; E_{T}^{sum} [GeV]; Entries / 25 GeV").c_str(), nbinE, lowET, suET), dir, all));
559 
560  }
561 
562  return StatusCode::SUCCESS;
563  }
564 
566  {
567  ATH_MSG_INFO ("Filling hists " << name() << "...");
568 
569  //If we're running over new AODs without MET containers, don't do anything!
571  return StatusCode::SUCCESS;
572 
573  //Beamspot weight
574  const xAOD::EventInfo* eventInfo(nullptr);
575  ATH_CHECK(evtStore()->retrieve(eventInfo, "EventInfo"));
576 
577  float weight = eventInfo->beamSpotWeight();
578 
579  //Retrieve MET Truth
580  const xAOD::MissingETContainer* met_Truth = nullptr;
581  if(m_doTruth) {
582  ATH_CHECK( evtStore()->retrieve(met_Truth,"MET_Truth") );
583  if (!met_Truth) {
584  ATH_MSG_ERROR ( "Failed to retrieve MET_Truth. Exiting." );
585  return StatusCode::FAILURE;
586  }
587  }
588 
589  //Physics Objects
590  const xAOD::MuonContainer* muons = nullptr;
591  ATH_CHECK( evtStore()->retrieve(muons,m_muonColl) );
592  if (!muons) {
593  ATH_MSG_ERROR ( "Failed to retrieve Muon container. Exiting." );
594  return StatusCode::FAILURE;
595  }
597  bool is_muon = 0;
598  for(const auto& mu : *muons) {
599  if(Accept(mu)) {
600  metMuons.push_back(mu);
601  is_muon = 1;
602  }
603  }
604 
605  const xAOD::ElectronContainer* electrons = nullptr;
607  if (!electrons) {
608  ATH_MSG_ERROR ( "Failed to retrieve Electron container. Exiting." );
609  return StatusCode::FAILURE;
610  }
612  bool is_electron = 0;
613  for(const auto& el : *electrons) {
614  if(Accept(el)) {
615  metElectrons.push_back(el);
616  is_electron = 1;
617  }
618  }
619 
620  const xAOD::PhotonContainer* photons = nullptr;
621  ATH_CHECK( evtStore()->retrieve(photons,m_gammaColl) );
622  if (!electrons) {
623  ATH_MSG_ERROR ( "Failed to retrieve Photon container. Exiting." );
624  return StatusCode::FAILURE;
625  }
627  for(const auto& ph : *photons) {
628  if(Accept(ph)) {
629  metPhotons.push_back(ph);
630  }
631  }
632 
633  const TauJetContainer* taus = nullptr;
634  ATH_CHECK( evtStore()->retrieve(taus, m_tauColl) );
635  if(!taus) {
636  ATH_MSG_ERROR("Failed to retrieve TauJet container: " << m_tauColl);
637  return StatusCode::SUCCESS;
638  }
640  for(const auto& tau : *taus) {
641  if(Accept(tau)) {
642  metTaus.push_back(tau);
643  }
644  }
645 
646  // Overlap removal
647 
653 
654  //Photons
655  bool is_photon = 0;
657  for(pho_itr = metPhotons.begin(); pho_itr != metPhotons.end(); ++pho_itr ) {
658  TLorentzVector phtlv = (*pho_itr)->p4();
659  bool passOR = 1;
660  for(ele_itr = metElectrons.begin(); ele_itr != metElectrons.end(); ++ele_itr) {
661  if(phtlv.DeltaR((*ele_itr)->p4()) < 0.2) {
662  passOR = 0;
663  break;
664  }
665  }
666  if(passOR){
667  metPhotonsOR.push_back(*pho_itr);
668  is_photon = 1;
669  }
670  }
671 
672  //TauJets
674  bool is_tau = 0;
675  for(taujet_itr = metTaus.begin(); taujet_itr != metTaus.end(); ++taujet_itr ) {
676  TLorentzVector tautlv = (*taujet_itr)->p4();
677  bool passOR = 1;
678  for(ele_itr = metElectrons.begin(); ele_itr != metElectrons.end(); ++ele_itr) {
679  if(tautlv.DeltaR((*ele_itr)->p4()) < 0.2) {
680  passOR = 0;
681  break;
682  }
683  }
684  for(pho_itr = metPhotonsOR.begin(); pho_itr != metPhotonsOR.end(); ++pho_itr) {
685  if(tautlv.DeltaR((*pho_itr)->p4()) < 0.2) {
686  passOR = 0;
687  break;
688  }
689  }
690  if(passOR){
691  metTausOR.push_back(*taujet_itr);
692  is_tau = 1;
693  }
694  }
695 
696  //Sum up the pT's of the objects
697  TLorentzVector el_tlv;
698  double sum_el = 0;
699  for(ele_itr = metElectrons.begin(); ele_itr != metElectrons.end(); ++ele_itr ) {
700  el_tlv += (*ele_itr)->p4();
701  sum_el += (*ele_itr)->pt();
702  }
703 
704  TLorentzVector mu_tlv;
705  double sum_mu = 0;
706  for(mu_itr = metMuons.begin(); mu_itr != metMuons.end(); ++mu_itr ) {
707  mu_tlv += (*mu_itr)->p4();
708  sum_mu += (*mu_itr)->pt();
709  }
710 
711  TLorentzVector tau_tlv;
712  double sum_tau = 0;
713  for(taujet_itr = metTausOR.begin(); taujet_itr != metTausOR.end(); ++taujet_itr ) {
714  tau_tlv += (*taujet_itr)->p4();
715  sum_tau += (*taujet_itr)->pt();
716  }
717 
718  TLorentzVector photon_tlv;
719  double sum_photon = 0;
720  for(pho_itr = metPhotonsOR.begin(); pho_itr != metPhotonsOR.end(); ++pho_itr ) {
721  photon_tlv += (*pho_itr)->p4();
722  sum_photon += (*pho_itr)->pt();
723  }
724 
725  for (const auto& type : m_types){
726  ToolHandle<IJetUpdateJvt>* jvtTool(nullptr);
727  double JvtCut = 0.59;
728  if (type == "AntiKt4EMPFlow"){
729  JvtCut = 0.2;
730  jvtTool = &m_jvtToolPFlow;
731  }
732  else if (type == "AntiKt4EMTopo"){
733  jvtTool = &m_jvtToolEM;
734  }
735 
736  if(jvtTool == nullptr){
737  ATH_MSG_ERROR("Unrecognized jet container: " << type << "Jets");
738  return StatusCode::FAILURE;
739  }
740 
741  // Retrieve Jets
742  std::string name_jet = type + "Jets";
743  const xAOD::JetContainer* jets = nullptr;
744  ATH_CHECK( evtStore()->retrieve(jets,name_jet) );
745  if (!jets) {
746  ATH_MSG_ERROR ( "Failed to retrieve Jet container: " << name_jet << ". Exiting." );
747  return StatusCode::FAILURE;
748  }
749  for(auto jet : *jets) {
750  float newjvt = (*jvtTool)->updateJvt(*jet);
751  jet->auxdecor<float>("NewJvt") = newjvt;
752  }
754  for(const auto& jet : *jets) {
755  metJets.push_back(jet);
756  }
757  //Overlap Removal
759  bool is_jet = 0;
760  for(jetc_itr = metJets.begin(); jetc_itr != metJets.end(); ++jetc_itr ) {
761  TLorentzVector jettlv = (*jetc_itr)->p4();
762  bool passOR = 1;
763  for(ele_itr = metElectrons.begin(); ele_itr != metElectrons.end(); ++ele_itr) {
764  if(jettlv.DeltaR((*ele_itr)->p4()) < 0.2) {
765  passOR = 0;
766  break;
767  }
768  }
769  for(pho_itr = metPhotonsOR.begin(); pho_itr != metPhotonsOR.end(); ++pho_itr) {
770  if(jettlv.DeltaR((*pho_itr)->p4()) < 0.2) {
771  passOR = 0;
772  break;
773  }
774  }
775  for(taujet_itr = metTausOR.begin(); taujet_itr != metTausOR.end(); ++taujet_itr) {
776  if(jettlv.DeltaR((*taujet_itr)->p4()) < 0.2) {
777  passOR = 0;
778  break;
779  }
780  }
781  if(passOR){
782  metJetsOR.push_back(*jetc_itr);
783  is_jet = 1;
784  }
785  }
786 
787  TLorentzVector jet_tlv;
788  double sum_jet = 0;
789  for(jetc_itr = metJetsOR.begin(); jetc_itr != metJetsOR.end(); ++jetc_itr ) {
790  jet_tlv += (*jetc_itr)->p4();
791  sum_jet += (*jetc_itr)->pt();
792  }
793 
794  // Fill MET_Ref
795  std::string name_met = "MET_Reference_" + type;
796  const xAOD::MissingETContainer* met_Ref = nullptr;
797  // We're not building METReference anymore in derivations
798 
799  if(m_doMETRefPlots){
800 
801  // Retrieve Reference MET
802  ATH_CHECK( evtStore()->retrieve(met_Ref, name_met) );
803  if (!met_Ref) {
804  ATH_MSG_ERROR ("Couldn't retrieve " << name_met);
805  return StatusCode::FAILURE;
806  }
807 
808  ATH_MSG_INFO( " MET_Ref_" << type << ":" );
809  for(const auto& it : *met_Ref) {
810  const std::string& name = it->name();
811  if(name == "RefEle"){
812  (m_MET_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
813  (m_MET_Ref_x[type]).at(0)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
814  (m_MET_Ref_y[type]).at(0)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
815  (m_MET_Ref_phi[type]).at(0)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
816  (m_MET_Ref_sum[type]).at(0)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
817  }
818  if(name == "RefGamma"){
819  (m_MET_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
820  (m_MET_Ref_x[type]).at(1)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
821  (m_MET_Ref_y[type]).at(1)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
822  (m_MET_Ref_phi[type]).at(1)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
823  (m_MET_Ref_sum[type]).at(1)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
824  }
825  if(name == "RefTau"){
826  (m_MET_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
827  (m_MET_Ref_x[type]).at(2)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
828  (m_MET_Ref_y[type]).at(2)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
829  (m_MET_Ref_phi[type]).at(2)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
830  (m_MET_Ref_sum[type]).at(2)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
831  }
832  if(name == "Muons"){
833  (m_MET_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
834  (m_MET_Ref_x[type]).at(3)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
835  (m_MET_Ref_y[type]).at(3)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
836  (m_MET_Ref_phi[type]).at(3)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
837  (m_MET_Ref_sum[type]).at(3)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
838  }
839  if(name == "RefJet"){
840  (m_MET_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
841  (m_MET_Ref_x[type]).at(4)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
842  (m_MET_Ref_y[type]).at(4)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
843  (m_MET_Ref_phi[type]).at(4)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
844  (m_MET_Ref_sum[type]).at(4)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
845  }
846  if(name == "SoftClus"){
847  (m_MET_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
848  (m_MET_Ref_x[type]).at(5)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
849  (m_MET_Ref_y[type]).at(5)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
850  (m_MET_Ref_phi[type]).at(5)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
851  (m_MET_Ref_sum[type]).at(5)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
852  }
853  if(name == "PVSoftTrk"){
854  (m_MET_Ref[type]).at(6)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
855  (m_MET_Ref_x[type]).at(6)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
856  (m_MET_Ref_y[type]).at(6)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
857  (m_MET_Ref_phi[type]).at(6)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
858  (m_MET_Ref_sum[type]).at(6)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
859  }
860  if(name == "FinalTrk"){
861  (m_MET_Ref[type]).at(7)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
862  (m_MET_Ref_x[type]).at(7)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
863  (m_MET_Ref_y[type]).at(7)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
864  (m_MET_Ref_phi[type]).at(7)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
865  (m_MET_Ref_sum[type]).at(7)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
866  }
867  if(name == "FinalClus"){
868  (m_MET_Ref[type]).at(8)->Fill((*met_Ref)[name.c_str()]->met()/1000., weight);
869  (m_MET_Ref_x[type]).at(8)->Fill((*met_Ref)[name.c_str()]->mpx()/1000., weight);
870  (m_MET_Ref_y[type]).at(8)->Fill((*met_Ref)[name.c_str()]->mpy()/1000., weight);
871  (m_MET_Ref_phi[type]).at(8)->Fill((*met_Ref)[name.c_str()]->phi(), weight);
872  (m_MET_Ref_sum[type]).at(8)->Fill((*met_Ref)[name.c_str()]->sumet()/1000., weight);
873  }
874  }
875  }
876 
877  //Prepare Rebuilding MET
878  ATH_MSG_INFO( " Rebuilding MET_" << type );
879  MissingETContainer* met_Reb = new MissingETContainer();
880  if( evtStore()->record(met_Reb,("MET_Rebuilt"+type).c_str()).isFailure() ) {
881  ATH_MSG_WARNING("Unable to record MissingETContainer: MET_Rebuilt_" << type);
882  return StatusCode::FAILURE;
883  }
884  MissingETAuxContainer* met_RebAux = new MissingETAuxContainer();
885  if( evtStore()->record(met_RebAux,("MET_Rebuilt"+type+"Aux").c_str()).isFailure() ) {
886  ATH_MSG_WARNING("Unable to record MissingETAuxContainer: MET_Rebuilt" << type);
887  return StatusCode::FAILURE;
888  }
889  met_Reb->setStore(met_RebAux);
890 
891  m_mapname = "METAssoc_"+type;
892  m_corename = "MET_Core_"+type;
893  const MissingETAssociationMap* metMap = nullptr;
894  if( evtStore()->retrieve(metMap, m_mapname).isFailure() ) {
895  ATH_MSG_WARNING("Unable to retrieve MissingETAssociationMap: " << m_mapname);
896  return StatusCode::SUCCESS;
897  }
898  MissingETAssociationHelper metHelper(metMap);
899  const MissingETContainer* coreMet(nullptr);
900  if( evtStore()->retrieve(coreMet, m_corename).isFailure() ) {
901  ATH_MSG_WARNING("Unable to retrieve MissingETContainer: " << m_corename);
902  return StatusCode::SUCCESS;
903  }
904 
905  ATH_MSG_INFO( " MET_Rebuilt_" << type << ":" );
906  //Select and flag objects for final MET building ***************************
907  if( type.find("PFlow") != std::string::npos) m_metmaker = &m_metmakerPFlow;
908  else m_metmaker = &m_metmakerTopo;
909 
910  // Electrons
911  if( (*m_metmaker)->rebuildMET("RefEle", xAOD::Type::Electron, met_Reb, metElectrons.asDataVector(), metHelper).isFailure() ) {
912  ATH_MSG_WARNING("Failed to build electron term.");
913  }
914 
915  // Photons
916  if( (*m_metmaker)->rebuildMET("RefGamma", xAOD::Type::Photon, met_Reb, metPhotons.asDataVector(), metHelper).isFailure() ) {
917  ATH_MSG_WARNING("Failed to build photon term.");
918  }
919 
920  // Taus
921  if( (*m_metmaker)->rebuildMET("RefTau", xAOD::Type::Tau, met_Reb,metTaus.asDataVector(),metHelper).isFailure() ){
922  ATH_MSG_WARNING("Failed to build tau term.");
923  }
924 
925  // Muons
926  if( (*m_metmaker)->rebuildMET("Muons", xAOD::Type::Muon, met_Reb, metMuons.asDataVector(), metHelper).isFailure() ) {
927  ATH_MSG_WARNING("Failed to build muon term.");
928  }
929 
930  // Jets
931  if( (*m_metmaker)->rebuildJetMET("RefJet", "SoftClus", "PVSoftTrk", met_Reb, jets, coreMet, metHelper, true).isFailure() ) {
932  ATH_MSG_WARNING("Failed to build jet and soft terms.");
933  }
935  if((*met_Reb)["PVSoftTrk"]) trksource = (*met_Reb)["PVSoftTrk"]->source();
936  if( met::buildMETSum("FinalTrk", met_Reb, trksource).isFailure() ){
937  ATH_MSG_WARNING("Building MET FinalTrk sum failed.");
938  }
940  if (type == "AntiKt4EMTopo") clsource = static_cast<MissingETBase::Types::bitmask_t>(MissingETBase::Source::Signal::EMTopo);
942 
943  if((*met_Reb)["SoftClus"]) clsource = (*met_Reb)["SoftClus"]->source();
944  if( met::buildMETSum("FinalClus", met_Reb, clsource).isFailure() ) {
945  ATH_MSG_WARNING("Building MET FinalClus sum failed.");
946  }
947 
948  // Fill MET_Reb
949  for(const auto& it : *met_Reb) {
950  std::string name = it->name();
951  if(name == "RefEle"){
952  (m_MET_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
953  (m_MET_Reb_x[type]).at(0)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
954  (m_MET_Reb_y[type]).at(0)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
955  (m_MET_Reb_phi[type]).at(0)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
956  (m_MET_Reb_sum[type]).at(0)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
957  }
958  if(name == "RefGamma"){
959  (m_MET_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
960  (m_MET_Reb_x[type]).at(1)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
961  (m_MET_Reb_y[type]).at(1)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
962  (m_MET_Reb_phi[type]).at(1)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
963  (m_MET_Reb_sum[type]).at(1)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
964  }
965  if(name == "RefTau"){
966  (m_MET_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
967  (m_MET_Reb_x[type]).at(2)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
968  (m_MET_Reb_y[type]).at(2)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
969  (m_MET_Reb_phi[type]).at(2)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
970  (m_MET_Reb_sum[type]).at(2)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
971  }
972  if(name == "Muons"){
973  (m_MET_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
974  (m_MET_Reb_x[type]).at(3)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
975  (m_MET_Reb_y[type]).at(3)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
976  (m_MET_Reb_phi[type]).at(3)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
977  (m_MET_Reb_sum[type]).at(3)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
978  }
979  if(name == "RefJet"){
980  (m_MET_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
981  (m_MET_Reb_x[type]).at(4)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
982  (m_MET_Reb_y[type]).at(4)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
983  (m_MET_Reb_phi[type]).at(4)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
984  (m_MET_Reb_sum[type]).at(4)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
985  }
986  if(name == "SoftClus"){
987  (m_MET_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
988  (m_MET_Reb_x[type]).at(5)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
989  (m_MET_Reb_y[type]).at(5)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
990  (m_MET_Reb_phi[type]).at(5)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
991  (m_MET_Reb_sum[type]).at(5)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
992  }
993  if(name == "PVSoftTrk"){
994  (m_MET_Reb[type]).at(6)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
995  (m_MET_Reb_x[type]).at(6)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
996  (m_MET_Reb_y[type]).at(6)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
997  (m_MET_Reb_phi[type]).at(6)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
998  (m_MET_Reb_sum[type]).at(6)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
999  }
1000  if(name == "FinalTrk"){
1001  (m_MET_Reb[type]).at(7)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
1002  (m_MET_Reb_x[type]).at(7)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
1003  (m_MET_Reb_y[type]).at(7)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
1004  (m_MET_Reb_phi[type]).at(7)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
1005  (m_MET_Reb_sum[type]).at(7)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
1006  }
1007  if(name == "FinalClus"){
1008  (m_MET_Reb[type]).at(8)->Fill((*met_Reb)[name.c_str()]->met()/1000., weight);
1009  (m_MET_Reb_x[type]).at(8)->Fill((*met_Reb)[name.c_str()]->mpx()/1000., weight);
1010  (m_MET_Reb_y[type]).at(8)->Fill((*met_Reb)[name.c_str()]->mpy()/1000., weight);
1011  (m_MET_Reb_phi[type]).at(8)->Fill((*met_Reb)[name.c_str()]->phi(), weight);
1012  (m_MET_Reb_sum[type]).at(8)->Fill((*met_Reb)[name.c_str()]->sumet()/1000., weight);
1013  }
1014  }
1015 
1016  //Fill MET Angles
1017  ATH_MSG_INFO( " MET_Angles :" );
1018 
1019  double leadPt = 0., subleadPt = 0., leadPhi = 0., subleadPhi = 0.;
1020 
1021  for (auto jet_itr = jets->begin(); jet_itr != jets->end(); ++jet_itr) {
1022  if ((*jet_itr)->pt() > leadPt && Accept(*jet_itr,JvtCut,jvtTool)) {
1023  subleadPt = leadPt;
1024  subleadPhi = leadPhi;
1025  leadPt = (*jet_itr)->pt();
1026  leadPhi = (*jet_itr)->phi();
1027  }
1028  else if ((*jet_itr)->pt() > subleadPt && Accept(*jet_itr,JvtCut,jvtTool)) {
1029  subleadPt = (*jet_itr)->pt();
1030  subleadPhi = (*jet_itr)->phi();
1031  }
1032  }
1033 
1034  if(m_doMETRefPlots){
1035  (m_MET_dPhi_Ref[type]).at(0)->Fill( -remainder( leadPhi - (*met_Ref)["FinalClus"]->phi(), 2*M_PI ), weight );
1036  (m_MET_dPhi_Ref[type]).at(1)->Fill( -remainder( subleadPhi - (*met_Ref)["FinalClus"]->phi(), 2*M_PI ), weight );
1037  (m_MET_dPhi_Ref[type]).at(3)->Fill( -remainder( leadPhi - (*met_Ref)["FinalTrk"]->phi(), 2*M_PI ), weight );
1038  (m_MET_dPhi_Ref[type]).at(4)->Fill( -remainder( subleadPhi - (*met_Ref)["FinalTrk"]->phi(), 2*M_PI ), weight );
1039  }
1040 
1041  (m_MET_dPhi_Reb[type]).at(0)->Fill( -remainder( leadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ), weight );
1042  (m_MET_dPhi_Reb[type]).at(1)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ), weight );
1043  (m_MET_dPhi_Reb[type]).at(3)->Fill( -remainder( leadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ), weight );
1044  (m_MET_dPhi_Reb[type]).at(4)->Fill( -remainder( subleadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ), weight );
1045 
1046  leadPt = 0.; leadPhi = 0.;
1047 
1048  xAOD::MuonContainer::const_iterator muon_itr = muons->begin();
1049  xAOD::MuonContainer::const_iterator muon_end = muons->end();
1050 
1051  for( ; muon_itr != muon_end; ++muon_itr ) {
1052  if((*muon_itr)->pt() > leadPt) {
1053  leadPt = (*muon_itr)->pt();
1054  leadPhi = (*muon_itr)->phi();
1055  }
1056  }
1057 
1058  xAOD::ElectronContainer::const_iterator electron_itr = electrons->begin();
1059  xAOD::ElectronContainer::const_iterator electron_end = electrons->end();
1060 
1061  for( ; electron_itr != electron_end; ++electron_itr ) {
1062  if((*electron_itr)->pt() > leadPt) {
1063  leadPt = (*electron_itr)->pt();
1064  leadPhi = (*electron_itr)->phi();
1065  }
1066  }
1067 
1068  (m_MET_dPhi_Reb[type]).at(2)->Fill( -remainder( leadPhi - (*met_Reb)["FinalClus"]->phi(), 2*M_PI ), weight );
1069  (m_MET_dPhi_Reb[type]).at(5)->Fill( -remainder( leadPhi - (*met_Reb)["FinalTrk"]->phi(), 2*M_PI ), weight );
1070 
1071  if(m_doMETRefPlots){
1072 
1073  (m_MET_dPhi_Ref[type]).at(2)->Fill( -remainder( leadPhi - (*met_Ref)["FinalClus"]->phi(), 2*M_PI ), weight );
1074  (m_MET_dPhi_Ref[type]).at(5)->Fill( -remainder( leadPhi - (*met_Ref)["FinalTrk"]->phi(), 2*M_PI ), weight );
1075 
1076  //Fill Correlation Plots
1077  //Reference
1078  for(const auto& it : *met_Ref) {
1079  const std::string& name = it->name();
1080  if(name == "RefEle"){
1081  (m_MET_CorrFinalTrk_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
1082  (m_MET_CorrFinalClus_Ref[type]).at(0)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
1083  }
1084  if(name == "RefGamma"){
1085  (m_MET_CorrFinalTrk_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
1086  (m_MET_CorrFinalClus_Ref[type]).at(1)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
1087  }
1088  if(name == "RefTau"){
1089  (m_MET_CorrFinalTrk_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
1090  (m_MET_CorrFinalClus_Ref[type]).at(2)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
1091  }
1092  if(name == "Muons"){
1093  (m_MET_CorrFinalTrk_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
1094  (m_MET_CorrFinalClus_Ref[type]).at(3)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
1095  }
1096  if(name == "RefJet"){
1097  (m_MET_CorrFinalTrk_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
1098  (m_MET_CorrFinalClus_Ref[type]).at(4)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
1099  }
1100  if(name == "PVSoftTrk"){
1101  (m_MET_CorrFinalTrk_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalTrk"]->met()/1000., weight);
1102  }
1103  if(name == "SoftClus"){
1104  (m_MET_CorrFinalClus_Ref[type]).at(5)->Fill((*met_Ref)[name.c_str()]->met()/1000.,(*met_Ref)["FinalClus"]->met()/1000., weight);
1105  }
1106  }
1107  }
1108 
1109  //Rebuilt
1110 
1111  for(const auto& it : *met_Reb) {
1112  std::string name = it->name();
1113  if(name == "RefEle"){
1114  (m_MET_CorrFinalTrk_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
1115  (m_MET_CorrFinalClus_Reb[type]).at(0)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
1116  }
1117  if(name == "RefGamma"){
1118  (m_MET_CorrFinalTrk_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
1119  (m_MET_CorrFinalClus_Reb[type]).at(1)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
1120  }
1121  if(name == "RefTau"){
1122  (m_MET_CorrFinalTrk_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
1123  (m_MET_CorrFinalClus_Reb[type]).at(2)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
1124  }
1125  if(name == "Muons"){
1126  (m_MET_CorrFinalTrk_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
1127  (m_MET_CorrFinalClus_Reb[type]).at(3)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
1128  }
1129  if(name == "RefJet"){
1130  (m_MET_CorrFinalTrk_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
1131  (m_MET_CorrFinalClus_Reb[type]).at(4)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
1132  }
1133  if(name == "PVSoftTrk"){
1134  (m_MET_CorrFinalTrk_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalTrk"]->met()/1000., weight);
1135  }
1136  if(name == "SoftClus"){
1137  (m_MET_CorrFinalClus_Reb[type]).at(5)->Fill((*met_Reb)[name.c_str()]->met()/1000.,(*met_Reb)["FinalClus"]->met()/1000., weight);
1138  }
1139  }
1140 
1141  // Fill Resolution
1142  if(m_doTruth){
1143  ATH_MSG_INFO( " Resolution:" );
1144  if(m_doMETRefPlots){
1145  (m_MET_Resolution_Ref[type]).at(0)->Fill(((*met_Ref)["FinalClus"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., weight);
1146  (m_MET_Resolution_Ref[type]).at(1)->Fill(((*met_Ref)["FinalClus"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., weight);
1147  (m_MET_Resolution_Ref[type]).at(2)->Fill(((*met_Ref)["FinalTrk"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., weight);
1148  (m_MET_Resolution_Ref[type]).at(3)->Fill(((*met_Ref)["FinalTrk"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., weight);
1149  }
1150  (m_MET_Resolution_Reb[type]).at(0)->Fill(((*met_Reb)["FinalClus"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., weight);
1151  (m_MET_Resolution_Reb[type]).at(1)->Fill(((*met_Reb)["FinalClus"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., weight);
1152  (m_MET_Resolution_Reb[type]).at(2)->Fill(((*met_Reb)["FinalTrk"]->mpx()-(*met_Truth)["NonInt"]->mpx())/1000., weight);
1153  (m_MET_Resolution_Reb[type]).at(3)->Fill(((*met_Reb)["FinalTrk"]->mpy()-(*met_Truth)["NonInt"]->mpy())/1000., weight);
1154  }
1155 
1156  //Fill MET significance
1157  if( (*met_Reb)["FinalClus"]->sumet() != 0) (m_MET_Significance_Reb[type]).at(0)->Fill((*met_Reb)["FinalClus"]->met()/sqrt((*met_Reb)["FinalClus"]->sumet()*1000.), weight);
1158  if( (*met_Reb)["FinalTrk"]->sumet() != 0) (m_MET_Significance_Reb[type]).at(1)->Fill((*met_Reb)["FinalTrk"]->met()/sqrt((*met_Reb)["FinalTrk"]->sumet()*1000.), weight);
1159 
1160  TLorentzVector target_tlv;
1161  if(m_doMETRefPlots){
1162  //Fill MET Significance
1163  ATH_MSG_INFO( " MET_significance:" );
1164  if( (*met_Ref)["FinalClus"]->sumet() != 0) (m_MET_Significance_Ref[type]).at(0)->Fill((*met_Ref)["FinalClus"]->met()/sqrt((*met_Ref)["FinalClus"]->sumet()*1000.), weight);
1165  if( (*met_Ref)["FinalTrk"]->sumet() != 0) (m_MET_Significance_Ref[type]).at(1)->Fill((*met_Ref)["FinalTrk"]->met()/sqrt((*met_Ref)["FinalTrk"]->sumet()*1000.), weight);
1166 
1167  //Fill Diff histograms
1168  for(const auto& it : *met_Ref) {
1169  if(it->name() == "RefEle"){
1170  if(is_electron or (it->sumet() > 0)){
1171  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1172  (m_MET_Diff_Ref[type]).at(0)->Fill((target_tlv.Pt() - el_tlv.Pt())/1000., weight);
1173  (m_MET_Diff_Ref_x[type]).at(0)->Fill((target_tlv.Px() - el_tlv.Px())/1000., weight);
1174  (m_MET_Diff_Ref_y[type]).at(0)->Fill((target_tlv.Py() - el_tlv.Py())/1000., weight);
1175  (m_MET_Diff_Ref_phi[type]).at(0)->Fill(el_tlv.DeltaPhi(target_tlv), weight);
1176  (m_MET_Diff_Ref_sum[type]).at(0)->Fill((it->sumet() - sum_el)/1000., weight);
1177  }
1178  }
1179  if(it->name() == "RefGamma"){
1180  if(is_photon or (it->sumet() > 0)){
1181  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1182  (m_MET_Diff_Ref[type]).at(1)->Fill((target_tlv.Pt() - photon_tlv.Pt())/1000., weight);
1183  (m_MET_Diff_Ref_x[type]).at(1)->Fill((target_tlv.Px() - photon_tlv.Px())/1000., weight);
1184  (m_MET_Diff_Ref_y[type]).at(1)->Fill((target_tlv.Py() - photon_tlv.Py())/1000., weight);
1185  (m_MET_Diff_Ref_phi[type]).at(1)->Fill(photon_tlv.DeltaPhi(target_tlv), weight);
1186  (m_MET_Diff_Ref_sum[type]).at(1)->Fill((it->sumet() - sum_photon)/1000., weight);
1187  }
1188  }
1189  if(it->name() == "RefTau"){
1190  if(is_tau or (it->sumet() > 0)){
1191  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1192  (m_MET_Diff_Ref[type]).at(2)->Fill((target_tlv.Pt() - tau_tlv.Pt())/1000., weight);
1193  (m_MET_Diff_Ref_x[type]).at(2)->Fill((target_tlv.Px() - tau_tlv.Px())/1000., weight);
1194  (m_MET_Diff_Ref_y[type]).at(2)->Fill((target_tlv.Py() - tau_tlv.Py())/1000., weight);
1195  (m_MET_Diff_Ref_phi[type]).at(2)->Fill(tau_tlv.DeltaPhi(target_tlv), weight);
1196  (m_MET_Diff_Ref_sum[type]).at(2)->Fill((it->sumet() - sum_tau)/1000., weight);
1197  }
1198  }
1199  if(it->name() == "Muons"){
1200  if(is_muon or (it->sumet() > 0)){
1201  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1202  (m_MET_Diff_Ref[type]).at(3)->Fill((target_tlv.Pt() - mu_tlv.Pt())/1000., weight);
1203  (m_MET_Diff_Ref_x[type]).at(3)->Fill((target_tlv.Px() - mu_tlv.Px())/1000., weight);
1204  (m_MET_Diff_Ref_y[type]).at(3)->Fill((target_tlv.Py() - mu_tlv.Py())/1000., weight);
1205  (m_MET_Diff_Ref_phi[type]).at(3)->Fill(mu_tlv.DeltaPhi(target_tlv), weight);
1206  (m_MET_Diff_Ref_sum[type]).at(3)->Fill((it->sumet() - sum_mu)/1000., weight);
1207  }
1208  }
1209  if(it->name() == "RefJet"){
1210  if(is_jet or (it->sumet() > 0)){
1211  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1212  (m_MET_Diff_Ref[type]).at(4)->Fill((target_tlv.Pt() - jet_tlv.Pt())/1000., weight);
1213  (m_MET_Diff_Ref_x[type]).at(4)->Fill((target_tlv.Px() - jet_tlv.Px())/1000., weight);
1214  (m_MET_Diff_Ref_y[type]).at(4)->Fill((target_tlv.Py() - jet_tlv.Py())/1000., weight);
1215  (m_MET_Diff_Ref_phi[type]).at(4)->Fill(jet_tlv.DeltaPhi(target_tlv), weight);
1216  (m_MET_Diff_Ref_sum[type]).at(4)->Fill((it->sumet() - sum_jet)/1000., weight);
1217  }
1218  }
1219  }
1220  }
1221 
1222  // For rebuilt MET add only jets with pT>20e3 and JVT cut
1223  TLorentzVector jetReb_tlv;
1224  double sum_jetReb = 0;
1225  for(const auto jet : metJetsOR) {
1226  if(Accept(jet, JvtCut, jvtTool)) {
1227  jetReb_tlv += jet->p4();
1228  sum_jetReb += jet->pt();
1229  }
1230  }
1231 
1232  for(const auto& it : *met_Reb) {
1233  if(it->name() == "RefEle"){
1234  if(is_electron or (it->sumet() > 0)){
1235  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1236  (m_MET_Diff_Reb[type]).at(0)->Fill((target_tlv.Pt() - el_tlv.Pt())/1000., weight);
1237  (m_MET_Diff_Reb_x[type]).at(0)->Fill((target_tlv.Px() - el_tlv.Px())/1000., weight);
1238  (m_MET_Diff_Reb_y[type]).at(0)->Fill((target_tlv.Py() - el_tlv.Py())/1000., weight);
1239  (m_MET_Diff_Reb_phi[type]).at(0)->Fill(el_tlv.DeltaPhi(target_tlv), weight);
1240  (m_MET_Diff_Reb_sum[type]).at(0)->Fill((it->sumet() - sum_el)/1000., weight);
1241  }
1242  }
1243  if(it->name() == "RefGamma"){
1244  if(is_photon or (it->sumet() > 0)){
1245  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1246  (m_MET_Diff_Reb[type]).at(1)->Fill((target_tlv.Pt() - photon_tlv.Pt())/1000., weight);
1247  (m_MET_Diff_Reb_x[type]).at(1)->Fill((target_tlv.Px() - photon_tlv.Px())/1000., weight);
1248  (m_MET_Diff_Reb_y[type]).at(1)->Fill((target_tlv.Py() - photon_tlv.Py())/1000., weight);
1249  (m_MET_Diff_Reb_phi[type]).at(1)->Fill(photon_tlv.DeltaPhi(target_tlv), weight);
1250  (m_MET_Diff_Reb_sum[type]).at(1)->Fill((it->sumet() - sum_photon)/1000., weight);
1251  }
1252  }
1253  if(it->name() == "RefTau"){
1254  if(is_tau or (it->sumet() > 0)){
1255  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1256  (m_MET_Diff_Reb[type]).at(2)->Fill((target_tlv.Pt() - tau_tlv.Pt())/1000., weight);
1257  (m_MET_Diff_Reb_x[type]).at(2)->Fill((target_tlv.Px() - tau_tlv.Px())/1000., weight);
1258  (m_MET_Diff_Reb_y[type]).at(2)->Fill((target_tlv.Py() - tau_tlv.Py())/1000., weight);
1259  (m_MET_Diff_Reb_phi[type]).at(2)->Fill(tau_tlv.DeltaPhi(target_tlv), weight);
1260  (m_MET_Diff_Reb_sum[type]).at(2)->Fill((it->sumet() - sum_tau)/1000., weight);
1261  }
1262  }
1263  if(it->name() == "Muons"){
1264  if(is_muon or (it->sumet() > 0)){
1265  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1266  (m_MET_Diff_Reb[type]).at(3)->Fill((target_tlv.Pt() - mu_tlv.Pt())/1000., weight);
1267  (m_MET_Diff_Reb_x[type]).at(3)->Fill((target_tlv.Px() - mu_tlv.Px())/1000., weight);
1268  (m_MET_Diff_Reb_y[type]).at(3)->Fill((target_tlv.Py() - mu_tlv.Py())/1000., weight);
1269  (m_MET_Diff_Reb_phi[type]).at(3)->Fill(mu_tlv.DeltaPhi(target_tlv), weight);
1270  (m_MET_Diff_Reb_sum[type]).at(3)->Fill((it->sumet() - sum_mu)/1000., weight);
1271  }
1272  }
1273  if(it->name() == "RefJet"){
1274  if(is_jet or (it->sumet() > 0)){
1275  target_tlv.SetPxPyPzE(-it->mpx(), -it->mpy(), 0, it->met());
1276  (m_MET_Diff_Reb[type]).at(4)->Fill((target_tlv.Pt() - jetReb_tlv.Pt())/1000., weight);
1277  (m_MET_Diff_Reb_x[type]).at(4)->Fill((target_tlv.Px() - jetReb_tlv.Px())/1000., weight);
1278  (m_MET_Diff_Reb_y[type]).at(4)->Fill((target_tlv.Py() - jetReb_tlv.Py())/1000., weight);
1279  (m_MET_Diff_Reb_phi[type]).at(4)->Fill(jetReb_tlv.DeltaPhi(target_tlv), weight);
1280  (m_MET_Diff_Reb_sum[type]).at(4)->Fill((it->sumet() - sum_jetReb)/1000., weight);
1281  }
1282  }
1283  }
1284 
1285  if(type == "AntiKt4EMTopo") {
1286  //Calo MET
1287  //const xAOD::JetContainer* emptyjets = 0;
1289  MissingETContainer* met_Calo = new MissingETContainer();
1290  if( evtStore()->record(met_Calo,("MET_Calo"+type).c_str()).isFailure() ) {
1291  ATH_MSG_WARNING("Unable to record MissingETContainer: MET_Calo_" << type);
1292  return StatusCode::FAILURE;
1293  }
1294  MissingETAuxContainer* met_CaloAux = new MissingETAuxContainer();
1295  if( evtStore()->record(met_CaloAux,("MET_Calo"+type+"Aux").c_str()).isFailure() ) {
1296  ATH_MSG_WARNING("Unable to record MissingETAuxContainer: MET_Calo" << type);
1297  return StatusCode::FAILURE;
1298  }
1299  met_Calo->setStore(met_CaloAux);
1300  MissingETAssociationHelper metHelper(metMap);
1301  if( (*m_metmaker)->rebuildJetMET("RefJet", "SoftClus", "PVSoftTrk", met_Calo, metJetsEmpty.asDataVector(), coreMet, metHelper, true).isFailure() ) {
1302  ATH_MSG_WARNING("Failed to build jet and soft terms.");
1303  }
1304 
1305  if((*met_Calo)["SoftClus"]) clsource = (*met_Calo)["SoftClus"]->source();
1306  if( met::buildMETSum("FinalClus", met_Calo, clsource).isFailure() ) {
1307  ATH_MSG_WARNING("Building MET FinalClus sum failed.");
1308  }
1309 
1310  m_MET_Calo->Fill((*met_Calo)["FinalClus"]->met()/1000., weight);
1311  m_MET_Calo_x->Fill((*met_Calo)["FinalClus"]->mpx()/1000., weight);
1312  m_MET_Calo_y->Fill((*met_Calo)["FinalClus"]->mpy()/1000., weight);
1313  m_MET_Calo_phi->Fill((*met_Calo)["FinalClus"]->phi(), weight);
1314  m_MET_Calo_sum->Fill((*met_Calo)["FinalClus"]->sumet()/1000., weight);
1315 
1316  }
1317 
1318  }
1319 
1320  //Currently we don't store MET_Track in the derivations
1321  //if MET_Ref not present, then we also dont have MET_Track
1322  if(m_doMETRefPlots){
1323 
1324  //Retrieve MET Track
1325  const xAOD::MissingETContainer* met_Track = nullptr;
1326  ATH_CHECK( evtStore()->retrieve(met_Track,"MET_Track") );
1327  if (!met_Track) {
1328  ATH_MSG_ERROR ( "Failed to retrieve MET_Track. Exiting." );
1329  return StatusCode::FAILURE;
1330  }
1331 
1332  // Fill MET Track
1333  ATH_MSG_INFO( " MET_Track:" );
1334 
1335  m_MET_Track->Fill((*met_Track)["Track"]->met()/1000., weight);
1336  m_MET_Track_x->Fill((*met_Track)["Track"]->mpx()/1000., weight);
1337  m_MET_Track_y->Fill((*met_Track)["Track"]->mpy()/1000., weight);
1338  m_MET_Track_phi->Fill((*met_Track)["Track"]->phi(), weight);
1339  m_MET_Track_sum->Fill((*met_Track)["Track"]->sumet()/1000., weight);
1340 
1341  const xAOD::VertexContainer *vxCont = nullptr;
1342  ATH_CHECK( evtStore()->retrieve(vxCont, "PrimaryVertices") );
1343  for(const auto& vx : *vxCont) {
1344  int N = vx->index();
1345  const std::string name = "PVTrack_vx"+std::to_string(N);
1346  if(vx->vertexType()!=xAOD::VxType::NoVtx) {
1347  if(vx->vertexType()==xAOD::VxType::PriVtx) {
1348  m_MET_PVTrack_Nominal->Fill((*met_Track)[name]->met()/1000., weight);
1349  m_MET_PVTrack_Nominal_x->Fill((*met_Track)[name]->mpx()/1000., weight);
1350  m_MET_PVTrack_Nominal_y->Fill((*met_Track)[name]->mpy()/1000., weight);
1351  m_MET_PVTrack_Nominal_phi->Fill((*met_Track)[name]->phi(), weight);
1352  m_MET_PVTrack_Nominal_sum->Fill((*met_Track)[name]->sumet()/1000., weight);
1353  } else {
1354  m_MET_PVTrack_Pileup->Fill((*met_Track)[name]->met()/1000., weight);
1355  m_MET_PVTrack_Pileup_x->Fill((*met_Track)[name]->mpx()/1000., weight);
1356  m_MET_PVTrack_Pileup_y->Fill((*met_Track)[name]->mpy()/1000., weight);
1357  m_MET_PVTrack_Pileup_phi->Fill((*met_Track)[name]->phi(), weight);
1358  m_MET_PVTrack_Pileup_sum->Fill((*met_Track)[name]->sumet()/1000., weight);
1359  }
1360  }
1361  }
1362  }
1363 
1364  return StatusCode::SUCCESS;
1365  //return StatusCode::FAILURE;
1366  }
1367 
1369  {
1370  ATH_MSG_INFO ("Finalising hists " << name() << "...");
1371 
1372  for (const auto& type : m_types){
1373  for(std::vector<TH1D*>::size_type i = 0; i < (m_MET_Reb[type]).size(); ++i) {
1374  if (m_doMETRefPlots){
1375  (m_MET_Ref[type]).at(i)->Sumw2();
1376  (m_MET_Ref_x[type]).at(i)->Sumw2();
1377  (m_MET_Ref_y[type]).at(i)->Sumw2();
1378  (m_MET_Ref_phi[type]).at(i)->Sumw2();
1379  (m_MET_Ref_sum[type]).at(i)->Sumw2();
1380  }
1381  (m_MET_Reb[type]).at(i)->Sumw2();
1382  (m_MET_Reb_x[type]).at(i)->Sumw2();
1383  (m_MET_Reb_y[type]).at(i)->Sumw2();
1384  (m_MET_Reb_phi[type]).at(i)->Sumw2();
1385  (m_MET_Reb_sum[type]).at(i)->Sumw2();
1386  }
1387 
1388  for(std::vector<TH1D*>::size_type i = 0; i < (m_MET_Diff_Reb[type]).size(); ++i) {
1389  if (m_doMETRefPlots){
1390  (m_MET_Diff_Ref[type]).at(i)->Sumw2();
1391  (m_MET_Diff_Ref_x[type]).at(i)->Sumw2();
1392  (m_MET_Diff_Ref_y[type]).at(i)->Sumw2();
1393  (m_MET_Diff_Ref_phi[type]).at(i)->Sumw2();
1394  (m_MET_Diff_Ref_sum[type]).at(i)->Sumw2();
1395  }
1396  (m_MET_Diff_Reb[type]).at(i)->Sumw2();
1397  (m_MET_Diff_Reb_x[type]).at(i)->Sumw2();
1398  (m_MET_Diff_Reb_y[type]).at(i)->Sumw2();
1399  (m_MET_Diff_Reb_phi[type]).at(i)->Sumw2();
1400  (m_MET_Diff_Reb_sum[type]).at(i)->Sumw2();
1401  }
1402 
1403  for(std::vector<TH2D*>::size_type i = 0; i < (m_MET_CorrFinalTrk_Reb[type]).size(); ++i) {
1404  if (m_doMETRefPlots){
1405  (m_MET_CorrFinalTrk_Ref[type]).at(i)->Sumw2();
1406  }
1407  (m_MET_CorrFinalTrk_Reb[type]).at(i)->Sumw2();
1408  }
1409 
1410  for(std::vector<TH2D*>::size_type i = 0; i < (m_MET_CorrFinalClus_Reb[type]).size(); ++i) {
1411  if (m_doMETRefPlots){
1412  (m_MET_CorrFinalClus_Ref[type]).at(i)->Sumw2();
1413  }
1414  (m_MET_CorrFinalClus_Reb[type]).at(i)->Sumw2();
1415  }
1416 
1417  for(std::vector<TH1D*>::size_type i = 0; i < (m_MET_Significance_Reb[type]).size(); ++i) {
1418  if (m_doMETRefPlots){
1419  (m_MET_Significance_Ref[type]).at(i)->Sumw2();
1420  }
1421  (m_MET_Significance_Reb[type]).at(i)->Sumw2();
1422  }
1423 
1424  for(std::vector<TH1D*>::size_type i = 0; i < (m_MET_Resolution_Reb[type]).size(); ++i) {
1425  if (m_doMETRefPlots){
1426  (m_MET_Resolution_Ref[type]).at(i)->Sumw2();
1427  }
1428  (m_MET_Resolution_Reb[type]).at(i)->Sumw2();
1429  }
1430 
1431  for(std::vector<TH1D*>::size_type i = 0; i < (m_MET_dPhi_Ref[type]).size(); ++i) {
1432  if (m_doMETRefPlots){
1433  (m_MET_dPhi_Ref[type]).at(i)->Sumw2();
1434  }
1435  (m_MET_dPhi_Reb[type]).at(i)->Sumw2();
1436  }
1437 
1438  int nBins = (m_MET_Reb[type]).at(7)->GetNbinsX();
1439  for(int i=1;i<=nBins;i++){
1440  double err;
1441  if (m_doMETRefPlots){
1442  (m_MET_Cumu_Ref[type]).at(0)->SetBinContent(i, (m_MET_Ref[type]).at(8)->IntegralAndError(i,nBins+1,err));
1443  (m_MET_Cumu_Ref[type]).at(0)->SetBinError(i, err);
1444  (m_MET_Cumu_Ref[type]).at(1)->SetBinContent(i, (m_MET_Ref[type]).at(7)->IntegralAndError(i,nBins+1,err));
1445  (m_MET_Cumu_Ref[type]).at(1)->SetBinError(i, err);
1446  }
1447  (m_MET_Cumu_Reb[type]).at(0)->SetBinContent(i, (m_MET_Reb[type]).at(8)->IntegralAndError(i,nBins+1,err));
1448  (m_MET_Cumu_Reb[type]).at(0)->SetBinError(i, err);
1449  (m_MET_Cumu_Reb[type]).at(1)->SetBinContent(i, (m_MET_Reb[type]).at(7)->IntegralAndError(i,nBins+1,err));
1450  (m_MET_Cumu_Reb[type]).at(1)->SetBinError(i, err);
1451  }
1452  for(std::vector<TH1D*>::size_type i = 0; i < (m_MET_Cumu_Ref[type]).size(); ++i) {
1453  if (m_doMETRefPlots){
1454  m_MET_Cumu_Ref[type].at(i)->Scale(1./(m_MET_Cumu_Ref[type]).at(i)->GetBinContent(1));
1455  }
1456  m_MET_Cumu_Reb[type].at(i)->Scale(1./(m_MET_Cumu_Reb[type]).at(i)->GetBinContent(1));
1457  }
1458 
1459  }
1460 
1461  if (m_doMETRefPlots){
1462  m_MET_Track->Sumw2();
1463  m_MET_Track_x->Sumw2();
1464  m_MET_Track_y->Sumw2();
1465  m_MET_Track_phi->Sumw2();
1466  m_MET_Track_sum->Sumw2();
1467  m_MET_PVTrack_Nominal->Sumw2();
1468  m_MET_PVTrack_Nominal_x->Sumw2();
1469  m_MET_PVTrack_Nominal_y->Sumw2();
1470  m_MET_PVTrack_Nominal_phi->Sumw2();
1471  m_MET_PVTrack_Nominal_sum->Sumw2();
1472  m_MET_PVTrack_Pileup->Sumw2();
1473  m_MET_PVTrack_Pileup_x->Sumw2();
1474  m_MET_PVTrack_Pileup_y->Sumw2();
1475  m_MET_PVTrack_Pileup_phi->Sumw2();
1476  m_MET_PVTrack_Pileup_sum->Sumw2();
1477  }
1478 
1479  m_MET_Calo->Sumw2();
1480  m_MET_Calo_x->Sumw2();
1481  m_MET_Calo_y->Sumw2();
1482  m_MET_Calo_phi->Sumw2();
1483  m_MET_Calo_sum->Sumw2();
1484 
1485  return StatusCode::SUCCESS;
1486  }
1487 
1489  // Const methods:
1491 
1493  // Non-const methods:
1496  {
1497  if( mu->pt()<2.5e3 || mu->pt()/cosh(mu->eta())<4e3 ) return false;
1498  return static_cast<bool> (m_muonSelTool->accept(*mu));
1499  }
1500 
1502  {
1503  if( fabs(el->eta())>2.47 || el->pt()<10e3 ) return false;
1504  return static_cast<bool> (m_elecSelLHTool->accept(el));
1505  }
1506 
1508  {
1509  if( !(ph->author()&20) || fabs(ph->eta())>2.47 || ph->pt()<10e3 ) return false;
1510  return static_cast<bool>(m_photonSelIsEMTool->accept(ph));
1511  }
1512 
1514  { return static_cast<bool> (m_tauSelTool->accept( *tau )); }
1515 
1516  bool PhysValMET::Accept(const xAOD::Jet* jet, double JvtCut, ToolHandle<IJetUpdateJvt>* jvtTool)
1517  {
1518  if( jet->pt()<20e3 || jvtTool == nullptr) return false;
1519  return (fabs(jet->eta()) > 2.4 || jet->pt() > 60e3 || (*jvtTool)->updateJvt(*jet) > JvtCut);
1520  }
1521 
1523  // Protected methods:
1525 
1527  // Const methods:
1529 
1531  // Non-const methods:
1533 
1534 
1535 }
1536 
1537 // LocalWords: str
MissingEtDQA::PhysValMET::m_MET_Reb_phi
std::map< std::string, std::vector< TH1D * > > m_MET_Reb_phi
Definition: PhysValMET.h:140
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MissingEtDQA::PhysValMET::m_MET_PVTrack_Nominal_phi
TH1D * m_MET_PVTrack_Nominal_phi
Definition: PhysValMET.h:116
MissingEtDQA::PhysValMET::initialize
virtual StatusCode initialize()
Definition: PhysValMET.cxx:114
MissingEtDQA::PhysValMET::m_MET_Diff_Reb
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Reb
Definition: PhysValMET.h:142
MissingETContainer
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingETContainer.h:22
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
MissingEtDQA::PhysValMET::~PhysValMET
virtual ~PhysValMET()
Destructor:
Definition: PhysValMET.cxx:73
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
MissingEtDQA::PhysValMET::m_MET_Track_y
TH1D * m_MET_Track_y
Definition: PhysValMET.h:115
xAOD::MissingETAuxContainer
MissingETAuxContainer_v1 MissingETAuxContainer
Definition: MissingETAuxContainer.h:16
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
AthCheckMacros.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MissingEtDQA::PhysValMET::m_muonColl
std::string m_muonColl
Definition: PhysValMET.h:94
ManagedMonitorToolBase
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
Definition: ManagedMonitorToolBase.h:74
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
ConstDataVector::end
iterator end() noexcept
Return an iterator pointing past the end of the collection.
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MissingEtDQA::PhysValMET::m_MET_Calo_sum
TH1D * m_MET_Calo_sum
Definition: PhysValMET.h:118
MissingEtDQA::PhysValMET::m_MET_Track
TH1D * m_MET_Track
Definition: PhysValMET.h:115
MissingEtDQA::PhysValMET::m_eleColl
std::string m_eleColl
Definition: PhysValMET.h:91
MissingEtDQA::PhysValMET::m_tauColl
std::string m_tauColl
Definition: PhysValMET.h:93
MissingEtDQA::PhysValMET::bookHistograms
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
Definition: PhysValMET.cxx:194
MissingEtDQA::PhysValMET::m_elecSelLHTool
ToolHandle< IAsgElectronLikelihoodTool > m_elecSelLHTool
Definition: PhysValMET.h:157
MissingEtDQA::PhysValMET::m_corename
std::string m_corename
Definition: PhysValMET.h:96
MissingEtDQA::PhysValMET::fillHistograms
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
Definition: PhysValMET.cxx:565
xAOD::Egamma_v1::author
uint16_t author(uint16_t bitmask=EgammaParameters::AuthorALL) const
Get author.
Definition: Egamma_v1.cxx:166
skel.it
it
Definition: skel.GENtoEVGEN.py:423
M_PI
#define M_PI
Definition: ActiveFraction.h:11
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
MissingEtDQA
Definition: PhysValMET.cxx:45
xAOD::MissingETContainer
MissingETContainer_v1 MissingETContainer
Definition: Event/xAOD/xAODMissingET/xAODMissingET/MissingETContainer.h:16
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
MissingEtDQA::PhysValMET::m_MET_Diff_Reb_y
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Reb_y
Definition: PhysValMET.h:144
MissingETBase::Source::Signal::EMTopo
@ EMTopo
Indicator for MET contribution from TopoClusters with EM (basic signal) calibration applied.
MissingEtDQA::PhysValMET::m_metmakerTopo
ToolHandle< IMETMaker > m_metmakerTopo
Definition: PhysValMET.h:161
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:570
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
MissingEtDQA::PhysValMET::m_MET_CorrFinalClus_Reb
std::map< std::string, std::vector< TH2D * > > m_MET_CorrFinalClus_Reb
Definition: PhysValMET.h:152
MissingEtDQA::PhysValMET::m_names
std::map< std::string, std::string > m_names
Definition: PhysValMET.h:112
MissingEtDQA::PhysValMET::m_terms
std::vector< std::string > m_terms
Definition: PhysValMET.h:109
xAOD::MissingETAssociationMap_v1
Definition: MissingETAssociationMap_v1.h:29
ConstDataVector::asDataVector
const DV * asDataVector() const
Return a pointer to this object, as a const DataVector.
MissingEtDQA::PhysValMET::m_MET_dPhi_Ref
std::map< std::string, std::vector< TH1D * > > m_MET_dPhi_Ref
Definition: PhysValMET.h:134
MissingEtDQA::PhysValMET::m_MET_PVTrack_Pileup_y
TH1D * m_MET_PVTrack_Pileup_y
Definition: PhysValMET.h:117
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
MissingEtDQA::PhysValMET::m_MET_PVTrack_Pileup
TH1D * m_MET_PVTrack_Pileup
Definition: PhysValMET.h:117
met::buildMETSum
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
Definition: METHelpers.cxx:64
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
MissingEtDQA::PhysValMET::m_MET_PVTrack_Pileup_x
TH1D * m_MET_PVTrack_Pileup_x
Definition: PhysValMET.h:117
MissingEtDQA::PhysValMET::m_doTruth
bool m_doTruth
Definition: PhysValMET.h:83
METHelpers.h
MissingEtDQA::PhysValMET::m_MET_Ref_phi
std::map< std::string, std::vector< TH1D * > > m_MET_Ref_phi
Definition: PhysValMET.h:124
met
Definition: IMETSignificance.h:24
MissingEtDQA::PhysValMET::m_MET_Track_sum
TH1D * m_MET_Track_sum
Definition: PhysValMET.h:115
MissingEtDQA::PhysValMET::m_MET_Diff_Reb_x
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Reb_x
Definition: PhysValMET.h:143
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
MissingETBase::Source::Signal::UnknownSignal
@ UnknownSignal
Unknown signal contribution.
ManagedMonitorToolBase::initialize
virtual StatusCode initialize()
Definition: ManagedMonitorToolBase.cxx:669
MissingEtDQA::PhysValMET::m_gammaColl
std::string m_gammaColl
Definition: PhysValMET.h:92
ElectronContainer.h
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
MissingEtDQA::PhysValMET::m_MET_PVTrack_Nominal
TH1D * m_MET_PVTrack_Nominal
Definition: PhysValMET.h:116
MissingEtDQA::PhysValMET::m_MET_Reb_y
std::map< std::string, std::vector< TH1D * > > m_MET_Reb_y
Definition: PhysValMET.h:139
lumiFormat.i
int i
Definition: lumiFormat.py:92
MissingEtDQA::PhysValMET::m_metmakerPFlow
ToolHandle< IMETMaker > m_metmakerPFlow
Definition: PhysValMET.h:162
MissingEtDQA::PhysValMET::m_jvtToolPFlow
ToolHandle< IJetUpdateJvt > m_jvtToolPFlow
Definition: PhysValMET.h:160
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MissingETAuxContainer.h
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
MissingEtDQA::PhysValMET::m_MET_Significance_Ref
std::map< std::string, std::vector< TH1D * > > m_MET_Significance_Ref
Definition: PhysValMET.h:133
MissingEtDQA::PhysValMET::m_MET_Calo_x
TH1D * m_MET_Calo_x
Definition: PhysValMET.h:118
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
MissingEtDQA::PhysValMET::m_MET_Resolution_Reb
std::map< std::string, std::vector< TH1D * > > m_MET_Resolution_Reb
Definition: PhysValMET.h:148
test_pyathena.parent
parent
Definition: test_pyathena.py:15
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
MissingEtDQA::PhysValMET::m_MET_Resolution_Ref
std::map< std::string, std::vector< TH1D * > > m_MET_Resolution_Ref
Definition: PhysValMET.h:132
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::MissingETAuxContainer_v1
Auxiliary data store for xAOD::MissingETContainer.
Definition: MissingETAuxContainer_v1.h:20
MissingEtDQA::PhysValMET::m_muonSelTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelTool
Definition: PhysValMET.h:156
MissingEtDQA::PhysValMET::m_mapname
std::string m_mapname
Definition: PhysValMET.h:95
MissingEtDQA::PhysValMET::m_MET_dPhi_Reb
std::map< std::string, std::vector< TH1D * > > m_MET_dPhi_Reb
Definition: PhysValMET.h:150
MissingEtDQA::PhysValMET::m_MET_PVTrack_Pileup_sum
TH1D * m_MET_PVTrack_Pileup_sum
Definition: PhysValMET.h:117
TauJetContainer.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Vertex.h
AcceptData.h
MissingETBase.h
beamspotman.dir
string dir
Definition: beamspotman.py:623
MissingEtDQA::PhysValMET::m_MET_Ref
std::map< std::string, std::vector< TH1D * > > m_MET_Ref
Definition: PhysValMET.h:121
MissingEtDQA::PhysValMET::m_MET_PVTrack_Nominal_x
TH1D * m_MET_PVTrack_Nominal_x
Definition: PhysValMET.h:116
MissingEtDQA::PhysValMET::m_MET_Significance_Reb
std::map< std::string, std::vector< TH1D * > > m_MET_Significance_Reb
Definition: PhysValMET.h:149
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
MissingET.h
MissingEtDQA::PhysValMET::m_MET_Reb_x
std::map< std::string, std::vector< TH1D * > > m_MET_Reb_x
Definition: PhysValMET.h:138
MissingEtDQA::PhysValMET::m_MET_Diff_Reb_sum
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Reb_sum
Definition: PhysValMET.h:146
remainder
std::vector< std::string > remainder(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
list of entries in a vector that are not in another
Definition: compareFlatTrees.cxx:44
MissingEtDQA::PhysValMET::m_MET_Track_phi
TH1D * m_MET_Track_phi
Definition: PhysValMET.h:115
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
MissingEtDQA::PhysValMET::m_MET_Diff_Reb_phi
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Reb_phi
Definition: PhysValMET.h:145
MissingEtDQA::PhysValMET::m_dir_met
std::vector< std::string > m_dir_met
Definition: PhysValMET.h:154
MissingEtDQA::PhysValMET::m_MET_Cumu_Reb
std::map< std::string, std::vector< TH1D * > > m_MET_Cumu_Reb
Definition: PhysValMET.h:147
ConstDataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
MissingEtDQA::PhysValMET::m_MET_Cumu_Ref
std::map< std::string, std::vector< TH1D * > > m_MET_Cumu_Ref
Definition: PhysValMET.h:131
MissingEtDQA::PhysValMET::m_jvtToolEM
ToolHandle< IJetUpdateJvt > m_jvtToolEM
Definition: PhysValMET.h:159
MissingEtDQA::PhysValMET::m_metmaker
ToolHandle< IMETMaker > * m_metmaker
Definition: PhysValMET.h:164
MissingEtDQA::PhysValMET::m_MET_Calo
TH1D * m_MET_Calo
Definition: PhysValMET.h:118
xAOD::MissingETAssociationHelper
Definition: MissingETAssociationHelper.h:26
MissingEtDQA::PhysValMET::m_photonSelIsEMTool
ToolHandle< IAsgPhotonIsEMSelector > m_photonSelIsEMTool
Definition: PhysValMET.h:158
xAOD::Electron_v1
Definition: Electron_v1.h:34
MissingEtDQA::PhysValMET::m_MET_Ref_sum
std::map< std::string, std::vector< TH1D * > > m_MET_Ref_sum
Definition: PhysValMET.h:125
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
MuonContainer.h
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
Muon
struct TBPatternUnitContext Muon
TrackParticle.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
MissingEtDQA::PhysValMET::m_MET_Reb
std::map< std::string, std::vector< TH1D * > > m_MET_Reb
Definition: PhysValMET.h:137
MissingETBase::Source::Signal::Track
@ Track
Indicator for MET contribution from reconstructed charged particle tracks.
VertexContainer.h
PhysValMET.h
JetContainer.h
xAOD::Photon_v1
Definition: Photon_v1.h:37
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
MissingEtDQA::PhysValMET::m_MET_Diff_Ref
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Ref
Definition: PhysValMET.h:126
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MissingEtDQA::PhysValMET::m_MET_Ref_x
std::map< std::string, std::vector< TH1D * > > m_MET_Ref_x
Definition: PhysValMET.h:122
MissingEtDQA::PhysValMET::m_MET_Diff_Ref_phi
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Ref_phi
Definition: PhysValMET.h:129
MissingEtDQA::PhysValMET::m_MET_Track_x
TH1D * m_MET_Track_x
Definition: PhysValMET.h:115
ManagedMonitorToolBase::all
@ all
Definition: ManagedMonitorToolBase.h:116
MissingEtDQA::PhysValMET::m_tauSelTool
ToolHandle< TauAnalysisTools::ITauSelectionTool > m_tauSelTool
Definition: PhysValMET.h:163
MissingEtDQA::PhysValMET::m_types
std::vector< std::string > m_types
Definition: PhysValMET.h:106
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: Egamma_v1.cxx:65
xAODType::Tau
@ Tau
The object is a tau (jet)
Definition: ObjectType.h:49
MissingEtDQA::PhysValMET::m_MET_CorrFinalTrk_Reb
std::map< std::string, std::vector< TH2D * > > m_MET_CorrFinalTrk_Reb
Definition: PhysValMET.h:151
xAOD::Egamma_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: Egamma_v1.cxx:70
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
MissingEtDQA::PhysValMET::m_MET_CorrFinalTrk_Ref
std::map< std::string, std::vector< TH2D * > > m_MET_CorrFinalTrk_Ref
Definition: PhysValMET.h:135
MissingETAssociationMap.h
ManagedMonitorToolBase::m_detailLevel
unsigned int m_detailLevel
Definition: ManagedMonitorToolBase.h:899
MissingEtDQA::PhysValMET::m_MET_CorrFinalClus_Ref
std::map< std::string, std::vector< TH2D * > > m_MET_CorrFinalClus_Ref
Definition: PhysValMET.h:136
MissingEtDQA::PhysValMET::m_MET_Calo_phi
TH1D * m_MET_Calo_phi
Definition: PhysValMET.h:118
MissingEtDQA::PhysValMET::m_doMETRefPlots
bool m_doMETRefPlots
Definition: PhysValMET.h:85
Accept
Templated class containing a cut, name of cut and description of cut(optional) Typically,...
Definition: CutFlow.h:28
MissingEtDQA::PhysValMET::m_MET_PVTrack_Nominal_y
TH1D * m_MET_PVTrack_Nominal_y
Definition: PhysValMET.h:116
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
passOR
@ passOR
Definition: SUSYToolsTester.cxx:100
MissingEtDQA::PhysValMET::m_MET_PVTrack_Nominal_sum
TH1D * m_MET_PVTrack_Nominal_sum
Definition: PhysValMET.h:116
MissingEtDQA::PhysValMET::m_MET_Diff_Ref_sum
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Ref_sum
Definition: PhysValMET.h:130
MissingEtDQA::PhysValMET::m_MET_Reb_sum
std::map< std::string, std::vector< TH1D * > > m_MET_Reb_sum
Definition: PhysValMET.h:141
MissingEtDQA::PhysValMET::m_MET_Calo_y
TH1D * m_MET_Calo_y
Definition: PhysValMET.h:118
MissingETAssociationHelper.h
PhotonContainer.h
ConstDataVector::begin
iterator begin() noexcept
Return an iterator pointing at the beginning of the collection.
MissingETComposition.h
MissingETContainer.h
MissingEtDQA::PhysValMET::Accept
bool Accept(const xAOD::Electron *el)
Definition: PhysValMET.cxx:1501
xAOD::EventInfo_v1::beamSpotWeight
float beamSpotWeight() const
Weight for beam spot size reweighting.
Definition: EventInfo_v1.cxx:970
ManagedMonitorToolBase::regHist
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition: ManagedMonitorToolBase.cxx:1454
MissingEtDQA::PhysValMET::procHistograms
virtual StatusCode procHistograms()
An inheriting class should either override this function or finalHists().
Definition: PhysValMET.cxx:1368
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
MissingEtDQA::PhysValMET::m_MET_Diff_Ref_x
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Ref_x
Definition: PhysValMET.h:127
MissingEtDQA::PhysValMET::m_MET_Diff_Ref_y
std::map< std::string, std::vector< TH1D * > > m_MET_Diff_Ref_y
Definition: PhysValMET.h:128
MissingEtDQA::PhysValMET::m_inputIsDAOD
bool m_inputIsDAOD
Definition: PhysValMET.h:84
MissingEtDQA::PhysValMET::m_MET_PVTrack_Pileup_phi
TH1D * m_MET_PVTrack_Pileup_phi
Definition: PhysValMET.h:117
MissingEtDQA::PhysValMET::m_MET_Ref_y
std::map< std::string, std::vector< TH1D * > > m_MET_Ref_y
Definition: PhysValMET.h:123