ATLAS Offline Software
FourLeptonVertexingAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef DERIVATIONFRAMEWORK_FourLeptonVertexingAlgorithm_H
5 #define DERIVATIONFRAMEWORK_FourLeptonVertexingAlgorithm_H
6 
7 // Gaudi & Athena basics
17 #include "xAODMuon/MuonContainer.h"
25 namespace DerivationFramework {
27  public:
28  FourLeptonVertexingAlgorithm(const std::string& n, ISvcLocator* p);
29  StatusCode initialize() override;
30  StatusCode execute(const EventContext& ctx) const override;
31  StatusCode finalize() override;
32 
33  using LeptonQuadruplet = std::array<const xAOD::IParticle*, 4>;
34 
35  private:
36  bool passSelection(const xAOD::Electron* elec) const;
37  bool passSelection(const xAOD::Muon* muon) const;
38  bool passSelection(const LeptonQuadruplet& quad) const;
39 
40  std::vector<LeptonQuadruplet> buildAllQuadruplets(const EventContext& ctx) const;
41 
42  std::unique_ptr<xAOD::Vertex> fitQuadruplet(const EventContext& ctx, const LeptonQuadruplet& quad) const;
43 
45  int charge(const xAOD::IParticle* part) const;
46 
48  SG::ReadHandleKey<xAOD::MuonContainer> m_muonKey{this, "MuonContainer", "Muons",
49  "Location of the input muon container in the StoreGate"};
50  SG::ReadHandleKey<xAOD::ElectronContainer> m_elecKey{this, "ElectronContainer", "Electrons",
51  "Location of the electron container in the store gate"};
52  SG::ReadHandleKey<xAOD::EventInfo> m_evtKey{this, "EventInfoKey", "EventInfo"};
53 
54  ToolHandle<CP::IMuonSelectionTool> m_muonSelTool{this, "MuonSelectionTool", "",
55  "Applied preselection on the muons. Will be ignored if empty"};
56  ToolHandle<IAsgElectronLikelihoodTool> m_elecSelTool{this, "ElectronSelectionTool", "",
57  "Applied preselection on the electrons. Will be ignored if empty"};
58 
59  ToolHandle<Trk::IVertexFitter> m_fitter{this, "VertexFitter", "", "Vertex fitter tool"};
60 
61  Gaudi::Property<float> m_minMuonPt{this, "MinMuonPt", 3. * Gaudi::Units::GeV,
62  "Minimum pt cut applied on the muon -- Unfortunately not handled by the MST"};
63  Gaudi::Property<float> m_minElecPt{this, "MinElecPt", 4.5 * Gaudi::Units::GeV, " Minimum pt cut applied on the electron"};
64 
65  using MuonTrk = xAOD::Muon::TrackParticleType;
66  Gaudi::Property<int> m_muonTrkProp{this, "PickMuonTrk", MuonTrk::InnerDetectorTrackParticle,
67  "Pick the proper track particle from the muon"};
69 
70  Gaudi::Property<bool> m_elecUseGSF{this, "PickElecGsfTrk", true,
71  "If this property is set to true it will pick up the electron GSF track"};
72 
73  Gaudi::Property<float> m_z0Cut{this, "DeltaZ0Cut", 7.5 * Gaudi::Units::mm,
74  "All leptons in the quadruplet have to be seperated from each other by maximum"};
75 
76 
77  Gaudi::Property<float> m_lowSFOS_Cut{this, "LowSFOSMass", 3.5 * Gaudi::Units::GeV, "Minimal mass for the lower SFOS pair"};
78  Gaudi::Property<float> m_highPair_Cut{this, "HighMassPair", 40.*Gaudi::Units::GeV, "Minimum mass for the largest lepton pair"};
79 
80  Gaudi::Property<float> m_LeadPtCut{this, "LeadingLeptonPt", 15. *Gaudi::Units::GeV,"Minimal momentum of the leading lepton in the quad "};
81  Gaudi::Property<float> m_SubLeadPtCut{this, "SubLeadingLeptonPt", 10. *Gaudi::Units::GeV,"Minimal momentum of the leading lepton in the quad "};
82 
83  Gaudi::Property<float> m_VtxChi2Cut{this, "VertexChi2Cut", 20, "Maximal chii n.D.o.F cut on the reconstructed vertex" };
84 
85 
86  SG::WriteHandleKey<xAOD::VertexContainer> m_vtxKey{this, "OutVertexContainer", "FourLeptonVertices", "Output vertex container"};
87  Gaudi::Property<bool> m_pruneCov{this, "PruneCovariance", true, "Clears the covariance vector"};
88  Gaudi::Property<bool> m_pruneWeight{this, "PruneTrackWeights", true, "Clears the track weight vector"};
89 
91  mutable std::array<std::atomic<unsigned int>, 8> m_num_lep ATLAS_THREAD_SAFE {};
92  mutable std::array<std::atomic<unsigned int>, 8> m_num_ele ATLAS_THREAD_SAFE {};
93  mutable std::array<std::atomic<unsigned int>, 8> m_num_muo ATLAS_THREAD_SAFE {};
94 
96  mutable std::atomic<unsigned int> m_tried_fits{0};
98  mutable std::atomic<unsigned int> m_good_fits{0};
99 
100 
101  };
102 
103 } // namespace DerivationFramework
104 #endif
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::FourLeptonVertexingAlgorithm::m_VtxChi2Cut
Gaudi::Property< float > m_VtxChi2Cut
Definition: FourLeptonVertexingAlgorithm.h:83
DerivationFramework::FourLeptonVertexingAlgorithm::m_z0Cut
Gaudi::Property< float > m_z0Cut
Definition: FourLeptonVertexingAlgorithm.h:73
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
DerivationFramework::FourLeptonVertexingAlgorithm::m_minMuonPt
Gaudi::Property< float > m_minMuonPt
Definition: FourLeptonVertexingAlgorithm.h:61
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
DerivationFramework::FourLeptonVertexingAlgorithm::m_vtxKey
SG::WriteHandleKey< xAOD::VertexContainer > m_vtxKey
Definition: FourLeptonVertexingAlgorithm.h:86
DerivationFramework::FourLeptonVertexingAlgorithm::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned int >, 8 > m_num_lep ATLAS_THREAD_SAFE
Simple counter to evaluate the number of leptons per event.
Definition: FourLeptonVertexingAlgorithm.h:91
DerivationFramework::FourLeptonVertexingAlgorithm::m_elecKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_elecKey
Definition: FourLeptonVertexingAlgorithm.h:50
DerivationFramework::FourLeptonVertexingAlgorithm::fitQuadruplet
std::unique_ptr< xAOD::Vertex > fitQuadruplet(const EventContext &ctx, const LeptonQuadruplet &quad) const
Definition: FourLeptonVertexingAlgorithm.cxx:181
DerivationFramework::FourLeptonVertexingAlgorithm::finalize
StatusCode finalize() override
Definition: FourLeptonVertexingAlgorithm.cxx:62
DerivationFramework::FourLeptonVertexingAlgorithm::m_highPair_Cut
Gaudi::Property< float > m_highPair_Cut
Definition: FourLeptonVertexingAlgorithm.h:78
DerivationFramework::FourLeptonVertexingAlgorithm::buildAllQuadruplets
std::vector< LeptonQuadruplet > buildAllQuadruplets(const EventContext &ctx) const
Definition: FourLeptonVertexingAlgorithm.cxx:95
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
DerivationFramework::FourLeptonVertexingAlgorithm::m_evtKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtKey
Definition: FourLeptonVertexingAlgorithm.h:52
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
DerivationFramework::FourLeptonVertexingAlgorithm::trackParticle
const xAOD::TrackParticle * trackParticle(const xAOD::IParticle *part) const
Definition: FourLeptonVertexingAlgorithm.cxx:169
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
InDet::ExclusiveOrigin::Primary
@ Primary
Definition: InDetTrackTruthOriginDefs.h:163
DerivationFramework::FourLeptonVertexingAlgorithm::m_SubLeadPtCut
Gaudi::Property< float > m_SubLeadPtCut
Definition: FourLeptonVertexingAlgorithm.h:81
IMuonSelectionTool.h
DerivationFramework::FourLeptonVertexingAlgorithm::FourLeptonVertexingAlgorithm
FourLeptonVertexingAlgorithm(const std::string &n, ISvcLocator *p)
Definition: FourLeptonVertexingAlgorithm.cxx:43
DerivationFramework::FourLeptonVertexingAlgorithm::MuonTrk
xAOD::Muon::TrackParticleType MuonTrk
Definition: FourLeptonVertexingAlgorithm.h:65
DerivationFramework::FourLeptonVertexingAlgorithm::initialize
StatusCode initialize() override
Definition: FourLeptonVertexingAlgorithm.cxx:45
IAsgElectronLikelihoodTool.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
ElectronContainer.h
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::FourLeptonVertexingAlgorithm::m_elecSelTool
ToolHandle< IAsgElectronLikelihoodTool > m_elecSelTool
Definition: FourLeptonVertexingAlgorithm.h:56
DerivationFramework::FourLeptonVertexingAlgorithm
Definition: FourLeptonVertexingAlgorithm.h:26
DerivationFramework::FourLeptonVertexingAlgorithm::m_muonSelTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelTool
Definition: FourLeptonVertexingAlgorithm.h:54
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
AthReentrantAlgorithm.h
DerivationFramework::FourLeptonVertexingAlgorithm::m_minElecPt
Gaudi::Property< float > m_minElecPt
Definition: FourLeptonVertexingAlgorithm.h:63
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
DerivationFramework::FourLeptonVertexingAlgorithm::m_lowSFOS_Cut
Gaudi::Property< float > m_lowSFOS_Cut
Definition: FourLeptonVertexingAlgorithm.h:77
DerivationFramework::FourLeptonVertexingAlgorithm::execute
StatusCode execute(const EventContext &ctx) const override
Definition: FourLeptonVertexingAlgorithm.cxx:74
DerivationFramework::FourLeptonVertexingAlgorithm::m_muonTrkProp
Gaudi::Property< int > m_muonTrkProp
Definition: FourLeptonVertexingAlgorithm.h:66
DerivationFramework::FourLeptonVertexingAlgorithm::m_muonTrk
MuonTrk m_muonTrk
Definition: FourLeptonVertexingAlgorithm.h:68
xAOD::Electron_v1
Definition: Electron_v1.h:34
IVertexFitter.h
EventInfo.h
MuonContainer.h
DerivationFramework::FourLeptonVertexingAlgorithm::charge
int charge(const xAOD::IParticle *part) const
Definition: FourLeptonVertexingAlgorithm.cxx:176
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
DerivationFramework::FourLeptonVertexingAlgorithm::m_fitter
ToolHandle< Trk::IVertexFitter > m_fitter
Definition: FourLeptonVertexingAlgorithm.h:59
DerivationFramework::FourLeptonVertexingAlgorithm::LeptonQuadruplet
std::array< const xAOD::IParticle *, 4 > LeptonQuadruplet
Definition: FourLeptonVertexingAlgorithm.h:33
VertexContainer.h
DerivationFramework::FourLeptonVertexingAlgorithm::m_pruneWeight
Gaudi::Property< bool > m_pruneWeight
Definition: FourLeptonVertexingAlgorithm.h:88
DerivationFramework::FourLeptonVertexingAlgorithm::m_elecUseGSF
Gaudi::Property< bool > m_elecUseGSF
Definition: FourLeptonVertexingAlgorithm.h:70
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
checker_macros.h
Define macros for attributes used to control the static checker.
DerivationFramework::FourLeptonVertexingAlgorithm::m_pruneCov
Gaudi::Property< bool > m_pruneCov
Definition: FourLeptonVertexingAlgorithm.h:87
DerivationFramework::FourLeptonVertexingAlgorithm::passSelection
bool passSelection(const xAOD::Electron *elec) const
Definition: FourLeptonVertexingAlgorithm.cxx:88
DerivationFramework::FourLeptonVertexingAlgorithm::m_good_fits
std::atomic< unsigned int > m_good_fits
How many vertex fits were actually successful.
Definition: FourLeptonVertexingAlgorithm.h:98
DerivationFramework::FourLeptonVertexingAlgorithm::m_tried_fits
std::atomic< unsigned int > m_tried_fits
How many vertex fits were attempted.
Definition: FourLeptonVertexingAlgorithm.h:96
DerivationFramework::FourLeptonVertexingAlgorithm::m_muonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonKey
Input containers.
Definition: FourLeptonVertexingAlgorithm.h:48
dumpNswErrorDb.quad
def quad
Definition: dumpNswErrorDb.py:24
DerivationFramework::FourLeptonVertexingAlgorithm::m_LeadPtCut
Gaudi::Property< float > m_LeadPtCut
Definition: FourLeptonVertexingAlgorithm.h:80