ATLAS Offline Software
Loading...
Searching...
No Matches
Lepton.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// contact: jmaurer@cern.ch
6
7#ifndef TRIGGLOBALEFFICIENCYCORRECTION_LEPTON_H
8#define TRIGGLOBALEFFICIENCYCORRECTION_LEPTON_H 1
9
10#include "xAODEgamma/Electron.h"
11#include "xAODEgamma/Photon.h"
12#include "xAODMuon/Muon.h"
13
14namespace TrigGlobEffCorr {
15
16class Lepton {
17 public:
18 Lepton(const xAOD::IParticle* ptr, std::size_t tag = 0)
19 : m_obj(ptr), m_tag(tag) {}
20 Lepton(const xAOD::Electron* ptr, std::size_t tag = 0)
21 : m_obj(ptr), m_tag(tag) {}
22 Lepton(const xAOD::Photon* ptr, std::size_t tag = 0)
23 : m_obj(ptr), m_tag(tag) {}
24 Lepton(const Lepton&) = default;
25 Lepton& operator=(const Lepton&) = default;
26 Lepton(Lepton&&) = default;
27 Lepton& operator=(Lepton&&) = default;
28 float pt() const { return m_obj->pt(); }
29 xAOD::Type::ObjectType type() const { return m_obj->type(); }
30 std::size_t tag() const { return m_tag; }
31 const xAOD::Electron* electron() const {
32 return static_cast<const xAOD::Electron*>(m_obj);
33 }
34 const xAOD::Muon* muon() const {
35 return static_cast<const xAOD::Muon*>(m_obj);
36 }
37 const xAOD::Photon* photon() const {
38 return static_cast<const xAOD::Photon*>(m_obj);
39 }
40 const xAOD::IParticle* particle() const { return m_obj; }
41 bool operator<(const Lepton& rhs) const { return m_obj < rhs.m_obj; }
42
43 protected:
44 const xAOD::IParticle* m_obj = nullptr;
45 std::size_t m_tag = 0; // 0 = no tag
46};
47
48} // namespace TrigGlobEffCorr
49
50#endif
bool operator<(const Lepton &rhs) const
Definition Lepton.h:41
Lepton & operator=(const Lepton &)=default
const xAOD::Muon * muon() const
Definition Lepton.h:34
const xAOD::IParticle * m_obj
Definition Lepton.h:44
Lepton(const Lepton &)=default
Lepton(const xAOD::Electron *ptr, std::size_t tag=0)
Definition Lepton.h:20
Lepton(Lepton &&)=default
Lepton & operator=(Lepton &&)=default
Lepton(const xAOD::Photon *ptr, std::size_t tag=0)
Definition Lepton.h:22
std::size_t tag() const
Definition Lepton.h:30
float pt() const
Definition Lepton.h:28
const xAOD::IParticle * particle() const
Definition Lepton.h:40
std::size_t m_tag
Definition Lepton.h:45
Lepton(const xAOD::IParticle *ptr, std::size_t tag=0)
Definition Lepton.h:18
const xAOD::Electron * electron() const
Definition Lepton.h:31
const xAOD::Photon * photon() const
Definition Lepton.h:37
xAOD::Type::ObjectType type() const
Definition Lepton.h:29
Class providing the definition of the 4-vector interface.
the template specializations below must be enclosed in this namespace
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32
Muon_v1 Muon
Reference the current persistent version:
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".