ATLAS Offline Software
Loading...
Searching...
No Matches
MissingMassTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// vim: ts=2 sw=2
6// Local include(s)
8
9// EDM include(s):
10#include "xAODTau/TauJet.h"
11
12using namespace DiTauMassTools;
13using ROOT::Math::PtEtaPhiMVector;
14
15// Default constructor
16MissingMassTool::MissingMassTool(const std::string& name) : asg::AsgTool(name)
17{
18}
19
20// Copy constructor
21MissingMassTool::MissingMassTool(const MissingMassTool& other): asg::AsgTool(other.name() + "_copy") {}
22
23
25
26{
27 ATH_MSG_INFO("Initialize MissingMassTool");
28
30
31 if (m_calib_set == "2015HIGHMASS") {
33 } else if (m_calib_set == "UPGRADE") {
35 } else if (m_calib_set == "LFV") {
37 } else if (m_calib_set == "2019") {
39 } else if (m_calib_set == "2024") {
41 } else {
42 return StatusCode::FAILURE;
43 }
44
45
46 if(aset == MMCCalibrationSet::MMC2019 && m_param_file_path.value().find("v051224") != std::string::npos){
47 ATH_MSG_WARNING( m_param_file_path << " param file not suitable for 2019 calibration set; please use MMC_params_v1_fixed.root");
48 }
49
50 if(aset == MMCCalibrationSet::MMC2024 && m_param_file_path.value().find("MMC_params_v1") != std::string::npos){
51 ATH_MSG_WARNING( m_param_file_path << " param file not suitable for 2024 calibration set; please use MMC_params_v051224_angle_likelihoodFit.root or MMC_params_v051224_angle_noLikelihoodFit.root");
52 }
53
55 m_MMC->SetUseFloatStopping(m_float_stop);
56 m_MMC->SetFloatStoppingMinIter(m_float_stop_miniter);
57 m_MMC->SetFloatStoppingCheckFreq(m_float_stop_checkfreq);
58 m_MMC->SetFloatStoppingComp(m_float_stop_comp);
59 // set properties if non negative
60 if (m_n_sigma_met>=0) m_MMC->SetNsigmaMETscan(m_n_sigma_met);
61 if (m_tail_cleanup>=0) m_MMC->preparedInput.SetUseTailCleanup(m_tail_cleanup);
62 if (m_use_verbose>=0) m_MMC->preparedInput.SetUseVerbose(m_use_verbose);
63 if (m_niter_fit_2>=0) m_MMC->SetNiterFit2(m_niter_fit_2);
64 if (m_niter_fit_3>=0) m_MMC->SetNiterFit3(m_niter_fit_3);
65 if (m_use_tau_probability>=0) m_MMC->Prob->SetUseTauProbability(m_use_tau_probability);
66 if (m_use_defaults>=0) m_MMC->preparedInput.SetUseDefaults(m_use_defaults);
67 if (m_use_efficiency_recovery>=0) m_MMC->SetUseEfficiencyRecovery(m_use_efficiency_recovery);
68 if (m_use_met_param_dphiLL) m_MMC->Prob->SetUseDphiLL(m_use_met_param_dphiLL);
69 if (m_use_mnu_probability) m_MMC->Prob->SetUseMnuProbability(m_use_mnu_probability);
70 if (m_beam_energy) m_MMC->SetBeamEnergy(m_beam_energy);
71 if (!m_lfv_leplep_refit) m_MMC->SetLFVLeplepRefit(false);
72 m_MMC->SaveLlhHisto(m_save_llh_histo);
73
74 // could be made a property but maybe not with the enum
75 // What about a string argument ?
76
77 return StatusCode::SUCCESS;
78}
79
81
82{
83 ATH_MSG_INFO("Finalize MissingMassTool");
84 delete m_MMC;
85 //delete Output;
86
87 return StatusCode::SUCCESS;
88}
89
90
91// generic method
95 const xAOD::MissingET* met,
96 const int & njets)
97{
98 // This is actually where the work is done
99 m_MMC->SetEventNumber(ei.eventNumber());
100 m_MMC->RunMissingMassCalculator(part1, part2, met, njets);
101
102 // Very dry decoration - MET and resonance vectors are retrieved
103 // in dedicated method (see MissingMassTool.h)
104
105 if (m_decorate) {
106 int aFitStatus = m_MMC->OutputInfo.GetFitStatus();
107 static const SG::Decorator<int> dec_mmc_fit_status ("mmc_fit_status");
108 static const SG::Decorator<double> dec_mmc_maxw_mass ("mmc_maxw_mass");
109 static const SG::Decorator<double> dec_mmc_mlm_mass ("mmc_mlm_mass");
110 static const SG::Decorator<double> dec_mmc_mlnu3p_mass ("mmc_mlnu3p_mass");
111 static const SG::Decorator<PtEtaPhiMVector> dec_mmc_mlnu3p_4vect ("mmc_mlnu3p_4vect");
112 dec_mmc_fit_status(ei) = aFitStatus;
113 dec_mmc_maxw_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MAXW) : -1;
114 dec_mmc_mlm_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MLM) : -1;
115 dec_mmc_mlnu3p_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MLNU3P) : -1;
116 PtEtaPhiMVector null4V(0.,0.,0.,0.);
117 dec_mmc_mlnu3p_4vect(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetResonanceVec(MMCFitMethod::MLNU3P) : null4V;
118 }
119
121}
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
Return value from object correction CP tools.
@ Ok
The correction was done successfully.
Gaudi::Property< double > m_n_sigma_met
virtual CP::CorrectionCode apply(const xAOD::EventInfo &ei, const xAOD::IParticle *part1, const xAOD::IParticle *part2, const xAOD::MissingET *met, const int &njets)
Gaudi::Property< int > m_use_verbose
MissingMassCalculator * m_MMC
Gaudi::Property< bool > m_use_mnu_probability
Gaudi::Property< int > m_tail_cleanup
Gaudi::Property< int > m_float_stop_miniter
Gaudi::Property< double > m_float_stop_comp
Gaudi::Property< int > m_niter_fit_2
virtual StatusCode finalize()
Initialize the tool.
Gaudi::Property< bool > m_float_stop
virtual StatusCode initialize()
Initialize the tool.
Gaudi::Property< bool > m_lfv_leplep_refit
Gaudi::Property< int > m_use_efficiency_recovery
Gaudi::Property< double > m_beam_energy
MissingMassTool(const std::string &name)
Proper constructor for Athena.
Gaudi::Property< int > m_use_tau_probability
Gaudi::Property< bool > m_save_llh_histo
Gaudi::Property< std::string > m_param_file_path
Gaudi::Property< bool > m_use_met_param_dphiLL
Gaudi::Property< bool > m_decorate
Gaudi::Property< int > m_float_stop_checkfreq
Gaudi::Property< int > m_use_defaults
Gaudi::Property< std::string > m_calib_set
Gaudi::Property< int > m_niter_fit_3
ROOT::Math::PtEtaPhiMVector PtEtaPhiMVector
Helper class to provide type-safe access to aux data.
Definition Decorator.h:59
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
uint64_t eventNumber() const
The current event's event number.
Class providing the definition of the 4-vector interface.
Definition part1.py:1
Definition part2.py:1
EventInfo_v1 EventInfo
Definition of the latest event info version.
MissingET_v1 MissingET
Version control by type defintion.