ATLAS Offline Software
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");
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  declareProperty("ParamFilePath", m_param_file_path = "MMC_params_v1_fixed.root");
36  declareProperty("BeamEnergy", m_beam_energy = 6500.0);
37  declareProperty("LFVLeplepRefit", m_lfv_leplep_refit = true);
38  declareProperty("SaveLlhHisto", m_save_llh_histo = false, "Save MMC LLh histograms for debugging purpose. If enabled, it can slow down MMC running time");
39 }
40 
41 // Copy constructor
43 
44 
46 
47 {
48  ATH_MSG_INFO("Initialize MissingMassTool");
49 
51 
52  if (m_calib_set == "2015HIGHMASS") {
54  } else if (m_calib_set == "UPGRADE") {
56  } else if (m_calib_set == "LFV") {
58  } else if (m_calib_set == "2016MC15C") {
60  } else if (m_calib_set == "2019") {
62  } else {
63  return StatusCode::FAILURE;
64  }
66  // set properties if non negative
81 
82  // could be made a property but maybe not with the enum
83  // What about a string argument ?
84 
85  return StatusCode::SUCCESS;
86 }
87 
89 
90 {
91  ATH_MSG_INFO("Finalize MissingMassTool");
92  delete m_MMC;
93  //delete Output;
94 
95  return StatusCode::SUCCESS;
96 }
97 
98 
99 // generic method
101  const xAOD::IParticle* part1,
102  const xAOD::IParticle* part2,
103  const xAOD::MissingET* met,
104  const int & njets)
105 {
106  // This is actually where the work is done
109 
110  // Very dry decoration - MET and resonance vectors are retrieved
111  // in dedicated method (see MissingMassTool.h)
112 
113  if (m_decorate) {
114  int aFitStatus = m_MMC->OutputInfo.GetFitStatus();
115  static const SG::Decorator<int> dec_mmc_fit_status ("mmc_fit_status");
116  static const SG::Decorator<double> dec_mmc_maxw_mass ("mmc_maxw_mass");
117  static const SG::Decorator<double> dec_mmc_mlm_mass ("mmc_mlm_mass");
118  static const SG::Decorator<double> dec_mmc_mlnu3p_mass ("mmc_mlnu3p_mass");
119  static const SG::Decorator<PtEtaPhiMVector> dec_mmc_mlnu3p_4vect ("mmc_mlnu3p_4vect");
120  dec_mmc_fit_status(ei) = aFitStatus;
121  dec_mmc_maxw_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MAXW) : -1;
122  dec_mmc_mlm_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MLM) : -1;
123  dec_mmc_mlnu3p_mass(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetFittedMass(MMCFitMethod::MLNU3P) : -1;
124  PtEtaPhiMVector null4V(0.,0.,0.,0.);
125  dec_mmc_mlnu3p_4vect(ei) = aFitStatus==1 ? m_MMC->OutputInfo.GetResonanceVec(MMCFitMethod::MLNU3P) : null4V;
126  }
127 
128  return CP::CorrectionCode::Ok;
129 }
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:100
DiTauMassTools::MissingMassTool::m_use_tau_probability
int m_use_tau_probability
Definition: MissingMassTool.h:84
DiTauMassTools::MissingMassCalculator::SetUseFloatStopping
void SetUseFloatStopping(const bool val)
Definition: MissingMassCalculator.h:390
DiTauMassTools::MissingMassCalculator::SetNsigmaMETscan
void SetNsigmaMETscan(const double val)
Definition: MissingMassCalculator.h:388
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:344
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:362
DiTauMassTools::MissingMassTool::m_decorate
bool m_decorate
Definition: MissingMassTool.h:91
DiTauMassTools::MissingMassCalculator::SetEventNumber
void SetEventNumber(const int eventNumber)
Definition: MissingMassCalculator.h:353
DiTauMassTools::MissingMassCalculator::SetNiterFit3
void SetNiterFit3(const int val)
Definition: MissingMassCalculator.h:345
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
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
DiTauMassTools::MissingMassCalculator::SaveLlhHisto
void SaveLlhHisto(const bool val)
Definition: MissingMassCalculator.h:393
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:391
met
Definition: IMETSignificance.h:24
DiTauMassTools::MissingMassCalculator::preparedInput
MissingMassInput preparedInput
Definition: MissingMassCalculator.h:335
SG::Decorator< int >
DiTauMassTools::MissingMassCalculator::SetLFVLeplepRefit
void SetLFVLeplepRefit(const bool val)
Definition: MissingMassCalculator.h:392
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:273
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DiTauMassTools::MissingMassTool::initialize
virtual StatusCode initialize()
Initialize the tool.
Definition: MissingMassTool.cxx:45
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
TauJet.h
DiTauMassTools::MissingMassTool::finalize
virtual StatusCode finalize()
Initialize the tool.
Definition: MissingMassTool.cxx:88
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::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:336
DiTauMassTools::MissingMassOutput::GetResonanceVec
PtEtaPhiMVector GetResonanceVec(int fitcode) const
Definition: MissingMassOutput.cxx:191
DiTauMassTools::MissingMassCalculator::Prob
MissingMassProb * Prob
Definition: MissingMassCalculator.h:337
DiTauMassTools::MissingMassTool::m_use_verbose
int m_use_verbose
Definition: MissingMassTool.h:83