21 #include "GaudiKernel/IToolSvc.h"
55 PhysValMET::PhysValMET(
const std::string&
type,
56 const std::string&
name,
57 const IInterface*
parent) :
121 m_names[
"RefEle"] =
"Electron term";
122 m_names[
"RefGamma"] =
"Photon term";
123 m_names[
"RefTau"] =
"Tau term";
124 m_names[
"Muons"] =
"Muon term";
125 m_names[
"RefJet"] =
"Jet term";
126 m_names[
"SoftClus"] =
"Cluster-based soft term";
127 m_names[
"PVSoftTrk"] =
"Track-based soft term (PV-matched)";
128 m_names[
"FinalTrk"] =
"Total MET with TST";
129 m_names[
"FinalClus"] =
"Total MET with CST";
130 m_names[
"Track"] =
"Track MET, loose selection";
131 m_names[
"PVTrack_Nominal"] =
"Track MET for highest sum p_{T}^{2} PV";
132 m_names[
"PVTrack_Pileup"] =
"Track MET for each pileup vertex";
135 m_types.emplace_back(
"AntiKt4EMTopo");
136 m_types.emplace_back(
"AntiKt4EMPFlow");
139 m_terms.emplace_back(
"RefEle");
140 m_terms.emplace_back(
"RefGamma");
141 m_terms.emplace_back(
"RefTau");
143 m_terms.emplace_back(
"RefJet");
144 m_terms.emplace_back(
"SoftClus");
145 m_terms.emplace_back(
"PVSoftTrk");
146 m_terms.emplace_back(
"FinalTrk");
147 m_terms.emplace_back(
"FinalClus");
192 return StatusCode::SUCCESS;
205 double suptmi = 500.;
206 double suptmixy = 250.;
207 double binphi = 3.15;
214 std::string name_met;
215 std::string name_sub;
216 std::vector<std::string> corrClus_names;
217 std::vector<std::string> corrTrk_names;
218 std::vector<std::string> sum_names;
221 corrClus_names.emplace_back(
"RefEle");
222 corrClus_names.emplace_back(
"RefGamma");
223 corrClus_names.emplace_back(
"RefTau");
224 corrClus_names.emplace_back(
"Muons");
225 corrClus_names.emplace_back(
"RefJet");
226 corrClus_names.emplace_back(
"SoftClus");
228 corrTrk_names.emplace_back(
"RefEle");
229 corrTrk_names.emplace_back(
"RefGamma");
230 corrTrk_names.emplace_back(
"RefTau");
231 corrTrk_names.emplace_back(
"Muons");
232 corrTrk_names.emplace_back(
"RefJet");
233 corrTrk_names.emplace_back(
"PVSoftTrk");
235 sum_names.emplace_back(
"RefEle");
236 sum_names.emplace_back(
"RefGamma");
237 sum_names.emplace_back(
"RefTau");
238 sum_names.emplace_back(
"Muons");
239 sum_names.emplace_back(
"RefJet");
244 name_met =
"MET_Reference_" +
type;
246 std::vector<TH1D*> v_MET_Ref;
247 std::vector<TH1D*> v_MET_Ref_x;
248 std::vector<TH1D*> v_MET_Ref_y;
249 std::vector<TH1D*> v_MET_Ref_phi;
250 std::vector<TH1D*> v_MET_Ref_sum;
251 std::vector<TH1D*> v_MET_Cumu_Ref;
252 std::vector<TH1D*> v_MET_Resolution_Ref;
253 std::vector<TH1D*> v_MET_Significance_Ref;
254 std::vector<TH1D*> v_MET_dPhi_Ref;
255 std::vector<TH2D*> v_MET_CorrFinalTrk_Ref;
256 std::vector<TH2D*> v_MET_CorrFinalClus_Ref;
257 std::vector<TH1D*> v_MET_Diff_Ref;
258 std::vector<TH1D*> v_MET_Diff_Ref_x;
259 std::vector<TH1D*> v_MET_Diff_Ref_y;
260 std::vector<TH1D*> v_MET_Diff_Ref_phi;
261 std::vector<TH1D*> v_MET_Diff_Ref_sum;
263 for(
const auto& term :
m_terms) {
264 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) );
265 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) );
266 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) );
267 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) );
268 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) );
269 m_dir_met.push_back(
"MET/" + name_met +
"/Terms/" + term +
"/");
278 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Ref.size(); ++
i) {
286 name_sub = name_met +
"/Cumulative";
287 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) );
288 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) );
292 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Cumu_Ref.size(); ++
i) {
296 name_sub = name_met +
"/Residuals";
297 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) );
298 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) );
299 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) );
300 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) );
304 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Resolution_Ref.size(); ++
i) {
308 name_sub = name_met +
"/Significance";
309 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.) );
310 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.) );
314 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Significance_Ref.size(); ++
i) {
318 name_sub = name_met +
"/dPhi";
319 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) );
320 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) );
321 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) );
322 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) );
323 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) );
324 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) );
328 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_dPhi_Ref.size(); ++
i) {
332 name_sub = name_met +
"/Correlations";
334 v_MET_CorrFinalClus_Ref.reserve(corrClus_names.size());
336 for(
const auto&
it : corrClus_names) {
337 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) );
339 v_MET_CorrFinalTrk_Ref.reserve(corrTrk_names.size());
341 for(
const auto&
it : corrTrk_names) {
342 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) );
348 for(std::vector<TH2D*>::size_type
i = 0;
i < v_MET_CorrFinalTrk_Ref.size(); ++
i) {
351 for(std::vector<TH2D*>::size_type
i = 0;
i < v_MET_CorrFinalClus_Ref.size(); ++
i) {
357 for(
const auto&
it : sum_names) {
358 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));
359 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) );
360 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) );
361 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) );
362 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) );
363 m_dir_met.push_back(
"MET/" + name_met +
"/Differences/" +
it +
"/");
372 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Diff_Ref.size(); ++
i) {
385 name_met =
"MET_Rebuilt_" +
type;
387 std::vector<TH1D*> v_MET_Reb;
388 std::vector<TH1D*> v_MET_Reb_x;
389 std::vector<TH1D*> v_MET_Reb_y;
390 std::vector<TH1D*> v_MET_Reb_phi;
391 std::vector<TH1D*> v_MET_Reb_sum;
392 std::vector<TH1D*> v_MET_Cumu_Reb;
393 std::vector<TH1D*> v_MET_Resolution_Reb;
394 std::vector<TH1D*> v_MET_Significance_Reb;
395 std::vector<TH1D*> v_MET_dPhi_Reb;
396 std::vector<TH2D*> v_MET_CorrFinalTrk_Reb;
397 std::vector<TH2D*> v_MET_CorrFinalClus_Reb;
398 std::vector<TH1D*> v_MET_Diff_Reb;
399 std::vector<TH1D*> v_MET_Diff_Reb_x;
400 std::vector<TH1D*> v_MET_Diff_Reb_y;
401 std::vector<TH1D*> v_MET_Diff_Reb_phi;
402 std::vector<TH1D*> v_MET_Diff_Reb_sum;
404 for(
const auto& term :
m_terms) {
405 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) );
406 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) );
407 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) );
408 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) );
409 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) );
410 m_dir_met.push_back(
"MET/" + name_met +
"/Terms/" + term +
"/");
419 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Reb.size(); ++
i) {
427 name_sub = name_met +
"/Cumulative";
428 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) );
429 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) );
433 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Cumu_Reb.size(); ++
i) {
437 name_sub = name_met +
"/Residuals";
438 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) );
439 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) );
440 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) );
441 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) );
444 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Resolution_Reb.size(); ++
i) {
448 name_sub = name_met +
"/Significance";
449 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.) );
450 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.) );
454 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Significance_Reb.size(); ++
i) {
458 name_sub = name_met +
"/dPhi";
459 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) );
460 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) );
461 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) );
462 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) );
463 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) );
464 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) );
468 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_dPhi_Reb.size(); ++
i) {
472 name_sub = name_met +
"/Correlations";
473 v_MET_CorrFinalClus_Reb.reserve(corrClus_names.size());
475 for(
const auto&
it : corrClus_names) {
476 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) );
478 v_MET_CorrFinalTrk_Reb.reserve(corrTrk_names.size());
480 for(
const auto&
it : corrTrk_names) {
481 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) );
487 for(std::vector<TH2D*>::size_type
i = 0;
i < v_MET_CorrFinalTrk_Reb.size(); ++
i) {
490 for(std::vector<TH2D*>::size_type
i = 0;
i < v_MET_CorrFinalClus_Reb.size(); ++
i) {
496 for(
const auto&
it : sum_names) {
497 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));
498 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) );
499 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) );
500 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) );
501 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) );
502 m_dir_met.push_back(
"MET/" + name_met +
"/Differences/" +
it +
"/");
511 for(std::vector<TH1D*>::size_type
i = 0;
i < v_MET_Diff_Reb.size(); ++
i) {
523 std::string name_met =
"MET_Track";
524 std::string
dir =
"MET/" + name_met +
"/";
527 sub_dir =
dir +
"Track/";
534 sub_dir =
dir +
"PVTrack_Nominal/";
541 sub_dir =
dir +
"PVTrack_Pileup/";
552 std::string name_met =
"MET_Calo";
553 std::string
dir =
"MET/" + name_met +
"/";
563 return StatusCode::SUCCESS;
572 return StatusCode::SUCCESS;
586 return StatusCode::FAILURE;
594 ATH_MSG_ERROR (
"Failed to retrieve Muon container. Exiting." );
595 return StatusCode::FAILURE;
599 for(
const auto mu : *muons) {
609 ATH_MSG_ERROR (
"Failed to retrieve Electron container. Exiting." );
610 return StatusCode::FAILURE;
613 bool is_electron = 0;
624 ATH_MSG_ERROR (
"Failed to retrieve Photon container. Exiting." );
625 return StatusCode::FAILURE;
628 for(
const auto ph : *photons) {
638 return StatusCode::SUCCESS;
641 for(
const auto tau : *taus) {
658 for(pho_itr = metPhotons.
begin(); pho_itr != metPhotons.
end(); ++pho_itr ) {
659 TLorentzVector phtlv = (*pho_itr)->p4();
661 for(ele_itr = metElectrons.
begin(); ele_itr != metElectrons.
end(); ++ele_itr) {
662 if(phtlv.DeltaR((*ele_itr)->p4()) < 0.2) {
676 for(taujet_itr = metTaus.
begin(); taujet_itr != metTaus.
end(); ++taujet_itr ) {
677 TLorentzVector tautlv = (*taujet_itr)->p4();
679 for(ele_itr = metElectrons.
begin(); ele_itr != metElectrons.
end(); ++ele_itr) {
680 if(tautlv.DeltaR((*ele_itr)->p4()) < 0.2) {
685 for(pho_itr = metPhotonsOR.
begin(); pho_itr != metPhotonsOR.
end(); ++pho_itr) {
686 if(tautlv.DeltaR((*pho_itr)->p4()) < 0.2) {
698 TLorentzVector el_tlv;
700 for(ele_itr = metElectrons.
begin(); ele_itr != metElectrons.
end(); ++ele_itr ) {
701 el_tlv += (*ele_itr)->p4();
702 sum_el += (*ele_itr)->pt();
705 TLorentzVector mu_tlv;
707 for(mu_itr = metMuons.
begin(); mu_itr != metMuons.
end(); ++mu_itr ) {
708 mu_tlv += (*mu_itr)->p4();
709 sum_mu += (*mu_itr)->pt();
712 TLorentzVector tau_tlv;
714 for(taujet_itr = metTausOR.
begin(); taujet_itr != metTausOR.
end(); ++taujet_itr ) {
715 tau_tlv += (*taujet_itr)->p4();
716 sum_tau += (*taujet_itr)->pt();
719 TLorentzVector photon_tlv;
720 double sum_photon = 0;
721 for(pho_itr = metPhotonsOR.
begin(); pho_itr != metPhotonsOR.
end(); ++pho_itr ) {
722 photon_tlv += (*pho_itr)->p4();
723 sum_photon += (*pho_itr)->pt();
727 ToolHandle<IJetUpdateJvt>* jvtTool(
nullptr);
728 double JvtCut = 0.59;
729 if (
type ==
"AntiKt4EMPFlow"){
733 else if (
type ==
"AntiKt4EMTopo"){
737 if(jvtTool ==
nullptr){
739 return StatusCode::FAILURE;
743 std::string name_jet =
type +
"Jets";
747 ATH_MSG_ERROR (
"Failed to retrieve Jet container: " << name_jet <<
". Exiting." );
748 return StatusCode::FAILURE;
752 float newjvt = (*jvtTool)->updateJvt(*
jet);
753 NewJvtDec(*
jet) = newjvt;
762 for(jetc_itr = metJets.
begin(); jetc_itr != metJets.
end(); ++jetc_itr ) {
763 TLorentzVector jettlv = (*jetc_itr)->p4();
765 for(ele_itr = metElectrons.
begin(); ele_itr != metElectrons.
end(); ++ele_itr) {
766 if(jettlv.DeltaR((*ele_itr)->p4()) < 0.2) {
771 for(pho_itr = metPhotonsOR.
begin(); pho_itr != metPhotonsOR.
end(); ++pho_itr) {
772 if(jettlv.DeltaR((*pho_itr)->p4()) < 0.2) {
777 for(taujet_itr = metTausOR.
begin(); taujet_itr != metTausOR.
end(); ++taujet_itr) {
778 if(jettlv.DeltaR((*taujet_itr)->p4()) < 0.2) {
789 TLorentzVector jet_tlv;
791 for(jetc_itr = metJetsOR.
begin(); jetc_itr != metJetsOR.
end(); ++jetc_itr ) {
792 jet_tlv += (*jetc_itr)->p4();
793 sum_jet += (*jetc_itr)->pt();
797 std::string name_met =
"MET_Reference_" +
type;
807 return StatusCode::FAILURE;
811 for(
const auto it : *met_Ref) {
812 const std::string&
name =
it->name();
813 if(
name ==
"RefEle"){
820 if(
name ==
"RefGamma"){
827 if(
name ==
"RefTau"){
841 if(
name ==
"RefJet"){
848 if(
name ==
"SoftClus"){
855 if(
name ==
"PVSoftTrk"){
862 if(
name ==
"FinalTrk"){
869 if(
name ==
"FinalClus"){
882 if(
evtStore()->record(met_Reb,(
"MET_Rebuilt"+
type).c_str()).isFailure() ) {
884 return StatusCode::FAILURE;
887 if(
evtStore()->record(met_RebAux,(
"MET_Rebuilt"+
type+
"Aux").c_str()).isFailure() ) {
889 return StatusCode::FAILURE;
891 met_Reb->setStore(met_RebAux);
898 return StatusCode::SUCCESS;
904 return StatusCode::SUCCESS;
933 if( (*m_metmaker)->rebuildJetMET(
"RefJet",
"SoftClus",
"PVSoftTrk", met_Reb,
jets, coreMet, metHelper,
true).isFailure() ) {
937 if((*met_Reb)[
"PVSoftTrk"]) trksource = (*met_Reb)[
"PVSoftTrk"]->source();
945 if((*met_Reb)[
"SoftClus"]) clsource = (*met_Reb)[
"SoftClus"]->source();
951 for(
const auto it : *met_Reb) {
952 std::string
name =
it->name();
953 if(
name ==
"RefEle"){
960 if(
name ==
"RefGamma"){
967 if(
name ==
"RefTau"){
981 if(
name ==
"RefJet"){
988 if(
name ==
"SoftClus"){
995 if(
name ==
"PVSoftTrk"){
1002 if(
name ==
"FinalTrk"){
1009 if(
name ==
"FinalClus"){
1021 double leadPt = 0., subleadPt = 0., leadPhi = 0., subleadPhi = 0.;
1023 for (
auto jet_itr =
jets->begin(); jet_itr !=
jets->end(); ++jet_itr) {
1024 if ((*jet_itr)->pt() > leadPt &&
Accept(*jet_itr,JvtCut,jvtTool)) {
1026 subleadPhi = leadPhi;
1027 leadPt = (*jet_itr)->pt();
1028 leadPhi = (*jet_itr)->phi();
1030 else if ((*jet_itr)->pt() > subleadPt &&
Accept(*jet_itr,JvtCut,jvtTool)) {
1031 subleadPt = (*jet_itr)->pt();
1032 subleadPhi = (*jet_itr)->phi();
1048 leadPt = 0.; leadPhi = 0.;
1053 for( ; muon_itr != muon_end; ++muon_itr ) {
1054 if((*muon_itr)->pt() > leadPt) {
1055 leadPt = (*muon_itr)->pt();
1056 leadPhi = (*muon_itr)->phi();
1063 for( ; electron_itr != electron_end; ++electron_itr ) {
1064 if((*electron_itr)->pt() > leadPt) {
1065 leadPt = (*electron_itr)->pt();
1066 leadPhi = (*electron_itr)->phi();
1080 for(
const auto it : *met_Ref) {
1081 const std::string&
name =
it->name();
1082 if(
name ==
"RefEle"){
1086 if(
name ==
"RefGamma"){
1090 if(
name ==
"RefTau"){
1094 if(
name ==
"Muons"){
1098 if(
name ==
"RefJet"){
1102 if(
name ==
"PVSoftTrk"){
1105 if(
name ==
"SoftClus"){
1113 for(
const auto it : *met_Reb) {
1114 std::string
name =
it->name();
1115 if(
name ==
"RefEle"){
1119 if(
name ==
"RefGamma"){
1123 if(
name ==
"RefTau"){
1127 if(
name ==
"Muons"){
1131 if(
name ==
"RefJet"){
1135 if(
name ==
"PVSoftTrk"){
1138 if(
name ==
"SoftClus"){
1159 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);
1160 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);
1162 TLorentzVector target_tlv;
1166 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);
1167 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);
1170 for(
const auto it : *met_Ref) {
1171 if(
it->name() ==
"RefEle"){
1172 if(is_electron or (
it->sumet() > 0)){
1173 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1181 if(
it->name() ==
"RefGamma"){
1182 if(is_photon or (
it->sumet() > 0)){
1183 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1191 if(
it->name() ==
"RefTau"){
1192 if(is_tau or (
it->sumet() > 0)){
1193 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1201 if(
it->name() ==
"Muons"){
1202 if(is_muon or (
it->sumet() > 0)){
1203 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1211 if(
it->name() ==
"RefJet"){
1212 if(is_jet or (
it->sumet() > 0)){
1213 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1225 TLorentzVector jetReb_tlv;
1226 double sum_jetReb = 0;
1227 for(
const auto jet : metJetsOR) {
1229 jetReb_tlv +=
jet->p4();
1230 sum_jetReb +=
jet->pt();
1234 for(
const auto it : *met_Reb) {
1235 if(
it->name() ==
"RefEle"){
1236 if(is_electron or (
it->sumet() > 0)){
1237 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1245 if(
it->name() ==
"RefGamma"){
1246 if(is_photon or (
it->sumet() > 0)){
1247 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1255 if(
it->name() ==
"RefTau"){
1256 if(is_tau or (
it->sumet() > 0)){
1257 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1265 if(
it->name() ==
"Muons"){
1266 if(is_muon or (
it->sumet() > 0)){
1267 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1275 if(
it->name() ==
"RefJet"){
1276 if(is_jet or (
it->sumet() > 0)){
1277 target_tlv.SetPxPyPzE(-
it->mpx(), -
it->mpy(), 0,
it->met());
1287 if(
type ==
"AntiKt4EMTopo") {
1292 if(
evtStore()->record(met_Calo,(
"MET_Calo"+
type).c_str()).isFailure() ) {
1294 return StatusCode::FAILURE;
1297 if(
evtStore()->record(met_CaloAux,(
"MET_Calo"+
type+
"Aux").c_str()).isFailure() ) {
1299 return StatusCode::FAILURE;
1301 met_Calo->setStore(met_CaloAux);
1303 if( (*m_metmaker)->rebuildJetMET(
"RefJet",
"SoftClus",
"PVSoftTrk", met_Calo, metJetsEmpty.
asDataVector(), coreMet, metHelper,
true).isFailure() ) {
1307 if((*met_Calo)[
"SoftClus"]) clsource = (*met_Calo)[
"SoftClus"]->source();
1331 return StatusCode::FAILURE;
1345 for(
const auto vx : *vxCont) {
1346 int N = vx->index();
1366 return StatusCode::SUCCESS;
1487 return StatusCode::SUCCESS;
1499 if(
mu->pt()<2.5e3 ||
mu->pt()/cosh(
mu->eta())<4
e3 )
return false;
1505 if( fabs(
el->eta())>2.47 ||
el->pt()<10
e3 )
return false;
1511 if( !(ph->
author()&20) || fabs(ph->
eta())>2.47 || ph->
pt()<10
e3 )
return false;
1516 {
return static_cast<bool> (
m_tauSelTool->accept( *tau )); }
1520 if(
jet->pt()<20
e3 || jvtTool ==
nullptr)
return false;
1521 return (fabs(
jet->eta()) > 2.4 ||
jet->pt() > 60
e3 || (*jvtTool)->updateJvt(*
jet) > JvtCut);