diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h similarity index 78% rename from ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h rename to ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h index 9d37c2c77b69ad0105cbb36a78ab8829b8d39aeb..38080060f69bb2c4eb623f60ddfe2d860e9aea7d 100644 --- a/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AfpFastReco.h +++ b/ForwardDetectors/AFP/Run3AFPMonitoring/Run3AFPMonitoring/AFPFastReco.h @@ -9,10 +9,10 @@ #include "xAODForward/AFPSiHit.h" #include "xAODForward/AFPSiHitContainer.h" -namespace AfpMon { +namespace AFPMon { - struct AfpCluster { - AfpCluster(float x_, float y_, float z_, int s, int l) + struct AFPCluster { + AFPCluster(float x_, float y_, float z_, int s, int l) : x {x_}, y {y_}, z {z_}, station {s}, layer {l} {} float x; @@ -22,7 +22,7 @@ namespace AfpMon { int layer; }; - inline bool operator==(const AfpCluster& lhs, const AfpCluster& rhs) { + inline bool operator==(const AFPCluster& lhs, const AFPCluster& rhs) { if (lhs.x != rhs.x) return false; if (lhs.y != rhs.y) return false; if (lhs.z != rhs.z) return false; @@ -32,8 +32,8 @@ namespace AfpMon { return true; } - struct AfpTrack { - AfpTrack(float x_, float y_, int s, std::array<int, 4> a) + struct AFPTrack { + AFPTrack(float x_, float y_, int s, std::array<int, 4> a) : x {x_}, y {y_}, station {s}, layerClusters {std::move(a)} {} float x; @@ -42,19 +42,19 @@ namespace AfpMon { std::array<int, 4> layerClusters; }; - class AfpFastReco { + class AFPFastReco { public: /// Constructor. Sets input hit container - AfpFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {} + AFPFastReco(const xAOD::AFPSiHitContainer* hits) : m_hitContainer {hits} {} /// Performs fast reconstruction of clusters and tracks void reco(); /// Returns vector of clusters - std::vector<AfpCluster> clusters() const { return m_clusters; } + std::vector<AFPCluster> clusters() const { return m_clusters; } /// Returns vector of tracks - std::vector<AfpTrack> tracks() const { return m_tracks; } + std::vector<AFPTrack> tracks() const { return m_tracks; } private: /// Performs fast cluster reconstruction @@ -74,18 +74,18 @@ namespace AfpMon { bool areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const; /// Checks if given clusters are neighbours - bool areNeighbours(const AfpCluster& lhs, const AfpCluster& rhs) const; + bool areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const; /// Pointer to hit container const xAOD::AFPSiHitContainer* m_hitContainer; /// Vector of clusters - std::vector<AfpCluster> m_clusters; + std::vector<AFPCluster> m_clusters; /// Vector of tracks - std::vector<AfpTrack> m_tracks; + std::vector<AFPTrack> m_tracks; - /// Number of Afp stations + /// Number of AFP stations static constexpr int s_afpStations = 4; /// Number of layers in each station @@ -99,7 +99,7 @@ namespace AfpMon { }; template <class T> - std::vector<T> AfpFastReco::findAround(T init, std::list<T>& toJoin) const { + std::vector<T> AFPFastReco::findAround(T init, std::list<T>& toJoin) const { std::vector<T> element; element.push_back(init); @@ -125,7 +125,7 @@ namespace AfpMon { return element; } -} // namespace AfpMon +} // namespace AFPMon #endif /* AFP_MONITORING_AFPFASTRECO_H */ diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx similarity index 85% rename from ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx rename to ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx index 41d2dc26c946cbf9aaa8afe76bc49a4072cf2c8b..83ba56c43358f7948e17db6ff961b39cf86df379 100644 --- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AfpFastReco.cxx +++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx @@ -1,13 +1,22 @@ -#include <Run3AFPMonitoring/AfpFastReco.h> +/* + * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + * * + * * + * * AFPFastReco.cxx + * * + * * + * */ -namespace AfpMon { +#include <Run3AFPMonitoring/AFPFastReco.h> - void AfpFastReco::reco() { +namespace AFPMon { + + void AFPFastReco::reco() { recoClusters(); recoTracks(); } - void AfpFastReco::recoClusters() { + void AFPFastReco::recoClusters() { constexpr float dx = 0.25; // [mm] constexpr float dy = 0.05; // [mm] constexpr float dz = 9.00; // [mm] @@ -46,7 +55,7 @@ namespace AfpMon { } } - void AfpFastReco::recoTracks() { + void AFPFastReco::recoTracks() { std::list toTrack(m_clusters.begin(), m_clusters.end()); while (toTrack.size() > 0) { @@ -76,7 +85,7 @@ namespace AfpMon { } } - std::pair<double, double> AfpFastReco::linReg(std::vector<std::pair<double, double>> YX) const { + std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, double>> YX) const { double meanx = 0; double meany = 0; for (const auto& yx : YX) { @@ -102,7 +111,7 @@ namespace AfpMon { return {position, slope}; } - bool AfpFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const { + bool AFPFastReco::areNeighbours(const xAOD::AFPSiHit* lhs, const xAOD::AFPSiHit* rhs) const { if (lhs->stationID() != rhs->stationID()) return false; if (lhs->pixelLayerID() != rhs->pixelLayerID()) return false; if (lhs->pixelColIDChip() != rhs->pixelColIDChip()) return false; @@ -111,7 +120,7 @@ namespace AfpMon { return true; } - bool AfpFastReco::areNeighbours(const AfpCluster& lhs, const AfpCluster& rhs) const { + bool AFPFastReco::areNeighbours(const AFPCluster& lhs, const AFPCluster& rhs) const { if (lhs.station != rhs.station) return false; const float dx = lhs.x - rhs.x; @@ -121,5 +130,5 @@ namespace AfpMon { return true; } -} // namespace AfpMon +} // namespace AFPMon diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx index 884bf30e01c9f667d9fd6b1ebbf7c853fa1ab7d4..eb48b4bd54038aec911d59b8d02c12260775ed12 100644 --- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx +++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration * * * AFPSiLayerAlgorithm @@ -11,7 +11,7 @@ #include "StoreGate/ReadHandleKey.h" #include "xAODForward/AFPStationID.h" -#include <Run3AFPMonitoring/AfpFastReco.h> +#include <Run3AFPMonitoring/AFPFastReco.h> AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) @@ -89,7 +89,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const else ATH_MSG_WARNING("Unrecognised station index: " << hitsItr->stationID()); } - AfpMon::AfpFastReco fast(afpHitContainer.get()); + AFPMon::AFPFastReco fast(afpHitContainer.get()); fast.reco(); for (const auto& cluster : fast.clusters()) { diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx index ffe4accdd777f4e42daee57017c3ba92fd572f4d..5d912b00bad9a6a3fc500f54e0c78154828e423d 100644 --- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx +++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration * * * AFPToFAlgorithm