ATLAS Offline Software
Loading...
Searching...
No Matches
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
8TrigMuonMonitorAlgorithm :: TrigMuonMonitorAlgorithm(const std::string& name, ISvcLocator* pSvcLocator)
9 : AthMonitorAlgorithm(name, pSvcLocator)
10{}
11
12
13StatusCode TrigMuonMonitorAlgorithm :: initialize(){
15 ATH_CHECK( m_matchTool.retrieve() );
16 ATH_CHECK( m_muonSelectionTool.retrieve() );
17 ATH_CHECK( m_MuonContainerKey.initialize() );
18 return sc;
19}
20
21
22StatusCode TrigMuonMonitorAlgorithm :: fillHistograms(const EventContext& ctx) const {
23
24
25 bool passToMonitor = selectEvents();
26
27 if(passToMonitor){
28
31
33 for(const std::string& chain : m_monitored_chains){
34 ATH_CHECK( fillVariablesPerChain(ctx, chain) );
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
65bool TrigMuonMonitorAlgorithm :: selectEvents() const {
66 return true;
67}
68
69
70StatusCode 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
82StatusCode TrigMuonMonitorAlgorithm :: fillVariables(const EventContext& ) const {
83 return StatusCode::SUCCESS;
84}
85
86
87StatusCode TrigMuonMonitorAlgorithm :: fillVariablesPerOfflineMuon(const EventContext&, const xAOD::Muon* ) const {
88 return StatusCode::SUCCESS;
89}
90
91StatusCode TrigMuonMonitorAlgorithm :: fillVariablesPerChain(const EventContext&, const std::string&) const {
92 return StatusCode::SUCCESS;
93}
94
95StatusCode TrigMuonMonitorAlgorithm :: fillVariablesPerOfflineMuonPerChain(const EventContext&, const xAOD::Muon* , const std::string&) const {
96 return StatusCode::SUCCESS;
97}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
static Double_t sc
virtual StatusCode initialize() override
initialize
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
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...
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
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...
Gaudi::Property< std::vector< std::string > > m_monitored_chains
List of trigger chains that are monitored in fillVariablesPerChain and fillVariablesPerOfflineMuonPer...
virtual StatusCode fillVariables(const EventContext &ctx) const
Function that fills variables by just retrieving containers of trigger objects.
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...
Gaudi::Property< int > m_muontype
Requirement for the offline muon type considered in analyses.
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
virtual bool selectEvents() const
Function that defines the event selection for anlayses User should reimlement in a subclass if needed...
ToolHandle< MuonMatchingTool > m_matchTool
virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const
Function that fills variables of trigger objects associated to specified trigger chains.
Muon_v1 Muon
Reference the current persistent version: