ATLAS Offline Software
AFPSiClusterTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef AFP_SICLUSTERTOOLS_AFPSICLUSTERTOOL_H
6 #define AFP_SICLUSTERTOOLS_AFPSICLUSTERTOOL_H 1
7 
17 // FrameWork includes
19 #include "GaudiKernel/ServiceHandle.h"
20 #include "GaudiKernel/ToolHandle.h"
21 
22 // Monitoring includes
25 
33 
36 #include "xAODForward/AFPSiHit.h"
41 
42 // STL includes
43 #include "nlohmann/json.hpp"
44 #include <string>
45 #include <vector>
46 
54  : public extends<AthAlgTool, IAFPSiClusterTool>
55 {
56 public:
57  AFPSiClusterTool(const std::string& type, const std::string& name, const IInterface* parent);
58 
59  virtual ~AFPSiClusterTool() override {}
60 
61  // Athena algtool's Hooks
62  virtual StatusCode initialize() override;
63 
65  virtual StatusCode finalize() override;
66 
68  StatusCode clusterHits(std::unique_ptr<xAOD::AFPSiHitsClusterContainer>& clustr, const EventContext &ctx) const override;
69 
70 private:
71  SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_AFPSiHitContainerKey { this, "AFPSiHitsContainerName", "AFPSiHitContainer", "name of AFPSiHit container" };
72 
74  ToolHandle<IAFPSiClusterAlgTool> m_clusterAlgToolHandle{this,"clusterAlgTool", "AFPSiClusterAlgTool","Tool with algorithm to perform actual clustering"};
75 
77  ToolHandle<IAFPSiRowColToLocalCSTool> m_rowColToLocalCSToolHandle{this,"rowColToLocalCSTool", "AFPSiRowColToLocalCSTool","Tool to rewrite clusters to xAOD and transform rows and columns to station local coordinates"};
78 
80  ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "", "Monitoring tool"};
81 
82 
84  ToolHandle<AFP::ISiLocAlignDBTool> m_siLocAlignDBTool {this, "siLocAlignDBTool", "AFP__SiLocAlignDBTool", "Tool to access DB to get the local alignment constants"};
85 
87  ToolHandle<AFP::ISiGlobAlignDBTool> m_siGlobAlignDBTool {this, "siGlobAlignDBTool", "AFP__SiGlobAlignDBTool", "Tool to access DB to get the global alignment constants"};
88 
93  Gaudi::Property<std::vector<int>> m_numberOfLayersInStations {this, "numberOfLayersInStations",{4,4,4,4}, "The size of the array in argument defines number of stations, the value in each entry defines number of layers in the station."};
94 
96  StatusCode clearAllLayers(std::vector< std::vector<AFPSiClusterLayerBasicObj> > &my_layers) const;
97 
99  StatusCode fillLayersWithHits(std::vector< std::vector<AFPSiClusterLayerBasicObj> > &my_layers, const EventContext &ctx) const;
100 
102  StatusCode clusterEachLayer(std::vector< std::vector<AFPSiClusterLayerBasicObj> > &my_layers) const;
103 
110  StatusCode saveToXAOD(std::unique_ptr<xAOD::AFPSiHitsClusterContainer>& clustr, std::vector< std::vector<AFPSiClusterLayerBasicObj> > &my_layers, const EventContext &ctx) const;
111 
116  std::vector< std::vector<AFPSiClusterLayerBasicObj> > initLayers (const std::vector<int>& layersInStations) const;
117 };
118 
119 
120 #endif // > !AFP_SICLUSTERTOOLS_AFPSICLUSTERTOOL_H
AFPSiHitsCluster.h
AFPSiClusterTool::clearAllLayers
StatusCode clearAllLayers(std::vector< std::vector< AFPSiClusterLayerBasicObj > > &my_layers) const
Runs AFPSiClusterLayerBasicObj::clearHitsAndClusters() on all layers in #my_layers.
Definition: AFPSiClusterTool.cxx:109
IAFPSiRowColToLocalCSTool.h
Header file for interface IAFPSiRowColToLocalCSTool.
ISiLocAlignDBTool.h
AFPSiClusterTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
@ brief Monitoring tool
Definition: AFPSiClusterTool.h:80
AFPSiClusterTool::~AFPSiClusterTool
virtual ~AFPSiClusterTool() override
Definition: AFPSiClusterTool.h:59
AFPSiClusterTool::initialize
virtual StatusCode initialize() override
Definition: AFPSiClusterTool.cxx:49
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
AFPSiClusterTool::AFPSiClusterTool
AFPSiClusterTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AFPSiClusterTool.cxx:18
AFPSiClusterTool::clusterHits
StatusCode clusterHits(std::unique_ptr< xAOD::AFPSiHitsClusterContainer > &clustr, const EventContext &ctx) const override
Run clusters reconstruction.
Definition: AFPSiClusterTool.cxx:75
AFPSiClusterTool::fillLayersWithHits
StatusCode fillLayersWithHits(std::vector< std::vector< AFPSiClusterLayerBasicObj > > &my_layers, const EventContext &ctx) const
Reads hits from StoreGate and saves them to appropriate layers in #my_layers.
Definition: AFPSiClusterTool.cxx:118
GenericMonitoringTool.h
AFPSiClusterTool::m_numberOfLayersInStations
Gaudi::Property< std::vector< int > > m_numberOfLayersInStations
Array defining number of stations and layers in each station.
Definition: AFPSiClusterTool.h:93
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SiLocAlignData.h
Header file for class SiLocAlignData.
AFPSiClusterTool::saveToXAOD
StatusCode saveToXAOD(std::unique_ptr< xAOD::AFPSiHitsClusterContainer > &clustr, std::vector< std::vector< AFPSiClusterLayerBasicObj > > &my_layers, const EventContext &ctx) const
Save clusters in xAOD::AFPSiHitsClusterContainer.
Definition: AFPSiClusterTool.cxx:164
AthAlgTool.h
AFPSiClusterTool::m_siLocAlignDBTool
ToolHandle< AFP::ISiLocAlignDBTool > m_siLocAlignDBTool
@ brief Tool for accessing DB to get the local alignment constants
Definition: AFPSiClusterTool.h:84
AFPSiClusterTool::initLayers
std::vector< std::vector< AFPSiClusterLayerBasicObj > > initLayers(const std::vector< int > &layersInStations) const
Initialise size as well as station and layer ID for #my_layers.
Definition: AFPSiClusterTool.cxx:25
AFPSiClusterTool::m_AFPSiHitContainerKey
SG::ReadHandleKey< xAOD::AFPSiHitContainer > m_AFPSiHitContainerKey
Definition: AFPSiClusterTool.h:71
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AFPSiClusterTool::clusterEachLayer
StatusCode clusterEachLayer(std::vector< std::vector< AFPSiClusterLayerBasicObj > > &my_layers) const
Runs tool reconstructing clusters on each layer.
Definition: AFPSiClusterTool.cxx:155
AFPSiHitsClusterContainer.h
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
AFPSiHit.h
AFPSiClusterLayerBasicObj.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AFPSiClusterTool::finalize
virtual StatusCode finalize() override
does nothing
Definition: AFPSiClusterTool.cxx:70
AFPSiClusterTool::m_clusterAlgToolHandle
ToolHandle< IAFPSiClusterAlgTool > m_clusterAlgToolHandle
Tool that does the clustering on hits.
Definition: AFPSiClusterTool.h:74
IAFPSiClusterTool.h
Header file for interface IAFPSiClusterTool.
AFPSiHitContainer.h
AFPSiClusterTool::m_rowColToLocalCSToolHandle
ToolHandle< IAFPSiRowColToLocalCSTool > m_rowColToLocalCSToolHandle
Tool that creates xAOD and transforms rows and pixels to local coordinate system.
Definition: AFPSiClusterTool.h:77
AFPSiHitsClusterAuxContainer.h
SiGlobAlignData.h
Source file for class SiGlobAlignData.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AFPSiClusterTool
This class reconstructs clusters of pixels.
Definition: AFPSiClusterTool.h:55
AFP_SiDigiCollection.h
ISiGlobAlignDBTool.h
AFPSiClusterTool::m_siGlobAlignDBTool
ToolHandle< AFP::ISiGlobAlignDBTool > m_siGlobAlignDBTool
@ brief Tool for accessing DB to get the global alignment constants
Definition: AFPSiClusterTool.h:87
IAFPSiClusterAlgTool.h
Header file for interface IAFPSiClusterAlgTool.