28 double vertex_x_min = -15;
29 double vertex_x_max = +15;
30 double vertex_y_min = -15;
31 double vertex_y_max = +15;
32 double vertex_z_min = -15;
33 double vertex_z_max = +15;
34 double vertex_dx = 0.1;
35 double vertex_dy = 0.1;
36 double vertex_dz = 0.1;
47 double dca_min = -2.5 - 0.5 * dca_dx;
48 double dca_max = +2.5 + 0.5 * dca_dx;
52 double res_dx = +0.001;
53 double res_min = -2.50 - 0.5 * res_dx;
54 double res_max = +2.50 + 0.5 * res_dx;
60 std::string h_name_base =
"";
61 if (element ==
static_cast<int32_t
>(
fTestLayer)) {
62 h_name_base = Form(
"Sts%d", element);
64 else if (element > 8) {
67 h_name_base = Form(
"Sts0x%x", element);
70 if (!h_name_base.length())
continue;
76 h_name = Form(
"%s_found", h_name_base.c_str());
78 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), x_sen_binning.n_of_bins, x_sen_binning.x_min,
79 x_sen_binning.x_max, y_sen_binning.n_of_bins, y_sen_binning.x_min, y_sen_binning.x_max);
80 fH2D[h_name]->GetXaxis()->SetTitle(
"StsHit^{rec}_{X} [cm]");
81 fH2D[h_name]->GetYaxis()->SetTitle(
"StsHit^{rec}_{Y} [cm]");
83 h_name = Form(
"%s_track", h_name_base.c_str());
85 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), x_sen_binning.n_of_bins, x_sen_binning.x_min,
86 x_sen_binning.x_max, y_sen_binning.n_of_bins, y_sen_binning.x_min, y_sen_binning.x_max);
87 fH2D[h_name]->GetXaxis()->SetTitle(
"StsHit^{ext}_{X} [cm]");
88 fH2D[h_name]->GetYaxis()->SetTitle(
"StsHit^{ext}_{Y} [cm]");
90 h_name = Form(
"%s_hit_map", h_name_base.c_str());
92 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), x_sen_binning.n_of_bins, x_sen_binning.x_min,
93 x_sen_binning.x_max, y_sen_binning.n_of_bins, y_sen_binning.x_min, y_sen_binning.x_max);
94 fH2D[h_name]->GetXaxis()->SetTitle(
"StsHit_{X} [cm]");
95 fH2D[h_name]->GetYaxis()->SetTitle(
"StsHit_{Y} [cm]");
99 for (
const char* di : {
"x",
"y"}) {
100 h_name = Form(
"%s_d%s_vs_x", h_name_base.c_str(), di);
102 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), r_sen_binning.n_of_bins, r_sen_binning.x_min,
103 r_sen_binning.x_max, x_sen_binning.n_of_bins, x_sen_binning.x_min, x_sen_binning.x_max);
104 fH2D[h_name]->GetYaxis()->SetTitle(
"X [cm]");
105 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"\\rho_{%s} [cm]", di));
107 h_name = Form(
"%s_d%s_vs_y", h_name_base.c_str(), di);
109 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), r_sen_binning.n_of_bins, r_sen_binning.x_min,
110 r_sen_binning.x_max, y_sen_binning.n_of_bins, y_sen_binning.x_min, y_sen_binning.x_max);
111 fH2D[h_name]->GetYaxis()->SetTitle(
"Y [cm]");
112 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"\\rho_{%s} [cm]", di));
118 h_name =
"vertex_y_vs_x";
120 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), x_vtx_binning.n_of_bins, x_vtx_binning.x_min,
121 x_vtx_binning.x_max, y_vtx_binning.n_of_bins, y_vtx_binning.x_min, y_vtx_binning.x_max);
122 fH2D[h_name]->GetXaxis()->SetTitle(
"Vertex_{X} [cm]");
123 fH2D[h_name]->GetYaxis()->SetTitle(
"Vertex_{Y} [cm]");
125 h_name =
"vertex_x_vs_z";
127 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), z_vtx_binning.n_of_bins, z_vtx_binning.x_min,
128 z_vtx_binning.x_max, x_vtx_binning.n_of_bins, x_vtx_binning.x_min, x_vtx_binning.x_max);
129 fH2D[h_name]->GetXaxis()->SetTitle(
"Vertex_{Z} [cm]");
130 fH2D[h_name]->GetYaxis()->SetTitle(
"Vertex_{X} [cm]");
132 h_name =
"vertex_y_vs_z";
134 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), z_vtx_binning.n_of_bins, z_vtx_binning.x_min,
135 z_vtx_binning.x_max, y_vtx_binning.n_of_bins, y_vtx_binning.x_min, y_vtx_binning.x_max);
136 fH2D[h_name]->GetXaxis()->SetTitle(
"Vertex_{Z} [cm]");
137 fH2D[h_name]->GetYaxis()->SetTitle(
"Vertex_{Y} [cm]");
141 for (
const char* di : {
"x",
"y",
"z"}) {
142 h_name = Form(
"dca_d%s_vs_x", di);
144 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), r_dca_binning.n_of_bins, r_dca_binning.x_min,
145 r_dca_binning.x_max, x_vtx_binning.n_of_bins, x_vtx_binning.x_min, x_vtx_binning.x_max);
146 fH2D[h_name]->GetYaxis()->SetTitle(
"X [cm]");
147 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"DCA_{%s} [cm]", di));
149 h_name = Form(
"dca_d%s_vs_y", di);
151 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), r_dca_binning.n_of_bins, r_dca_binning.x_min,
152 r_dca_binning.x_max, y_vtx_binning.n_of_bins, y_vtx_binning.x_min, y_vtx_binning.x_max);
153 fH2D[h_name]->GetYaxis()->SetTitle(
"Y [cm]");
154 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"DCA_{%s} [cm]", di));
156 h_name = Form(
"dca_d%s_vs_z", di);
158 std::make_unique<TH2D>(h_name.c_str(), h_name.c_str(), r_dca_binning.n_of_bins, r_dca_binning.x_min,
159 r_dca_binning.x_max, z_vtx_binning.n_of_bins, z_vtx_binning.x_min, z_vtx_binning.x_max);
160 fH2D[h_name]->GetYaxis()->SetTitle(Form(
"Z [cm]"));
161 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"DCA_{%s} [cm]", di));
166 for (
const char* mod : {
":all",
":sel"}) {
167 h_name = Form(
"ca_track_multiplicity%s", mod);
168 fH1D[h_name] = std::make_unique<TH1D>(h_name.c_str(), h_name.c_str(), 50, 0, 50);
169 fH1D[h_name]->GetXaxis()->SetTitle(
"N_{CATrack}");
170 fH1D[h_name]->GetYaxis()->SetTitle(
"Entries");
172 h_name = Form(
"ca_track_chi2%s", mod);
173 fH1D[h_name] = std::make_unique<TH1D>(h_name.c_str(), h_name.c_str(), 10000, 0, 10);
174 fH1D[h_name]->GetXaxis()->SetTitle(
"Chi2");
175 fH1D[h_name]->GetYaxis()->SetTitle(
"Entries");
182 LOG(debug) <<
"Checking efficiency of STS station " <<
fTestLayer <<
" using " <<
fGlbTrks.size()
183 <<
" CbmGlobalTracks";
185 const std::optional<CbmVertex> vertex =
fVertexFinder->FindVertex();
187 if (!vertex.has_value())
return;
191 fH2D[
"vertex_y_vs_x"]->Fill(vertex->GetX(), vertex->GetY());
192 fH2D[
"vertex_x_vs_z"]->Fill(vertex->GetZ(), vertex->GetX());
193 fH2D[
"vertex_y_vs_z"]->Fill(vertex->GetZ(), vertex->GetY());
195 TVector3 vtx(vertex->GetX(), vertex->GetY(), vertex->GetZ());
196 std::map<int32_t, std::vector<bool>> hit_used;
198 double trk_tx = trk->GetParamFirst()->GetTx();
199 double trk_ty = trk->GetParamFirst()->GetTy();
200 double trk_x0 = trk->GetParamFirst()->GetX();
201 double trk_y0 = trk->GetParamFirst()->GetY();
202 double trk_z0 = trk->GetParamFirst()->GetZ();
205 TVector3 p(trk_x0, trk_y0, trk_z0);
206 TVector3 e(trk_tx, trk_ty, 1);
207 TVector3 trk_to_vtx = ((vtx - p).Cross(e)) * (1. / e.Mag());
209 fH2D[
"dca_dx_vs_x"]->Fill(trk_to_vtx.Px(), vtx.Px());
210 fH2D[
"dca_dx_vs_y"]->Fill(trk_to_vtx.Px(), vtx.Py());
211 fH2D[
"dca_dx_vs_z"]->Fill(trk_to_vtx.Px(), vtx.Pz());
213 fH2D[
"dca_dy_vs_x"]->Fill(trk_to_vtx.Py(), vtx.Px());
214 fH2D[
"dca_dy_vs_y"]->Fill(trk_to_vtx.Py(), vtx.Py());
215 fH2D[
"dca_dy_vs_z"]->Fill(trk_to_vtx.Py(), vtx.Pz());
217 fH2D[
"dca_dz_vs_x"]->Fill(trk_to_vtx.Pz(), vtx.Px());
218 fH2D[
"dca_dz_vs_y"]->Fill(trk_to_vtx.Pz(), vtx.Py());
219 fH2D[
"dca_dz_vs_z"]->Fill(trk_to_vtx.Pz(), vtx.Pz());
225 size_t n_of_hits =
hits.size();
229 double predicted_x = trk_x0 + trk_tx * (sensor_z - trk_z0);
230 double predicted_y = trk_y0 + trk_ty * (sensor_z - trk_z0);
239 fH2D[Form(
"Sts%d_track", unit)]->Fill(predicted_x, predicted_y);
240 fH2D[Form(
"Sts0x%x_track", sensor)]->Fill(predicted_x, predicted_y);
244 double closest_id = 0;
245 double dx =
hits[0]->GetX() - predicted_x -
fResiduals[sensor].mean.Px();
246 double dy =
hits[0]->GetY() - predicted_y -
fResiduals[sensor].mean.Py();
247 double closest_rho = dx * dx + dy * dy;
249 for (
size_t idx = 1; idx < n_of_hits; idx++) {
250 dx =
hits[idx]->GetX() - predicted_x -
fResiduals[sensor].mean.Px();
251 dy =
hits[idx]->GetY() - predicted_y -
fResiduals[sensor].mean.Py();
252 double rho = dx * dx + dy * dy;
254 if (rho < closest_rho) {
260 dx =
hits[closest_id]->GetX() - predicted_x -
fResiduals[sensor].mean.Px();
261 dy =
hits[closest_id]->GetY() - predicted_y -
fResiduals[sensor].mean.Py();
263 fH2D[Form(
"Sts%d_dx_vs_x", unit)]->Fill(dx,
hits[closest_id]->GetX());
264 fH2D[Form(
"Sts%d_dy_vs_x", unit)]->Fill(dy,
hits[closest_id]->GetX());
265 fH2D[Form(
"Sts%d_dx_vs_y", unit)]->Fill(dx,
hits[closest_id]->GetY());
266 fH2D[Form(
"Sts%d_dy_vs_y", unit)]->Fill(dy,
hits[closest_id]->GetY());
268 fH2D[Form(
"Sts0x%x_dx_vs_x", sensor)]->Fill(dx,
hits[closest_id]->GetX());
269 fH2D[Form(
"Sts0x%x_dy_vs_x", sensor)]->Fill(dy,
hits[closest_id]->GetX());
270 fH2D[Form(
"Sts0x%x_dx_vs_y", sensor)]->Fill(dx,
hits[closest_id]->GetY());
271 fH2D[Form(
"Sts0x%x_dy_vs_y", sensor)]->Fill(dy,
hits[closest_id]->GetY());
273 double sensor_resolution =
275 if (closest_rho <= 3.0 * sensor_resolution) {
276 fH2D[Form(
"Sts%d_found", unit)]->Fill(predicted_x, predicted_y);
277 fH2D[Form(
"Sts0x%x_found", sensor)]->Fill(predicted_x, predicted_y);