|
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include <boost/algorithm/string.hpp>
23 #ifndef XAOD_STANDALONE // For now metadata is Athena-only
35 return StatusCode::FAILURE;
38 if (
m_isPHYSLITE && taukey.find(
"AnalysisTauJets")==std::string::npos){
39 ATH_MSG_ERROR(
"You are running on PHYSLITE derivation. Please change the Taus container to 'AnalysisTauJets'");
40 return StatusCode::FAILURE;
45 if (containerToBeCopied !=
nullptr) {
46 taus = containerToBeCopied;
52 copy = shallowcopy.first;
53 copyaux = shallowcopy.second;
59 ATH_MSG_DEBUG(
"Not retrieving tau collecton, using existing one provided by user");
63 for (
const auto& tau : *
copy) {
71 return StatusCode::SUCCESS;
86 if (std::abs(
input.eta()) <= 2.5 &&
input.nTracks() > 0) {
100 dec_baseline(
input) =
false;
102 if (acc_baseline(
input)) dec_selected(
input) = 2;
103 else dec_selected(
input) = 0;
107 return StatusCode::SUCCESS;
113 dec_signal(
input) =
false;
115 if ( !acc_baseline(
input) )
return false;
119 if (std::abs(
input.eta()) >= etacut)
return false;
123 dec_signal(
input) =
true;
131 const bool triggerSF,
132 const std::string& trigExpr)
136 if (acc_signal(tau)) {
154 dec_effscalefact(tau) =
sf;
162 const bool triggerSF,
163 const std::string& trigExpr)
169 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool for systematic var. " << systConfig.
name() ); }
172 ret =
tool->applySystematicVariation(systConfig);
173 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " <<
tool->name() <<
" for systematic var. " << systConfig.
name()); }
180 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool back to default"); }
184 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " <<
tool->name() <<
" back to default"); }
187 dec_effscalefact(tau) =
sf;
199 ATH_MSG_WARNING(
"The trigger item requested (" << trigExpr <<
") is not supported! Please check. Setting SF to 1.");
204 std::vector<std::string>
chains;
219 ATH_MSG_ERROR(
"Some problem found to retrieve SF for trigger item requested (" << trigExpr <<
")");
233 if (!acc_passOR.isAvailable(*tau)) {
234 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!");
240 if (acc_signal(*tau) && acc_passOR(*tau)) {
254 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool for systematic var. " << systConfig.
name() ); }
257 ret =
tool->applySystematicVariation(systConfig);
258 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " <<
tool->name() <<
" for systematic var. " << systConfig.
name()); }
265 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool back to default"); }
269 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " <<
tool->name() <<
" back to default"); }
def retrieve(aClass, aKey=None)
double GetTauTriggerEfficiencySF(const xAOD::TauJet &tau, const std::string &trigExpr="tau25_medium1_tracktwo") override final
asg::AnaToolHandle< TauAnalysisTools::ITauSelectionTool > m_tauSelTool
double GetTotalTauSF(const xAOD::TauJetContainer &taus, const bool idSF=true, const bool triggerSF=true, const std::string &trigExpr="tau25_medium1_tracktwo") 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< TauAnalysisTools::ITauSmearingTool > m_tauSmearingTool
Class creating a shallow copy of an existing auxiliary container.
Class to wrap a set of SystematicVariations.
std::string name() const
returns: the systematics joined into a single string.
asg::AnaToolHandle< Trig::IMatchingTool > m_trigMatchingTool
#define ATH_MSG_VERBOSE(x)
std::map< std::string, std::string > m_tau_trig_support
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a tau jet.
asg::AnaToolHandle< TauAnalysisTools::ITauSelectionTool > m_tauSelToolBaseline
bool isData() const override final
asg::AnaToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tauTruthMatch
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::ITauEfficiencyCorrectionsTool > m_tauEffTool
StatusCode FillTau(xAOD::TauJet &input) override final
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
double GetSignalTauSF(const xAOD::TauJet &tau, const bool idSF=true, const bool triggerSF=true, const std::string &trigExpr="tau25_medium1_tracktwo") override final
@ Ok
The correction was done successfully.
#define ATH_MSG_WARNING(x)
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...
CP::SystematicSet m_currentSyst
setBGCode setTAP setLVL2ErrorBits bool
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
StatusCode GetTaus(xAOD::TauJetContainer *©, xAOD::ShallowAuxContainer *©aux, const bool recordSG=true, const std::string &taukey="TauJets", const xAOD::TauJetContainer *containerToBeCopied=nullptr) override final
std::vector< asg::AnaToolHandle< TauAnalysisTools::ITauEfficiencyCorrectionsTool > > m_tauTrigEffTool
bool match(std::string s1, std::string s2)
match the individual directories of two strings
bool IsSignalTau(const xAOD::TauJet &input, const float ptcut, const float etacut) const override final