|  | 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) = std::move(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
Scalar phi() const
phi method
SG::WriteDecorHandleKey< xAOD::JetContainer > m_hitAssociationKey
JetHitAssociationAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize() override
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
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
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.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
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