27 auto* ioman = FairRootManager::Instance();
32 AnalysisTree::BranchConfig rich_branch(
out_branch_, AnalysisTree::DetType::kHit);
33 rich_branch.AddField<
float>(
"radius");
34 rich_branch.AddFields<
int>({
"n_hits",
"n_hits_on_ring"});
35 rich_branch.AddFields<
float>({
"axis_a",
"axis_b"});
36 rich_branch.AddFields<
float>({
"center_x",
"center_y"});
37 rich_branch.AddField<
float>(
"chi2_ov_ndf",
"chi2/ndf ring fit");
38 rich_branch.AddField<
float>(
"phi_ellipse",
"phi rotation angle of ellipse");
39 rich_branch.AddField<
float>(
"radial_pos",
"sqrt(x**2+abs(y-110)**2)");
40 rich_branch.AddField<
float>(
"radial_angle",
"(0||1||2)*pi +- atan( abs((+-100-y)/-x) )");
42 i_r_ = rich_branch.GetFieldId(
"radius");
43 i_n_hits_ = rich_branch.GetFieldId(
"n_hits");
44 i_axis_ = rich_branch.GetFieldId(
"axis_a");
45 i_center_ = rich_branch.GetFieldId(
"center_x");
46 i_chi2_ = rich_branch.GetFieldId(
"chi2_ov_ndf");
51 auto* man = AnalysisTree::TaskManager::GetInstance();
62 auto* out_config_ = AnalysisTree::TaskManager::GetInstance()->GetConfig();
63 const auto& branch = out_config_->GetBranchConfig(
out_branch_);
66 if (it ==
indexes_map_->end()) {
throw std::runtime_error(
match_to_ +
" is not found to match with RICH rings"); }
67 auto rec_tracks_map = it->second;
71 LOG(warn) <<
"No global tracks!";
76 for (Int_t igt = 0; igt < n_tracks; igt++) {
81 if (i_rich < 0)
continue;
83 if (rich_ring ==
nullptr) {
84 LOG(warn) <<
"No RICH ring!";
89 ring.SetPosition(rich_ring->GetCenterX(), rich_ring->GetCenterY(), 0.f);
90 ring.SetField(
int(rich_ring->GetNofHits()),
i_n_hits_);
91 ring.SetField(
int(rich_ring->GetNofHitsOnRing()),
i_n_hits_ + 1);
92 ring.SetField(
float(rich_ring->GetAaxis()),
i_axis_);
93 ring.SetField(
float(rich_ring->GetBaxis()),
i_axis_ + 1);
94 ring.SetField(
float(rich_ring->GetCenterX()),
i_center_);
95 ring.SetField(
float(rich_ring->GetCenterY()),
i_center_ + 1);
96 ring.SetField(
float(rich_ring->GetRadius()),
i_r_);
97 ring.SetField(
float(rich_ring->GetNDF() > 0. ? rich_ring->GetChi2() / rich_ring->GetNDF() : -999.),
i_chi2_);
99 ring.SetField(
float(rich_ring->GetRadialPosition()),
i_radial_pos_);
102 if (rec_tracks_map.empty()) {
continue; }
103 const Int_t stsTrackIndex = global_track->GetStsTrackIndex();
104 if (rec_tracks_map.find(stsTrackIndex) != rec_tracks_map.end()) {
105 vtx_tracks_2_rich_->AddMatch(rec_tracks_map.find(stsTrackIndex)->second, ring.GetId());