ATLAS Offline Software
Loading...
Searching...
No Matches
MuonFeatureCnvTestAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6
10
11#include <vector>
12#include <iomanip>
13
14MuonFeatureCnvTestAlg::MuonFeatureCnvTestAlg( const std::string& name, ISvcLocator* svcLoc ) :
15 AthAlgorithm(name, svcLoc)
16{
17 declareProperty( "AODMuonFeatureContainerName", m_aodMuonFeatureContainerName = "HLT" );
18 declareProperty( "AODMuonFeatureDetailsContainerName", m_aodMuonFeatureDetailsContainerName = "HLT" );
19 declareProperty( "xAODL2StandAloneMuonContainerName", m_xaodContainerName = "L2StandAloneMuon" );
20}
21
23
24 ATH_MSG_DEBUG( "AODMuonFeatureContainerName = " << m_aodMuonFeatureContainerName);
25 ATH_MSG_DEBUG( "AODMuonFeatureDetailsContainerName = " << m_aodMuonFeatureDetailsContainerName);
26 ATH_MSG_DEBUG( "xAODL2StandAloneMuonContainerName = " << m_xaodContainerName );
27
28 // Return gracefully:
29 return StatusCode::SUCCESS;
30}
31
33
34 // Retrieve MuonFeatureContainer
36 if (!mf) {
37 ATH_MSG_ERROR("No MuonFeatureContainer with key " << m_aodMuonFeatureContainerName << " found.");
38 return StatusCode::RECOVERABLE;
39 }
41 ATH_MSG_DEBUG( "Size of MuonFeatureContainer = " << mf->size() );
42
43 // Retrieve MuonFeatureDetailsContainer
45 if (!mfd) {
46 ATH_MSG_ERROR("No MuonFeatureDetailsContainer with key " << m_aodMuonFeatureDetailsContainerName << " found.");
47 return StatusCode::RECOVERABLE;
48 }
50 ATH_MSG_DEBUG( "Size of MuonFeatureDetailsContainer = " << mfd->size() );
51
52 // Retrieve the xAOD::L2StandAloneMuonContainer
54 if(!xaod) {
55 ATH_MSG_ERROR("No xAOD::L2StandAloneMuonContainer with key " << m_xaodContainerName << " found.");
56 return StatusCode::RECOVERABLE;
57 }
58 ATH_MSG_DEBUG("Retrieved " << m_xaodContainerName);
59 ATH_MSG_DEBUG( "Size of xAOD::L2StandAloneMuonContainer = " << xaod->size() );
60
63 int counter = 0;
64 for (; muonSA_it!= muonSA_end; ++muonSA_it) {
65 ATH_MSG_DEBUG( "Check xAOD L2StandAloneMuonContainer pt of " << counter << "-th track is " << (*muonSA_it)->pt() );
66 counter++;
67 }
68
69 return StatusCode::SUCCESS;
70}//execute
71
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
std::string m_xaodContainerName
The key for the xAOD::L2StandAloneMuonContainer.
MuonFeatureCnvTestAlg(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
std::string m_aodMuonFeatureContainerName
The key of the MuonFeatureContainer and MuonFeatureDetailsContainer.
std::string m_aodMuonFeatureDetailsContainerName
virtual StatusCode execute()
Function executing the algorithm.
virtual StatusCode initialize()
Function initialising the algorithm.
L2StandAloneMuonContainer_v2 L2StandAloneMuonContainer
Define the latest version of the muon SA container.