36#include "FairMCPoint.h"
37#include "FairRootManager.h"
41#include "TClonesArray.h"
45#include "TGraphAsymmErrors.h"
50#include "TProfile2D.h"
69template<ca::EDetectorID DetID>
78template<ca::EDetectorID DetID>
81 LOG(info) <<
"\n\n ** Checking the " << fName <<
" **\n\n";
92 for (
int iSt = 0; iSt < nSt; ++iSt) {
94 for (
int i = 1; i < effxy->GetNbinsX() - 1; i++) {
95 for (
int j = 1; j < effxy->GetNbinsY() - 1; j++) {
96 int bin = effxy->GetBin(i, j);
97 if (effxy->GetBinEntries(bin) >= 1) {
111 std::vector<double> vStationPos(nSt, 0.);
112 for (
int iSt = 0; iSt < nSt; ++iSt) {
113 vStationPos[iSt] =
fpDetInterface->GetFullVolume(iSt).GetCenterZ();
116 if (!std::is_sorted(vStationPos.cbegin(), vStationPos.cend(), [](
int l,
int r) { return l <= r; })) {
118 LOG(error) << fName <<
": stations are ordered improperly along the beam axis:";
119 for (
auto z : vStationPos) {
120 LOG(error) <<
"\t- " << z;
125 StoreCheckResult(
"station_position_ordering", res);
141 std::stringstream msgs;
143 for (
int iSt = 0; iSt < nSt; ++iSt) {
146 LOG_IF(error, fVerbose > 0) << fName <<
": station " << iSt <<
" does not have hits";
150 int iBinMin = fvph_hit_station_delta_z[iSt]->FindBin(-fConfig.fMaxDiffZStHit);
151 int iBinMax = fvph_hit_station_delta_z[iSt]->FindBin(+fConfig.fMaxDiffZStHit);
153 auto nHitsWithin = fvph_hit_station_delta_z[iSt]->Integral(iBinMin, iBinMax);
154 if (nHitsWithin < nHits) {
155 if (!msgs.str().empty()) {
158 msgs << (static_cast<double>((nHits - nHitsWithin) * 100) / nHits) <<
"% (st. " << iSt <<
")";
162 std::string msg = msgs.str().empty() ?
"" : Form(
"Out of range z = +-%.2f cm: ", fConfig.fMaxDiffZStHit);
166 StoreCheckResult(
"station_position_hit_delta_z", res, msg);
181 LOG(info) <<
"-- Hit efficiency integrated over hit distance from station center";
183 auto* pEffTable = MakeQaObject<CbmQaTable>(
"vs Station/eff_table",
"Efficiency table", nSt, 1);
184 pEffTable->SetNamesOfCols({
"Efficiency"});
185 pEffTable->SetColWidth(20);
187 for (
int iSt = 0; iSt < nSt; ++iSt) {
188 auto eff = fvph_reco_eff[iSt]->GetMean();
189 pEffTable->SetRowName(iSt, Form(
"station %d", iSt));
190 pEffTable->SetCell(iSt, 0, eff);
191 bool res = CheckRange(
"Hit finder efficiency in station " + std::to_string(iSt), eff, fConfig.fEffThrsh, 1.000);
192 std::string msg = (res ?
"" : Form(
"efficiency = %f lower then threshold = %f", eff, fConfig.fEffThrsh));
193 StoreCheckResult(Form(
"hit_efficiency_station_%d", iSt), res, msg);
195 LOG(info) <<
'\n' << pEffTable->ToString(3);
201 auto* pResidualsTable =
202 MakeQaObject<CbmQaTable>(
"vs Station/residuals_mean",
"Residual mean values in different stations", nSt, 3);
203 pResidualsTable->SetNamesOfCols({
"Residual(x) [cm]",
"Residual(y) [cm]",
"Residual(t) [ns]"});
204 pResidualsTable->SetColWidth(20);
207 for (
int iSt = 0; iSt <= nSt; ++iSt) {
213 pResidualsTable->SetRowName(iSt, Form(
"station %d", iSt));
214 pResidualsTable->SetCell(iSt, 0, fvph_res_x[iSt]->GetStdDev());
215 pResidualsTable->SetCell(iSt, 1, fvph_res_y[iSt]->GetStdDev());
216 pResidualsTable->SetCell(iSt, 2, fvph_res_t[iSt]->GetStdDev());
218 LOG(info) <<
'\n' << pResidualsTable->ToString(8);
228 std::vector<CbmQaTable*> vpPullTables = {
230 MakeQaObject<CbmQaTable>(
"vs Station/pulls_x",
"x-coordinate pull quantities in diff. stations", nSt, 2),
231 MakeQaObject<CbmQaTable>(
"vs Station/pulls_y",
"y-coordinate pull quantities in diff. stations", nSt, 2),
232 MakeQaObject<CbmQaTable>(
"vs Station/pulls_t",
"Time pull quantities in diff. stations", nSt, 2)};
234 for (
auto* pullTable : vpPullTables) {
235 pullTable->SetNamesOfCols({
"mean",
"std.dev."});
236 pullTable->SetColWidth(20);
240 auto DefinePullTableRow = [&](
const TH1*
h,
CbmQaTable* table,
int iSt) {
241 table->SetCell(iSt, 0,
h->GetMean(), 3.5 *
h->GetMeanError());
242 table->SetCell(iSt, 1,
h->GetStdDev(), 3.5 *
h->GetStdDevError());
245 for (
int iSt = 0; iSt < nSt + 1; ++iSt) {
251 for (
auto* pullTable : vpPullTables) {
252 pullTable->SetRowName(iSt, (iSt == nSt ?
"all stations" : Form(
"station %u", iSt)));
256 auto [msg, status] = CheckRangePull(fvph_pull_x[iSt]);
257 StoreCheckResult(Form(
"pull_x_station_%d", iSt), status, msg);
258 DefinePullTableRow(fvph_pull_x[iSt], vpPullTables[0], iSt);
261 auto [msg, status] = CheckRangePull(fvph_pull_y[iSt]);
262 StoreCheckResult(Form(
"pull_y_station_%d", iSt), status, msg);
263 DefinePullTableRow(fvph_pull_y[iSt], vpPullTables[1], iSt);
266 auto [msg, status] = CheckRangePull(fvph_pull_t[iSt]);
267 StoreCheckResult(Form(
"pull_t_station_%d", iSt), status, msg);
268 DefinePullTableRow(fvph_pull_t[iSt], vpPullTables[2], iSt);
272 for (
auto* pullTable : vpPullTables) {
273 LOG(info) <<
'\n' << pullTable->ToString(3,
true);
279 LOG(info) << fMonitor.ToString();
284template<ca::EDetectorID DetID>
287 constexpr double factor = 3.5;
289 constexpr auto Check = [&](
double val,
double err,
double min,
double max) -> std::pair<std::string, bool> {
290 std::stringstream msg;
292 if (val + factor * err <
min) {
293 msg <<
"underflow: " << val <<
" < " <<
min <<
" - " << factor <<
" x " << err;
296 if (val - factor * err >
max) {
297 msg <<
"overflow: " << val <<
" > " <<
max <<
" + " << factor <<
" x " << err;
300 return std::make_pair(msg.str(), res);
303 std::pair<std::string, bool> ret = {
"",
true};
304 if (
h->GetEntries() >= 10) {
307 auto [msg, res] =
Check(
h->GetMean(),
h->GetMeanError(), -
fConfig.fPullMeanThrsh, +
fConfig.fPullMeanThrsh);
309 ret.first +=
"mean ";
317 Check(
h->GetStdDev(),
h->GetStdDevError(), 1. -
fConfig.fPullWidthThrsh, 1. +
fConfig.fPullWidthThrsh);
319 if (!ret.first.empty()) {
322 ret.first +=
"std.dev. ";
334template<ca::EDetectorID DetID>
389template<ca::EDetectorID DetID>
393 const int nHits =
fpHits->GetEntriesFast();
398 std::vector<std::vector<std::vector<int>>>
402 vNofHitsPerMcTrack.resize(nMCevents);
403 for (
int iE = 0; iE < nMCevents; ++iE) {
406 int nMcTracks =
fpMCTracks->Size(iFile, iEvent);
407 vNofHitsPerMcTrack[iE].resize(nSt);
408 for (
int iSt = 0; iSt < nSt; iSt++) {
409 vNofHitsPerMcTrack[iE][iSt].resize(nMcTracks, 0);
414 for (
int iH = 0; iH < nHits; ++iH) {
420 LOG(error) << fName <<
": hit with iH = " << iH <<
" is not an CbmStsHit (dynamic cast failed)";
425 auto address = pHit->GetAddress();
438 int iSt =
fpDetInterface->GetTrackingStationId(pHit->GetAddress());
444 LOG(error) << fName <<
": index of station (" << iSt <<
") is out of range for hit with id = " << iH;
460 fHitQaData.SetHitTimeError(pHit->GetTimeError());
501 for (
int iLink = 0; iLink < pHitMatch->GetNofLinks(); ++iLink) {
502 const auto& link = pHitMatch->GetLink(iLink);
504 int iP = link.GetIndex();
517 if (iE < 0 || iE >= nMCevents) {
518 LOG(error) << fName <<
": id of MC event is out of range (hit id = " << iH <<
", link id = " << iLink
519 <<
", event id = " << iE <<
", mc point ID = " << iP <<
')';
526 LOG(error) << fName <<
": MC point object does not exist for hit " << iH;
530 int iTr = pMCPoint->GetTrackID();
532 if (iTr >=
static_cast<int>(vNofHitsPerMcTrack[iE][iSt].
size())) {
533 LOG(error) << fName <<
": index of MC track is out of range (hit id = " << iH <<
", link id = " << iLink
534 <<
", event id = " << iE <<
", track id = " << iTr <<
')';
538 vNofHitsPerMcTrack[iE][iSt][iTr]++;
549 if (pHitMatch->GetNofLinks() != 1) {
554 assert(pHitMatch->GetNofLinks() > 0);
555 const auto& bestPointLink = pHitMatch->GetMatchedLink();
558 if (bestPointLink.GetIndex() < 0) {
563 const auto* pMCPoint =
dynamic_cast<const Point_t*
>(
fpMCPoints->Get(bestPointLink));
564 fHitQaData.SetPointID(bestPointLink.GetIndex(), bestPointLink.GetEntry(), bestPointLink.GetFile());
566 LOG(error) << fName <<
": MC point object does not exist for hit " << iH;
589 CbmLink bestTrackLink = bestPointLink;
590 bestTrackLink.
SetIndex(pMCPoint->GetTrackID());
593 LOG(error) << fName <<
": MC track object does not exist for hit " << iH <<
" and link: ";
599 LOG(error) << fName <<
": MC time zero is lower then 0 ns: " << t0MC;
610 if (vNofHitsPerMcTrack[iE][iSt][pMCPoint->GetTrackID()] != 1) {
617 double mass = pMCTrack->GetMass();
624 double xMC = pMCPoint->FairMCPoint::GetX();
625 double yMC = pMCPoint->FairMCPoint::GetY();
626 double zMC = pMCPoint->FairMCPoint::GetZ();
627 double tMC = pMCPoint->GetTime() + t0MC;
632 double pxMC = pMCPoint->GetPx();
633 double pyMC = pMCPoint->GetPy();
634 double pzMC = pMCPoint->GetPz();
635 double pMC =
sqrt(pxMC * pxMC + pyMC * pyMC + pzMC * pzMC);
646 double xMCs = xMC + shiftZ * pxMC / pzMC;
647 double yMCs = yMC + shiftZ * pyMC / pzMC;
657 zRes =
fHitQaData.GetHitZ() - pMCPoint->GetZ();
660 zRes =
fHitQaData.GetHitZ() - 0.5 * (pMCPoint->GetZ() + pMCPoint->GetZOut());
733 for (
int iE = 0; iE < nMCevents; ++iE) {
736 int nPoints =
fpMCPoints->Size(iFile, iEvent);
737 int nTracks =
fpMCTracks->Size(iFile, iEvent);
740 std::vector<std::vector<bool>> vIsTrackProcessed(nSt);
741 for (
int iSt = 0; iSt < nSt; iSt++) {
742 vIsTrackProcessed[iSt].resize(nTracks, 0);
745 for (
int iP = 0; iP < nPoints; ++iP) {
750 const auto* pMCPoint =
dynamic_cast<const Point_t*
>(
fpMCPoints->Get(iFile, iEvent, iP));
752 LOG(error) << fName <<
": MC point does not exist for iFile = " << iFile <<
", iEvent = " << iEvent
757 int address = pMCPoint->GetDetectorID();
758 int iSt =
fpDetInterface->GetTrackingStationId(pMCPoint->GetDetectorID());
764 LOG(error) << fName <<
": MC point for FEI = " << iFile <<
", " << iEvent <<
", " << iP <<
" and address "
765 << address <<
" has wrong station index: iSt = " << iSt;
772 fHitQaData.SetPointX(pMCPoint->FairMCPoint::GetX());
773 fHitQaData.SetPointY(pMCPoint->FairMCPoint::GetY());
774 fHitQaData.SetPointZ(pMCPoint->FairMCPoint::GetZ());
784 int iTr = pMCPoint->GetTrackID();
786 if (iTr >= nTracks) {
787 LOG(error) << fName <<
": index of MC track is out of range (point id = " << iP <<
", event id = " << iE
788 <<
", track id = " << iTr <<
')';
793 fHitQaData.SetIfTrackHasHits(vNofHitsPerMcTrack[iE][iSt][iTr] > 0);
797 LOG(error) << fName <<
": null MC track pointer for file id = " << iFile <<
", event id = " << iEvent
798 <<
", track id = " << iTr;
803 if (vIsTrackProcessed[iSt][iTr]) {
807 vIsTrackProcessed[iSt][iTr] =
true;
815 bool ifTrackHasHits =
fHitQaData.GetIfTrackHasHits();
826template<ca::EDetectorID DetID>
835 auto* pFairRootManager = FairRootManager::Instance();
836 LOG_IF(fatal, !pFairRootManager) <<
"\033[1;31m" << fName <<
": FairRootManager instance is a null pointer\033[0m";
840 LOG_IF(fatal, !pRecoSetupManager->IsInitialized())
841 <<
"\033[1;31m" << fName <<
": RecoSetupManager instance is not initialized\033[0m";
844 LOG_IF(fatal, !
fpDetInterface) <<
"\033[1;31m" << fName <<
": reco setup unit for detId=" <<
static_cast<int>(DetID)
845 <<
" was not created\033[0m";
847 LOG_IF(fatal, !
fpDetInterface) <<
"\033[1;31m" << fName <<
": tracking detector interface is undefined\033[0m";
857 fpHits =
dynamic_cast<TClonesArray*
>(pFairRootManager->GetObject(
"TofCalHit"));
859 fpHits =
dynamic_cast<TClonesArray*
>(pFairRootManager->GetObject(
"TofHit"));
866 LOG_IF(fatal, !
fpHits) <<
"\033[1;31m" << fName <<
": container of reconstructed hits is not found\033[0m";
872 LOG_IF(fatal, !
fpMCDataManager) <<
"\033[1;31m" << fName <<
": MC data manager branch is not found\033[0m";
876 LOG_IF(fatal, !
fpMCEventList) <<
"\033[1;31m" << fName <<
": MC event list branch is not found\033[0m";
880 LOG_IF(fatal, !
fpMCTracks) <<
"\033[1;31m" << fName <<
": MC track branch is not found\033[0m";
884 LOG_IF(fatal, !
fpMCTracks) <<
"\033[1;31m" << fName <<
": MC point branch is not found\033[0m";
888 fpHitMatches =
dynamic_cast<TClonesArray*
>(pFairRootManager->GetObject(hitMatchName));
889 LOG_IF(fatal, !
fpHitMatches) <<
"\033[1;31m]" << fName <<
": hit match branch is not found\033[0m";
895 frXmin.resize(nSt + 1, 0.);
896 frXmax.resize(nSt + 1, 0.);
898 frYmin.resize(nSt + 1, 0.);
899 frYmax.resize(nSt + 1, 0.);
901 frZmin.resize(nSt + 1, 0.);
902 frZmax.resize(nSt + 1, 0.);
904 for (
int i = nSt; i >= 0; --i) {
906 int j = (i == nSt ? 0 : i);
908 frXmin[i] = vol.GetMaxX();
909 frXmax[i] = vol.GetMinX();
911 frYmin[i] = vol.GetMinY();
912 frYmax[i] = vol.GetMaxY();
914 frZmin[i] = vol.GetMinZ();
915 frZmax[i] = vol.GetMaxZ();
932 for (
int i = 0; i <= nSt; ++i) {
954 fMonitor.SetName(Form(
"Monitor for %s", fName.Data()));
988 for (
int iSt = 0; iSt <= nSt; ++iSt) {
990 sF += (iSt == nSt) ?
"All stations/" : Form(
"Station %d/", iSt);
991 TString nsuff = (iSt == nSt) ?
"" : Form(
"_st%d", iSt);
992 TString tsuff = (iSt == nSt) ?
"" : Form(
" in %s station %d", detName.c_str(), iSt);
1008 sN = (TString)
"hit_xy" + nsuff;
1009 sT = (TString)
"Hit occupancy in xy-Plane" + tsuff +
";x_{hit} [cm];y_{hit} [cm]";
1013 sN = (TString)
"hit_zx" + nsuff;
1014 sT = (TString)
"Hit occupancy in xz-Plane" + tsuff +
";z_{hit} [cm];x_{hit} [cm]";
1018 sN = (TString)
"hit_zy" + nsuff;
1019 sT = (TString)
"Hit occupancy in yz-plane" + tsuff +
";z_{hit} [cm];y_{hit} [cm]";
1024 sN = (TString)
"hit_dx" + nsuff;
1025 sT = (TString)
"Hit position error along x-axis" + tsuff +
";dx_{hit} [cm]";
1028 sN = (TString)
"hit_dy" + nsuff;
1029 sT = (TString)
"Hit position error along y-axis" + tsuff +
";dy_{hit} [cm]";
1032 sN = (TString)
"hit_du" + nsuff;
1033 sT = (TString)
"Hit position error along the major detector coordinate U" + tsuff +
";du_{hit} [cm]";
1036 sN = (TString)
"hit_dv" + nsuff;
1037 sT = (TString)
"Hit position error along the minor detector coordinate V" + tsuff +
";dv_{hit} [cm]";
1040 sN = (TString)
"hit_kuv" + nsuff;
1041 sT = (TString)
"Hit error correlation between the major (U) and the minor detector coordinate Vs" + tsuff
1042 +
";kuv_{hit} [unitless]";
1045 sN = (TString)
"hit_dt" + nsuff;
1046 sT = (TString)
"Hit time error" + tsuff +
";dt_{hit} [ns]";
1049 sN = (TString)
"hit_station_delta_z" + nsuff;
1050 sT = (TString)
"Different between hit and station z-positions" + tsuff +
";z_{hit} - z_{st} [cm]";
1086 for (
int iSt = 0; iSt <= nSt; ++iSt) {
1088 sF += (iSt == nSt) ?
"All stations/" : Form(
"Station %d/", iSt);
1089 TString nsuff = (iSt == nSt) ?
"" : Form(
"_st%d", iSt);
1090 TString tsuff = (iSt == nSt) ?
"" : Form(
" in %s station %d", detName.c_str(), iSt);
1094 sN = (TString)
"n_points_per_hit" + nsuff;
1095 sT = (TString)
"Number of points per hit" + tsuff +
";N_{point}/hit";
1099 sN = (TString)
"point_xy" + nsuff;
1100 sT = (TString)
"Point occupancy in XY plane" + tsuff +
";x_{MC} [cm];y_{MC} [cm]";
1104 sN = (TString)
"point_zx" + nsuff;
1105 sT = (TString)
"Point Occupancy in XZ plane" + tsuff +
";z_{MC} [cm];x_{MC} [cm]";
1109 sN = (TString)
"point_zy" + nsuff;
1110 sT = (TString)
"Point Occupancy in YZ Plane" + tsuff +
";z_{MC} [cm];y_{MC} [cm]";
1115 sN = (TString)
"point_hit_delta_z" + nsuff;
1116 sT = (TString)
"Distance between " + detName +
" point and hit along z axis" + tsuff +
";z_{reco} - z_{MC} [cm]";
1119 sN = (TString)
"res_x" + nsuff;
1120 sT = (TString)
"Residuals for X" + tsuff +
";x_{reco} - x_{MC} [cm]";
1123 sN = (TString)
"res_y" + nsuff;
1124 sT = (TString)
"Residuals for Y" + tsuff +
";y_{reco} - y_{MC} [cm]";
1127 sN = (TString)
"res_u" + nsuff;
1128 sT = (TString)
"Residuals for the major detector coordinate U" + tsuff +
";u_{reco} - u_{MC} [cm]";
1131 sN = (TString)
"res_v" + nsuff;
1132 sT = (TString)
"Residuals for the minor detector coordinate V" + tsuff +
";v_{reco} - v_{MC} [cm]";
1135 sN = (TString)
"res_t" + nsuff;
1136 sT = (TString)
"Residuals for Time" + tsuff +
";t_{reco} - t_{MC} [ns]";
1139 sN = (TString)
"pull_x" + nsuff;
1140 sT = (TString)
"Pulls for X" + tsuff +
";(x_{reco} - x_{MC}) / #sigma_{x}^{reco}";
1143 sN = (TString)
"pull_y" + nsuff;
1144 sT = (TString)
"Pulls for Y" + tsuff +
";(y_{reco} - y_{MC}) / #sigma_{y}^{reco}";
1147 sN = (TString)
"pull_u" + nsuff;
1148 sT = (TString)
"Pulls for the major detector coordinate U" + tsuff +
";(u_{reco} - u_{MC}) / #sigma_{u}^{reco}";
1151 sN = (TString)
"pull_v" + nsuff;
1152 sT = (TString)
"Pulls for the minor detector coordinate V" + tsuff +
";(v_{reco} - v_{MC}) / #sigma_{v}^{reco}";
1155 sN = (TString)
"pull_t" + nsuff;
1156 sT = (TString)
"Pulls for Time" + tsuff +
";(t_{reco} - t_{MC}) / #sigma_{t}^{reco}";
1159 sN = (TString)
"res_x_vs_x" + nsuff;
1160 sT = (TString)
"Residuals for X" + tsuff +
";x_{MC} [cm];x_{reco} - x_{MC} [cm]";
1164 sN = (TString)
"res_y_vs_y" + nsuff;
1165 sT = (TString)
"Residuals for Y" + tsuff +
";y_{MC} [cm];y_{reco} - y_{MC} [cm]";
1169 sN = (TString)
"res_u_vs_u" + nsuff;
1170 sT = (TString)
"Residuals for the major detector coordinate U" + tsuff +
";u_{MC} [cm];u_{reco} - u_{MC} [cm]";
1174 sN = (TString)
"res_v_vs_v" + nsuff;
1175 sT = (TString)
"Residuals for the minor detector coordinate V" + tsuff +
";v_{MC} [cm];v_{reco} - v_{MC} [cm]";
1179 sN = (TString)
"res_t_vs_t" + nsuff;
1180 sT = (TString)
"Residuals for Time" + tsuff +
";t_{MC} [ns];t_{reco} - t_{MC} [ns]";
1183 sN = (TString)
"pull_x_vs_x" + nsuff;
1184 sT = (TString)
"Pulls for X" + tsuff +
";x_{MC} [cm];(x_{reco} - x_{MC}) / #sigma_{x}^{reco}";
1188 sN = (TString)
"pull_y_vs_y" + nsuff;
1189 sT = (TString)
"Pulls for Y" + tsuff +
";y_{MC} [cm];(y_{reco} - y_{MC}) / #sigma_{y}^{reco}";
1193 sN = (TString)
"pull_u_vs_u" + nsuff;
1194 sT = (TString)
"Pulls for the major detector coordinate U" + tsuff
1195 +
";u_{MC} [cm];(u_{reco} - u_{MC}) / #sigma_{u}^{reco}";
1199 sN = (TString)
"pull_v_vs_v" + nsuff;
1200 sT = (TString)
"Pulls for the minor detector coordinate V" + tsuff
1201 +
";v_{MC} [cm];(v_{reco} - v_{MC}) / #sigma_{v}^{reco}";
1205 sN = (TString)
"pull_t_vs_t" + nsuff;
1206 sT = (TString)
"Pulls for Time" + tsuff +
";t_{MC} [ns];(t_{reco} - t_{MC}) / #sigma_{t}^{reco}";
1209 sN = (TString)
"reco_eff_vs_xy" + nsuff;
1210 sT = (TString)
"Hit rec. efficiency in XY" + tsuff +
";x_{MC} [cm];y_{MC} [cm];#epsilon";
1214 sN = (TString)
"reco_eff" + nsuff;
1215 sT = (TString)
"Hit rec. efficiency in XY bins" + tsuff +
";eff";
1224template<ca::EDetectorID DetID>
1228 gStyle->SetOptFit(1);
1235 constexpr auto contColor = kOrange + 7;
1236 constexpr auto contWidth = 2;
1237 constexpr auto contStyle = 2;
1238 constexpr auto contFill = 0;
1339 canv->DivideSquare(nSt);
1340 for (
int iSt = 0; iSt < nSt; ++iSt) {
1346 double stXmin = actVol.GetMinX();
1347 double stXmax = actVol.GetMaxX();
1348 double stYmin = actVol.GetMinY();
1349 double stYmax = actVol.GetMaxY();
1351 auto* pBox =
new TBox(stXmin, stYmin, stXmax, stYmax);
1352 pBox->SetLineWidth(contWidth);
1353 pBox->SetLineStyle(contStyle);
1354 pBox->SetLineColor(contColor);
1355 pBox->SetFillStyle(contFill);
1364 for (
int iSt = 0; iSt < nSt; ++iSt) {
1367 double stZmin = actVol.GetMinZ();
1368 double stZmax = actVol.GetMaxZ();
1369 double stHmin = actVol.GetMinX();
1370 double stHmax = actVol.GetMaxX();
1372 auto* pBox =
new TBox(stZmin, stHmin, stZmax, stHmax);
1373 pBox->SetLineWidth(contWidth);
1374 pBox->SetLineStyle(contStyle);
1375 pBox->SetLineColor(contColor);
1376 pBox->SetFillStyle(contFill);
1385 for (
int iSt = 0; iSt < nSt; ++iSt) {
1388 double stZmin = actVol.GetMinZ();
1389 double stZmax = actVol.GetMaxZ();
1390 double stHmin = actVol.GetMinY();
1391 double stHmax = actVol.GetMaxY();
1393 auto* pBox =
new TBox(stZmin, stHmin, stZmax, stHmax);
1394 pBox->SetLineWidth(contWidth);
1395 pBox->SetLineStyle(contStyle);
1396 pBox->SetLineColor(contColor);
1397 pBox->SetFillStyle(contFill);
1412 canv->DivideSquare(nSt);
1413 for (
int iSt = 0; iSt < nSt; ++iSt) {
1419 double stXmin = actVol.GetMinX();
1420 double stXmax = actVol.GetMaxX();
1421 double stYmin = actVol.GetMinY();
1422 double stYmax = actVol.GetMaxY();
1424 auto* pBox =
new TBox(stXmin, stYmin, stXmax, stYmax);
1425 pBox->SetLineWidth(contWidth);
1426 pBox->SetLineStyle(contStyle);
1427 pBox->SetLineColor(contColor);
1428 pBox->SetFillStyle(contFill);
1437 for (
int iSt = 0; iSt < nSt; ++iSt) {
1440 double stZmin = actVol.GetMinZ();
1441 double stZmax = actVol.GetMaxZ();
1442 double stHmin = actVol.GetMinX();
1443 double stHmax = actVol.GetMaxX();
1445 auto* pBox =
new TBox(stZmin, stHmin, stZmax, stHmax);
1446 pBox->SetLineWidth(contWidth);
1447 pBox->SetLineStyle(contStyle);
1448 pBox->SetLineColor(contColor);
1449 pBox->SetFillStyle(contFill);
1458 for (
int iSt = 0; iSt < nSt; ++iSt) {
1461 double stZmin = actVol.GetMinZ();
1462 double stZmax = actVol.GetMaxZ();
1463 double stHmin = actVol.GetMinY();
1464 double stHmax = actVol.GetMaxY();
1466 auto* pBox =
new TBox(stZmin, stHmin, stZmax, stHmax);
1467 pBox->SetLineWidth(contWidth);
1468 pBox->SetLineStyle(contStyle);
1469 pBox->SetLineColor(contColor);
1470 pBox->SetFillStyle(contFill);
1480 canv->DivideSquare(nSt);
1481 for (
int iSt = 0; iSt < nSt; ++iSt) {
1489 canv->DivideSquare(nSt);
1490 for (
int iSt = 0; iSt < nSt; ++iSt) {
1498 canv->DivideSquare(nSt);
1499 for (
int iSt = 0; iSt < nSt; ++iSt) {
1507 canv->DivideSquare(nSt);
1508 for (
int iSt = 0; iSt < nSt; ++iSt) {
1516 canv->DivideSquare(nSt);
1517 for (
int iSt = 0; iSt < nSt; ++iSt) {
1529 canv->DivideSquare(nSt);
1530 for (
int iSt = 0; iSt < nSt; ++iSt) {
1538 canv->DivideSquare(nSt);
1539 for (
int iSt = 0; iSt < nSt; ++iSt) {
1547 canv->DivideSquare(nSt);
1548 for (
int iSt = 0; iSt < nSt; ++iSt) {
1556 canv->DivideSquare(nSt);
1557 for (
int iSt = 0; iSt < nSt; ++iSt) {
1565 canv->DivideSquare(nSt);
1566 for (
int iSt = 0; iSt < nSt; ++iSt) {
1576 auto* canv =
MakeQaObject<TCanvas>(
"vs Station/reco_eff",
"Hit efficiencies in xy bins", 1600, 800);
1577 canv->DivideSquare(nSt);
1578 for (
int iSt = 0; iSt < nSt; ++iSt) {
1586 auto* canv =
MakeQaObject<TCanvas>(
"vs Station/reco_eff_vs_xy",
"Hit efficiencies wrt x and y", 1600, 800);
1587 canv->DivideSquare(nSt);
1588 for (
int iSt = 0; iSt < nSt; ++iSt) {
1598template<ca::EDetectorID DetID>
1607 double px = std::numeric_limits<double>::signaling_NaN();
1608 double py = std::numeric_limits<double>::signaling_NaN();
1609 double pz = std::numeric_limits<double>::signaling_NaN();
1611 px = point->GetPx();
1612 py = point->GetPy();
1613 pz = point->GetPz();
1616 px = point->GetPxOut();
1617 py = point->GetPyOut();
1618 pz = point->GetPzOut();
1620 double p =
sqrt(px * px + py * py + pz * pz);
1626 if (p <
fConfig.fMcTrackCuts.fMinMom) {
1630 if (TMath::ATan2(
sqrt(px * px + py * py), pz) * TMath::RadToDeg() >
fConfig.fMcTrackCuts.fMaxTheta) {
Compile-time constants definition for the CA tracking algorithm.
Implementation of L1DetectorID enum class for CBM.
Class for pixel hits in MUCH detector.
Definition of CbmQaTable class.
Useful utilities for CBM QA tasks.
Data class for STS clusters.
Data class for a reconstructed hit in the STS.
Class for hits in TRD detector.
friend fvec sqrt(const fvec &a)
friend fscal max(fscal x, fscal y)
friend fscal min(fscal x, fscal y)
Generates beam ions for transport simulation.
static CbmDigiManager * Instance()
Static instance.
void SetIndex(int32_t index)
Task class creating and managing CbmMCDataArray objects.
Container class for MC events with number, file and start time.
int32_t GetMotherId() const
T * MakeQaObject(TString sName, TString sTitle, Args... args)
void MakeQaDirectory(TString sName)
std::optional< Config > ReadSpecificConfig() const
Reads the specific configuration structure from the YAML node.
void SetStoringMode(EStoringMode mode)
Set storing mode.
@ kSUBDIR
Objects of different type will be stored in different subdirectories like histograms/ canvases/.
TODO: SZh, 30.01.2023: Override THistPainter::PaintText() to add zeroes in tables.
CbmQaTask(const char *name, int verbose, bool isMCUsed, ECbmRecoMode recoMode=ECbmRecoMode::Timeslice)
Constructor from parameters.
bool IsMCUsed() const
Returns flag, whether MC information is used or not in the task.
Data class with information on a STS local track.
static int32_t GetSmType(uint32_t address)
static RecoSetupManager * Instance()
Instance access.
constexpr fscal SpeedOfLight
Speed of light [cm/ns].
TODO: SZh 8.11.2022: add selection of parameterisation.
constexpr ECbmModuleId ToCbmModuleId(EDetectorID detID)
Conversion map from EDetectorID to ECbmModuleId.
constexpr DetIdArr_t< const char * > kDetPointBrName
Name of point branches for each detector.
constexpr DetIdArr_t< const char * > kDetHitBrName
Name of hit branches for each detector.
void SetLargeStats(TH1 *pHist)
Set large stat. window.