30 return StatusCode::SUCCESS;
44 int countPassingVtx = 0;
45 int countPassing_pt05 = 0;
46 int countPassing_pt1 = 0;
47 int countPassing_pt2 = 0;
48 int countPassing_pt4 = 0;
49 int countPassing_pt6 = 0;
50 int countPassing_pt8 = 0;
52 for (
const auto trk : *offlineTrkHandle)
57 and std::abs(trk->d0()) <
m_d0) {
61 const double pt = std::fabs(trk->pt()) * 1e-3;
75 if (pt > leadingTrackPt) leadingTrackPt = pt;
78 ATH_MSG_DEBUG(
"::monitorTrkCounts countPassing = " << countPassing);
79 auto nTrkOffline =
Scalar(
"nTrkOffline", countPassing);
80 auto nTrkOfflineVtx =
Scalar(
"nTrkOfflineVtx", countPassingVtx);
81 auto nTrkOffline_pt05 =
Scalar(
"nTrkOffline_pt05", countPassing_pt05);
82 auto nTrkOffline_pt1 =
Scalar(
"nTrkOffline_pt1", countPassing_pt1);
83 auto nTrkOffline_pt2 =
Scalar(
"nTrkOffline_pt2", countPassing_pt2);
84 auto nTrkOffline_pt4 =
Scalar(
"nTrkOffline_pt4", countPassing_pt4);
85 auto nTrkOffline_pt6 =
Scalar(
"nTrkOffline_pt6", countPassing_pt6);
86 auto nTrkOffline_pt8 =
Scalar(
"nTrkOffline_pt8", countPassing_pt8);
92 auto isL1 = [](
const std::string& name) {
return name.compare(0, 3,
"L1_") == 0; };
93 auto isHLT = [](
const std::string& name) {
return name.compare(0, 4,
"HLT_") == 0; };
107 const unsigned int passBits = trigDecTool->isPassedBits(trig);
108 const bool wasRun = isL1(trig) or (isHLT(trig) and activeHLT(passBits));
111 const auto decision = (isL1(trig) and passedL1(passBits)) or (isHLT(trig) and passedHLT(passBits));
112 ATH_MSG_DEBUG(
"chain " << trig << (decision ?
" passed" :
" failed"));
114 auto effPassed =
Scalar<int>(
"EffPassed", decision);
115 fill(trig +
ref, effPassed, nTrkOffline, nTrkOfflineVtx, nTrkOffline_pt05, nTrkOffline_pt1, nTrkOffline_pt2, nTrkOffline_pt4, nTrkOffline_pt6, nTrkOffline_pt8, leadingTrackPt);
125 auto nTrkOffline =
Scalar(
"nTrkOffline_counts_" + trig, countPassing);
126 fill(
"TrigAll", whichtrigger, nTrkOffline);
130 return StatusCode::SUCCESS;
const boost::regex ref(r_ef)
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
initialize
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< xAOD::TrigCompositeContainer > m_trkCountsKey
HLTMinBiasEffMonitoringAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
initialize
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelectionTool
Gaudi::Property< float > m_minPt
Gaudi::Property< float > m_d0
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_offlineTrkKey
std::vector< std::string > m_uniqueTriggerList
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
SG::ReadHandleKey< xAOD::TrigT2MbtsBitsContainer > m_TrigT2MbtsBitsContainerKey
virtual StatusCode finalize() override
Gaudi::Property< std::vector< std::string > > m_triggerList
virtual ~HLTMinBiasEffMonitoringAlg() override
virtual StatusCode fillHistograms(const EventContext &context) const override
adds event to the monitoring histograms
Gaudi::Property< std::vector< std::string > > m_refTriggerList
Gaudi::Property< float > m_z0
Declare a monitored scalar variable.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
Generic monitoring tool for athena components.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
static const unsigned int L1_isPassedBeforePrescale
static const unsigned int requireDecision
static const unsigned int EF_prescaled
static const unsigned int EF_passedRaw
const xAOD::Vertex * selectPV(SG::ReadHandle< xAOD::VertexContainer > &container)
Finds the Primary Vertex.
double z0wrtPV(const xAOD::TrackParticle *trk, const xAOD::Vertex *vtx)
Provide the trk DCA w.r.t. the PV.
Vertex_v1 Vertex
Define the latest version of the vertex class.