ATLAS Offline Software
DiMuonTaggingAlg.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 #ifndef DERIVATIONFRAMEWORK_DIMUONTAGGINGALG_H
6 #define DERIVATIONFRAMEWORK_DIMUONTAGGINGALG_H
7 
8 
9 // Gaudi & Athena basics
14 
15 // xAOD header files
18 #include "xAODMuon/MuonContainer.h"
20 
21 
22 namespace DerivationFramework {
23 
25  public:
27  DiMuonTaggingAlg(const std::string& name, ISvcLocator* pSvcLocator);
28 
30  virtual ~DiMuonTaggingAlg() = default;
31  // Athena algtool's Hooks
32  StatusCode initialize() override;
33 
34  virtual StatusCode execute(const EventContext& ctx) const override;
35 
36  private:
39  bool passKinematicCuts(const xAOD::IParticle* mu, const float ptMin, const float absEtaMax) const;
40 
41  bool passMuonCuts(const xAOD::Muon* muon, const float ptMin, const float absEtaMax, const bool applyQuality) const;
42 
43  bool passTrigger(const xAOD::Muon* muon, const std::vector<std::string>& trigList) const;
44 
45  template <class probe_type> bool muonPairCheck(const xAOD::Muon* mu1, const probe_type* mu2) const;
46 
47  void maskNearbyIDtracks(const xAOD::IParticle* mu, TrackPassDecor& decor) const;
48 
49 
50  Gaudi::Property<bool> m_applyTrig{this, "applyTrigger", true,
51  "Flag deciding whether the trigger selection should be applied"};
52 
54  Gaudi::Property<std::vector<std::string>> m_orTrigs{this, "OrTrigs", {}};
56  Gaudi::Property<std::vector<std::string>> m_andTrigs{this, "AndTrigs", {}};
57 
58 
59  ToolHandle<Trig::IMatchingTool> m_matchingTool{this, "TrigMatchingTool", "",
60  "Tool to access the trigger decision"};
61 
62 
63  Gaudi::Property<float> m_triggerMatchDeltaR{this, "TriggerMatchDeltaR", 0.1};
64 
65 
66  SG::ReadHandleKey<xAOD::MuonContainer> m_muonSGKey{this, "MuonContainerKey", "Muons"};
67 
68  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackSGKey{this, "TrackContainerKey", "InDetTrackParticles"};
69 
71 
74  "Key to whitelist the muon for writeout. Will be overwritten by BranchPrefix property"};
76  "Key to whitelist the tracks for writeout. Will be overwritten by BranchPreFix property"};
78  SG::WriteHandleKey<int> m_skimmingKey{this, "SkimmingKey", "", "Set via BranchPreFixProperty + DIMU_pass"};
79 
81  ToolHandle<CP::IMuonSelectionTool> m_muonSelTool{this, "SelectionTool", ""};
83  Gaudi::Property<float> m_mu1PtMin{this, "Mu1PtMin", -1};
85  Gaudi::Property<float> m_mu1AbsEtaMax{this, "Mu1AbsEtaMax", 10};
87  Gaudi::Property<bool> m_applyQualityMu1{this, "Mu1RequireQual", false};
88 
90  Gaudi::Property<float> m_mu2PtMin{this, "Mu2PtMin", -1};
92  Gaudi::Property<float> m_mu2AbsEtaMax{this, "Mu2AbsEtaMax", 10};
94  Gaudi::Property<bool> m_applyQualityMu2{this, "Mu2RequireQual", false};
95 
97  Gaudi::Property<bool> m_isMC{this, "isMC", false};
100  Gaudi::Property<bool> m_useTrackProbe{this, "UseTrackProbe", false};
102  Gaudi::Property<std::string> m_br_prefix{this, "BranchPrefix", ""};
103 
105  Gaudi::Property<bool> m_requireOS{this, "OppositeCharge", true};
107  Gaudi::Property<float> m_dPhiMin{this, "PairDPhiMin", -1};
109  Gaudi::Property<float> m_invariantMassLow{this, "InvariantMassLow", 2.0 * Gaudi::Units::GeV};
111  Gaudi::Property<float> m_invariantMassHigh{this, "InvariantMassHigh",-1.*Gaudi::Units::GeV};
112 
113  Gaudi::Property<float> m_thinningConeSize{this, "IDTrackThinningConeSize", 0.4};
114 
118  };
119 } // namespace DerivationFramework
120 #endif // DERIVATIONFRAMEWORK_SKIMMINGTOOLEXAMPLE_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::DiMuonTaggingAlg::m_applyQualityMu1
Gaudi::Property< bool > m_applyQualityMu1
Flag to toggle whether selection working point should be applied on the first muon.
Definition: DiMuonTaggingAlg.h:87
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
DerivationFramework::DiMuonTaggingAlg::m_dPhiMin
Gaudi::Property< float > m_dPhiMin
Require a minimal delta Phi between the two selected candidates.
Definition: DiMuonTaggingAlg.h:107
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
DerivationFramework::DiMuonTaggingAlg::m_muonSelTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelTool
Selection tool to filter muons with poor quality.
Definition: DiMuonTaggingAlg.h:81
DerivationFramework::DiMuonTaggingAlg::m_trkKeepKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_trkKeepKey
Definition: DiMuonTaggingAlg.h:75
DerivationFramework::DiMuonTaggingAlg::m_requireOS
Gaudi::Property< bool > m_requireOS
Both particles have to be of opposite charge.
Definition: DiMuonTaggingAlg.h:105
IAugmentationTool.h
DerivationFramework::DiMuonTaggingAlg::passMuonCuts
bool passMuonCuts(const xAOD::Muon *muon, const float ptMin, const float absEtaMax, const bool applyQuality) const
Definition: DiMuonTaggingAlg.cxx:176
TruthParticleContainer.h
DerivationFramework::DiMuonTaggingAlg::m_thinningConeSize
Gaudi::Property< float > m_thinningConeSize
Definition: DiMuonTaggingAlg.h:113
DerivationFramework::DiMuonTaggingAlg::m_applyQualityMu2
Gaudi::Property< bool > m_applyQualityMu2
Flag to toggle whether the selection working point should be applied on the second muon.
Definition: DiMuonTaggingAlg.h:94
DerivationFramework::DiMuonTaggingAlg::m_thinningConeSize2
float m_thinningConeSize2
Definition: DiMuonTaggingAlg.h:117
DerivationFramework::DiMuonTaggingAlg::m_br_prefix
Gaudi::Property< std::string > m_br_prefix
Name of the ouput selection flag.
Definition: DiMuonTaggingAlg.h:102
DerivationFramework::DiMuonTaggingAlg::m_mu1PtMin
Gaudi::Property< float > m_mu1PtMin
Pt cut on the primary muon in the event.
Definition: DiMuonTaggingAlg.h:83
DerivationFramework::DiMuonTaggingAlg::m_applyTrig
Gaudi::Property< bool > m_applyTrig
Definition: DiMuonTaggingAlg.h:50
DerivationFramework::DiMuonTaggingAlg::m_truthSGKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthSGKey
Definition: DiMuonTaggingAlg.h:70
DerivationFramework::DiMuonTaggingAlg::m_mu2PtMin
Gaudi::Property< float > m_mu2PtMin
Pt cut on the second muon in the event.
Definition: DiMuonTaggingAlg.h:90
DerivationFramework::DiMuonTaggingAlg::m_isMC
Gaudi::Property< bool > m_isMC
Flag whether it's MC.
Definition: DiMuonTaggingAlg.h:97
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
DerivationFramework::DiMuonTaggingAlg::m_invariantMassHigh
Gaudi::Property< float > m_invariantMassHigh
Upper invariant mass selection window (Negative number refers to disable)
Definition: DiMuonTaggingAlg.h:111
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
DerivationFramework::DiMuonTaggingAlg::m_triggerMatchDeltaR
Gaudi::Property< float > m_triggerMatchDeltaR
Definition: DiMuonTaggingAlg.h:63
DerivationFramework::DiMuonTaggingAlg::passKinematicCuts
bool passKinematicCuts(const xAOD::IParticle *mu, const float ptMin, const float absEtaMax) const
Returns true of the pointer is valid and also whether the pt and absEta are above and below the thres...
Definition: DiMuonTaggingAlg.cxx:171
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
DerivationFramework::DiMuonTaggingAlg::m_invariantMassLow
Gaudi::Property< float > m_invariantMassLow
Lower invariant mass selection window.
Definition: DiMuonTaggingAlg.h:109
IMuonSelectionTool.h
DerivationFramework::DiMuonTaggingAlg::~DiMuonTaggingAlg
virtual ~DiMuonTaggingAlg()=default
Destructor.
DerivationFramework::DiMuonTaggingAlg::m_mu2AbsEtaMax
Gaudi::Property< float > m_mu2AbsEtaMax
Eta cut on the second muon in the event.
Definition: DiMuonTaggingAlg.h:92
SG::WriteHandleKey< int >
DerivationFramework::DiMuonTaggingAlg::m_orTrigs
Gaudi::Property< std::vector< std::string > > m_orTrigs
List of triggers in which at least one muon in the pair needs to pass.
Definition: DiMuonTaggingAlg.h:54
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::DiMuonTaggingAlg::m_invariantMassHigh2
float m_invariantMassHigh2
Definition: DiMuonTaggingAlg.h:116
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
DerivationFramework::DiMuonTaggingAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: DiMuonTaggingAlg.cxx:52
DerivationFramework::DiMuonTaggingAlg::muonPairCheck
bool muonPairCheck(const xAOD::Muon *mu1, const probe_type *mu2) const
Definition: DiMuonTaggingAlg.cxx:184
WriteDecorHandle.h
Handle class for adding a decoration to an object.
DerivationFramework::DiMuonTaggingAlg::m_invariantMassLow2
float m_invariantMassLow2
Definition: DiMuonTaggingAlg.h:115
DerivationFramework::DiMuonTaggingAlg::m_skimmingKey
SG::WriteHandleKey< int > m_skimmingKey
Event Decision Key.
Definition: DiMuonTaggingAlg.h:78
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::DiMuonTaggingAlg
Definition: DiMuonTaggingAlg.h:24
DerivationFramework::DiMuonTaggingAlg::m_mu1AbsEtaMax
Gaudi::Property< float > m_mu1AbsEtaMax
Eta cut on the primary muon in the event.
Definition: DiMuonTaggingAlg.h:85
AthReentrantAlgorithm.h
DerivationFramework::DiMuonTaggingAlg::m_muonSGKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonSGKey
Definition: DiMuonTaggingAlg.h:66
DerivationFramework::DiMuonTaggingAlg::initialize
StatusCode initialize() override
Definition: DiMuonTaggingAlg.cxx:23
DerivationFramework::DiMuonTaggingAlg::m_matchingTool
ToolHandle< Trig::IMatchingTool > m_matchingTool
Definition: DiMuonTaggingAlg.h:59
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
DerivationFramework::DiMuonTaggingAlg::m_trackSGKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackSGKey
Definition: DiMuonTaggingAlg.h:68
DerivationFramework::DiMuonTaggingAlg::m_useTrackProbe
Gaudi::Property< bool > m_useTrackProbe
Run the analysis with a Muon <--> Track pair — Muon has to hold criteria 1 and track to satisfy kinem...
Definition: DiMuonTaggingAlg.h:100
MuonContainer.h
DerivationFramework::DiMuonTaggingAlg::maskNearbyIDtracks
void maskNearbyIDtracks(const xAOD::IParticle *mu, TrackPassDecor &decor) const
Definition: DiMuonTaggingAlg.cxx:166
DerivationFramework::DiMuonTaggingAlg::m_muonKeepKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonKeepKey
Keys to whitelist the muons & tracks needed for MCP studies to output.
Definition: DiMuonTaggingAlg.h:73
IMatchingTool.h
DerivationFramework::DiMuonTaggingAlg::DiMuonTaggingAlg
DiMuonTaggingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters.
Definition: DiMuonTaggingAlg.cxx:19
PhysDESDM_SmpCaloId.ptMin
ptMin
Definition: PhysDESDM_SmpCaloId.py:90
DerivationFramework::DiMuonTaggingAlg::passTrigger
bool passTrigger(const xAOD::Muon *muon, const std::vector< std::string > &trigList) const
Definition: DiMuonTaggingAlg.cxx:179
DerivationFramework::DiMuonTaggingAlg::m_andTrigs
Gaudi::Property< std::vector< std::string > > m_andTrigs
List of trigger in which both muons need to pass the selection.
Definition: DiMuonTaggingAlg.h:56
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30