ATLAS Offline Software
Loading...
Searching...
No Matches
DRAW_ZMUMU_SkimmingTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// DRAW_ZMUMUSkimmingTool.cxx
8// Author: James Catmore (James.Catmore@cern.ch)
9// This tool implements the "good muon" event selection required
10// by the DRAW_ZMUMU format, avoiding the use of decorators on the
11// muons. Inherits from derivation framework components.
12
14#include <vector>
15#include <string>
16
17// Constructor
19 const std::string& n,
20 const IInterface* p ) :
21 AthAlgTool(t,n,p) {
22 declareInterface<DerivationFramework::ISkimmingTool>(this);
23
24 }
25
26// Destructor
28// Athena initialize and finalize
30{
31 ATH_MSG_VERBOSE("initialize() ...");
32 ATH_CHECK(m_muonSGKey.initialize());
33 return StatusCode::SUCCESS;
34}
36{
37 ATH_MSG_VERBOSE("finalize() ...");
38 ATH_MSG_INFO("Processed "<< m_ntot <<" events, "<< m_npass<<" events passed filter ");
39 return StatusCode::SUCCESS;
40}
41
42// The filter itself
44{
45 ++m_ntot;
47 // Loop over muons, count up and set decision
48 unsigned int nGoodMu(0);
49 for (const xAOD::Muon* muItr : *muons) {
50 nGoodMu += muItr->pt() > m_muonPtCut && m_muonSelectionTool->accept(*muItr);
51 }
52 bool acceptEvent{false};
53 if (nGoodMu >= m_nMuons) {
54 acceptEvent = true;
55 ++m_npass;
56 }
57 return acceptEvent;
58}
59
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
SG::ReadHandleKey< xAOD::MuonContainer > m_muonSGKey
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
bool eventPassesFilter() const override
Check that the current event passes this filter.
DRAW_ZMUMUSkimmingTool(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Muon_v1 Muon
Reference the current persistent version: