ATLAS Offline Software
Loading...
Searching...
No Matches
InnerDetector/InDetMeasurementUtilities/src/Helpers.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace TrackingUtilities {
8
9 std::pair<float, float> computeOmegas(const xAOD::PixelCluster& cluster,
10 const PixelID& pixelID)
11 {
13 rdo_list_cluster = cluster.rdoList();
14 const std::vector<float>& charge_list_cluster = cluster.chargeList();
15
16 if (rdo_list_cluster.size() != charge_list_cluster.size()) {
17 return {-1.f, -1.f};
18 }
19
20 int colmax = std::numeric_limits<int>::min();
21 int rowmax = std::numeric_limits<int>::min();
22 int colmin = std::numeric_limits<int>::max();
23 int rowmin = std::numeric_limits<int>::max();
24
25 float qRowMin = 0.f;
26 float qRowMax = 0.f;
27 float qColMin = 0.f;
28 float qColMax = 0.f;
29
30 for (std::size_t i(0); i<rdo_list_cluster.size(); ++i) {
31 Identifier this_rdo(rdo_list_cluster.at(i));
32 const float this_charge = charge_list_cluster.at(i);
33
34 const int row = pixelID.phi_index(this_rdo);
35 if (row > rowmax) {
36 rowmax = row;
37 qRowMax = this_charge;
38 } else if (row == rowmax) {
39 qRowMax += this_charge;
40 }
41
42 if (row < rowmin) {
43 rowmin = row;
44 qRowMin = this_charge;
45 } else if (row == rowmin) {
46 qRowMin += this_charge;
47 }
48
49 const int col = pixelID.eta_index(this_rdo);
50 if (col > colmax) {
51 colmax = col;
52 qColMax = this_charge;
53 } else if (col == colmax) {
54 qColMax += this_charge;
55 }
56
57 if (col < colmin) {
58 colmin = col;
59 qColMin = this_charge;
60 } else if (col == colmin) {
61 qColMin += this_charge;
62 }
63 } // loop on rdos and charges
64
65 float omegax = -1.f;
66 float omegay = -1.f;
67 if(qRowMin + qRowMax > 0) omegax = qRowMax/(qRowMin + qRowMax);
68 if(qColMin + qColMax > 0) omegay = qColMax/(qColMin + qColMax);
69
70 return std::make_pair(omegax, omegay);
71 }
72
73}
74
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
int eta_index(const Identifier &id) const
Definition PixelID.h:640
int phi_index(const Identifier &id) const
Definition PixelID.h:634
Helper class to provide constant type-safe access to aux data.
SG::ConstAccessor< SG::JaggedVecElt< Identifier::value_type > >::element_type rdoList() const
Returns the list of identifiers of the channels building the cluster.
SG::ConstAccessor< SG::JaggedVecElt< float > >::element_type chargeList() const
Returns the list of charges of the channels building the cluster.
std::pair< float, float > computeOmegas(const xAOD::PixelCluster &cluster, const PixelID &pixelID)
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.