ATLAS Offline Software
DQTGlobalWZFinderAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ********************************************************************
6 //
7 // NAME: DQTGlobalWZFinderAlg.h
8 // PACKAGE: DataQualityTools
9 //
10 // AUTHORS: Jahred Adelman (jahred.adelman@cern.ch)
11 // Simon Viel (svielcern.ch)
12 // Koos van Nieuwkoop (jvannieu@cern.ch)
13 // Samuel Alibocus (salibocu@cern.ch)
14 //
15 // ********************************************************************
16 #ifndef DQTGlobalWZFinderAlg_H
17 #define DQTGlobalWZFinderAlg_H
18 
19 #include "GaudiKernel/ToolHandle.h"
21 
25 #include "xAODMuon/MuonContainer.h"
29 
32 
33 #include "xAODTruth/TruthEvent.h"
36 
38 
40 {
41 
42  public:
43 
44  DQTGlobalWZFinderAlg(const std::string& name, ISvcLocator* pSvcLocator );
45 
46  virtual ~DQTGlobalWZFinderAlg() = default;
47 
48  virtual StatusCode initialize() override;
49 
50  virtual StatusCode fillHistograms(const EventContext& ctx) const override;
51 
52 private:
53 
54  Gaudi::Property<float_t> m_electronEtCut {this, "electronEtCut", 27};
55  Gaudi::Property<float_t> m_muonPtCut {this, "muonPtCut", 27};
56  Gaudi::Property<float_t> m_zCutLow {this, "zCutLow", 66.0};
57  Gaudi::Property<float_t> m_zCutHigh {this, "zCutHigh", 116.0};
58  Gaudi::Property<float_t> m_muonMaxEta {this, "muonMaxEta", 2.4};
59 
60  Gaudi::Property<std::vector<std::string>> m_Z_ee_trigger {this, "Z_ee_trigger", {"HLT_e26_lhtight_ivarloose_L1EM22VHI", "HLT_e60_lhmedium_L1EM22VHI"}};
61  Gaudi::Property<std::vector<std::string>> m_Z_mm_trigger {this, "Z_mm_trigger", {"HLT_mu24_ivarmedium_L1MU14FCH", "HLT_mu50_L1MU14FCH"}};
62 
63  BooleanProperty m_doRunBeam{this, "doRunBeam", true};
64  BooleanProperty m_doTrigger{this, "doTrigger", false};
65  BooleanProperty m_do_BCID{this, "do_BCID", false};
66 
67  bool kinematicCuts(const xAOD::Egamma* particle) const;
68  bool goodElectrons(const xAOD::Electron* electron_itr, const xAOD::Vertex* pVtx, const EventContext& ctx) const;
69  bool antiGoodElectrons(const xAOD::Electron* electron_itr, const xAOD::Vertex* pVtx, const EventContext& ctx) const;
70  void fillEleEffHistos(bool tag_good, bool probe_good, bool probe_anti_good, bool os, double el_mass) const;
71 
72  void doEleTriggerTP(const xAOD::Electron* el1, const xAOD::Electron* el2, const EventContext& ctx, bool writeTTrees, const float evtWeight, bool osel, bool ssel) const;
73  void doEleTP(const xAOD::Electron* leadingAllEle, const xAOD::Electron* subleadingAllEle, const xAOD::Vertex* pVtx, const EventContext& ctx, bool writeTTrees, bool isSimulation, const float evtWeight) const;
74  void doEleContainerTP(std::vector<const xAOD::Electron*>& allElectrons, std::vector<const xAOD::Electron*>& goodelectrons, const EventContext& ctx) const;
75 
76  void doMuonTriggerTP(const xAOD::Muon* mu1, const xAOD::Muon* mu2, const EventContext& ctx, bool isSimulation, bool writeTTrees, const float evtWeight) const;
77  void doMuonTruthEff(std::vector<const xAOD::Muon*>& goodmuonsZ, const EventContext& ctx) const;
78  void doMuonLooseTP(std::vector<const xAOD::Muon*>& goodmuonsZ, const xAOD::Vertex* pVtx, const EventContext& ctx, bool isSimulation, bool writeTTrees, const float evtWeight) const;
79  void doMuonInDetTP(std::vector<const xAOD::Muon*>& goodmuonsZ, const xAOD::Vertex* pVtx, const EventContext& ctx, bool isSimulation, bool writeTTrees, const float evtWeight) const;
80 
81  bool checkTruthElectron(const xAOD::Electron* electron) const;
82  bool checkTruthMuon(const xAOD::Muon* muon) const;
83  bool checkTruthTrack(const xAOD::TrackParticle* trk) const;
84 
85  ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool{this,"MuonSelectionTool","CP::MuonSelectionTool/MuonSelectionTool","MuonSelectionTool"};
86  ToolHandle<Trig::R3MatchingTool> m_r3MatchingTool{this, "R3MatchingTool", "Trig::R3MatchingTool", "R3MatchingTool"};
87 
88  ToolHandle<IMCTruthClassifier> m_truthClassifier{this, "MCTruthClassifier", "MCTruthClassifier/MCTruthClassifier", "MCTruthClassifier"};
89 
91  { this, "ElectronContainerName", "Electrons", "" };
93  { this, "MuonContainerName", "Muons", "" };
95  { this, "PhotonContainerName", "Photons", ""};
97  { this, "PrimaryVertexContainerName", "PrimaryVertices" };
99  {this, "TruthParticleContainerName", "TruthParticles", "" };
101  {this, "MuonInDetTrackParticleContainerName", "InDetTrackParticles", ""};
103  {this, "MuonExtrapolatedTrackParticleContainerName", "ExtrapolatedMuonTrackParticles", ""};
104 
106  {this, "IsoMuonVariableNames", {"Muons.ptcone20"}, "Isolation decoration for muon container"};
108  {this, "IsoElectronVariableNames", {"Electrons.ptcone20"}, "Isolation decoration for electron container"};
109 };
110 #endif
DQTGlobalWZFinderAlg::doMuonTruthEff
void doMuonTruthEff(std::vector< const xAOD::Muon * > &goodmuonsZ, const EventContext &ctx) const
Definition: DQTGlobalWZFinderAlg.cxx:893
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
DQTGlobalWZFinderAlg::m_MuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Definition: DQTGlobalWZFinderAlg.h:93
DQTGlobalWZFinderAlg::fillEleEffHistos
void fillEleEffHistos(bool tag_good, bool probe_good, bool probe_anti_good, bool os, double el_mass) const
Definition: DQTGlobalWZFinderAlg.cxx:1208
DQTGlobalWZFinderAlg::doMuonLooseTP
void doMuonLooseTP(std::vector< const xAOD::Muon * > &goodmuonsZ, const xAOD::Vertex *pVtx, const EventContext &ctx, bool isSimulation, bool writeTTrees, const float evtWeight) const
Definition: DQTGlobalWZFinderAlg.cxx:920
DQTGlobalWZFinderAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: DQTGlobalWZFinderAlg.cxx:68
DQTGlobalWZFinderAlg::m_zCutLow
Gaudi::Property< float_t > m_zCutLow
Definition: DQTGlobalWZFinderAlg.h:56
DQTGlobalWZFinderAlg::m_Z_mm_trigger
Gaudi::Property< std::vector< std::string > > m_Z_mm_trigger
Definition: DQTGlobalWZFinderAlg.h:61
TruthParticleContainer.h
DQTGlobalWZFinderAlg::doMuonTriggerTP
void doMuonTriggerTP(const xAOD::Muon *mu1, const xAOD::Muon *mu2, const EventContext &ctx, bool isSimulation, bool writeTTrees, const float evtWeight) const
Definition: DQTGlobalWZFinderAlg.cxx:791
DQTGlobalWZFinderAlg::checkTruthElectron
bool checkTruthElectron(const xAOD::Electron *electron) const
Definition: DQTGlobalWZFinderAlg.cxx:1126
DQTGlobalWZFinderAlg::m_Z_ee_trigger
Gaudi::Property< std::vector< std::string > > m_Z_ee_trigger
Definition: DQTGlobalWZFinderAlg.h:60
DQTGlobalWZFinderAlg::kinematicCuts
bool kinematicCuts(const xAOD::Egamma *particle) const
Definition: DQTGlobalWZFinderAlg.cxx:657
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
DQTGlobalWZFinderAlg::initialize
virtual StatusCode initialize() override
initialize
Definition: DQTGlobalWZFinderAlg.cxx:45
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
DQTGlobalWZFinderAlg::m_electronEtCut
Gaudi::Property< float_t > m_electronEtCut
Definition: DQTGlobalWZFinderAlg.h:54
SG::ReadHandleKey< xAOD::ElectronContainer >
DQTGlobalWZFinderAlg::m_doRunBeam
BooleanProperty m_doRunBeam
Definition: DQTGlobalWZFinderAlg.h:63
DQTGlobalWZFinderAlg::m_isoMuonContainerKey
SG::ReadDecorHandleKeyArray< xAOD::MuonContainer > m_isoMuonContainerKey
Definition: DQTGlobalWZFinderAlg.h:106
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
DQTGlobalWZFinderAlg::~DQTGlobalWZFinderAlg
virtual ~DQTGlobalWZFinderAlg()=default
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
IMuonSelectionTool.h
DQTGlobalWZFinderAlg::m_do_BCID
BooleanProperty m_do_BCID
Definition: DQTGlobalWZFinderAlg.h:65
DQTGlobalWZFinderAlg::doEleTP
void doEleTP(const xAOD::Electron *leadingAllEle, const xAOD::Electron *subleadingAllEle, const xAOD::Vertex *pVtx, const EventContext &ctx, bool writeTTrees, bool isSimulation, const float evtWeight) const
Definition: DQTGlobalWZFinderAlg.cxx:466
DQTGlobalWZFinderAlg::m_TruthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_TruthParticleContainerKey
Definition: DQTGlobalWZFinderAlg.h:99
DQTGlobalWZFinderAlg::checkTruthMuon
bool checkTruthMuon(const xAOD::Muon *muon) const
Definition: DQTGlobalWZFinderAlg.cxx:1151
DQTGlobalWZFinderAlg::doMuonInDetTP
void doMuonInDetTP(std::vector< const xAOD::Muon * > &goodmuonsZ, const xAOD::Vertex *pVtx, const EventContext &ctx, bool isSimulation, bool writeTTrees, const float evtWeight) const
Definition: DQTGlobalWZFinderAlg.cxx:1024
IMCTruthClassifier.h
DQTGlobalWZFinderAlg::m_truthClassifier
ToolHandle< IMCTruthClassifier > m_truthClassifier
Definition: DQTGlobalWZFinderAlg.h:88
ElectronContainer.h
DQTGlobalWZFinderAlg::antiGoodElectrons
bool antiGoodElectrons(const xAOD::Electron *electron_itr, const xAOD::Vertex *pVtx, const EventContext &ctx) const
Definition: DQTGlobalWZFinderAlg.cxx:729
DQTGlobalWZFinderAlg::doEleContainerTP
void doEleContainerTP(std::vector< const xAOD::Electron * > &allElectrons, std::vector< const xAOD::Electron * > &goodelectrons, const EventContext &ctx) const
Definition: DQTGlobalWZFinderAlg.cxx:588
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMonitorAlgorithm.h
DQTGlobalWZFinderAlg::m_muonSelectionTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
Definition: DQTGlobalWZFinderAlg.h:85
DQTGlobalWZFinderAlg::doEleTriggerTP
void doEleTriggerTP(const xAOD::Electron *el1, const xAOD::Electron *el2, const EventContext &ctx, bool writeTTrees, const float evtWeight, bool osel, bool ssel) const
Definition: DQTGlobalWZFinderAlg.cxx:387
DQTGlobalWZFinderAlg::m_zCutHigh
Gaudi::Property< float_t > m_zCutHigh
Definition: DQTGlobalWZFinderAlg.h:57
DQTGlobalWZFinderAlg::m_PhotonContainerKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_PhotonContainerKey
Definition: DQTGlobalWZFinderAlg.h:95
DQTGlobalWZFinderAlg::m_ElectronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronContainerKey
Definition: DQTGlobalWZFinderAlg.h:91
DQTGlobalWZFinderAlg::m_r3MatchingTool
ToolHandle< Trig::R3MatchingTool > m_r3MatchingTool
Definition: DQTGlobalWZFinderAlg.h:86
DQTGlobalWZFinderAlg::m_idTrackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_idTrackParticleContainerKey
Definition: DQTGlobalWZFinderAlg.h:101
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
DQTGlobalWZFinderAlg
Definition: DQTGlobalWZFinderAlg.py:1
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
DQTGlobalWZFinderAlg::m_muonPtCut
Gaudi::Property< float_t > m_muonPtCut
Definition: DQTGlobalWZFinderAlg.h:55
xAOD::Electron_v1
Definition: Electron_v1.h:34
EventInfo.h
MuonContainer.h
TrackParticle.h
DQTGlobalWZFinderAlg::checkTruthTrack
bool checkTruthTrack(const xAOD::TrackParticle *trk) const
Definition: DQTGlobalWZFinderAlg.cxx:1180
VertexContainer.h
DQTGlobalWZFinderAlg::m_isoElectronContainerKey
SG::ReadDecorHandleKeyArray< xAOD::ElectronContainer > m_isoElectronContainerKey
Definition: DQTGlobalWZFinderAlg.h:108
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
R3MatchingTool.h
DQTGlobalWZFinderAlg::m_doTrigger
BooleanProperty m_doTrigger
Definition: DQTGlobalWZFinderAlg.h:64
DQTGlobalWZFinderAlg::DQTGlobalWZFinderAlg
DQTGlobalWZFinderAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: DQTGlobalWZFinderAlg.cxx:38
DQTGlobalWZFinderAlg::m_muonMaxEta
Gaudi::Property< float_t > m_muonMaxEta
Definition: DQTGlobalWZFinderAlg.h:58
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
TruthParticle.h
DQTGlobalWZFinderAlg::goodElectrons
bool goodElectrons(const xAOD::Electron *electron_itr, const xAOD::Vertex *pVtx, const EventContext &ctx) const
Definition: DQTGlobalWZFinderAlg.cxx:671
DQTGlobalWZFinderAlg::m_msTrackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_msTrackParticleContainerKey
Definition: DQTGlobalWZFinderAlg.h:103
PhotonContainer.h
ReadDecorHandleKeyArray.h
DQTGlobalWZFinderAlg::m_VertexContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_VertexContainerKey
Definition: DQTGlobalWZFinderAlg.h:97
TruthEvent.h