21 std::string h_name_base = element < 8 ? Form(
"Sts%d", element) : Form(
"Sts0x%x", element);
23 LOG(debug) << Form(
"Booking for %s", h_name_base.c_str());
25 double x_min = geo[0];
26 double x_max = geo[1];
27 double y_min = geo[2];
28 double y_max = geo[3];
35 double r_min = -2.7 - 0.5 * dr;
36 double r_max = +2.7 + 0.5 * dr;
37 unsigned int nb_bins_r = (r_max - r_min) / dr;
39 for (
auto mod : {
":all",
":trk"}) {
41 h_name = Form(
"%s_dx_vs_x%s", h_name_base.c_str(), mod);
42 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(),
"", nb_bins_r, r_min, r_max, nb_bins_x, x_min, x_max);
43 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"X_{trk} - X_{hit} [cm]"));
44 fH2D[h_name]->GetYaxis()->SetTitle(
"X_{hit} [cm]");
45 fH2D[h_name]->GetXaxis()->CenterTitle(
true);
46 fH2D[h_name]->GetYaxis()->CenterTitle(
true);
48 h_name = Form(
"%s_dx_vs_y%s", h_name_base.c_str(), mod);
49 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(),
"", nb_bins_r, r_min, r_max, nb_bins_y, y_min, y_max);
50 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"X_{trk} - X_{hit} [cm]"));
51 fH2D[h_name]->GetYaxis()->SetTitle(
"Y_{hit} [cm]");
52 fH2D[h_name]->GetXaxis()->CenterTitle(
true);
53 fH2D[h_name]->GetYaxis()->CenterTitle(
true);
55 h_name = Form(
"%s_dy_vs_x%s", h_name_base.c_str(), mod);
56 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(),
"", nb_bins_r, r_min, r_max, nb_bins_x, x_min, x_max);
57 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"Y_{trk} - Y_{hit} [cm]"));
58 fH2D[h_name]->GetYaxis()->SetTitle(
"X_{hit} [cm]");
59 fH2D[h_name]->GetXaxis()->CenterTitle(
true);
60 fH2D[h_name]->GetYaxis()->CenterTitle(
true);
62 h_name = Form(
"%s_dy_vs_y%s", h_name_base.c_str(), mod);
63 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(),
"", nb_bins_r, r_min, r_max, nb_bins_y, y_min, y_max);
64 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"Y_{trk} - Y_{hit} [cm]"));
65 fH2D[h_name]->GetYaxis()->SetTitle(
"Y_{hit} [cm]");
66 fH2D[h_name]->GetXaxis()->CenterTitle(
true);
67 fH2D[h_name]->GetYaxis()->CenterTitle(
true);
70 std::string h_name = Form(
"Sts%d_ref_hits", element);
71 fH2D[h_name] = std::make_unique<TH2D>(h_name.c_str(),
"", nb_bins_x, x_min, x_max, nb_bins_y, y_min, y_max);
72 fH2D[h_name]->GetXaxis()->SetTitle(Form(
"X_{TrkHit} [cm]"));
73 fH2D[h_name]->GetYaxis()->SetTitle(
"Y_{TrkHit} [cm]");
74 fH2D[h_name]->GetXaxis()->CenterTitle(
true);
75 fH2D[h_name]->GetYaxis()->CenterTitle(
true);
105 auto sts_trk_idx = trk->GetStsTrackIndex();
106 if (sts_trk_idx == -1)
continue;
131 double x_i = hit_i->
GetX();
132 double y_i = hit_i->
GetY();
133 double z_i = hit_i->
GetZ();
135 double x_j = hit_j->
GetX();
136 double y_j = hit_j->
GetY();
137 double z_j = hit_j->
GetZ();
139 fH2D[Form(
"Sts%d_ref_hits", unit_i)]->Fill(x_i, y_i);
140 fH2D[Form(
"Sts%d_ref_hits", unit_j)]->Fill(x_j, y_j);
142 double x_0, y_0, t_x, t_y;
144 t_x = (x_i - x_j) / (z_i - z_j);
145 t_y = (y_i - y_j) / (z_i - z_j);
146 x_0 = x_i - t_x * z_i;
147 y_0 = y_i - t_y * z_i;
150 t_x = trk->GetParamFirst()->GetTx();
151 t_y = trk->GetParamFirst()->GetTy();
152 x_0 = x_i - t_x * z_i;
153 y_0 = y_i - t_y * z_i;
156 double d_trk_trg = TMath::Sqrt(x_0 * x_0 + y_0 * y_0);
160 for (
int uut = 0; uut < n_of_units; uut++) {
161 if (uut == unit_i || uut == unit_j)
continue;
164 double min_dist = 1e+6;
165 for (
auto hit_dut :
fStsHits[uut]) {
166 double x_dut = hit_dut->GetX();
167 double y_dut = hit_dut->GetY();
168 double z_dut = hit_dut->GetZ();
170 double x_trk = x_i + t_x * (z_dut - z_i);
171 double y_trk = y_i + t_y * (z_dut - z_i);
173 double dx = x_trk - x_dut;
174 double dy = y_trk - y_dut;
176 fH2D[Form(
"Sts0x%x_dx_vs_x:all", hit_dut->GetAddress())]->Fill(dx, x_dut);
177 fH2D[Form(
"Sts0x%x_dx_vs_y:all", hit_dut->GetAddress())]->Fill(dx, y_dut);
178 fH2D[Form(
"Sts0x%x_dy_vs_x:all", hit_dut->GetAddress())]->Fill(dy, x_dut);
179 fH2D[Form(
"Sts0x%x_dy_vs_y:all", hit_dut->GetAddress())]->Fill(dy, y_dut);
181 fH2D[Form(
"Sts%d_dx_vs_x:all", uut)]->Fill(dx, x_dut);
182 fH2D[Form(
"Sts%d_dx_vs_y:all", uut)]->Fill(dx, y_dut);
183 fH2D[Form(
"Sts%d_dy_vs_x:all", uut)]->Fill(dy, x_dut);
184 fH2D[Form(
"Sts%d_dy_vs_y:all", uut)]->Fill(dy, y_dut);
186 if (min_dist > dx * dx + dy * dy) {
187 min_dist = dx * dx + dy * dy;
188 closest_hit = hit_dut;
193 double x_dut = closest_hit->
GetX();
194 double y_dut = closest_hit->
GetY();
195 double z_dut = closest_hit->
GetZ();
197 double x_trk = x_i + t_x * (z_dut - z_i);
198 double y_trk = y_i + t_y * (z_dut - z_i);
200 double dx = x_trk - x_dut;
201 double dy = y_trk - y_dut;
203 fH2D[Form(
"Sts0x%x_dx_vs_x:trk", closest_hit->
GetAddress())]->Fill(dx, x_dut);
204 fH2D[Form(
"Sts0x%x_dx_vs_y:trk", closest_hit->
GetAddress())]->Fill(dx, y_dut);
205 fH2D[Form(
"Sts0x%x_dy_vs_x:trk", closest_hit->
GetAddress())]->Fill(dy, x_dut);
206 fH2D[Form(
"Sts0x%x_dy_vs_y:trk", closest_hit->
GetAddress())]->Fill(dy, y_dut);
208 fH2D[Form(
"Sts%d_dx_vs_x:trk", uut)]->Fill(dx, x_dut);
209 fH2D[Form(
"Sts%d_dx_vs_y:trk", uut)]->Fill(dx, y_dut);
210 fH2D[Form(
"Sts%d_dy_vs_x:trk", uut)]->Fill(dy, x_dut);
211 fH2D[Form(
"Sts%d_dy_vs_y:trk", uut)]->Fill(dy, y_dut);
236 if (trk ==
nullptr)
return;
243 float trk_p_val = TMath::Prob(trk->
GetChi2(), trk->
GetNDF());
246 int32_t mvd_trk_size = sts_trk_idx != -1 &&
fStsTrkArray !=
nullptr
250 int32_t sts_trk_size = sts_trk_idx != -1 &&
fStsTrkArray !=
nullptr
254 int32_t rich_trk_size = rich_trk_idx != -1 &&
fRchTrkArray !=
nullptr
258 int32_t much_trk_size = much_trk_idx != -1 &&
fMchTrkArray !=
nullptr
262 int32_t trd_trk_size = trd_trk_idx != -1 &&
fTrdTrkArray !=
nullptr
266 int32_t tof_trk_size = tof_trk_idx != -1 &&
fTofTrkArray !=
nullptr
330 LOG(debug) <<
"Init CbmStsResolution ...";
332 FairRootManager* ioman = FairRootManager::Instance();
333 if (ioman !=
nullptr) {
335 fCbmEvtArray = (TClonesArray*) ioman->GetObject(
"CbmEvent");
337 fGlbTrkArray = (TClonesArray*) ioman->GetObject(
"GlobalTrack");
338 fStsTrkArray = (TClonesArray*) ioman->GetObject(
"StsTrack");
339 fRchTrkArray = (TClonesArray*) ioman->GetObject(
"RichTrack");
340 fMchTrkArray = (TClonesArray*) ioman->GetObject(
"MuchTrack");
341 fTrdTrkArray = (TClonesArray*) ioman->GetObject(
"TrdTrack");
342 fTofTrkArray = (TClonesArray*) ioman->GetObject(
"TofTrack");
344 fStsHitArray = (TClonesArray*) ioman->GetObject(
"StsHit");
345 fStsCluArray = (TClonesArray*) ioman->GetObject(
"StsCluster");