ATLAS Offline Software
AFP_VertexRecoBasic.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 #ifndef AFP_VERTEXRECO_AFP_TIMERECOTOOL_H
6 #define AFP_VERTEXRECO_AFP_TIMERECOTOOL_H
7 
9 
10 // FrameWork includes
12 #include "GaudiKernel/ServiceHandle.h"
13 #include "Gaudi/Property.h"
16 
17 // xAOD includes
20 #include "xAODForward/AFPVertex.h"
23 #include "xAODForward/AFPProton.h"
29 
30 #include "nlohmann/json.hpp"
31 #include <string>
32 #include <vector>
33 #include <memory>
34 #include <iterator>
35 #include <algorithm>
36 
37 
39 class AFP_VertexRecoBasic : public extends<AthAlgTool, IAFP_TimeRecoTool> {
40 
41  public:
43  AFP_VertexRecoBasic(const std::string& type, const std::string& name, const IInterface* parent);
44 
45  virtual ~AFP_VertexRecoBasic() = default;
46 
48  virtual StatusCode initialize() override;
49 
50  // return name of the output container; needed by AFP_VertexRecoTool to make write handle keys
51  const std::string& outputContainerName () const override {return m_vertexContainerName;}
52 
53  // TODO: put doVertexReco() in a separate "base" class
54  StatusCode doVertexReco(std::unique_ptr<xAOD::AFPVertexContainer>& outputContainer, const EventContext& ctx) const override;
55 
56 
57  private:
58 
60  StatusCode configInfo() const;
61 
62 
71  xAOD::AFPVertex * reco(const double distA, const double distC, const xAOD::AFPToFTrack* toFTrackA, const xAOD::AFPToFTrack* toFTrackC,const xAOD::AFPProton* protonA, const xAOD::AFPProton* protonC, const AFP::ToFVtxParamData& TVP_A, const AFP::ToFVtxParamData& TVP_C, std::unique_ptr<xAOD::AFPVertexContainer>& outputContainer) const;
72 
73 
75  ToolHandle<AFP::IToFVtxParamDBTool> m_tofVtxParamDBTool {this, "tofVtxParamDBTool", "AFP__ToFLocParamDBTool", "Tool to access DB to get the vertex ToF parameters"};
76 
77  Gaudi::Property<double> m_trackDistance{this, "TrackDistance", 0.5, "Maximum distance between ToF train edge and proton"};
78 
79  SG::ReadHandleKey<xAOD::AFPToFTrackContainer> m_tofTrackContainerKey{this, "AFPToFTrackContainerKey", "AFPToFTrackContainer", "Name of the container with ToF tracks from which vertices are to be reconstructed"};
80 
81  SG::ReadHandleKey<xAOD::AFPProtonContainer> m_protonContainerKey{this, "AFPProtonContainerKey", "AFPProtonContainer", "Name of the container with protons from which vertices are to be reconstructed"};
82 
83  Gaudi::Property<std::string> m_vertexContainerName{this, "verticesContainerName", "AFPVertexContainer", "Name of the container in which vertices are saved"};
84 
86  xAOD::AFPVertex * createVertex (const double position, const double distA, const double distC, std::unique_ptr<xAOD::AFPVertexContainer>& outputContainer) const;
87 
90 
93 
94 };
95 
96 
97 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
AFPVertexAuxContainer.h
AFP_VertexRecoBasic::AFP_VertexRecoBasic
AFP_VertexRecoBasic(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: AFP_VertexRecoBasic.cxx:9
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AFP_VertexRecoBasic::m_trackDistance
Gaudi::Property< double > m_trackDistance
Definition: AFP_VertexRecoBasic.h:77
AFP_VertexRecoBasic::doVertexReco
StatusCode doVertexReco(std::unique_ptr< xAOD::AFPVertexContainer > &outputContainer, const EventContext &ctx) const override
Definition: AFP_VertexRecoBasic.cxx:38
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
AFP_VertexRecoBasic::outputContainerName
const std::string & outputContainerName() const override
Definition: AFP_VertexRecoBasic.h:51
AFP::ToFVtxParamData
Class storing information about alignment.
Definition: ToFVtxParamData.h:24
ToFVtxParamData.h
AFP_VertexRecoBasic::configInfo
StatusCode configInfo() const
Definition: AFP_VertexRecoBasic.cxx:16
AFP_VertexRecoBasic::~AFP_VertexRecoBasic
virtual ~AFP_VertexRecoBasic()=default
IToFVtxParamDBTool.h
AFP_VertexRecoBasic::m_tofTrackContainerKey
SG::ReadHandleKey< xAOD::AFPToFTrackContainer > m_tofTrackContainerKey
Definition: AFP_VertexRecoBasic.h:79
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AFPProton.h
AthAlgTool.h
AFP_VertexRecoBasic::createVertex
xAOD::AFPVertex * createVertex(const double position, const double distA, const double distC, std::unique_ptr< xAOD::AFPVertexContainer > &outputContainer) const
Creates and sets up a vertex.
Definition: AFP_VertexRecoBasic.cxx:158
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AFPProtonContainer.h
AFP_VertexRecoBasic::initialize
virtual StatusCode initialize() override
Loads parameterization.
Definition: AFP_VertexRecoBasic.cxx:29
PathResolver.h
AFPVertex.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAOD::proton
@ proton
Definition: TrackingPrimitives.h:198
AFP_VertexRecoBasic::reco
xAOD::AFPVertex * reco(const double distA, const double distC, const xAOD::AFPToFTrack *toFTrackA, const xAOD::AFPToFTrack *toFTrackC, const xAOD::AFPProton *protonA, const xAOD::AFPProton *protonC, const AFP::ToFVtxParamData &TVP_A, const AFP::ToFVtxParamData &TVP_C, std::unique_ptr< xAOD::AFPVertexContainer > &outputContainer) const
Reconstructs single vertex from pair of ToFTracks and a pair of protons.
Definition: AFP_VertexRecoBasic.cxx:197
IAFP_TimeRecoTool.h
Header file for interface IAFP_TimeRecoTool.
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
AFPToFTrackContainer.h
AFP_VertexRecoBasic::m_tofVtxParamDBTool
ToolHandle< AFP::IToFVtxParamDBTool > m_tofVtxParamDBTool
@ brief Tool for accessing DB to get the vertex ToF parameters
Definition: AFP_VertexRecoBasic.h:75
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::AFPProton_v1
Class representing a proton reconstructed in AFP.
Definition: AFPProton_v1.h:36
AFP_VertexRecoBasic
Tool for vertex reconstruction by basic algorithm.
Definition: AFP_VertexRecoBasic.h:39
AFPProtonAuxContainer.h
AFPToFTrack.h
AFP_VertexRecoBasic::linkProtonsToVertex
void linkProtonsToVertex(const xAOD::AFPProton *proton, SG::ReadHandle< xAOD::AFPProtonContainer > &protonContainer, xAOD::AFPVertex *vertex) const
Links proton pair to reconstructed vertex.
Definition: AFP_VertexRecoBasic.cxx:186
AFP_VertexRecoBasic::m_protonContainerKey
SG::ReadHandleKey< xAOD::AFPProtonContainer > m_protonContainerKey
Definition: AFP_VertexRecoBasic.h:81
xAOD::AFPVertex_v1
Class representing a vertex reconstructed in AFP.
Definition: AFPVertex_v1.h:41
AFP_VertexRecoBasic::m_vertexContainerName
Gaudi::Property< std::string > m_vertexContainerName
Definition: AFP_VertexRecoBasic.h:83
AFP_VertexRecoBasic::linkToFTracksToVertex
void linkToFTracksToVertex(const xAOD::AFPToFTrack *toFTrack, SG::ReadHandle< xAOD::AFPToFTrackContainer > &tofTrackContainer, xAOD::AFPVertex *vertex) const
Links ToF track pair to reconstructed vertex.
Definition: AFP_VertexRecoBasic.cxx:177
AFPVertexContainer.h
AFPToFTrackAuxContainer.h
xAOD::AFPToFTrack_v1
Class representing a track reconstructed in AFP ToF.
Definition: AFPToFTrack_v1.h:36