ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
44public:
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
62private:
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
98 bool areNeighbours(const xAOD::AFPSiHitsCluster* a, const xAOD::AFPSiHitsCluster* b) const;
99
102 std::pair<double, double> linearRegression(const std::vector<std::pair<double, double>>& YX) const;
103 };
104
105
106#endif
Definitions of identification numbers of track reconstruction algorithms.
Header file for interface IAFPSiDLocRecoTrackAlgTool.
Gaudi::Property< unsigned int > m_minimalNumberOfPlanesInTrack
Minimal numer of planes required for track candidate.
StatusCode reconstructTracks(std::unique_ptr< xAOD::AFPTrackContainer > &outputContainer, const EventContext &ctx) const override
Reconstructs tracks properties from track candidates.
SG::ReadHandleKey< xAOD::AFPSiHitsClusterContainer > m_hitsClusterContainerKey
Name of the xAOD container with clusters to be used in track reconstruction.
virtual StatusCode initialize() override
Read parameters from job options and print tool configuration.
bool areNeighbours(const xAOD::AFPSiHitsCluster *a, const xAOD::AFPSiHitsCluster *b) const
Checks if clusters are neighbours Compares distance between them to m_allowedDistanceBetweenClustersI...
std::pair< double, double > linearRegression(const std::vector< std::pair< double, double > > &YX) const
Simple linear regression Used to calculate track postions and slopes.
std::function< bool(const std::vector< const xAOD::AFPSiHitsCluster * > &)> m_selectionFunction
Gaudi::Property< int > m_stationID
AFP station ID for which tracks will be reconstructed.
virtual ~AFPSiDLinRegTool() override
Gaudi::Property< std::string > m_tracksContainerName
Name of the xAOD container to which tracks will be saved; actual saving is done in AFPSIDLocRecoTool.
Gaudi::Property< std::string > m_trackSelection
Track selection type:
AFPSiDLinRegTool(const std::string &type, const std::string &name, const IInterface *parent)
const std::string & outputContainerName() const override
std::vector< const xAOD::AFPSiHitsCluster * > findClusterAroundElement(std::list< const xAOD::AFPSiHitsCluster * > &toJoin, const xAOD::AFPSiHitsCluster *init) const
Looks for cluster around init cluster.
Gaudi::Property< double > m_allowedDistanceBetweenClustersInTrack
Maximum allowed distance between clusters to be considered coming from the same proton.
Property holding a SG store/key/clid from which a ReadHandle is made.
AFPSiHitsCluster_v1 AFPSiHitsCluster