ATLAS Offline Software
ClusterTimeProjectionMMClusterBuilderTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef ClusterTimeProjectionMMClusterBuilderTool_h
5 #define ClusterTimeProjectionMMClusterBuilderTool_h
6 
7 
14 #include <array>
15 
16 namespace Muon {
18  public:
19  ClusterTimeProjectionMMClusterBuilderTool(const std::string&, const std::string&, const IInterface*);
20 
22  StatusCode initialize() override;
23 
24  StatusCode getClusters(const EventContext& ctx,
25  std::vector<Muon::MMPrepData>&& stripsVect,
26  std::vector<std::unique_ptr<Muon::MMPrepData>>& clustersVect) const override;
27 
28  virtual RIO_Author getCalibratedClusterPosition(const EventContext& ctx,
29  const std::vector<NSWCalib::CalibratedStrip>& calibratedStrips,
30  const Amg::Vector3D& directionEstimate,
31  Amg::Vector2D& clusterLocalPosition,
32  Amg::MatrixX& covMatrix) const override;
33 
34  private:
35  using LaySortedPrds = std::array<std::vector<Muon::MMPrepData>, 8>;
37  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
38 
39 
40  SG::ReadCondHandleKey<NswErrorCalibData> m_uncertCalibKey{this, "ErrorCalibKey", "NswUncertData",
41  "Key of the parametrized NSW uncertainties"};
42 
43  Gaudi::Property<bool> m_writeStripProperties{this, "writeStripProperties" , true};
44  Gaudi::Property<uint> m_maxHoleSize{this, "maxHoleSize", 1};
45 
46  LaySortedPrds sortHitsToLayer(std::vector<Muon::MMPrepData>&& MMprds) const;
47 
48  std::vector<std::vector<uint>> clusterLayer(const std::vector<Muon::MMPrepData>& MMPrdsPerLayer) const;
49 
50  std::pair<double, double> getClusterPositionPRD(const NswErrorCalibData& errorCalibDB,
52  const std::vector<NSWCalib::CalibratedStrip>& features,
53  const Amg::Vector3D& thetaEstimate) const;
54 
55  StatusCode writeClusterPrd(const EventContext& ctx,
56  const std::vector<Muon::MMPrepData>& constituents,
57  const double clustersPosition,
58  const double clustersPositionErrorSq,
59  std::vector<std::unique_ptr<Muon::MMPrepData>>& mergedClust) const;
60 
61  uint channel(const Identifier& id) const { return m_idHelperSvc->mmIdHelper().channel(id); }
62  uint channel(const MMPrepData& strip) const { return channel(strip.identify()); }
63  }; // class ClusterTimeProjectionMMClusterBuilderTool
64 
65 } // namespace Muon
66 #endif // ClusterTimeProjectionMMClusterBuilderTool_h
NswErrorCalibData
Definition: NswErrorCalibData.h:19
Muon::MMPrepData
Class to represent MM measurements.
Definition: MMPrepData.h:22
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Muon::ClusterTimeProjectionMMClusterBuilderTool::channel
uint channel(const MMPrepData &strip) const
Definition: ClusterTimeProjectionMMClusterBuilderTool.h:62
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::ClusterTimeProjectionMMClusterBuilderTool::getClusters
StatusCode getClusters(const EventContext &ctx, std::vector< Muon::MMPrepData > &&stripsVect, std::vector< std::unique_ptr< Muon::MMPrepData >> &clustersVect) const override
Standard Interface to produce Micromega clusters from raw Input hits without external contstaint.
Definition: ClusterTimeProjectionMMClusterBuilderTool.cxx:36
Muon::IMMClusterBuilderTool
Definition: IMMClusterBuilderTool.h:22
Muon::ClusterTimeProjectionMMClusterBuilderTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Muon Detector Descriptor.
Definition: ClusterTimeProjectionMMClusterBuilderTool.h:37
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
Muon::ClusterTimeProjectionMMClusterBuilderTool::m_maxHoleSize
Gaudi::Property< uint > m_maxHoleSize
Definition: ClusterTimeProjectionMMClusterBuilderTool.h:44
Muon::ClusterTimeProjectionMMClusterBuilderTool::~ClusterTimeProjectionMMClusterBuilderTool
virtual ~ClusterTimeProjectionMMClusterBuilderTool()=default
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::covMatrix
covMatrix
Definition: TrackMeasurement_v1.cxx:19
Muon::ClusterTimeProjectionMMClusterBuilderTool::ClusterTimeProjectionMMClusterBuilderTool
ClusterTimeProjectionMMClusterBuilderTool(const std::string &, const std::string &, const IInterface *)
Definition: ClusterTimeProjectionMMClusterBuilderTool.cxx:23
AthAlgTool.h
MMPrepData.h
NswErrorCalibData.h
Muon::ClusterTimeProjectionMMClusterBuilderTool
Definition: ClusterTimeProjectionMMClusterBuilderTool.h:17
ReadCondHandleKey.h
Muon::ClusterTimeProjectionMMClusterBuilderTool::getCalibratedClusterPosition
virtual RIO_Author getCalibratedClusterPosition(const EventContext &ctx, const std::vector< NSWCalib::CalibratedStrip > &calibratedStrips, const Amg::Vector3D &directionEstimate, Amg::Vector2D &clusterLocalPosition, Amg::MatrixX &covMatrix) const override
Definition: ClusterTimeProjectionMMClusterBuilderTool.cxx:259
Muon::ClusterTimeProjectionMMClusterBuilderTool::channel
uint channel(const Identifier &id) const
Definition: ClusterTimeProjectionMMClusterBuilderTool.h:61
Muon::ClusterTimeProjectionMMClusterBuilderTool::sortHitsToLayer
LaySortedPrds sortHitsToLayer(std::vector< Muon::MMPrepData > &&MMprds) const
Definition: ClusterTimeProjectionMMClusterBuilderTool.cxx:91
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
SG::ReadCondHandleKey< NswErrorCalibData >
Muon::ClusterTimeProjectionMMClusterBuilderTool::getClusterPositionPRD
std::pair< double, double > getClusterPositionPRD(const NswErrorCalibData &errorCalibDB, uint8_t author, const std::vector< NSWCalib::CalibratedStrip > &features, const Amg::Vector3D &thetaEstimate) const
Definition: ClusterTimeProjectionMMClusterBuilderTool.cxx:146
Muon::ClusterTimeProjectionMMClusterBuilderTool::clusterLayer
std::vector< std::vector< uint > > clusterLayer(const std::vector< Muon::MMPrepData > &MMPrdsPerLayer) const
Definition: ClusterTimeProjectionMMClusterBuilderTool.cxx:113
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
Muon::ClusterTimeProjectionMMClusterBuilderTool::m_uncertCalibKey
SG::ReadCondHandleKey< NswErrorCalibData > m_uncertCalibKey
Definition: ClusterTimeProjectionMMClusterBuilderTool.h:40
IMMClusterBuilderTool.h
AthAlgTool
Definition: AthAlgTool.h:26
Muon::ClusterTimeProjectionMMClusterBuilderTool::m_writeStripProperties
Gaudi::Property< bool > m_writeStripProperties
Definition: ClusterTimeProjectionMMClusterBuilderTool.h:43
Muon::MMClusterOnTrack::Author
Author
Definition: MMClusterOnTrack.h:89
Muon::ClusterTimeProjectionMMClusterBuilderTool::writeClusterPrd
StatusCode writeClusterPrd(const EventContext &ctx, const std::vector< Muon::MMPrepData > &constituents, const double clustersPosition, const double clustersPositionErrorSq, std::vector< std::unique_ptr< Muon::MMPrepData >> &mergedClust) const
Definition: ClusterTimeProjectionMMClusterBuilderTool.cxx:208
Muon::ClusterTimeProjectionMMClusterBuilderTool::initialize
StatusCode initialize() override
Definition: ClusterTimeProjectionMMClusterBuilderTool.cxx:30
Muon::ClusterTimeProjectionMMClusterBuilderTool::LaySortedPrds
std::array< std::vector< Muon::MMPrepData >, 8 > LaySortedPrds
Definition: ClusterTimeProjectionMMClusterBuilderTool.h:35
IMuonIdHelperSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14