 |
ATLAS Offline Software
|
Go to the documentation of this file.
25 return StatusCode::SUCCESS;
34 if (!tauJetsReadHandle.
isValid()) {
35 ATH_MSG_ERROR (
"Could not retrieve TauJetContainer with key " << tauJetsReadHandle.
key());
36 return StatusCode::FAILURE;
43 std::vector<SG::WriteDecorHandle<xAOD::TauJetContainer, float> > scoreDecors;
46 scoreDecors.emplace_back (
k, ctx);
48 std::vector<SG::WriteDecorHandle<xAOD::TauJetContainer, char> > WPDecors;
51 WPDecors.emplace_back (
k, ctx);
56 for (
const auto tau : *tauContainer) {
57 float tauTrackBasedWidth = 0.;
59 std::vector<const xAOD::TauTrack *> tauTracks = tau->tracks();
61 tauTracks.push_back(trk);
63 double sumWeightedDR = 0.;
71 tauTrackBasedWidth = sumWeightedDR / ptSum;
74 dec_trackWidth(*tau) = tauTrackBasedWidth;
80 for (
auto tau : *shallowCopy.first) {
85 float absEtaLead = -1111.;
86 if(tau->nTracks() > 0) {
88 absEtaLead = std::abs(
track->eta() );
90 acc_absEtaLead(*tau) = absEtaLead;
99 const xAOD::TauJet* xTau = tauContainer->at(tau->index());
102 dec(*xTau) = scoreAcc(*tau);
106 dec(*xTau) = WPAcc(*tau);
110 delete shallowCopy.first;
111 delete shallowCopy.second;
115 if (!muonReadHandle.
isValid()) {
116 ATH_MSG_DEBUG (
"Could not retrieve MuonContainer with key " << muonReadHandle.
key() <<
" so won't add TAT MuonOLR flag");
117 return StatusCode::SUCCESS;
121 for (
const auto tau : *tauContainer) {
122 bool bTauMuonOLR =
true;
124 if(
muon->pt() < 2000.)
continue;
125 if(
muon->muonType() == xAOD::Muon::CaloTagged)
continue;
126 if(
muon->p4().DeltaR( tau->p4() ) > 0.2 )
continue;
130 dec_passTATTauMuonOLR(*tau) = bTauMuonOLR;
133 return StatusCode::SUCCESS;
xAOD::MuonContainer * muonContainer
SG::WriteDecorHandleKeyArray< xAOD::TauJetContainer > m_WPDecorKeys
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
virtual StatusCode addBranches(const EventContext &ctx) const override final
const_pointer_type cptr()
Dereference the pointer.
ToolHandleArray< TauRecToolBase > m_tauIDTools
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_passTATTauMuonOLRKey
Gaudi::Property< bool > m_doEvetoWP
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Class describing a tau jet.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauContainerKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
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.
SG::WriteDecorHandleKeyArray< xAOD::TauJetContainer > m_scoreDecorKeys
Class describing a TrackParticle.
Handle class for reading from StoreGate.
virtual StatusCode initialize() override final
Helper class to provide type-safe access to aux data.
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContainerKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_trackWidthKey
double deltaR(double eta1, double eta2, double phi1, double phi2)