|
ATLAS Offline Software
|
Go to the documentation of this file.
39 return StatusCode::SUCCESS;
48 if ( !jetReadHandle.
isValid() ) {
50 return StatusCode::FAILURE;
53 std::vector<const xAOD::Jet*>
jets;
54 jets.reserve( jetReadHandle->
size() );
64 std::vector<std::pair<float, const xAOD::TrackMeasurementValidation*>> hitCoord;
66 for (
const auto* hit : *HitsXRelToBeamspot) {
67 auto localX = HitsXRelToBeamspot(*hit);
68 auto localY = HitsYRelToBeamspot(*hit);
69 float phi = std::atan2(localY, localX);
70 hitCoord.emplace_back(phi,hit);
78 std::vector<std::pair<float, const xAOD::TrackMeasurementValidation*>> closeHits;
79 std::vector<ElementLink<xAOD::TrackMeasurementValidationContainer> > vectorEL;
80 double jetPhi =
jet->phi();
83 for (
const auto& [hitPhi, hit]: hitCoord) {
84 float dPhi = std::abs(jetPhi-hitPhi);
88 closeHits.emplace_back(
dPhi, hit);
93 std::sort(closeHits.begin(), closeHits.end(),[](
const auto&
p1,
const auto&
p2) { return p1 < p2; });
96 for (
const auto& [phi, hit]: closeHits) {
101 hitAssociation(*
jet) = vectorEL;
104 return StatusCode::SUCCESS;
109 return StatusCode::SUCCESS;
virtual StatusCode execute(const EventContext &) const override
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_inputPixHitCollectionKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetCollectionKey
This file contains "getter" functions used for accessing tagger inputs from the EDM.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_hitAssociationKey
JetHitAssociationAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize() override
SG::ReadDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_HitsYRelToBeamspotKey
An algorithm that can be simultaneously executed in multiple threads.
Handle class for reading a decoration on an object.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< int > m_maxHits
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
Handle class for reading a decoration on an object.
Gaudi::Property< float > m_dPhiHitToJet
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode initialize() override
SG::ReadDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_HitsXRelToBeamspotKey