ATLAS Offline Software
MergedPixelsTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MergedPixelsAlg.h
7 // SimplePixelClusteringTool plus implementation of merging clusters which
8 // contain a common RDO Identifier
9 // Input from RDOs
11 // (c) ATLAS Detector software
13 
14 #ifndef SICLUSTERIZATIONTOOL_MERGEDPIXELSTOOL_H
15 #define SICLUSTERIZATIONTOOL_MERGEDPIXELSTOOL_H
16 
18 
19 #include "Identifier/Identifier.h"
20 // forward declare not possible (typedef)
28 
29 #include "GaudiKernel/ServiceHandle.h"
30 
31 #include <atomic>
32 #include <vector>
33 #include <array>
34 
35 class PixelID;
36 
37 namespace InDetDD {
38  class SiDetectorElement;
39 }
40 
41 
42 namespace InDet {
43 
44  struct network {
45  public:
46  int NC{};
47  std::array<int,8> CON{};
48  };
49 
50  const auto pixel_less = [] (UnpackedPixelRDO const& id1,UnpackedPixelRDO const& id2) -> bool {
51  if(id1.COL == id2.COL) return id1.ROW < id2.ROW;
52  return id1.COL < id2.COL;
53  };
54 
55  class MergedPixelsTool final: public extends<AthAlgTool, IPixelClusteringTool> {
56  public:
57 
58 
59  // Constructor with parameters:
60  MergedPixelsTool(const std::string& type,
61  const std::string& name,
62  const IInterface* parent);
63 
64  virtual ~MergedPixelsTool() = default;
65 
66  // Called by the PixelPrepRawDataFormation algorithm once for every pixel
67  // module (with non-empty RDO collection...).
68  // It clusters together the RDOs with a pixell cell side in common.
69  // [Implementation of the IPixelClusteringTool interface]
72  const PixelID& pixelID,
73  DataPool<PixelCluster>* dataItemsPool,
74  const EventContext& ctx) const override;
75 
76  // Once the lists of RDOs which makes up the clusters have been found by the
77  // clusterize() method, this method is called for each of these lists.
78  // The method computes the local position of the cluster, and create
79  // a "cluster object" with all the required information (including charge
80  // interpolation variables Omegax and Omegay, and whether the cluster
81  // contains ganged pixels)
82  // This method calls the ClusterMakerTool to compute global position and
83  // position errors.
84  // Input parameters are the list of RDOs identifier of the would-be
85  // cluster, the list of TOT values, the module the cluster belongs to,
86  // the pixel helper tool and the number of RDOS of the cluster.
88  const std::vector<Identifier>& group,
89  const std::vector<int>& totgroup,
90  const std::vector<int>& lvl1group,
91  const InDetDD::SiDetectorElement* element,
92  const PixelID& pixelID,
93  int& clusterNumber,
94  bool split,
95  double splitProb1,
96  double splitProb2,
97  const PixelChargeCalibCondData* calibData,
98  const PixelCalib::PixelOfflineCalibData* offlineCalibData,
99  const EventContext& ctx) const;
100 
102  virtual StatusCode initialize() override;
103 
105  virtual StatusCode finalize() override;
106 
107 
108  private:
112 
113  void addClusterNumber(const int& r,
114  const int& Ncluster,
115  const std::vector<network>& connections,
116  std::vector<UnpackedPixelRDO>& collectionID) const;
117 
118  BooleanProperty m_addCorners{this, "AddCorners", true};
119 
120  ToolHandle<ClusterMakerTool> m_clusterMaker {this, "globalPosAlg", "InDet::ClusterMakerTool"};
121  ToolHandle<PixelRDOTool> m_pixelRDOTool {this, "PixelRDOTool", "InDet::PixelRDOTool"};
122 
123  SG::ReadCondHandleKey<PixelChargeCalibCondData> m_chargeDataKey {this, "PixelChargeCalibCondData", "PixelChargeCalibCondData", "Pixel charge calibration data"};
124  SG::ReadCondHandleKey<PixelCalib::PixelOfflineCalibData> m_clusterErrorKey{this, "PixelOfflineCalibData", "PixelOfflineCalibData", "Output key of pixel cluster"};
125 
126 
127  IntegerProperty m_posStrategy{this, "posStrategy", 0};
128  IntegerProperty m_errorStrategy{this, "errorStrategy", 1};
129 
130  mutable std::atomic_uint m_processedClusters{0};
131  mutable std::atomic_bool m_printw{true};
132  };
133 
134 }
135 
136 #endif // SICLUSTERIZATIONTOOL_MERGEDPIXELSALG_H
beamspotman.r
def r
Definition: beamspotman.py:676
InDet::MergedPixelsTool::m_addCorners
BooleanProperty m_addCorners
Definition: MergedPixelsTool.h:118
PixelOfflineCalibData.h
InDet::MergedPixelsTool::m_clusterErrorKey
SG::ReadCondHandleKey< PixelCalib::PixelOfflineCalibData > m_clusterErrorKey
Definition: MergedPixelsTool.h:124
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::MergedPixelsTool::m_chargeDataKey
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
Definition: MergedPixelsTool.h:123
InDet::MergedPixelsTool::clusterize
virtual PixelClusterCollection * clusterize(const InDetRawDataCollection< PixelRDORawData > &RDOs, const PixelID &pixelID, DataPool< PixelCluster > *dataItemsPool, const EventContext &ctx) const override
Definition: MergedPixelsTool.cxx:270
InDet::MergedPixelsTool::~MergedPixelsTool
virtual ~MergedPixelsTool()=default
InDet::MergedPixelsTool::m_errorStrategy
IntegerProperty m_errorStrategy
Definition: MergedPixelsTool.h:128
InDet::network::CON
std::array< int, 8 > CON
Definition: MergedPixelsTool.h:47
InDet::MergedPixelsTool::m_clusterMaker
ToolHandle< ClusterMakerTool > m_clusterMaker
Definition: MergedPixelsTool.h:120
InDet::pixel_less
const auto pixel_less
Definition: MergedPixelsTool.h:50
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
PixelRDORawData.h
PixelGangedClusterAmbiguities.h
PixelCalib::PixelOfflineCalibData
Definition: PixelOfflineCalibData.h:31
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PixelChargeCalibCondData
Definition: PixelChargeCalibCondData.h:24
InDetRawDataCollection
Definition: InDetRawDataCollection.h:31
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::MergedPixelsTool::initialize
virtual StatusCode initialize() override
Retrieve the necessary services in initialize
Definition: MergedPixelsTool.cxx:41
InDet::MergedPixelsTool::MergedPixelsTool
MergedPixelsTool()
PixelClusterCollection.h
InDet::MergedPixelsTool::finalize
virtual StatusCode finalize() override
Statistics output
Definition: MergedPixelsTool.cxx:52
ReadCondHandleKey.h
InDet::MergedPixelsTool::m_printw
std::atomic_bool m_printw
Definition: MergedPixelsTool.h:131
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDet::MergedPixelsTool::operator=
MergedPixelsTool & operator=(const MergedPixelsTool &)
InDet::network
Definition: MergedPixelsTool.h:44
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
SG::ReadCondHandleKey< PixelChargeCalibCondData >
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
InDet::MergedPixelsTool::m_posStrategy
IntegerProperty m_posStrategy
Definition: MergedPixelsTool.h:127
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:47
InDet::MergedPixelsTool
Definition: MergedPixelsTool.h:55
InDetRawDataCollection.h
InDet::MergedPixelsTool::makeCluster
PixelCluster makeCluster(const std::vector< Identifier > &group, const std::vector< int > &totgroup, const std::vector< int > &lvl1group, const InDetDD::SiDetectorElement *element, const PixelID &pixelID, int &clusterNumber, bool split, double splitProb1, double splitProb2, const PixelChargeCalibCondData *calibData, const PixelCalib::PixelOfflineCalibData *offlineCalibData, const EventContext &ctx) const
Definition: MergedPixelsTool.cxx:74
InDet::MergedPixelsTool::m_pixelRDOTool
ToolHandle< PixelRDOTool > m_pixelRDOTool
Definition: MergedPixelsTool.h:121
PixelID
Definition: PixelID.h:67
PixelChargeCalibCondData.h
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
InDet::MergedPixelsTool::m_processedClusters
std::atomic_uint m_processedClusters
statistics output
Definition: MergedPixelsTool.h:130
InDet::MergedPixelsTool::addClusterNumber
void addClusterNumber(const int &r, const int &Ncluster, const std::vector< network > &connections, std::vector< UnpackedPixelRDO > &collectionID) const
Definition: MergedPixelsTool.cxx:458
InDet::PixelClusterCollection
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
Definition: PixelClusterCollection.h:26
InDet::MergedPixelsTool::MergedPixelsTool
MergedPixelsTool(const MergedPixelsTool &)
InDet::network::NC
int NC
Definition: MergedPixelsTool.h:46
PixelRDOTool.h