ATLAS Offline Software
AFPSiDLinRegTool.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 
11 #ifndef AFP_LOCRECO_AFPSIDLINREGTOOL_H
12 #define AFP_LOCRECO_AFPSIDLINREGTOOL_H
13 
14 
15 
16 // FrameWork includes
18 #include "GaudiKernel/ServiceHandle.h"
19 
20 // xAOD includes
24 #include "xAODForward/AFPTrack.h"
26 
27 // AFP_LocReco includes
29 
30 // STL includes
31 #include <string>
32 #include <list>
33 #include <vector>
34 #include <tuple>
35 #include <memory>
36 #include <utility>
37 
38 
41 : public extends<AthAlgTool, IAFPSiDLocRecoTrackAlgTool>
42 {
43 
44 public:
45  AFPSiDLinRegTool(const std::string& type, const std::string& name, const IInterface* parent);
46 
47  virtual ~AFPSiDLinRegTool() override {}
48 
50  virtual StatusCode initialize() override;
51 
52 
57  StatusCode reconstructTracks(std::unique_ptr<xAOD::AFPTrackContainer>& outputContainer, const EventContext& ctx) const override;
58 
60  const std::string& outputContainerName () const override {return m_tracksContainerName;}
61 
62 private:
64  Gaudi::Property<std::string> m_tracksContainerName{this, "tracksContainerName", "AFPTrackContainer", "Name of the container in which tracks are saved"};
65 
67  Gaudi::Property<int> m_stationID{this, "stationID", 0, "ID number of station for which tracks should be reconstructed"};
68 
70  Gaudi::Property<double> m_allowedDistanceBetweenClustersInTrack{this, "allowedDistanceBetweenClustersInTrack", 0.5, "Maximum allowed distance between clusters to be considered coming from the same proton"};
71 
76  Gaudi::Property<std::string> m_trackSelection{this, "trackSelection", "Medium", "Track selection, allowed values are \"Loose\" (accept all track candidates), \"Medium\" (accept only tracks with clusters in at least #m_minimalNumberOfPlanesInTrack planes), or \"Tight\" (reject all with more than a single cluster per plane and less than #m_minimalNumberOfPlanesInTrack planes)"};
77 
79  Gaudi::Property<unsigned int> m_minimalNumberOfPlanesInTrack{this, "minimalNumberOfPlanesInTrack", 2, "Minimal numer of planes required for track candidate"};
80 
81  // function to select tracks
82  std::function<bool(const std::vector<const xAOD::AFPSiHitsCluster*>&)> m_selectionFunction;
83 
85  SG::ReadHandleKey<xAOD::AFPSiHitsClusterContainer> m_hitsClusterContainerKey{this, "AFPSiHitsClusterContainerKey", "AFPSiHitsClusterContainer", "Name of the container with clusters of hits from which tracks are to be reconstructed"};
86 
94  std::vector<const xAOD::AFPSiHitsCluster*> findClusterAroundElement(std::list<const xAOD::AFPSiHitsCluster*>& toJoin, const xAOD::AFPSiHitsCluster* init) const;
95 
99 
102  std::pair<double, double> linearRegression(const std::vector<std::pair<double, double>>& YX) const;
103  };
104 
105 
106 #endif
AFPSiDLinRegTool::m_minimalNumberOfPlanesInTrack
Gaudi::Property< unsigned int > m_minimalNumberOfPlanesInTrack
Minimal numer of planes required for track candidate.
Definition: AFPSiDLinRegTool.h:79
AFPTrackContainer.h
AFPSiHitsCluster.h
AFPSiDLinRegTool::m_allowedDistanceBetweenClustersInTrack
Gaudi::Property< double > m_allowedDistanceBetweenClustersInTrack
Maximum allowed distance between clusters to be considered coming from the same proton.
Definition: AFPSiDLinRegTool.h:70
AFPSiDLinRegTool::m_selectionFunction
std::function< bool(const std::vector< const xAOD::AFPSiHitsCluster * > &)> m_selectionFunction
Definition: AFPSiDLinRegTool.h:82
AFPSiDLinRegTool::linearRegression
std::pair< double, double > linearRegression(const std::vector< std::pair< double, double >> &YX) const
Simple linear regression Used to calculate track postions and slopes.
Definition: AFPSiDLinRegTool.cxx:127
AFPSiDLinRegTool::initialize
virtual StatusCode initialize() override
Read parameters from job options and print tool configuration.
Definition: AFPSiDLinRegTool.cxx:23
AFPSiDLinRegTool::m_hitsClusterContainerKey
SG::ReadHandleKey< xAOD::AFPSiHitsClusterContainer > m_hitsClusterContainerKey
Name of the xAOD container with clusters to be used in track reconstruction.
Definition: AFPSiDLinRegTool.h:85
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
AFPTrackRecoAlgID.h
Definitions of identification numbers of track reconstruction algorithms.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
AFPSiDLinRegTool::findClusterAroundElement
std::vector< const xAOD::AFPSiHitsCluster * > findClusterAroundElement(std::list< const xAOD::AFPSiHitsCluster * > &toJoin, const xAOD::AFPSiHitsCluster *init) const
Looks for cluster around init cluster.
Definition: AFPSiDLinRegTool.cxx:93
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AFPSiDLinRegTool::reconstructTracks
StatusCode reconstructTracks(std::unique_ptr< xAOD::AFPTrackContainer > &outputContainer, const EventContext &ctx) const override
Reconstructs tracks properties from track candidates.
Definition: AFPSiDLinRegTool.cxx:155
AFPSiDLinRegTool::~AFPSiDLinRegTool
virtual ~AFPSiDLinRegTool() override
Definition: AFPSiDLinRegTool.h:47
AFPSiHitsClusterContainer.h
AFPSiDLinRegTool::outputContainerName
const std::string & outputContainerName() const override
Definition: AFPSiDLinRegTool.h:60
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
IAFPSiDLocRecoTrackAlgTool.h
Header file for interface IAFPSiDLocRecoTrackAlgTool.
AFPSiDLinRegTool::m_tracksContainerName
Gaudi::Property< std::string > m_tracksContainerName
Name of the xAOD container to which tracks will be saved; actual saving is done in AFPSIDLocRecoTool.
Definition: AFPSiDLinRegTool.h:64
python.PyKernel.init
def init(v_theApp, v_rootStream=None)
Definition: PyKernel.py:45
AFPTrack.h
a
TList * a
Definition: liststreamerinfos.cxx:10
AFPSiDLinRegTool::areNeighbours
bool areNeighbours(const xAOD::AFPSiHitsCluster *a, const xAOD::AFPSiHitsCluster *b) const
Checks if clusters are neighbours Compares distance between them to m_allowedDistanceBetweenClustersI...
Definition: AFPSiDLinRegTool.cxx:76
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AFPSiDLinRegTool
Tool for reconstructing AFPTrack parameters from track candidates.
Definition: AFPSiDLinRegTool.h:42
AFPSiDLinRegTool::AFPSiDLinRegTool
AFPSiDLinRegTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AFPSiDLinRegTool.cxx:15
xAOD::AFPSiHitsCluster_v1
Class representing a cluster of AFP pixel hits.
Definition: AFPSiHitsCluster_v1.h:32
AFPSiDLinRegTool::m_trackSelection
Gaudi::Property< std::string > m_trackSelection
Track selection type:
Definition: AFPSiDLinRegTool.h:76
AFPSiDLinRegTool::m_stationID
Gaudi::Property< int > m_stationID
AFP station ID for which tracks will be reconstructed.
Definition: AFPSiDLinRegTool.h:67
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60