ATLAS Offline Software
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 
14 MuonFeatureCnvTestAlg::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 
MuonFeatureCnvTestAlg::m_xaodContainerName
std::string m_xaodContainerName
The key for the xAOD::L2StandAloneMuonContainer.
Definition: MuonFeatureCnvTestAlg.h:45
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MuonFeatureCnvTestAlg::MuonFeatureCnvTestAlg
MuonFeatureCnvTestAlg(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
Definition: MuonFeatureCnvTestAlg.cxx:14
L2StandAloneMuonContainer.h
MuonFeatureDetailsContainer.h
DQPostProcessTest.mf
mf
Definition: DQPostProcessTest.py:19
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonFeatureContainer
Definition: MuonFeatureContainer.h:16
MuonFeatureCnvTestAlg::m_aodMuonFeatureContainerName
std::string m_aodMuonFeatureContainerName
The key of the MuonFeatureContainer and MuonFeatureDetailsContainer.
Definition: MuonFeatureCnvTestAlg.h:42
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgorithm
Definition: AthAlgorithm.h:47
MuonFeatureContainer.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonFeatureCnvTestAlg.h
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
MuonFeatureCnvTestAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: MuonFeatureCnvTestAlg.cxx:22
test_pyathena.counter
counter
Definition: test_pyathena.py:15
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
MuonFeatureCnvTestAlg::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: MuonFeatureCnvTestAlg.cxx:32
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
MuonFeatureDetailsContainer
Definition: MuonFeatureDetailsContainer.h:12
MuonFeatureCnvTestAlg::m_aodMuonFeatureDetailsContainerName
std::string m_aodMuonFeatureDetailsContainerName
Definition: MuonFeatureCnvTestAlg.h:43