ATLAS Offline Software
Loading...
Searching...
No Matches
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
35class PixelID;
36
37namespace InDetDD {
39}
40
41
42namespace 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]
70 virtual PixelClusterCollection* clusterize(
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
HWIdentifier id2
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
Class to hold geometrical description of a silicon detector element.
MergedPixelsTool(const std::string &type, const std::string &name, const IInterface *parent)
IntegerProperty m_errorStrategy
virtual StatusCode finalize() override
Statistics output.
std::atomic_uint m_processedClusters
statistics output
ToolHandle< PixelRDOTool > m_pixelRDOTool
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
void addClusterNumber(const int &r, const int &Ncluster, const std::vector< network > &connections, std::vector< UnpackedPixelRDO > &collectionID) const
SG::ReadCondHandleKey< PixelCalib::PixelOfflineCalibData > m_clusterErrorKey
IntegerProperty m_posStrategy
ToolHandle< ClusterMakerTool > m_clusterMaker
virtual StatusCode initialize() override
Retrieve the necessary services in initialize.
virtual PixelClusterCollection * clusterize(const InDetRawDataCollection< PixelRDORawData > &RDOs, const PixelID &pixelID, DataPool< PixelCluster > *dataItemsPool, const EventContext &ctx) const override
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
MergedPixelsTool & operator=(const MergedPixelsTool &)
virtual ~MergedPixelsTool()=default
MergedPixelsTool(const MergedPixelsTool &)
const auto pixel_less
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
int r
Definition globals.cxx:22
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177
Message Stream Member.
Primary Vertex Finder.
std::array< int, 8 > CON