ATLAS Offline Software
BuildVertexPointingAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PHOTONVERTEXSELECTION_BUILDVERTEXPOINTINGALG_H
6 #define PHOTONVERTEXSELECTION_BUILDVERTEXPOINTINGALG_H
7 
10 
14 
19 #include <AsgTools/AsgTool.h>
21 
22 #include <string>
23 
24 
32  public:
33  BuildVertexPointingAlg(const std::string& name,
34  ISvcLocator* svcLoc = nullptr);
35  virtual StatusCode initialize();
36  virtual StatusCode execute();
37 
38  private:
40  this, "PhotonContainerKey", "Photons",
41  "The input photons (or electrons) container"};
43  "EventInfo", ""};
45  this, "PointingVertexContainerKey", "PhotonPointingVertices", ""};
46 
47  // additional information written to the vertex as decorations
49  this, "NGoodPhotonsKey", m_pointingVertexContainerKey, "nphotons_good", ""};
51  this, "ZCommonPhotonsKey", m_pointingVertexContainerKey, "z_common_nphotons", ""};
53  this, "PhotonsPxKey", m_pointingVertexContainerKey, "photons_px", ""};
55  this, "PhotonsPyKey", m_pointingVertexContainerKey, "photons_py", ""};
57  this, "PhotonsPzKey", m_pointingVertexContainerKey, "photons_pz", ""};
59  this, "PhotonLinksKey", m_pointingVertexContainerKey, "PhotonLinks", ""};
60 
61  // decoration read from Photon by xAOD::PVHelpers::getZCommonAndError function
62  // the user should not change them
64  this, "PhotonZVertexKey", m_photonContainerKey, "zvertex"};
66  this, "PhotonErrZKey", m_photonContainerKey, "errz"};
68  this, "PhotonHPVZVertexKey", m_photonContainerKey, "HPV_zvertex"};
70  this, "PhotonHPVErrZKey", m_photonContainerKey, "HPV_errz"};
71 
72  ToolHandle<IAsgSelectionTool> m_selectionTool{
73  this, "selectionTool", "CP::AsgPtEtaSelectionTool/PhotonSelectionTool",
74  "the selection tool we apply to photons to compute pointing variables"};
75 
76  ToolHandle<IAsgSelectionTool> m_goodPhotonSelectionTool{
77  this, "goodPhotonSelectionTool", "",
78  "the selection tool to count good photons"};
79 
80  Gaudi::Property<float> m_convPtCut {this, "convPtCut", 2E3, "the conversion pt cut"};
81  Gaudi::Property<int> m_nphotons_to_use {this, "nphotonsToUse", -1, "the number of photons to use for the pointing computation"};
82 
83  void selectPhotons(const xAOD::EgammaContainer& original_photons,
84  ConstDataVector<DataVector<xAOD::Egamma>>& photons_selected) const;
85 
86 
87 };
88 
89 #endif // PHOTONVERTEXSELECTION_BUILDVERTEXPOINTINGALG_H
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
PropertyWrapper.h
BuildVertexPointingAlg::m_photon_zvertex_key
SG::ReadDecorHandleKey< xAOD::EgammaContainer > m_photon_zvertex_key
Definition: BuildVertexPointingAlg.h:63
VertexContainerFwd.h
BuildVertexPointingAlg::m_photon_links_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_photon_links_key
Definition: BuildVertexPointingAlg.h:58
BuildVertexPointingAlg::BuildVertexPointingAlg
BuildVertexPointingAlg(const std::string &name, ISvcLocator *svcLoc=nullptr)
Definition: BuildVertexPointingAlg.cxx:22
EgammaContainerFwd.h
BuildVertexPointingAlg::m_convPtCut
Gaudi::Property< float > m_convPtCut
Definition: BuildVertexPointingAlg.h:80
BuildVertexPointingAlg::m_photon_errz_key
SG::ReadDecorHandleKey< xAOD::EgammaContainer > m_photon_errz_key
Definition: BuildVertexPointingAlg.h:65
BuildVertexPointingAlg::m_nphotons_good_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_nphotons_good_key
Definition: BuildVertexPointingAlg.h:48
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
IAsgSelectionTool.h
BuildVertexPointingAlg
An algorithm to build a vertex from photon pointing.
Definition: BuildVertexPointingAlg.h:31
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
AnaAlgorithm.h
BuildVertexPointingAlg::m_photons_px_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_photons_px_key
Definition: BuildVertexPointingAlg.h:52
EL::AnaAlgorithm
the (new) base class for EventLoop algorithms
Definition: AnaAlgorithm.h:73
BuildVertexPointingAlg::m_photons_py_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_photons_py_key
Definition: BuildVertexPointingAlg.h:54
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
BuildVertexPointingAlg::m_nphotons_to_use
Gaudi::Property< int > m_nphotons_to_use
Definition: BuildVertexPointingAlg.h:81
BuildVertexPointingAlg::m_goodPhotonSelectionTool
ToolHandle< IAsgSelectionTool > m_goodPhotonSelectionTool
Definition: BuildVertexPointingAlg.h:76
BuildVertexPointingAlg::execute
virtual StatusCode execute()
Definition: BuildVertexPointingAlg.cxx:63
BuildVertexPointingAlg::m_selectionTool
ToolHandle< IAsgSelectionTool > m_selectionTool
Definition: BuildVertexPointingAlg.h:72
BuildVertexPointingAlg::m_photon_HPV_zvertex_key
SG::ReadDecorHandleKey< xAOD::EgammaContainer > m_photon_HPV_zvertex_key
Definition: BuildVertexPointingAlg.h:67
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
BuildVertexPointingAlg::m_photon_HPV_errz_key
SG::ReadDecorHandleKey< xAOD::EgammaContainer > m_photon_HPV_errz_key
Definition: BuildVertexPointingAlg.h:69
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
BuildVertexPointingAlg::m_pointingVertexContainerKey
SG::WriteHandleKey< xAOD::VertexContainer > m_pointingVertexContainerKey
Definition: BuildVertexPointingAlg.h:44
BuildVertexPointingAlg::selectPhotons
void selectPhotons(const xAOD::EgammaContainer &original_photons, ConstDataVector< DataVector< xAOD::Egamma >> &photons_selected) const
Definition: BuildVertexPointingAlg.cxx:151
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
EventInfo.h
BuildVertexPointingAlg::m_photonContainerKey
SG::ReadHandleKey< xAOD::EgammaContainer > m_photonContainerKey
Definition: BuildVertexPointingAlg.h:39
WriteDecorHandleKey.h
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
BuildVertexPointingAlg::m_photons_pz_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_photons_pz_key
Definition: BuildVertexPointingAlg.h:56
BuildVertexPointingAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: BuildVertexPointingAlg.h:42
BuildVertexPointingAlg::m_z_common_nphotons_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_z_common_nphotons_key
Definition: BuildVertexPointingAlg.h:50
BuildVertexPointingAlg::initialize
virtual StatusCode initialize()
Definition: BuildVertexPointingAlg.cxx:26
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
AsgTool.h