ATLAS Offline Software
Loading...
Searching...
No Matches
PixelClusterValidationPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8namespace ActsTrk {
9
11 const std::string& sDir)
12 : PlotBase(pParent, sDir)
13 {
14 m_barrelEndcap = Book1D("barrelEndcap", "PixelCluster_barrelEndcap;Barrel-Endcap;Entries;", 5, -2, 3, false);
15
16 m_layerDisk_barrel = Book1D("layerDisk_barrel", "PixelCluster_layerDisk_barrel;Layer Disk;Entries;", 9, 0, 9, false);
17 m_layerDisk_endcap = Book1D("layerDisk_endcap", "PixelCluster_layerDisk_endcap;Layer Disk;Entries;", 9, 0, 9, false);
18
19 m_phiModule_barrel = Book1D("phiModule_barrel", "PixelCluster_phiModule_barrel;Phi Module;Entries;", 56, 0, 56, false);
20 m_phiModule_endcap = Book1D("phiModule_endcap", "PixelCluster_phiModule_endcap;Phi Module;Entries;", 56, 0, 56, false);
21
22 m_etaModule_barrel = Book1D("etaModule_barrel", "PixelCluster_etaModule_barrel;Eta Module;Entries;", 46, -18, 28, false);
23 m_etaModule_endcap = Book1D("etaModule_endcap", "PixelCluster_etaModule_endcap;Eta Module;Entries;", 46, -18, 28, false);
24
25 m_isInnermost_barrel = Book1D("isInnermost_barrel", "PixelCluster_isInnermost_barrel;In Innermost;Entries;", 2, 0, 2, false);
26 m_isInnermost_endcap = Book1D("isInnermost_endcap", "PixelCluster_isInnermost_endcap;In Innermost;Entries;", 2, 0, 2, false);
27
28 m_isNextToInnermost_barrel = Book1D("isNextToInnermost_barrel", "PixelCluster_isNextToInnermost_barrel;Is Next To Innermost;Entries", 2, 0, 2, false);
29 m_isNextToInnermost_endcap = Book1D("isNextToInnermost_endcap", "PixelCluster_isNextToInnermost_endcap;Is Next To Innermost;Entries", 2, 0, 2, false);
30
31 m_eta_barrel = Book1D("eta_barrel", "PixelCluster_eta_barrel;eta;Entries;", 50, -5, 5, false);
32 m_eta_endcap = Book1D("eta_endcap", "PixelCluster_eta_endcap;eta;Entries;", 50, -5, 5, false);
33
34 m_perp_barrel = Book1D("perp_barrel", "PixelCluster_perp_barrel;r [mm];Entries;", 100, 0, 320, false);
35 m_perp_endcap = Book1D("perp_endcap", "PixelCluster_perp_endcap;r [mm];Entries;", 100, 0, 320, false);
36
37 m_charge_barrel = Book1D("charge_barrel", "PixelCluster_charge_barrel;Charge; Entries;", 100, 0, 150000, false);
38 m_charge_endcap = Book1D("charge_endcap", "PixelCluster_charge_endcap;Charge; Entries;", 100, 0, 150000, false);
39
40 m_total_charge_barrel = Book1D("total_charge_barrel", "PixelCluster_totalCharge_barrel;total charge;Entries;", 50, 0, 300000, false);
41 m_total_charge_endcap = Book1D("total_charge_endcap", "PixelCluster_totalCharge_endcap;total charge;Entries;", 50, 0, 300000, false);
42
43 m_tot_barrel = Book1D("tot_barrel", "PixelCluster_tot_barrel;tot;Entries;", 18, 0, 18, false);
44 m_tot_endcap = Book1D("tot_endcap", "PixelCluster_tot_endcap;tot;Entries;", 18, 0, 18, false);
45
46 m_charge_vs_tot_barrel = Book2D("charge_vs_tot_barrel", "PixelCluster_charge_vs_tot_barrel;Charge;ToT;", 100, 0, 150000, 18, 0, 18, false);
47 m_charge_vs_tot_endcap = Book2D("charge_vs_tot_endcap", "PixelCluster_charge_vs_tot_endcap;Charge;ToT;", 100, 0, 150000, 18, 0, 18, false);
48
49 m_total_tot_barrel = Book1D("total_tot_barrel", "PixelCluster_totalTot_barrel;total tot;Entries;", 50, 0, 5000, false);
50 m_total_tot_endcap = Book1D("total_tot_endcap", "PixelCluster_totalTot_endcap;total tot;Entries;", 50, 0, 5000, false);
51
52 m_omega_x_barrel = Book1D("omega_x_barrel", "PixelCluster_omega_x_barrel;omega x;Entries;", 50, 0, 1, false);
53 m_omega_x_endcap = Book1D("omega_x_endcap", "PixelCluster_omega_x_endcap;omega x;Entries;", 50, 0, 1, false);
54
55 m_omega_y_barrel = Book1D("omega_y_barrel", "PixelCluster_omega_y_barrel;omega x;Entries;", 50, 0, 1, false);
56 m_omega_y_endcap = Book1D("omega_y_endcap", "PixelCluster_omega_y_endcap;omega x;Entries;", 50, 0, 1, false);
57
58 m_lvl1a_barrel = Book1D("lvl1a_barrel", "PixelCluster_lvl1a_barrel;lvl1a;Entries;",20, 0, 20, false);
59 m_lvl1a_endcap = Book1D("lvl1a_endcap", "PixelCluster_lvl1a_endcap;lvl1a;Entries;",20, 0, 20, false);
60
61 m_global_x_barrel = Book1D("global_x_barrel", "PixelCluster_global_x_barrel;Global x [mm];Entries;", 64, -350, 350, false);
62 m_global_x_endcap = Book1D("global_x_endcap", "PixelCluster_global_x_endcap;Global x [mm];Entries;", 64, -350, 350, false);
63
64 m_global_y_barrel = Book1D("global_y_barrel", "PixelCluster_global_y_barrel;Global y [mm];Entries;", 64, -350, 350, false);
65 m_global_y_endcap = Book1D("global_y_endcap", "PixelCluster_global_y_endcap;Global y [mm];Entries;", 64, -350, 350, false);
66
67 m_global_z_barrel = Book1D("global_z_barrel", "PixelCluster_global_z_barrel;Global z [mm];Entries;", 100, -3000, 3000, false);
68 m_global_z_endcap = Book1D("global_z_endcap", "PixelCluster_global_z_endcap;Global z [mm];Entries;", 100, -3000, 3000, false);
69
70 m_local_x_barrel = Book1D("local_x_barrel", "PixelCluster_local_x_barrel;Local x [mm];Entries;", 56, -28, 28, false);
71 m_local_x_endcap = Book1D("local_x_endcap", "PixelCluster_local_x_endcap;Local x [mm];Entries;", 56, -28, 28, false);
72
73 m_local_y_barrel = Book1D("local_y_barrel", "PixelCluster_local_y_barrel;Local y [mm];Entries;", 56, -28, 28, false);
74 m_local_y_endcap = Book1D("local_y_endcap", "PixelCluster_local_y_endcap;Local y [mm];Entries;", 56, -28, 28, false);
75
76 m_localCovXX_barrel = Book1D("localCovXX_barrel", "PixelCluster_localCovXX_barrel;Local Cov XX [mm2];Entries;", 100, 0, 0.9*1e-3, false);
77 m_localCovXX_endcap = Book1D("localCovXX_endcap", "PixelCluster_localCovXX_endcap;Local Cov XX [mm2];Entries;", 100, 0, 0.9*1e-3, false);
78
79 m_localCovYY_barrel = Book1D("localCovYY_barrel", "PixelCluster_localCovYY_barrel;Local Cov YY [mm2];Entries;", 100, 0, 0.9*1e-3, false);
80 m_localCovYY_endcap = Book1D("localCovYY_endcap", "PixelCluster_localCovYY_endcap;Local Cov YY [mm2];Entries;", 100, 0, 0.9*1e-3, false);
81
82 m_sizeX_barrel = Book1D("sizeX_barrel", "PixelCluster_sizeX_barrel;Size X;Entries;", 100, 0, 400, false);
83 m_sizeX_endcap = Book1D("sizeX_endcap", "PixelCluster_sizeX_endcap;Size X;Entries;", 100, 0, 400, false);
84
85 m_sizeY_barrel = Book1D("sizeY_barrel", "PixelCluster_sizeY_barrel;Size Y;Entries;", 100, 0, 400, false);
86 m_sizeY_endcap = Book1D("sizeY_endcap", "PixelCluster_sizeY_endcap;Size Y;Entries;", 100, 0, 400, false);
87
88 m_widthY_barrel = Book1D("widthY_barrel", "PixelCluster_widthY_barrel;Width Y;Entries;", 60, 0, 30, false);
89 m_widthY_endcap = Book1D("widthY_endcap", "PixelCluster_widthY_endcap;Width Y;Entries;", 60, 0, 30, false);
90
91 m_global_xy_barrel = Book2D("global_xy_barrel", "PixelCluster_global_xy_barrel;x [mm];y [mm];", 64, -320, 320, 64, -350, 350, false);
92 m_global_xy_endcap = Book2D("global_xy_endcap", "PixelCluster_global_xy_endcap;x [mm];y [mm];", 64, -320, 320, 64, -350, 350, false);
93
94 m_global_zr_barrel = Book2D("global_zr_barrel", "PixelCluster_global_zr_barrel;z [mm];r [mm];", 100, -3000, 3000, 100, 0, 350, false);
95 m_global_zr_endcap = Book2D("global_zr_endcap", "PixelCluster_global_zr_endcap;z [mm];r [mm];", 100, -3000, 3000, 100, 0, 350, false);
96
97 m_sizeX_vs_eta_barrel = Book2D("sizeX_vs_eta_barrel", "PixelCluster_sizeX_vs_eta_barrel;Eta;Size X;", 400, -5, 5, 400, 0, 400, false);
98 m_sizeX_vs_eta_endcap = Book2D("sizeX_vs_eta_endcap", "PixelCluster_sizeX_vs_eta_endcap;Eta;Size X;", 400, -5, 5, 400, 0, 400, false);
99
100 m_sizeY_vs_eta_barrel = Book2D("sizeY_vs_eta_barrel", "PixelCluster_sizeY_vs_eta_barrel;Eta;Size Y;", 400, -5, 5, 400, 0, 400, false);
101 m_sizeY_vs_eta_endcap = Book2D("sizeY_vs_eta_endcap", "PixelCluster_sizeY_vs_eta_endcap;Eta;Size Y;", 400, -5, 5, 400, 0, 400, false);
102
103 m_sizeX_vs_sizeY_barrel = Book2D("sizeX_vs_sizeY_barrel", "PixelCluster_sizeX_vs_sizeY_barrel;Size X;Size Y;", 400, 0, 400, 400, 0, 400, false);
104 m_sizeX_vs_sizeY_endcap = Book2D("sizeX_vs_sizeY_endcap", "PixelCluster_sizeX_vs_sizeY_endcap;Size X;Size Y;", 400, 0, 400, 400, 0, 400, false);
105 }
106
108 float beamSpotWeight,
109 const PixelID* pixelID)
110 {
111 const Identifier& id = pixelID->wafer_id(cluster->identifierHash());
112 int pixBrlEc = pixelID->barrel_ec(id);
113 int pixLayerDisk = pixelID->layer_disk(id);
114
115
116 bool isBarrel = (pixBrlEc == 0);
117
118 m_barrelEndcap->Fill(pixBrlEc, beamSpotWeight);
119
120 const auto& local_position = cluster->template localPosition<2>();
121 const auto& local_covariance = cluster->template localCovariance<2>();
122 const auto& globalPos = cluster->globalPosition();
123 Amg::Vector3D globalPosition(globalPos(0, 0), globalPos(1, 0), globalPos(2, 0));
124
125 const std::vector<int>& tots = cluster->totList();
126 std::vector<float> charges = cluster->chargeList();
127 if (charges.size() != tots.size()) {
128 charges.resize(tots.size(), 0);
129 }
130
131 const auto& [omegax, omegay] = TrackingUtilities::computeOmegas(*cluster,
132 *pixelID);
133
134 if (isBarrel) {
135 m_layerDisk_barrel->Fill(pixLayerDisk, beamSpotWeight);
136 m_phiModule_barrel->Fill(pixelID->phi_module(id), beamSpotWeight);
137 m_etaModule_barrel->Fill(pixelID->eta_module(id), beamSpotWeight);
138 m_isInnermost_barrel->Fill(static_cast<int>(pixLayerDisk==0), beamSpotWeight);
139 m_isNextToInnermost_barrel->Fill(static_cast<int>(pixLayerDisk==1), beamSpotWeight);
140
141 m_eta_barrel->Fill(globalPosition.eta(), beamSpotWeight);
142 m_perp_barrel->Fill(globalPosition.perp(), beamSpotWeight);
143
144 m_total_charge_barrel->Fill(cluster->totalCharge(), beamSpotWeight);
145 m_total_tot_barrel->Fill(cluster->totalToT(), beamSpotWeight);
146
147 m_omega_x_barrel->Fill(omegax, beamSpotWeight);
148 m_omega_y_barrel->Fill(omegay, beamSpotWeight);
149
150 m_lvl1a_barrel->Fill(cluster->lvl1a(), beamSpotWeight);
151
152 m_global_x_barrel->Fill(globalPos(0, 0), beamSpotWeight);
153 m_global_y_barrel->Fill(globalPos(1, 0), beamSpotWeight);
154 m_global_z_barrel->Fill(globalPos(2, 0), beamSpotWeight);
155
156 m_local_x_barrel->Fill(local_position(0, 0), beamSpotWeight);
157 m_local_y_barrel->Fill(local_position(1, 0), beamSpotWeight);
158
159 m_localCovXX_barrel->Fill(local_covariance(0, 0), beamSpotWeight);
160 m_localCovYY_barrel->Fill(local_covariance(1, 1), beamSpotWeight);
161
162 m_sizeX_barrel->Fill(cluster->channelsInPhi(), beamSpotWeight);
163 m_sizeY_barrel->Fill(cluster->channelsInEta(), beamSpotWeight);
164
165 m_widthY_barrel->Fill(cluster->widthInEta(), beamSpotWeight);
166
167 m_global_xy_barrel->Fill(globalPos(0, 0), globalPos(1, 0), beamSpotWeight);
168 m_global_zr_barrel->Fill(globalPos(2, 0), globalPosition.perp(), beamSpotWeight);
169
170 m_sizeX_vs_eta_barrel->Fill(globalPosition.eta(), cluster->channelsInPhi(), beamSpotWeight);
171 m_sizeY_vs_eta_barrel->Fill(globalPosition.eta(), cluster->channelsInEta(), beamSpotWeight);
172 m_sizeX_vs_sizeY_barrel->Fill(cluster->channelsInPhi(), cluster->channelsInEta(), beamSpotWeight);
173
174 for (std::size_t i(0); i<charges.size(); ++i) {
175 m_charge_barrel->Fill(charges.at(i), beamSpotWeight);
176 m_tot_barrel->Fill(tots.at(i), beamSpotWeight);
177 m_charge_vs_tot_barrel->Fill(charges.at(i), tots.at(i), beamSpotWeight);
178 }
179
180 } else {
181 m_layerDisk_endcap->Fill(pixLayerDisk, beamSpotWeight);
182 m_phiModule_endcap->Fill(pixelID->phi_module(id), beamSpotWeight);
183 m_etaModule_endcap->Fill(pixelID->eta_module(id), beamSpotWeight);
184 m_isInnermost_endcap->Fill(static_cast<int>(pixLayerDisk==0), beamSpotWeight);
185 m_isNextToInnermost_endcap->Fill(static_cast<int>(pixLayerDisk==1 or pixLayerDisk==2), beamSpotWeight);
186
187 m_eta_endcap->Fill(globalPosition.eta(), beamSpotWeight);
188 m_perp_endcap->Fill(globalPosition.perp(), beamSpotWeight);
189
190 m_total_charge_endcap->Fill(cluster->totalCharge(), beamSpotWeight);
191 m_total_tot_endcap->Fill(cluster->totalToT(), beamSpotWeight);
192
193 m_omega_x_endcap->Fill(omegax, beamSpotWeight);
194 m_omega_y_endcap->Fill(omegay, beamSpotWeight);
195
196 m_lvl1a_endcap->Fill(cluster->lvl1a(), beamSpotWeight);
197
198 m_global_x_endcap->Fill(globalPos(0, 0), beamSpotWeight);
199 m_global_y_endcap->Fill(globalPos(1, 0), beamSpotWeight);
200 m_global_z_endcap->Fill(globalPos(2, 0), beamSpotWeight);
201
202 m_local_x_endcap->Fill(local_position(0, 0), beamSpotWeight);
203 m_local_y_endcap->Fill(local_position(1, 0), beamSpotWeight);
204
205 m_localCovXX_endcap->Fill(local_covariance(0, 0), beamSpotWeight);
206 m_localCovYY_endcap->Fill(local_covariance(1, 1), beamSpotWeight);
207
208 m_sizeX_endcap->Fill(cluster->channelsInPhi(), beamSpotWeight);
209 m_sizeY_endcap->Fill(cluster->channelsInEta(), beamSpotWeight);
210
211 m_widthY_endcap->Fill(cluster->widthInEta(), beamSpotWeight);
212
213 m_global_xy_endcap->Fill(globalPos(0, 0), globalPos(1, 0), beamSpotWeight);
214 m_global_zr_endcap->Fill(globalPos(2, 0), globalPosition.perp(), beamSpotWeight);
215
216 m_sizeX_vs_eta_endcap->Fill(globalPosition.eta(), cluster->channelsInPhi(), beamSpotWeight);
217 m_sizeY_vs_eta_endcap->Fill(globalPosition.eta(), cluster->channelsInEta(), beamSpotWeight);
218 m_sizeX_vs_sizeY_endcap->Fill(cluster->channelsInPhi(), cluster->channelsInEta(), beamSpotWeight);
219
220 for (std::size_t i(0); i<charges.size(); ++i) {
221 m_charge_endcap->Fill(charges.at(i), beamSpotWeight);
222 m_tot_endcap->Fill(tots.at(i), beamSpotWeight);
223 m_charge_vs_tot_endcap->Fill(charges.at(i), tots.at(i), beamSpotWeight);
224 }
225 }
226
227 }
228
229}
230
PixelClusterValidationPlots(PlotBase *pParent, const std::string &sDir)
void fill(const xAOD::PixelCluster *cluster, float beamSpotWeight, const PixelID *)
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
int layer_disk(const Identifier &id) const
Definition PixelID.h:607
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition PixelID.h:360
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition PixelID.h:600
int eta_module(const Identifier &id) const
Definition PixelID.h:632
int phi_module(const Identifier &id) const
Definition PixelID.h:625
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition PlotBase.cxx:94
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
TH2F * Book2D(const std::string &name, const std::string &labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
Definition PlotBase.cxx:123
const std::vector< float > & chargeList() const
Returns the list of charges of the channels building the cluster.
const std::vector< int > & totList() const
Returns the list of ToT of the channels building the cluster.
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions,...
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
int lvl1a() const
Return the LVL1 accept.
int channelsInEta() const
float widthInEta() const
Returns the width of the cluster in phi (x) and eta (y) directions, respectively.
float totalCharge() const
Returns the sum of the charges of the channels building the cluster.
int totalToT() const
Returns the sum of the ToTs of the channels building the cluster.
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash)
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Eigen::Matrix< double, 3, 1 > Vector3D
std::pair< float, float > computeOmegas(const xAOD::PixelCluster &cluster, const PixelID &pixelID)
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.