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