ATLAS Offline Software
AFPTDBasicTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #ifndef AFP_LOCRECO_AFPTDBASICKALMANTOOL_H
11 #define AFP_LOCRECO_AFPTDBASICKALMANTOOL_H 1
12 
13 
14 // FrameWork includes
16 #include "GaudiKernel/ServiceHandle.h"
17 
18 // xAOD includes
21 #include "xAODForward/AFPToFHit.h"
26 
27 // AFP_LocReco includes
31 
32 // STL includes
33 #include "nlohmann/json.hpp"
34 #include <string>
35 #include <list>
36 #include <vector>
37 
43  : public extends<AthAlgTool, IAFPTDLocRecoTrackAlgTool>
44 {
45 public:
46  AFPTDBasicTool(const std::string& type,
47  const std::string& name,
48  const IInterface* parent);
49 
50  virtual ~AFPTDBasicTool() override {}
51 
53  virtual StatusCode initialize() override;
54 
56  virtual StatusCode finalize() override;
57 
62  StatusCode reconstructTracks(std::unique_ptr<xAOD::AFPToFTrackContainer>& outputContainer, const EventContext& ctx) const override;
63 
65  const std::string& outputContainerName () const override {return m_tracksContainerName;}
66 
67 
68 private:
70  Gaudi::Property<std::string> m_tracksContainerName{this, "tracksContainerName", "AFPToFTrackContainer", "Name of the container in which ToF tracks are saved"};
71 
73  Gaudi::Property<int> m_stationID{this, "stationID", 0, "ID number of station for which tracks should be reconstructed"};
74 
76  SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_hitContainerKey{this, "AFPToFHitContainerKey", "AFPToFHitContainer", "Name of the container with ToF hits from which ToF tracks are to be reconstructed"};
77 
79  Gaudi::Property<unsigned int> m_minHitsNumber{this, "minHitsNumber", 3, "Minimal number of bars in track. If there are less bars, track is rejected"};
80 
81  Gaudi::Property<double> m_maxAllowedLength{this, "maxAllowedLength", 100, "Maximal length of the bar signal at which bar can be joined to the track"};
82 
84  ToolHandle<AFP::IToFLocParamDBTool> m_tofLocParamDBTool {this, "tofLocParamDBTool", "AFP__ToFLocParamDBTool", "Tool to access DB to get the local ToF parameters"};
85 
87  void fillTrainWithBars(std::vector<const xAOD::AFPToFHit*> my_trainBars[4], SG::ReadHandle<xAOD::AFPToFHitContainer>& hitContainer) const;
88 
90  void clearTrains(std::vector<const xAOD::AFPToFHit*> my_trainBars[4]) const
91  {my_trainBars[0].clear(); my_trainBars[1].clear(); my_trainBars[2].clear(); my_trainBars[3].clear();}
92 
94  void saveToXAOD (const AFPTDBasicToolTrack& recoTrack, std::unique_ptr<xAOD::AFPToFTrackContainer>& containerToFill, SG::ReadHandle<xAOD::AFPToFHitContainer>& hitContainer) const;
95 };
96 
97 
98 #endif // > !AFP_LOCRECO_AFPTDBASICKALMANTOOL_H
IAFPTDLocRecoTrackAlgTool.h
Header file for interface IAFPTDLocRecoTrackAlgTool.
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AFPToFHit.h
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
AFPTDBasicTool::m_tofLocParamDBTool
ToolHandle< AFP::IToFLocParamDBTool > m_tofLocParamDBTool
@ brief Tool for accessing DB to get the local ToF parameters
Definition: AFPTDBasicTool.h:84
AFPTDBasicTool::finalize
virtual StatusCode finalize() override
Does nothing.
Definition: AFPTDBasicTool.cxx:41
AFPTDBasicTool::saveToXAOD
void saveToXAOD(const AFPTDBasicToolTrack &recoTrack, std::unique_ptr< xAOD::AFPToFTrackContainer > &containerToFill, SG::ReadHandle< xAOD::AFPToFHitContainer > &hitContainer) const
Save reconstructed track to the xAOD container.
Definition: AFPTDBasicTool.cxx:143
AFPTDBasicTool::m_tracksContainerName
Gaudi::Property< std::string > m_tracksContainerName
Name of the xAOD container to which tracks will be saved.
Definition: AFPTDBasicTool.h:70
IToFLocParamDBTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AFPTDBasicTool::outputContainerName
const std::string & outputContainerName() const override
Definition: AFPTDBasicTool.h:65
ToFLocParamData.h
AthAlgTool.h
AFPTDBasicTool::clearTrains
void clearTrains(std::vector< const xAOD::AFPToFHit * > my_trainBars[4]) const
clear station from bars saved in #my_trainBars;
Definition: AFPTDBasicTool.h:90
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AFPTDBasicToolTrack.h
Header file for AFPTDBasicToolTrack used in ToF tracks reconstruction.
AFPTDBasicTool::reconstructTracks
StatusCode reconstructTracks(std::unique_ptr< xAOD::AFPToFTrackContainer > &outputContainer, const EventContext &ctx) const override
Does actual tracks reconstruction.
Definition: AFPTDBasicTool.cxx:65
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AFPTDBasicTool::m_minHitsNumber
Gaudi::Property< unsigned int > m_minHitsNumber
Minimal number of bars in track. If there are less bars, track is rejected (Default = 3)
Definition: AFPTDBasicTool.h:79
AFPLocRecoStationBasicObj.h
Full implementation of class AFPLocRecoStationBasicObj.
AFPToFTrackContainer.h
AFPTDBasicTool::~AFPTDBasicTool
virtual ~AFPTDBasicTool() override
Definition: AFPTDBasicTool.h:50
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AFPTDBasicTool::AFPTDBasicTool
AFPTDBasicTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AFPTDBasicTool.cxx:19
AFPTDBasicTool::m_hitContainerKey
SG::ReadHandleKey< xAOD::AFPToFHitContainer > m_hitContainerKey
Name of the xAOD container with ToF hits to be used in track reconstruction.
Definition: AFPTDBasicTool.h:76
AFPToFTrack.h
AFPTDBasicTool::fillTrainWithBars
void fillTrainWithBars(std::vector< const xAOD::AFPToFHit * > my_trainBars[4], SG::ReadHandle< xAOD::AFPToFHitContainer > &hitContainer) const
Fills Station with ToF hits, dividing them into stations.
Definition: AFPTDBasicTool.cxx:48
AFPTDBasicTool::m_stationID
Gaudi::Property< int > m_stationID
AFP station ID for which tracks will be reconstructed.
Definition: AFPTDBasicTool.h:73
AFPTDBasicTool::initialize
virtual StatusCode initialize() override
Read parameters from job options and print tool configuration.
Definition: AFPTDBasicTool.cxx:27
AFPToFHitContainer.h
AFPTDBasicTool
Class reconstructing tracks using basic Kalman filter.
Definition: AFPTDBasicTool.h:44
AFPTDBasicToolTrack
Class representing a reconstructed basic ToF track.
Definition: AFPTDBasicToolTrack.h:21
AFPTDBasicTool::m_maxAllowedLength
Gaudi::Property< double > m_maxAllowedLength
Definition: AFPTDBasicTool.h:81
AFPToFTrackAuxContainer.h