ATLAS Offline Software
TrigMuonMonitorAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 TrigMuonMonitorAlgorithm :: TrigMuonMonitorAlgorithm(const std::string& name, ISvcLocator* pSvcLocator)
9  : AthMonitorAlgorithm(name, pSvcLocator)
10 {}
11 
12 
15  ATH_CHECK( m_matchTool.retrieve() );
16  ATH_CHECK( m_muonSelectionTool.retrieve() );
17  ATH_CHECK( m_MuonContainerKey.initialize() );
18  return sc;
19 }
20 
21 
23 
24 
25  bool passToMonitor = selectEvents();
26 
27  if(passToMonitor){
28 
31 
33  for(const std::string& chain : m_monitored_chains){
35  }
36 
37 
40  if (! muons.isValid() ) {
41  ATH_MSG_ERROR("evtStore() does not contain muon Collection with name "<< m_MuonContainerKey);
42  return StatusCode::FAILURE;
43  }
44  std::vector<const xAOD::Muon*> probes;
45  ATH_CHECK(selectMuons(muons, probes));
46 
47  for(const xAOD::Muon* mu : probes){
49 
51  for(const std::string& chain : m_monitored_chains){
53  }
54  }
55 
56  }
57 
58 
59 
60  return StatusCode::SUCCESS;
61 }
62 
63 
64 
66  return true;
67 }
68 
69 
70 StatusCode TrigMuonMonitorAlgorithm :: selectMuons(SG::ReadHandle<xAOD::MuonContainer> &muons, std::vector<const xAOD::Muon*> &probes) const {
71  for (const xAOD::Muon* mu : *muons) {
72  if(mu->muonType()<=m_muontype &&
73  (mu->author()==xAOD::Muon::Author::MuidCo || mu->author()==xAOD::Muon::Author::STACO) &&
74  m_muonSelectionTool->getQuality(*mu)<=xAOD::Muon::Medium ){
75  probes.push_back(mu);
76  }
77  }
78  return StatusCode::SUCCESS;
79 }
80 
81 
83  return StatusCode::SUCCESS;
84 }
85 
86 
88  return StatusCode::SUCCESS;
89 }
90 
91 StatusCode TrigMuonMonitorAlgorithm :: fillVariablesPerChain(const EventContext&, const std::string&) const {
92  return StatusCode::SUCCESS;
93 }
94 
95 StatusCode TrigMuonMonitorAlgorithm :: fillVariablesPerOfflineMuonPerChain(const EventContext&, const xAOD::Muon* , const std::string&) const {
96  return StatusCode::SUCCESS;
97 }
TrigMuonMonitorAlgorithm::selectEvents
virtual bool selectEvents() const
Function that defines the event selection for anlayses User should reimlement in a subclass if needed...
Definition: TrigMuonMonitorAlgorithm.cxx:65
TrigMuonMonitorAlgorithm.h
TrigMuonMonitorAlgorithm::m_MuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Definition: TrigMuonMonitorAlgorithm.h:133
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrigMuonMonitorAlgorithm::m_matchTool
ToolHandle< MuonMatchingTool > m_matchTool
Definition: TrigMuonMonitorAlgorithm.h:129
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
TrigMuonMonitorAlgorithm::TrigMuonMonitorAlgorithm
TrigMuonMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigMuonMonitorAlgorithm.cxx:8
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_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigMuonMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
Function that steers anlayses.
Definition: TrigMuonMonitorAlgorithm.cxx:22
TrigMuonMonitorAlgorithm::fillVariables
virtual StatusCode fillVariables(const EventContext &ctx) const
Function that fills variables by just retrieving containers of trigger objects.
Definition: TrigMuonMonitorAlgorithm.cxx:82
TrigMuonMonitorAlgorithm::m_monitored_chains
Gaudi::Property< std::vector< std::string > > m_monitored_chains
List of trigger chains that are monitored in fillVariablesPerChain and fillVariablesPerOfflineMuonPer...
Definition: TrigMuonMonitorAlgorithm.h:137
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigMuonMonitorAlgorithm::selectMuons
virtual StatusCode selectMuons(SG::ReadHandle< xAOD::MuonContainer > &muons, std::vector< const xAOD::Muon * > &probes) const
Function that defines the event selection for anlayses Users should reimlement in a subclass if neede...
Definition: TrigMuonMonitorAlgorithm.cxx:70
TrigMuonMonitorAlgorithm::m_muontype
Gaudi::Property< int > m_muontype
Requirement for the offline muon type considered in analyses.
Definition: TrigMuonMonitorAlgorithm.h:139
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
MuonParameters::MuidCo
@ MuidCo
Definition: MuonParamDefs.h:60
LikeEnum::Medium
@ Medium
Definition: LikelihoodEnums.h:14
TrigMuonMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: TrigMuonMonitorAlgorithm.cxx:13
TrigMuonMonitorAlgorithm::fillVariablesPerOfflineMuonPerChain
virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon *mu, const std::string &chain) const
Function that fills variables of trigger objects associated to specified trigger chains comparing off...
Definition: TrigMuonMonitorAlgorithm.cxx:95
xAOD::STACO
@ STACO
Tracks produced by STACO.
Definition: TrackingPrimitives.h:99
TrigMuonMonitorAlgorithm::fillVariablesPerOfflineMuon
virtual StatusCode fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon *mu) const
Function that fills variables that are compared to offline muons but the trigger chains are not speci...
Definition: TrigMuonMonitorAlgorithm.cxx:87
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
TrigMuonMonitorAlgorithm::m_muonSelectionTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
Definition: TrigMuonMonitorAlgorithm.h:130
TrigMuonMonitorAlgorithm::fillVariablesPerChain
virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const
Function that fills variables of trigger objects associated to specified trigger chains.
Definition: TrigMuonMonitorAlgorithm.cxx:91