ATLAS Offline Software
TrigMuonMonitorAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGMUONMONITORING_TRIGMUONMONITORALGORITHM_H
6 #define TRIGMUONMONITORING_TRIGMUONMONITORALGORITHM_H
7 
12 #include "MuonMatchingTool.h"
13 
14 
23 
24  public:
25  TrigMuonMonitorAlgorithm(const std::string& name, ISvcLocator* pSvcLocator );
26 
27 
28  virtual StatusCode initialize() override;
29 
37  virtual StatusCode fillHistograms(const EventContext &ctx) const override;
38 
39  protected:
40 
46  virtual bool selectEvents() const;
47 
54  virtual StatusCode selectMuons(SG::ReadHandle<xAOD::MuonContainer> &muons, std::vector<const xAOD::Muon*> &probes) const;
55 
62  virtual StatusCode fillVariables(const EventContext &ctx) const;
63 
72  virtual StatusCode fillVariablesPerOfflineMuon(const EventContext &ctx, const xAOD::Muon* mu) const;
73 
82  virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const;
83 
93  virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const;
94 
95 
105  template <class T, class FUNCT>
106  StatusCode fillVariablesRatioPlots(const EventContext &ctx, const xAOD::Muon* mu,
107  std::string &&trigstep,
108  xAOD::Muon::TrackParticleType type,
109  FUNCT matchFunc) const;
110 
119  template<class T>
120  StatusCode fillVariableEtaPhi(const EventContext &ctx,
121  SG::ReadHandleKey<DataVector<T> > ReadHandleKey,
122  std::string &&trigstep,
123  std::tuple<bool,double,double> (*PosFunc)(const T*) = &TrigMuonMonitorAlgorithm::defaultPosFunc<T>) const;
124 
125  template<class T> static inline std::tuple<bool, double, double> defaultPosFunc(const T* trig);
126 
127 
128  // ToolHandle
129  ToolHandle<MuonMatchingTool> m_matchTool {this, "MuonMatchingTool", "MuonMatchingTool", "Tool for matching offline and online objects"};
130  ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool{this,"MuonSelectionTool","CP::MuonSelectionTool/MuonSelectionTool","MuonSelectionTool"};
131 
132  // ReadHandles
133  SG::ReadHandleKey<xAOD::MuonContainer> m_MuonContainerKey {this, "MuonContainerName", "Muons", "Offline muon container"};
134 
135  // Properties
137  Gaudi::Property<std::vector<std::string> > m_monitored_chains {this, "MonitoredChains", {}, "Trigger chains that are monitored"};
139  Gaudi::Property<int> m_muontype {this, "MuonType", xAOD::Muon::MuonType::Combined, "MuonType used for monitoring"};
141  Gaudi::Property<std::string> m_group {this, "Group", "", "Histogram group"};
142 
145 
146 };
147 
149 
150 #endif //TRIGMUONMONITORING_TRIGMUONMONITORALGORITHM_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
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::m_MuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Definition: TrigMuonMonitorAlgorithm.h:133
TrigMuonMonitorAlgorithm::m_group
Gaudi::Property< std::string > m_group
Name of monitored group.
Definition: TrigMuonMonitorAlgorithm.h:141
TrigMuonMonitorAlgorithm::fillVariablesRatioPlots
StatusCode fillVariablesRatioPlots(const EventContext &ctx, const xAOD::Muon *mu, std::string &&trigstep, xAOD::Muon::TrackParticleType type, FUNCT matchFunc) const
Function that fills variables of ratio plots.
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
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
IMuonSelectionTool.h
TrigMuonMonitorAlgorithm::defaultPosFunc
static std::tuple< bool, double, double > defaultPosFunc(const T *trig)
TrigMuonMonitorAlgorithm::TrigMuonMonitorAlgorithm
TrigMuonMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigMuonMonitorAlgorithm.cxx:8
MuonMatchingTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMonitorAlgorithm.h
TrigMuonMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
Function that steers anlayses.
Definition: TrigMuonMonitorAlgorithm.cxx:22
TrigMuonMonitorAlgorithm
Base class from which analyzers can define a derived class to do specific analysis.
Definition: TrigMuonMonitorAlgorithm.h:22
TrigMuonMonitorAlgorithm.icc
DataVector< T >
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
Trk::Combined
@ Combined
Definition: TrackSummaryTool.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonContainer.h
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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
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
TrigMuonMonitorAlgorithm::fillVariableEtaPhi
StatusCode fillVariableEtaPhi(const EventContext &ctx, SG::ReadHandleKey< DataVector< T > > ReadHandleKey, std::string &&trigstep, std::tuple< bool, double, double >(*PosFunc)(const T *)=&TrigMuonMonitorAlgorithm::defaultPosFunc< T >) const
Function that fills variables of etaphi2D plots.
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
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TrigMuonMonitorAlgorithm::m_ratio_measurement_threshold
const float m_ratio_measurement_threshold
Threshold for ratio measurement.
Definition: TrigMuonMonitorAlgorithm.h:144