Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MissingMassTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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 
12 using namespace DiTauMassTools;
13 using ROOT::Math::PtEtaPhiMVector;
14 
15 // Default constructor
16 MissingMassTool::MissingMassTool(const std::string& name) : asg::AsgTool(name)
17 
18 {
19  declareProperty("Decorate", m_decorate=false, "Activate EventInfo decoration");
20  declareProperty("FloatStoppingCrit", m_float_stop=true, "Activate floating stopping criterion");
21  declareProperty("CalibSet", m_calib_set="2019", "Calibration: 2019"); // Change to "2024" if the new MMC version is to be used.
22  // default negative. Only set parameter if positive
23  // so that the default are in MissingMassCalculator code
24  declareProperty("NsigmaMET", m_n_sigma_met=-1);
25  declareProperty("UseTailCleanup", m_tail_cleanup=-1);
26  declareProperty("UseVerbose", m_use_verbose=-1);
27  declareProperty("NiterFit2", m_niter_fit_2=-1);
28  declareProperty("NiterFit3", m_niter_fit_3=-1);
29  // Property not there in latest MMC tags
30  declareProperty("UseTauProbability", m_use_tau_probability=-1);
31  declareProperty("UseMnuProbability", m_use_mnu_probability=false);
32  declareProperty("UseDefaults", m_use_defaults=-1);
33  declareProperty("UseEfficiencyRecovery", m_use_efficiency_recovery=-1);
34  declareProperty("UseMETDphiLL", m_use_met_param_dphiLL = false);
35  // Available parameterization files: MMC_params_v051224_angle_noLikelihoodFit.root and MMC_params_v051224_angle_likelihoodFit.root. More details on the differences between these two options can be found in the slides:
36  // https://indico.cern.ch/event/1487242/contributions/6269201/attachments/2989313/5265428/HbbHtautau_MMCstudies_statusReport_181224_v2.pdf
37  declareProperty("ParamFilePath", m_param_file_path = "MMC_params_v1_fixed.root");
38  declareProperty("BeamEnergy", m_beam_energy = 6500.0);
39  declareProperty("LFVLeplepRefit", m_lfv_leplep_refit = true);
40  declareProperty("SaveLlhHisto", m_save_llh_histo = false, "Save MMC LLh histograms for debugging purpose. If enabled, it can slow down MMC running time");
41 }
42 
43 // Copy constructor
45 
46 
48 
49 {
50  ATH_MSG_INFO("Initialize MissingMassTool");
51 
53 
54  if (m_calib_set == "2015HIGHMASS") {
56  } else if (m_calib_set == "UPGRADE") {
58  } else if (m_calib_set == "LFV") {
60  } else if (m_calib_set == "2016MC15C") {
62  } else if (m_calib_set == "2019") {
64  } else if (m_calib_set == "2024") {
66  } else {
67  return StatusCode::FAILURE;
68  }
69 
70 
71  if(aset == MMCCalibrationSet::MMC2019 && m_param_file_path.find("v051224") != std::string::npos){
72  ATH_MSG_WARNING( m_param_file_path << " param file not suitable for 2019 calibration set; please use MMC_params_v1_fixed.root");
73  }
74 
75  if(aset == MMCCalibrationSet::MMC2024 && m_param_file_path.find("MMC_params_v1") != std::string::npos){
76  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");
77  }
78 
80  // set properties if non negative
95 
96  // could be made a property but maybe not with the enum
97  // What about a string argument ?
98 
99  return StatusCode::SUCCESS;
100 }
101 
103 
104 {
105  ATH_MSG_INFO("Finalize MissingMassTool");
106  delete m_MMC;
107  //delete Output;
108 
109  return StatusCode::SUCCESS;
110 }
111 
112 
113 // generic method
115  const xAOD::IParticle* part1,
116  const xAOD::IParticle* part2,
117  const xAOD::MissingET* met,
118  const int & njets)
119 {
120  // This is actually where the work is done
123 
124  // Very dry decoration - MET and resonance vectors are retrieved
125  // in dedicated method (see MissingMassTool.h)
126 
127  if (m_decorate) {
128  int aFitStatus = m_MMC->OutputInfo.GetFitStatus();
129  static const SG::Decorator<int> dec_mmc_fit_status ("mmc_fit_status");
130  static const SG::Decorator<double> dec_mmc_maxw_mass ("mmc_maxw_mass");
131  static const SG::Decorator<double> dec_mmc_mlm_mass ("mmc_mlm_mass");
132  static const SG::Decorator<double> dec_mmc_mlnu3p_mass ("mmc_mlnu3p_mass");
133  static const SG::Decorator<PtEtaPhiMVector> dec_mmc_mlnu3p_4vect ("mmc_mlnu3p_4vect");
134  dec_mmc_fit_status(ei) = aFitStatus;
135  dec_mmc_maxw_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MAXW) : -1;
136  dec_mmc_mlm_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MLM) : -1;
137  dec_mmc_mlnu3p_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MLNU3P) : -1;
138  PtEtaPhiMVector null4V(0.,0.,0.,0.);
139  dec_mmc_mlnu3p_4vect(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetResonanceVec(MMCFitMethod::MLNU3P) : null4V;
140  }
141 
142  return CP::CorrectionCode::Ok;
143 }
DiTauMassTools::MMCCalibrationSet::MMC2024
@ MMC2024
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassProb::SetUseDphiLL
void SetUseDphiLL(bool val)
Definition: MissingMassProb.h:57
DiTauMassTools::MissingMassTool::apply
virtual CP::CorrectionCode apply(const xAOD::EventInfo &ei, const xAOD::IParticle *part1, const xAOD::IParticle *part2, const xAOD::MissingET *met, const int &njets)
Definition: MissingMassTool.cxx:114
DiTauMassTools::MissingMassTool::m_use_tau_probability
int m_use_tau_probability
Definition: MissingMassTool.h:84
DiTauMassTools::MissingMassCalculator::SaveLlhHisto
void SaveLlhHisto(const bool val)
Definition: MissingMassCalculator.cxx:3088
DiTauMassTools::MissingMassCalculator::SetNsigmaMETscan
void SetNsigmaMETscan(const double val)
Definition: MissingMassCalculator.h:390
DiTauMassTools::MMCCalibrationSet::MMC2015HIGHMASS
@ MMC2015HIGHMASS
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
DiTauMassTools::MissingMassTool::m_use_met_param_dphiLL
bool m_use_met_param_dphiLL
Definition: MissingMassTool.h:94
DiTauMassTools::MissingMassCalculator::SetNiterFit2
void SetNiterFit2(const int val)
Definition: MissingMassCalculator.h:346
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DiTauMassTools::MissingMassTool::m_save_llh_histo
bool m_save_llh_histo
Definition: MissingMassTool.h:98
DiTauMassTools::MMCFitMethod::MLM
@ MLM
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:46
MissingMassTool.h
DiTauMassTools::MissingMassInput::SetUseDefaults
void SetUseDefaults(int val)
Definition: MissingMassInput.h:44
DiTauMassTools::MissingMassProb::SetUseMnuProbability
void SetUseMnuProbability(bool val)
Definition: MissingMassProb.h:54
DiTauMassTools::MissingMassTool::m_calib_set
std::string m_calib_set
Definition: MissingMassTool.h:89
asg
Definition: DataHandleTestTool.h:28
DiTauMassTools::MissingMassCalculator::SetUseEfficiencyRecovery
void SetUseEfficiencyRecovery(const bool val)
Definition: MissingMassCalculator.h:364
DiTauMassTools::MissingMassTool::m_decorate
bool m_decorate
Definition: MissingMassTool.h:91
DiTauMassTools::MissingMassCalculator::SetEventNumber
void SetEventNumber(const int eventNumber)
Definition: MissingMassCalculator.h:355
DiTauMassTools::MissingMassCalculator::SetNiterFit3
void SetNiterFit3(const int val)
Definition: MissingMassCalculator.h:347
DiTauMassTools::MissingMassInput::SetUseVerbose
void SetUseVerbose(bool val)
Definition: MissingMassInput.h:46
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
IMissingMassTool::PtEtaPhiMVector
ROOT::Math::PtEtaPhiMVector PtEtaPhiMVector
Definition: IMissingMassTool.h:31
DiTauMassTools::MissingMassTool::m_niter_fit_2
int m_niter_fit_2
Definition: MissingMassTool.h:85
DiTauMassTools::MMCCalibrationSet::LFVMMC2012
@ LFVMMC2012
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassTool::MissingMassTool
MissingMassTool(const std::string &name)
Proper constructor for Athena.
Definition: MissingMassTool.cxx:16
DiTauMassTools::MissingMassTool::m_use_mnu_probability
bool m_use_mnu_probability
Definition: MissingMassTool.h:93
DiTauMassTools::MissingMassTool::m_float_stop
bool m_float_stop
Definition: MissingMassTool.h:92
DiTauMassTools::MissingMassCalculator
Definition: MissingMassCalculator.h:46
part1
Definition: part1.py:1
DiTauMassTools::MissingMassTool::m_niter_fit_3
int m_niter_fit_3
Definition: MissingMassTool.h:86
DiTauMassTools
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:24
DiTauMassTools::MissingMassCalculator::SetBeamEnergy
void SetBeamEnergy(const double val)
Definition: MissingMassCalculator.h:393
met
Definition: IMETSignificance.h:24
DiTauMassTools::MissingMassCalculator::preparedInput
MissingMassInput preparedInput
Definition: MissingMassCalculator.h:337
SG::Decorator< int >
DiTauMassTools::MissingMassCalculator::SetLFVLeplepRefit
void SetLFVLeplepRefit(const bool val)
Definition: MissingMassCalculator.h:394
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DiTauMassTools::MMCCalibrationSet::MMC2019
@ MMC2019
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
DiTauMassTools::MMCCalibrationSet::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassTool::m_n_sigma_met
double m_n_sigma_met
Definition: MissingMassTool.h:81
DiTauMassTools::MissingMassOutput::GetFittedMass
double GetFittedMass(int fitcode) const
Definition: MissingMassOutput.cxx:72
part2
Definition: part2.py:1
DiTauMassTools::MissingMassCalculator::RunMissingMassCalculator
int RunMissingMassCalculator(const xAOD::IParticle *part1, const xAOD::IParticle *part2, const xAOD::MissingET *met, const int &njets)
Definition: MissingMassCalculator.cxx:187
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DiTauMassTools::MissingMassTool::initialize
virtual StatusCode initialize()
Initialize the tool.
Definition: MissingMassTool.cxx:47
DiTauMassTools::MissingMassTool::m_lfv_leplep_refit
bool m_lfv_leplep_refit
Definition: MissingMassTool.h:97
DiTauMassTools::MissingMassOutput::GetFitStatus
int GetFitStatus() const
Definition: MissingMassOutput.cxx:49
DiTauMassTools::MissingMassProb::SetUseTauProbability
void SetUseTauProbability(bool val)
Definition: MissingMassProb.h:51
DiTauMassTools::MissingMassTool::m_use_defaults
int m_use_defaults
Definition: MissingMassTool.h:87
DiTauMassTools::MissingMassTool
Definition: MissingMassTool.h:25
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
DiTauMassTools::MissingMassTool::m_tail_cleanup
int m_tail_cleanup
Definition: MissingMassTool.h:82
DiTauMassTools::MissingMassTool::m_use_efficiency_recovery
int m_use_efficiency_recovery
Definition: MissingMassTool.h:88
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
DiTauMassTools::MMCFitMethod::MAXW
@ MAXW
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:46
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TauJet.h
DiTauMassTools::MissingMassTool::finalize
virtual StatusCode finalize()
Initialize the tool.
Definition: MissingMassTool.cxx:102
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
DiTauMassTools::MMCFitMethod::MLNU3P
@ MLNU3P
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:46
DiTauMassTools::MMCCalibrationSet::MMC2016MC15C
@ MMC2016MC15C
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassTool::m_MMC
MissingMassCalculator * m_MMC
Definition: MissingMassTool.h:80
DiTauMassTools::MissingMassInput::SetUseTailCleanup
void SetUseTailCleanup(bool val)
Definition: MissingMassInput.h:45
DiTauMassTools::MissingMassTool::m_param_file_path
std::string m_param_file_path
Definition: MissingMassTool.h:95
DiTauMassTools::MissingMassCalculator::SetUseFloatStopping
void SetUseFloatStopping(const bool val)
Definition: MissingMassCalculator.cxx:3123
DiTauMassTools::MMCCalibrationSet::UPGRADE
@ UPGRADE
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassTool::m_beam_energy
double m_beam_energy
Definition: MissingMassTool.h:96
DiTauMassTools::MissingMassCalculator::OutputInfo
MissingMassOutput OutputInfo
Definition: MissingMassCalculator.h:338
DiTauMassTools::MissingMassOutput::GetResonanceVec
PtEtaPhiMVector GetResonanceVec(int fitcode) const
Definition: MissingMassOutput.cxx:191
DiTauMassTools::MissingMassCalculator::Prob
MissingMassProb * Prob
Definition: MissingMassCalculator.h:339
DiTauMassTools::MissingMassTool::m_use_verbose
int m_use_verbose
Definition: MissingMassTool.h:83