34 return StatusCode::SUCCESS;
77 int total_leptons = 0;
82 total_charge += el->charge();
90 total_charge += mu->charge();
98 total_charge += tau->charge();
108 total_charge += el->charge();
116 total_charge += mu->charge();
124 total_charge += tau->charge();
132 if (total_leptons != 2 ) {
133 ATH_MSG_ERROR(
"Exactly two leptons are required to check whether the event is OS or SS!");
134 return StatusCode::FAILURE;
138 bool decision =
m_OSmode ? total_charge == 0 : std::abs(total_charge) == 2;
141 return StatusCode::SUCCESS;
CP::SysReadSelectionHandle m_tauSelection
the tau-jet selection handle
CP::SysReadSelectionHandle m_electronTruthSelection
the truth electron selection handle
CP::SysReadSelectionHandle m_muonTruthSelection
the truth muon selection handle
CP::SysReadSelectionHandle m_preselection
the preselection
CP::SysReadSelectionHandle m_tauTruthSelection
the truth muon selection handle
CP::SysReadHandle< xAOD::ElectronContainer > m_electronsHandle
the electron input handle
CP::SysReadHandle< xAOD::TruthParticleContainer > m_electronsTruthHandle
the truth electron input handle
virtual StatusCode execute() override
CP::SysWriteSelectionHandle m_decoration
the output decoration handle
virtual StatusCode initialize() override
CP::SysReadHandle< xAOD::MuonContainer > m_muonsHandle
the muon input handle
CP::SysReadHandle< xAOD::TruthParticleContainer > m_tausTruthHandle
the truth tau input handle
ChargeSelectorAlg(const std::string &name, ISvcLocator *pSvcLocator)
the standard constructor
CP::SysReadHandle< xAOD::TruthParticleContainer > m_muonsTruthHandle
the truth muon input handle
CP::SysReadHandle< xAOD::TauJetContainer > m_tausHandle
the tau-jet input handle
CP::SysListHandle m_systematicsList
the systematics list
Gaudi::Property< bool > m_OSmode
whether or not to select 2 opposite-sign leptons
CP::SysReadSelectionHandle m_electronSelection
the electron selection handle
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the event info handle
CP::SysReadSelectionHandle m_muonSelection
the muon selection handle
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Select isolated Photons, Electrons and Muons.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
TauJet_v3 TauJet
Definition of the current "tau version".
TruthParticle_v1 TruthParticle
Typedef to implementation.
Muon_v1 Muon
Reference the current persistent version:
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Electron_v1 Electron
Definition of the current "egamma version".