24#ifndef XAOD_STANDALONE
36 return StatusCode::FAILURE;
39 if (
m_isPHYSLITE && taukey.find(
"AnalysisTauJets")==std::string::npos){
40 ATH_MSG_ERROR(
"You are running on PHYSLITE derivation. Please change the Taus container to 'AnalysisTauJets'");
41 return StatusCode::FAILURE;
46 if (containerToBeCopied !=
nullptr) {
47 taus = containerToBeCopied;
53 copy = shallowcopy.first.get();
54 copyaux = shallowcopy.second.get();
64 return StatusCode::FAILURE;
67 ATH_MSG_DEBUG(
"Not retrieving tau collecton, using existing one provided by user");
71 for (
const auto tau : *copy) {
76 return StatusCode::SUCCESS;
83 ATH_MSG_VERBOSE(
"Starting FillTau on tau with pT = " << input.pt()/1000 <<
" GeV" );
84 ATH_MSG_VERBOSE(
"TAU pT before smearing " << input.pt()/1000 <<
" GeV");
91 if (std::abs(input.eta()) <= 2.5 && input.nTracks() > 0) {
112 return StatusCode::SUCCESS;
122 if (input.pt() <= ptcut)
return false;
124 if (std::abs(input.eta()) >= etacut)
return false;
136 const bool triggerSF,
137 const std::string& trigExpr)
167 const bool triggerSF,
168 const std::string& trigExpr)
173 StatusCode ret =
m_tauEffTool->applySystematicVariation(systConfig);
174 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool for systematic var. " << systConfig.
name() ); }
177 ret = tool->applySystematicVariation(systConfig);
178 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " << tool->name() <<
" for systematic var. " << systConfig.
name()); }
185 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool back to default"); }
189 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " << tool->name() <<
" back to default"); }
204 ATH_MSG_WARNING(
"The trigger item requested (" << trigExpr <<
") is not supported! Please check. Setting SF to 1.");
209 std::vector<std::string> chains;
210 for (
auto part : std::views::split(map_it->second,
',')) chains.emplace_back(&*part.begin(), std::ranges::distance(part));
212 for (
const std::string& chain : chains)
224 ATH_MSG_ERROR(
"Some problem found to retrieve SF for trigger item requested (" << trigExpr <<
")");
239 ATH_MSG_WARNING(
"Tau does not have Overlap Removal decision set. You should only call GetTotalTauSF with taus that have been passed through OR. SF will NOT be applied!");
258 StatusCode ret =
m_tauEffTool->applySystematicVariation(systConfig);
259 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool for systematic var. " << systConfig.
name() ); }
262 ret = tool->applySystematicVariation(systConfig);
263 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " << tool->name() <<
" for systematic var. " << systConfig.
name()); }
270 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool back to default"); }
274 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " << tool->name() <<
" back to default"); }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
ServiceHandle< StoreGateSvc > & evtStore()
@ Ok
The correction was done successfully.
Class to wrap a set of SystematicVariations.
std::string name() const
returns: the systematics joined into a single string.
asg::AnaToolHandle< TauAnalysisTools::ITauSelectionTool > m_tauSelToolBaseline
StatusCode FillTau(xAOD::TauJet &input) override final
bool IsSignalTau(const xAOD::TauJet &input, const float ptcut, const float etacut) const override final
asg::AnaToolHandle< TauAnalysisTools::ITauSelectionTool > m_tauSelTool
asg::AnaToolHandle< TauAnalysisTools::ITauEfficiencyCorrectionsTool > m_tauEffTool
bool isData() const override final
double GetSignalTauSFsys(const xAOD::TauJet &tau, const CP::SystematicSet &systConfig, const bool idSF=true, const bool triggerSF=true, const std::string &trigExpr="tau25_medium1_tracktwo") override final
asg::AnaToolHandle< Trig::IMatchingTool > m_trigMatchingTool
StatusCode GetTaus(xAOD::TauJetContainer *©, xAOD::ShallowAuxContainer *©aux, const bool recordSG=true, const std::string &taukey="TauJets", const xAOD::TauJetContainer *containerToBeCopied=nullptr) override final
std::map< std::string, std::string > m_tau_trig_support
double GetTauTriggerEfficiencySF(const xAOD::TauJet &tau, const std::string &trigExpr="tau25_medium1_tracktwo") override final
double GetSignalTauSF(const xAOD::TauJet &tau, const bool idSF=true, const bool triggerSF=true, const std::string &trigExpr="tau25_medium1_tracktwo") override final
double GetTotalTauSF(const xAOD::TauJetContainer &taus, const bool idSF=true, const bool triggerSF=true, const std::string &trigExpr="tau25_medium1_tracktwo") override final
CP::SystematicSet m_currentSyst
double GetTotalTauSFsys(const xAOD::TauJetContainer &taus, const CP::SystematicSet &systConfig, const bool idSF=true, const bool triggerSF=true, const std::string &trigExpr="tau25_medium1_tracktwo") override final
asg::AnaToolHandle< TauAnalysisTools::ITauSmearingTool > m_tauSmearingTool
asg::AnaToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tauTruthMatch
std::vector< asg::AnaToolHandle< TauAnalysisTools::ITauEfficiencyCorrectionsTool > > m_tauTrigEffTool
Class creating a shallow copy of an existing auxiliary container.
bool match(std::string s1, std::string s2)
match the individual directories of two strings
static const SG::Decorator< double > dec_effscalefact("effscalefact")
static const SG::Decorator< char > dec_baseline("baseline")
static const SG::ConstAccessor< char > acc_signal("signal")
static const SG::ConstAccessor< char > acc_baseline("baseline")
static const SG::ConstAccessor< char > acc_passOR("passOR")
static const SG::Decorator< char > dec_signal("signal")
static const SG::Decorator< char > dec_selected("selected")
typename ShallowCopyResult< T >::type ShallowCopyResult_t
Return type of xAOD::shallowCopy.
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.
TauJet_v3 TauJet
Definition of the current "tau version".
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
setBGCode setTAP setLVL2ErrorBits bool
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".