 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include <string_view>
24 #ifndef XAOD_STANDALONE // For now metadata is Athena-only
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;
54 copyaux = shallowcopy.second;
60 ATH_MSG_DEBUG(
"Not retrieving tau collecton, using existing one provided by user");
64 for (
const auto tau : *
copy) {
72 return StatusCode::SUCCESS;
79 ATH_MSG_VERBOSE(
"Starting FillTau on tau with pT = " << input.pt()/1000 <<
" GeV" );
80 ATH_MSG_VERBOSE(
"TAU pT before smearing " << input.pt()/1000 <<
" GeV");
87 if (std::abs(input.eta()) <= 2.5 && input.nTracks() > 0) {
101 dec_baseline(input) =
false;
103 if (acc_baseline(input)) dec_selected(input) = 2;
104 else dec_selected(input) = 0;
106 if (acc_baseline(input))
ATH_MSG_VERBOSE(
"FillTau: passed baseline selection");
108 return StatusCode::SUCCESS;
114 dec_signal(input) =
false;
116 if ( !acc_baseline(input) )
return false;
118 if (input.pt() <=
ptcut)
return false;
120 if (std::abs(input.eta()) >= etacut)
return false;
124 dec_signal(input) =
true;
132 const bool triggerSF,
133 const std::string& trigExpr)
137 if (acc_signal(tau)) {
155 dec_effscalefact(tau) =
sf;
163 const bool triggerSF,
164 const std::string& trigExpr)
170 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool for systematic var. " << systConfig.
name() ); }
173 ret =
tool->applySystematicVariation(systConfig);
174 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " <<
tool->name() <<
" for systematic var. " << systConfig.
name()); }
181 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool back to default"); }
185 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " <<
tool->name() <<
" back to default"); }
188 dec_effscalefact(tau) =
sf;
200 ATH_MSG_WARNING(
"The trigger item requested (" << trigExpr <<
") is not supported! Please check. Setting SF to 1.");
205 std::vector<std::string>
chains;
220 ATH_MSG_ERROR(
"Some problem found to retrieve SF for trigger item requested (" << trigExpr <<
")");
234 if (!acc_passOR.isAvailable(*tau)) {
235 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!");
241 if (acc_signal(*tau) && acc_passOR(*tau)) {
255 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool for systematic var. " << systConfig.
name() ); }
258 ret =
tool->applySystematicVariation(systConfig);
259 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure " <<
tool->name() <<
" for systematic var. " << systConfig.
name()); }
266 if (ret != StatusCode::SUCCESS) {
ATH_MSG_ERROR(
"Cannot configure TauEfficiencyCorrectionsTool back to default"); }
270 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