28#include "FairMCPoint.h"
30#include <FairRootManager.h>
33#include <TClonesArray.h>
34#include <TGeoManager.h>
55 LOG(warn) << GetName() <<
"::AddDetector(" <<
ToString(
id) <<
")."
56 <<
" already registered. Using "
57 <<
"\"CbmRecoQaTask::GetDetector(ECbmModuleId).\"";
70 LOG(debug) << GetName() <<
"::AddDetector(" <<
ToString(
id) <<
").";
73 default: LOG(warn) << GetName() <<
"::AddDetector : unsupported det " <<
ToString(
id);
return nullptr;
90 LOG(warning) << GetName() <<
" missing tracks for " <<
ToString(did);
94 LOG(warning) << GetName() <<
" negative trk idx for " <<
ToString(did);
99 LOG(debug1) << GetName() <<
" missing trk_" <<
id <<
" for " <<
ToString(did);
112 FairRootManager* ioman = FairRootManager::Instance();
115 LOG(fatal) << GetName() <<
"::Init :: RootManager not instantiated!";
119 fGTracks =
static_cast<TClonesArray*
>(ioman->GetObject(
"GlobalTrack"));
121 LOG(warn) << GetName() <<
"::Init: Global track array not found!";
125 fEvents =
static_cast<TClonesArray*
>(ioman->GetObject(
"CbmEvent"));
127 LOG(warn) << GetName() <<
"::Init: No event found. Some results will be missing.";
133 LOG(info) << GetName() <<
"::Init: Setup config for \"mCBM 2022\".";
137 LOG(info) << GetName() <<
"::Init: Setup config for \"mCBM 2024\". ";
141 LOG(info) << GetName() <<
"::Init: Setup config for \"Default\". ";
149 LOG(warn) << GetName() <<
"::Init: MC data manager not available even though asked by user !";
153 fTrackMatches =
static_cast<TClonesArray*
>(ioman->GetObject(
"GlobalTrackMatch"));
155 LOG(warn) << GetName() <<
"::Init: MC info for Global track not available !";
161 for (
auto& detp :
fDetQa) {
162 auto& det = detp.second;
167 LOG(warn) << GetName() <<
"::Init: MC Point array for " <<
ToString(det.id) <<
" not found!";
168 fHitMatch[det.id] =
static_cast<TClonesArray*
>(ioman->GetObject((det.hit.name +
"Match").c_str()));
171 LOG(warn) << GetName() <<
"::Init: Hit Match array for " <<
ToString(det.id) <<
" not found!";
174 fHits[det.id] =
static_cast<TClonesArray*
>(ioman->GetObject(det.hit.name.data()));
175 if (!
fHits[det.id]) {
176 LOG(warn) << GetName() <<
"::Init: Hit array for " <<
ToString(det.id) <<
" not found!";
181 fTracks[det.id] =
static_cast<TClonesArray*
>(ioman->GetObject(det.trk.name.data()));
182 if (!
fTracks[det.id]) LOG(warn) << GetName() <<
"::Init: Track array for " <<
ToString(det.id) <<
" not found!";
188 ? (TDirectoryFile*)
fOutFolder.mkdir(
"TRG",
"Target tomography with CA")
193 fViews.emplace(
"prj",
View(
"TrkProj",
"", {}));
198 LOG(warn) << GetName() <<
"::Init: Only " <<
kNtrkProjections <<
" are supported. Skipping the rest.";
208 fViews[
"prj"].Register(trgDir);
219 fViews[
"vx"].Init(
"Prim");
220 fViews[
"vx"].Register(trgDir);
229 LOG(error) <<
"Unprocessed hit in view " <<
name;
230 cout <<
h->ToString();
238 int32_t a =
h->GetAddress();
243 for (
auto ii : fSelector) {
244 if (uint(ii) != sel[idx])
break;
254 LOG(debug4) <<
"Accept Sts hit for " << sel[0] <<
" " << sel[1] <<
" " << sel[2];
258 LOG(error) <<
"Failed loading STS hit in view " << name;
273 int8_t modId = (uId >> 8) & 0xF;
276 if (modId >= fSelector[0])
return false;
281 LOG(error) <<
"Failed loading RICH hit in view " << name;
294 std::vector<int> sel;
305 for (
auto ii : fSelector) {
306 if (ii != sel[idx])
break;
310 if (idx != fSelector.size()) {
314 LOG(debug4) <<
"Accept Sts hit for " << sel[0] <<
" " << sel[1] <<
" " << sel[2];
318 LOG(error) <<
"Failed loading TRD hit in view " << name;
331 int32_t a =
h->GetAddress();
334 for (
auto ii : fSelector) {
335 if (ii != sel[idx])
break;
345 LOG(debug4) <<
"Accept Tof hit for " << sel[0] <<
" " << sel[1] <<
" " << sel[2];
349 LOG(error) <<
"Failed loading ToF hit in view " << name;
361 double x(0),
y(0), dx(0), dy(0);
362 if (!HasAddress<Hit>(
h,
x,
y, dx, dy)) {
363 LOG(debug1) <<
"view " << name <<
" does not own hit " <<
h->ToString();
370 auto fillView = [&](
eProjectionType proj,
double xx,
double yy,
bool scaleY =
true) {
371 auto it = fProjection.find(proj);
372 if (it != fProjection.end()) {
373 scale = std::get<0>(it->second);
374 hh = std::get<2>(it->second);
375 if (hh) hh->Fill(xx, scaleY ? yy * scale : yy);
409 for (
auto& projection : fProjection) {
410 int scale = get<0>(projection.second);
411 TH2* hh = get<2>(projection.second);
414 switch (projection.first) {
427 double dxMC = point->GetX() - t.
X(), dyMC = point->GetY() - t.
Y();
429 switch (projection.first) {
441 for (
auto& projection : fProjection) {
442 int scale = get<0>(projection.second);
443 TH2* hh = get<2>(projection.second);
445 switch (projection.first) {
447 if (
int(p->Z()) == -124) hh->Fill(p->X(), p->Y());
450 if (
int(p->Z()) == 0) hh->Fill(scale * p->X(), scale * p->Y());
454 if (
int(p->Z()) == 1) hh->Fill(scale * p->X(), scale * p->Y());
458 if (
int(p->Z()) == 2) hh->Fill(scale * p->X(), scale * p->Y());
462 if (
int(p->Z()) == 3) hh->Fill(scale * p->X(), scale * p->Y());
466 if (
int(p->Z()) == 4) hh->Fill(scale * p->X(), scale * p->Y());
470 if (
int(p->Z()) == 5) hh->Fill(scale * p->X(), scale * p->Y());
477 if (
int(p->Z()) == -123) hh->Fill(scale * p->X(), scale * p->Y());
489 LOG(info) << GetName() <<
"::Exec : Evs[" << (
fEvents ?
fEvents->GetEntriesFast() : 0) <<
"] Trks["
498 int iev = 0, itrack = 0, nnodes = 0;
499 auto processHits = [&](
CbmEvent* ev) {
500 for (
auto& detp :
fDetQa) {
501 auto& det = detp.second;
502 if (!
fHits[det.id]) {
503 LOG(error) << GetName() <<
"::Exec() : Hits for " <<
ToString(det.id) <<
" not available. Skip.";
507 const int nh = (ev) ?
max(
int(0),
int(ev->GetNofData(det.hit.id))) :
fHits[det.id]->GetEntriesFast();
508 for (
int ih = 0; ih < nh; ++ih) {
509 const int jh = (ev) ? ev->GetIndex(det.hit.id, ih) : ih;
511 const FairMCPoint* mcpoint =
nullptr;
514 LOG(warning) << GetName() <<
"::Exec() : Hit " << jh <<
" for " <<
ToString(det.id)
515 <<
" not available. Skip.";
524 if (!mcpoint)
continue;
532 int file_id{0}, event_id{0};
533 if (ev && ev->GetMatch() && ev->GetMatch()->GetNofLinks() > 0) {
534 file_id = ev->GetMatch()->GetMatchedLink().GetFile();
535 event_id = ev->GetMatch()->GetMatchedLink().GetEntry();
538 event_id = FairRootManager::Instance()->GetEntryNr();
540 if (link.GetFile() != file_id || link.GetEntry() != event_id) {
541 LOG(warn) <<
"match from different event";
544 mcpoint =
dynamic_cast<FairMCPoint*
>(
fPoints[det.id]->Get(link));
550 for (
auto& view : det.fViews) {
561 default: LOG(fatal) << GetName() <<
"::Exec : unsupported det " <<
ToString(det.id);
break;
567 for (
auto&
v : det.fViews) {
568 mult.SetXYZ(nh,
double(
v.fMult) / nh, -124);
575 auto processTracks = [&](
CbmEvent* ev) {
579 int ntrkDet[3] = {0};
584 vx = ev->GetVertex();
589 for (
int i(0); i < 3; i++) {
591 if (evx[i] > 0.) evx[i] =
sqrt(evx[i]);
595 pvx.SetXYZ(ntrk, nTrkVx, -123);
598 for (
int itrk = 0; itrk < ntrk; ++itrk) {
600 auto track =
dynamic_cast<const CbmGlobalTrack*
>((*fGTracks)[trkIdx]);
606 if (track->GetStsTrackIndex() >= 0) ntrkDet[0]++;
607 if (track->GetTrdTrackIndex() >= 0) ntrkDet[1]++;
608 if (track->GetTofTrackIndex() >= 0) ntrkDet[2]++;
614 LOG(fatal) << GetName() <<
"::Exec: can not create the track for the fit!";
617 if (!nnodes) nnodes = trkKf.
fNodes.size();
620 for (
auto& n : trkKf.
fNodes) {
623 auto& det =
fDetQa[n.fHitSystemId];
625 auto view = det.FindView(n.fMxy.X(), n.fMxy.Y(), n.fZ);
627 LOG(debug) << GetName() <<
"::Exec: view for tracking layer " <<
ToString(det.id) <<
" not defined.";
630 n.fIsTimeSet = n.fIsXySet =
false;
634 const CbmHit* hit =
dynamic_cast<CbmHit*
>(
fHits[n.fHitSystemId]->At(n.fHitIndex));
636 const FairMCPoint* mcpoint =
nullptr;
649 mcpoint =
dynamic_cast<FairMCPoint*
>(
fPoints[n.fHitSystemId]->Get(link));
654 view->Load(&n, mcpoint);
655 nhit[(int) n.fHitSystemId]++;
656 n.fIsTimeSet = n.fIsXySet =
true;
660 if (!nnodes) nnodes = (int) trkKf.
fNodes.size();
664 LOG(error) << GetName() <<
"::Exec: view for track projection with wrong type. Skipping.";
672 trkKf.
fNodes.push_back(n);
678 for (
auto& n : trkKf.
fNodes) {
679 if (n.fReference1 < 0)
continue;
680 xyz.SetXYZ(n.fParamUp.X(), n.fParamUp.Y(), n.fReference1);
693 auto ev =
dynamic_cast<CbmEvent*
>(evObj);
699 LOG(info) << GetName() <<
"::Exec : Evs(%)["
700 << (
fEvents->GetEntriesFast() ? 1.e2 * iev /
fEvents->GetEntriesFast() : 0) <<
"] Trks(%)["
706 processHits(
nullptr);
709 LOG(info) << GetName() <<
"::Exec : TS local reco only.";
713 processTracks(
nullptr);
715 LOG(info) << GetName() <<
"::Exec : Trks(%)["
725 if (
v.second.fType != type)
continue;
735 FairSink* sink = FairRootManager::Instance()->GetSink();
746 if (!evCut.Accept(ptr,
this))
return false;
755 if (!trkCut.Accept(ptr,
this))
return false;
763 gGeoManager->CdTop();
764 TGeoNode* cave = gGeoManager->GetCurrentNode();
766 LOG(error) <<
"Error: Could not get the top node in the geometry manager." << std::endl;
770 for (Int_t iNode = 0; iNode < cave->GetNdaughters(); iNode++) {
771 TString name = cave->GetDaughter(iNode)->GetVolume()->GetName();
772 if (name.Contains(detector, TString::kIgnoreCase)) {
773 return name.Contains(
"mcbm", TString::kIgnoreCase) ? TString(name(5, name.Length()))
774 : TString(name(5, name.Length() - 5));
784 std::vector<TString> nodePaths;
790 TString nodePath = path;
791 if (!nodePath.IsNull()) {
794 nodePath += node->GetName();
796 if (TString(node->GetName()).Contains(activeNodeName)) {
797 if (nodePath.Contains(detector)) nodePaths.push_back(nodePath);
801 Int_t numDaughters = node->GetNdaughters();
802 for (Int_t i = 0; i < numDaughters; ++i) {
803 TGeoNode* daughterNode = node->GetDaughter(i);
805 std::vector<TString> result =
GetPath(daughterNode, detector, activeNodeName, depth + 1, nodePath);
806 nodePaths.insert(nodePaths.end(), result.begin(), result.end());
816 LOG(fatal) << GetName() <<
"::InitMcbm22() : Missing setup definition.";
825 std::vector<TString> path;
826 TGeoNode* topNode = gGeoManager->GetTopNode();
828 LOG(error) <<
"Error: Top node not found.";
832 auto processDetector = [&](
const std::string& detector,
const std::string& component) {
835 if (geoTag.Length() > 0) {
836 LOG(info) << detector <<
": geometry tag is " << geoTag;
839 LOG(warn) <<
"Warning: No geometry tag found for detector " << detector;
842 path =
GetPath(topNode, detector, component, 0);
847 processDetector(
"sts",
"Sensor");
849 std::regex pattern(
"/Station(\\d+)_(\\d+)/Ladder(\\d+)_(\\d+)/HalfLadder\\d+d_(\\d+)/"
850 "HalfLadder\\d+d_Module(\\d+)_(\\d+)/Sensor(\\d+)_(\\d+)");
853 for (
const auto& str : path) {
854 std::string Str(str.Data());
856 if (std::regex_search(Str, match, pattern)) {
857 int station = std::stoi(match[2]);
858 int ladder = std::stoi(match[4]);
859 int module = std::stoi(match[7]);
861 const char* fType = Form(
"U%dL%dM%d", station - 1, ladder - 1, module - 1);
863 v = sts->
AddView(fType, str.Data(), {station - 1, ladder - 1, module - 1});
874 std::cout <<
"No match found in string: " << str << std::endl;
880 processDetector(
"trd",
"module");
885 for (
const auto& str : path) {
886 if (!str.Contains(
"module9"))
continue;
887 v = trd->
AddView(
"2D", str.Data(), {5});
900 for (
const auto& str : path) {
902 if (str.Contains(
"layer02")) {
903 v = trd->
AddView(
"1Dx", str.Data(), {21});
911 if (str.Contains(
"layer03")) {
912 v = trd->
AddView(
"1Dy", str.Data(), {37});
925 processDetector(
"tof",
"counter");
929 std::regex pattern(
"module_(\\d+)_(\\d+)/gas_box_(\\d+)/counter_(\\d+)");
931 for (
const auto& str : path) {
932 std::string Str(str.Data());
934 if (std::regex_search(Str, match, pattern)) {
935 int type = std::stoi(match[1]);
936 int smid = std::stoi(match[2]);
937 int rpc = std::stoi(match[4]);
938 const char* name = Form(
"Sm%d_%dRpc%d", type, smid, rpc);
940 v = tof->
AddView(name, str.Data(), {smid, type, rpc});
944 v = tof->
AddView(name, str.Data(), {smid, type, rpc});
948 std::cout <<
"No match found in string: " << str << std::endl;
954 float angle = 25., L[] = {14.3, 0, -20, -38 , -50.5 };
956 for (
int i(0); i < 5; i++) {
957 fPrjPlanes.emplace_back(L[i] * TMath::Sin(angle * TMath::DegToRad()), 0.,
958 L[i] * TMath::Cos(angle * TMath::DegToRad()));
968 LOG(fatal) << GetName() <<
"::InitMcbm24() : Missing setup definition.";
984 Form(
"/cave_1/sts_%s_0/Station01_1/Ladder13_1/"
985 "HalfLadder13u_1/HalfLadder13u_Module03_1/Sensor03_1",
992 Form(
"/cave_1/sts_%s_0/Station02_2/Ladder09_1/"
993 "HalfLadder09d_2/HalfLadder09d_Module03_1/Sensor03_1",
999 Form(
"/cave_1/sts_%s_0/Station02_2/Ladder09_1/"
1000 "HalfLadder09d_2/HalfLadder09d_Module03_2/Sensor03_1",
1007 Form(
"/cave_1/sts_%s_0/Station02_2/Ladder09_2/"
1008 "HalfLadder09d_2/HalfLadder09d_Module03_1/Sensor03_1",
1014 Form(
"/cave_1/sts_%s_0/Station02_2/Ladder09_2/"
1015 "HalfLadder09d_2/HalfLadder09d_Module03_2/Sensor03_1",
1022 Form(
"/cave_1/sts_%s_0/Station03_3/Ladder10_1/"
1023 "HalfLadder10d_2/HalfLadder10d_Module03_1/Sensor03_1",
1029 Form(
"/cave_1/sts_%s_0/Station03_3/Ladder10_1/"
1030 "HalfLadder10d_2/HalfLadder10d_Module04_2/Sensor04_1",
1037 Form(
"/cave_1/sts_%s_0/Station03_3/Ladder12_2/"
1038 "HalfLadder12d_2/HalfLadder12d_Module03_1/Sensor03_1",
1044 Form(
"/cave_1/sts_%s_0/Station03_3/Ladder12_2/"
1045 "HalfLadder12d_2/HalfLadder12d_Module04_2/Sensor04_1",
1052 Form(
"/cave_1/sts_%s_0/Station03_3/Ladder11_3/"
1053 "HalfLadder11d_2/HalfLadder11d_Module03_1/Sensor03_1",
1059 Form(
"/cave_1/sts_%s_0/Station03_3/Ladder11_3/"
1060 "HalfLadder11d_2/HalfLadder11d_Module03_2/Sensor03_1",
1064 Form(
"/cave_1/sts_%s_0/Station03_3/Ladder11_3/"
1065 "HalfLadder11d_2/HalfLadder11d_Module03_3/Sensor03_1",
1077 v = trd->
AddView(
"2D", Form(
"/cave_1/trd_%s_0/layer01_20101/module9_101001001/gas_0", dtag.Data()), {5});
1081 v = trd->
AddView(
"1Dx", Form(
"/cave_1/trd_%s_0/layer02_10202/module5_101002001", dtag.Data()), {21});
1086 v = trd->
AddView(
"1Dy", Form(
"/cave_1/trd_%s_0/layer03_11303/module5_101103001", dtag.Data()), {37});
1096 vector<int> tofSelect(3);
1098 for (
int ism(0); ism < 6; ism++) {
1100 for (
int irpc(0); irpc < 5; irpc++) {
1101 tofSelect[2] = irpc;
1102 v = tof->
AddView(Form(
"Sm%dRpc%d", ism, irpc),
1103 Form(
"/cave_1/tof_%s_0/tof_%sStand_1/module_%d_%d/"
1104 "gas_box_0/counter_%d",
1105 dtag.Data(), dtag.Data(), tofSelect[1], tofSelect[0], tofSelect[2]),
1114 for (
int irpc(0); irpc < 2; irpc++) {
1115 tofSelect[2] = irpc;
1116 tof->
AddView(Form(
"BuchRpc%d", irpc),
1117 Form(
"/cave_1/tof_%s_0/tof_%sStand_1/module_%d_%d/gas_box_0/"
1119 dtag.Data(), dtag.Data(), tofSelect[1], tofSelect[0], tofSelect[2]),
1124 for (
int ism(0); ism < 2; ism++) {
1126 for (
int irpc(0); irpc < 2; irpc++) {
1127 tofSelect[2] = irpc;
1128 tof->
AddView(Form(
"Test%dRpc%d", ism, irpc),
1129 Form(
"/cave_1/tof_%s_0/tof_%sStand_1/module_%d_%d/"
1130 "gas_box_0/counter_%d",
1131 dtag.Data(), dtag.Data(), tofSelect[1], tofSelect[0], tofSelect[2]),
1137 for (
int ism(0); ism < 2; ism++) {
1139 for (
int irpc(0); irpc < 5; irpc++) {
1140 tofSelect[2] = irpc;
1141 tof->
AddView(Form(
"Sm2%dRpc%d", ism, irpc),
1142 Form(
"/cave_1/tof_%s_0/tof_%sStand_1/module_%d_%d/"
1143 "gas_box_0/counter_%d",
1144 dtag.Data(), dtag.Data(), tofSelect[1], tofSelect[0], tofSelect[2]),
1155 rich->
AddView(
"Aerogel", Form(
"/cave_1/rich_%s_0/box_1/Gas_1", dtag.Data()), {4});
1159 float angle = 25., L[] = {14.3, 0, -20, -38, -50.5};
1161 for (
int i(0); i < 5; i++) {
1162 fPrjPlanes.emplace_back(L[i] * TMath::Sin(angle * TMath::DegToRad()), 0.,
1163 L[i] * TMath::Cos(angle * TMath::DegToRad()));
1169 LOG(info) <<
"Init Default ....";
1172 LOG(fatal) << GetName() <<
"::InitDefault() : Missing setup definition.";
1177 std::vector<TString> path;
1178 TGeoNode* topNode = gGeoManager->GetTopNode();
1180 LOG(error) <<
"Error: Top node not found.";
1185 auto processDetector = [&](
const std::string& detector,
const std::string& component) {
1188 if (geoTag.Length() > 0) {
1189 LOG(info) << detector <<
": geometry tag is " << geoTag;
1192 LOG(warn) <<
"Warning: No geometry tag found for detector " << detector;
1194 path =
GetPath(topNode, detector, component, 0);
1198 processDetector(
"sts",
"Unit");
1201 std::regex pattern(R
"(Unit(\d{2}[LR])_(\d+))");
1205 for (
const auto& str : path) {
1206 std::string Str(str.Data());
1209 if (std::regex_search(Str, match, pattern)) {
1210 int unitid = std::stoi(match[2].str());
1211 std::string unitname = (Str.find(
"Unit") != std::string::npos) ? Str.substr(Str.find(
"Unit")) :
"";
1213 v = sts->
AddView(unitname.c_str(), str.Data(), {unitid - 1, -1, -1});
1217 std::cout <<
"No match found in string: " << str << std::endl;
1223 processDetector(
"trd",
"module");
1224 std::regex pattern(
"layer(\\d+)_(\\d+)/module(\\d+)_(\\d+)");
1227 for (
const auto& str : path) {
1228 std::string Str(str.Data());
1230 if (std::regex_search(Str, match, pattern)) {
1231 int layer = std::stoi(match[1]);
1232 int layercopyNr = std::stoi(match[2]);
1234 int module = std::stoi(match[3]);
1235 int modulecopyNr = std::stoi(match[4]);
1237 int fLayer = ((layercopyNr / 100) % 10);
1238 int fModuleCopy = (modulecopyNr % 100);
1240 sprintf(name,
"layer%d_%d_module_%d_%d", layer, layercopyNr, module, modulecopyNr);
1242 v = trd->
AddView(name, str.Data(), {fLayer - 1, fModuleCopy - 1, -1});
1246 std::cout <<
"No match found in string: " << str << std::endl;
1252 processDetector(
"rich",
"sens");
1254 for (
const auto& str : path) {
1255 v = rich->
AddView(
"rich", str.Data(), {-1, -1, -1});
1261 processDetector(
"tof",
"module");
1265 std::regex pattern(
"module_(\\d+)_(\\d+)");
1266 for (
const auto& str : path) {
1267 std::string Str(str.Data());
1269 if (std::regex_search(Str, match, pattern)) {
1270 int type = std::stoi(match[1]);
1271 int smid = std::stoi(match[2]);
1273 std::string modulename = (Str.find(
"module") != std::string::npos) ? Str.substr(Str.find(
"module")) :
"";
1275 v = tof->
AddView(modulename.c_str(), str.Data(), {smid, type, -1});
1279 std::cout <<
"No match found in string: " << str << std::endl;
1327 LOG(warn) <<
"QA unsupported for Detector=" <<
ToString(did);
1338 fViews.emplace_back(n, p, set);
1367 for (
auto& view :
fViews)
1368 if (view.name.compare(n) == 0)
return &view;
1379 if (abs(
v.pos[0] -
x) > 0.5 *
v.size[0])
continue;
1380 if (abs(
v.pos[1] -
y) > 0.5 *
v.size[1])
continue;
1381 if (abs(
v.pos[2] - z) > 0.5 *
v.size[2])
continue;
1393 LOG(fatal) <<
"CbmRecoQaTask::Detector::Init() " <<
ToString(
id) <<
" missing geometry.";
1397 LOG(info) <<
"CbmRecoQaTask::Detector::Init() : " <<
ToString(
id) <<
" MC = " << mc;
1399 TDirectoryFile* modDir =
1400 (TDirectoryFile*) fOut->mkdir(ToString(
id).data(), Form(
"Reco QA for %s",
ToString(
id).data()));
1402 for (
auto& view :
fViews) {
1403 bool vret = view.Init(
ToString(
id).data(), mc);
1404 view.Register(modDir);
1413 s <<
"D[" <<
ToString(
id) <<
"] views[" <<
fViews.size() <<
"]\n";
1423 if (fProjection.find(prj) != fProjection.end()) {
1424 LOG(warn) <<
"Projection " <<
ToString(prj) <<
" already registered";
1428 if (strcmp(unit,
"mm") == 0)
1430 else if (strcmp(unit,
"um") == 0)
1432 else if (strcmp(unit,
"ps") == 0)
1434 else if (strcmp(unit,
"eV") == 0)
1436 else if (strcmp(unit,
"cm") == 0)
1438 else if (strcmp(unit,
"ns") == 0)
1440 else if (strcmp(unit,
"keV") == 0)
1442 else if (strcmp(unit,
"a.u.") == 0)
1445 LOG(warn) <<
"Projection units " << unit <<
" not registered. Natural units will be used.";
1447 fProjection[prj] = make_tuple(scale, range,
nullptr);
1453 if (fProjection.find(prj) == fProjection.end()) {
1454 LOG(warn) <<
"Projection " <<
ToString(prj)
1455 <<
" not initialized. Calling "
1456 "\"CbmRecoQaTask::View::AddProjection()\"";
1457 return AddProjection(prj, range, unit);
1460 if (strcmp(unit,
"mm") == 0)
1462 else if (strcmp(unit,
"um") == 0)
1464 else if (strcmp(unit,
"ps") == 0)
1466 else if (strcmp(unit,
"eV") == 0)
1468 else if (strcmp(unit,
"cm") == 0)
1470 else if (strcmp(unit,
"ns") == 0)
1472 else if (strcmp(unit,
"keV") == 0)
1474 else if (strcmp(unit,
"a.u.") == 0)
1477 LOG(warn) <<
"Projection units " << unit <<
" not registered. Natural units will be used.";
1479 get<0>(fProjection[prj]) = scale;
1480 get<1>(fProjection[prj]) = range;
1491 if (!gGeoManager->cd(path.data()))
return false;
1492 TGeoHMatrix* m = gGeoManager->GetCurrentMatrix();
1493 const double* tr(m->GetTranslation());
1494 TGeoVolume*
v = gGeoManager->GetCurrentVolume();
1495 TGeoShape* bb =
v->GetShape();
1497 for (
int i(0); i < 3; i++) {
1498 size[i] = bb->GetAxisRange(i + 1, w_lo, w_hi);
1499 pos[i] = 0.5 * (w_lo + w_hi) + tr[i];
1502 LOG(info) <<
"CbmRecoQaTask::Detector(" << dname <<
")::View(" << name <<
")::Init() : size [" <<
size[0] <<
" x "
1503 <<
size[1] <<
" x " <<
size[2] <<
"]. mc[" << mc <<
"].";
1506 LOG(info) <<
"CbmRecoQaTask::Detector(" << dname <<
")::View(" << name <<
")::Init() : mc[" << mc <<
"].";
1511 if (strcmp(dname,
"Tof") == 0 || strcmp(dname,
"Rich") == 0) dscale = 1;
1515 for (
auto& projection : fProjection) {
1516 int scale = get<0>(projection.second);
1517 float yrange = get<1>(projection.second);
1519 char mc_id[2] = {
' ',
' '};
1522 switch (projection.first) {
1530 if (!xy_id) xy_id =
't';
1531 nbinsx = 10 * ceil(
size[0]);
1532 unit = makeYrange(scale, yrange);
1534 get<2>(projection.second) =
1535 new TH2D(Form(
"hxx%s_%s%s", (xy_id ==
'M' ?
"MC" :
""), dname, name.data()),
1536 Form(
"X resolution %s %s [%s]; X^{%s}_{%s-%s} (cm); #Delta X (%s)", (xy_id ==
'M' ?
"MC" :
""),
1537 name.data(), dname, mc_id, dname, name.data(), unit.data()),
1538 nbinsx, xlo, xhi, nbinsy, -yrange, yrange);
1548 if (!xy_id) xy_id =
't';
1549 nbinsx = 10 * ceil(
size[1]);
1550 unit = makeYrange(scale, yrange);
1552 get<2>(projection.second) =
1553 new TH2D(Form(
"hyy%s_%s%s", (xy_id ==
'M' ?
"MC" :
""), dname, name.data()),
1554 Form(
"Y resolution %s %s [%s]; Y^{%s}_{%s-%s} (cm); #Delta Y (%s)", (xy_id ==
'M' ?
"MC" :
""),
1555 name.data(), dname, mc_id, dname, name.data(), unit.data()),
1556 nbinsx, ylo, yhi, nbinsy, -yrange, yrange);
1560 nbinsx = 10 * ceil(
size[0]);
1562 LOG(debug) <<
"ProjectionP[" << name <<
"] using default range.";
1566 get<2>(projection.second) =
1567 new TH2D(Form(
"hpx_%s%s", dname, name.data()),
1568 Form(
"X pulls %s [%s]; X^{%s}_{%s-%s} (cm); pull(X)", name.data(), dname, mc_id, dname, name.data()),
1569 nbinsx, xlo, xhi, nbinsy, -yrange, yrange);
1573 nbinsx = 10 * ceil(
size[1]);
1575 LOG(debug) <<
"ProjectionP[" << name <<
"] using default range.";
1579 get<2>(projection.second) =
1580 new TH2D(Form(
"hpy_%s%s", dname, name.data()),
1581 Form(
"Y pulls %s [%s]; Y^{%s}_{%s-%s} (cm); pull(Y)", name.data(), dname, mc_id, dname, name.data()),
1582 nbinsx, ylo, yhi, nbinsy, -yrange, yrange);
1586 nbinsx = 10 * ceil(
size[0]);
1587 unit = makeTrange(scale, yrange);
1588 nbinsy = 2 * ceil(yrange);
1589 get<2>(projection.second) =
new TH2D(Form(
"hxt_%s%s", dname, name.data()),
1590 Form(
"Hit_Trk %s [%s]; X_{%s-%s} (cm); #Delta time_{TRK} (%s)",
1591 name.data(), dname, dname, name.data(), unit.data()),
1592 nbinsx, xlo, xhi, nbinsy, -yrange, yrange);
1596 nbinsx = dscale * ceil(
size[0]);
1597 unit = makeTrange(scale, yrange);
1598 nbinsy = 10 * ceil(yrange);
1599 get<2>(projection.second) =
new TH2D(Form(
"hct_%s%s", dname, name.data()),
1600 Form(
"Hit Event %s [%s]; X_{%s-%s} (cm); #Delta time_{EV} (%s)",
1601 name.data(), dname, dname, name.data(), unit.data()),
1602 nbinsx, xlo, xhi, nbinsy, -yrange, yrange);
1612 get<2>(projection.second) =
new TH2D(
1613 Form(
"hdm_%s%s", dname, name.data()),
1614 Form(
"%s multiplicity [EbyE] %s [%s]; N_{%s}^{%s}; N_{%s-%s}^{%s} (%%)", (xy_id ?
"point" :
"hit"),
1615 name.data(), dname, dname, (xy_id ?
"point" :
"hit"), dname, name.data(), (xy_id ?
"point" :
"hit")),
1616 nbinsx, xlo, xhi, 200, 0, 1);
1623 if (!xy_id) xy_id =
'h';
1624 nbinsx = dscale * ceil(
size[0]);
1625 nbinsy = dscale * ceil(
size[1]);
1626 get<2>(projection.second) =
1627 new TH2D(Form(
"hxy%c_%s%s", xy_id, dname, name.data()),
1628 Form(
"Hit_{%s} %s [%s]; X_{%s-%s} (cm); Y_{%s-%s} (cm)", (xy_id ==
'h' ?
"reco" :
"attach"),
1629 name.data(), dname, dname, name.data(), dname, name.data()),
1630 nbinsx, xlo, xhi, nbinsy, ylo, yhi);
1635 if (!xy_id) xy_id =
'h';
1638 nbinsx = dscale * ceil(
size[0]);
1639 nbinsy = dscale * ceil(
size[1]);
1640 get<2>(projection.second) =
1641 new TH2D(Form(
"hxymc%c_%s%s", xy_id, dname, name.data()),
1642 Form(
"Hit_{%s} %s [%s]; X_{%s-%s} (cm); Y_{%s-%s} (cm)", (xy_id ==
'h' ?
"mc" :
"attach"),
1643 name.data(), dname, dname, name.data(), dname, name.data()),
1644 nbinsx, xlo, xhi, nbinsy, ylo, yhi);
1656 nbinsx = dscale * ceil(
size[0]);
1657 nbinsy = dscale * ceil(
size[1]);
1658 unit = makeYrange(scale, yrange);
1660 get<2>(projection.second) =
new TH2D(
1661 Form(
"h%sR_%s%s", (isResidualX ?
"xx" :
"yy"), dname, name.data()),
1662 Form(
"%s resolution %s [%s]; %s_{%s-%s} (cm); #Delta %s (%s)", (isResidualX ?
"X" :
"Y"), name.data(),
1663 dname, (isResidualX ?
"X" :
"Y"), dname, name.data(), (isResidualX ?
"X" :
"Y"), unit.data()),
1664 nbinsx, (isResidualX ? xlo : ylo), (isResidualX ? xhi : yhi), nbinsy, -yrange, yrange);
1675 nbinsx = dscale * ceil(
size[0]);
1676 nbinsy = dscale * ceil(
size[1]);
1678 get<2>(projection.second) =
new TH2D(
1679 Form(
"h%sR_%s%s", (isResidualTX ?
"tx" :
"ty"), dname, name.data()),
1680 Form(
"%s resolution %s [%s]; %s_{%s-%s} (cm); #Delta %s (ns)", (isResidualTX ?
"T" :
"T"), name.data(),
1681 dname, (isResidualTX ?
"X" :
"Y"), dname, name.data(), (isResidualTX ?
"T" :
"T")),
1682 nbinsx, (isResidualTX ? xlo : ylo), (isResidualTX ? xhi : yhi), nbinsy, -yrange, yrange);
1693 nbinsx = dscale * ceil(
size[0]);
1694 nbinsy = dscale * ceil(
size[1]);
1695 unit = makeYrange(scale, yrange);
1697 get<2>(projection.second) =
1698 new TH2D(Form(
"h%sP_%s%s", (isPullX ?
"xx" :
"yy"), dname, name.data()),
1699 Form(
"%s pull %s [%s]; %s_{%s-%s} (cm); pull(%s)", (isPullX ?
"X" :
"Y"), name.data(), dname,
1700 (isPullX ?
"X" :
"Y"), dname, name.data(), (isPullX ?
"X" :
"Y")),
1701 nbinsx, (isPullX ? xlo : ylo), (isPullX ? xhi : yhi), nbinsy, -yrange, yrange);
1706 nbinsx = dscale * ceil(
size[0] * 2.);
1707 nbinsy = dscale * ceil(
size[1] * 2.);
1713 get<2>(projection.second) =
new TH2D(Form(
"hxyp_%s%s", dname, name.data()),
1714 Form(
"Trk_{proj} %s [%s]; X_{%s-%s} (cm); Y_{%s-%s} (cm)", name.data(),
1715 dname, dname, name.data(), dname, name.data()),
1716 nbinsx, xlo, xhi, nbinsy, ylo, yhi);
1721 if (!xy_id) xy_id =
'1';
1724 if (!xy_id) xy_id =
'2';
1727 if (!xy_id) xy_id =
'3';
1730 if (!xy_id) xy_id =
'4';
1733 if (!xy_id) xy_id =
'5';
1741 get<2>(projection.second) =
new TH2D(Form(
"hxyt%c_%s%s", xy_id, dname, name.data()),
1742 Form(
"Trk_{proj} z = %+.2f [%s]; X_{%s-%s} (cm); Y_{%s-%s} (cm)", yrange,
1743 dname, dname, name.data(), dname, name.data()),
1744 nbinsx, xlo, xhi, nbinsy, ylo, yhi);
1756 get<2>(projection.second) =
1757 new TH2D(Form(
"hMult_%s%s", dname, name.data()),
"Vertex multiplicity; N_{trk}^{event}; N_{trk}^{PV}",
1758 nbinsx, xlo, xhi, nbinsy, ylo, yhi);
1796 get<2>(projection.second) =
1797 new TH2D(Form(
"h%c_%s%s", xy_id, dname, name.data()),
1798 Form(
"Vertex_{%c%c}; %c (cm); %c (cm)", mc_id[0], mc_id[1], mc_id[0], mc_id[1]), nbinsx, xlo, xhi,
1809 s <<
"V[" << name <<
"] path[" << path <<
"] @ [" <<
pos[0] <<
", " <<
pos[1] <<
", " <<
pos[2] <<
"] size["
1810 <<
size[0] <<
", " <<
size[1] <<
", " <<
size[2] <<
"] projections[" << fProjection.size() <<
"] sel[";
1811 for (
auto ii : fSelector)
1820 TDirectoryFile* lDir = (TDirectoryFile*) fOut->mkdir(name.data(), Form(
"QA for vol[%s]", path.data()));
1821 TDirectoryFile *sDir(
nullptr), *tDir(
nullptr);
1825 sDir = (TDirectoryFile*) lDir->mkdir(
"event",
"Local Reco QA");
1827 sDir = (TDirectoryFile*) lDir->mkdir(
"TS",
"TimeSlice QA");
1831 for (
auto& projection : fProjection) {
1832 TH2* hh = get<2>(projection.second);
1834 switch (projection.first) {
1844 if (tDir) tDir->Add(hh);
1857 if (sDir) sDir->Add(hh);
1869 if (lDir) lDir->Add(hh);
1874 LOG(debug) <<
"CbmRecoQaTask::View[" << name <<
"]::Register() : " << n <<
" projections for " << fOut->GetName();
1906 default: LOG(error) <<
"View::ToString() : Unknown projection " << int(prj);
break;
1913 bool kDefaultRange =
false;
1916 LOG(debug) <<
"ProjectionY[" << name <<
"] using default range.";
1917 kDefaultRange =
true;
1922 if (kDefaultRange) yrange = 10;
1924 else if (scale == 10000) {
1926 if (kDefaultRange) yrange = 150;
1933 bool kDefaultRange =
false;
1936 LOG(debug) <<
"ProjectionT[" << name <<
"] using default range.";
1937 kDefaultRange =
true;
1940 if (scale == 1000) {
1942 if (kDefaultRange) yrange = 300;
1950 if (cut.fType == type) {
1951 LOG(warning) << GetName() <<
"::AddEventFilter event filter : " << cut.ToString() <<
" already on the list.";
1962 if (cut.fType == type) {
1963 LOG(warning) << GetName() <<
"::AddTrackFilter track filter : " << cut.ToString() <<
" already on the list.";
1979 case eEventCut::kMultTrk:
1981 if (fMinTrack > 0 && val <
size_t(fMinTrack)) {
1982 ss <<
"NofTrack[" << val <<
"] < min[" << fMinTrack <<
"].";
1986 if (ret && fMaxTrack > 0 && val >
size_t(fMaxTrack)) {
1987 ss <<
"NofTrack[" << val <<
"] > max[" << fMaxTrack <<
"].";
1991 case eEventCut::kMultHit:
1993 if (fMultHit[0] > 0 && val >
size_t(fMultHit[0])) {
1994 ss <<
"Sts hits [" << val <<
"] > max[" << fMultHit[0] <<
"].";
1999 if (fMultHit[1] > 0 && val >
size_t(fMultHit[1])) {
2000 ss <<
"Trd hits [" << val <<
"] > max[" << fMultHit[1] <<
"].";
2005 if (fMultHit[2] > 0 && val >
size_t(fMultHit[2])) {
2006 ss <<
"Tof hits [" << val <<
"] > max[" << fMultHit[2] <<
"].";
2012 if (!ret) LOG(debug2) <<
"Event reject for : " << ss.str();
2018 case eEventCut::kMultTrk:
2019 if (cuts.size() < 2 || cuts[1] < cuts[0]) {
2020 LOG(warning) <<
"Improper definition for event filter :\n\t" <<
ToString() << endl;
2024 fMinTrack = int(cuts[0]);
2025 fMaxTrack = int(cuts[1]);
2027 case eEventCut::kMultHit:
2028 if (cuts.size() < 3) {
2029 LOG(warning) <<
"Improper definition for event filter :\n\t" <<
ToString() << endl;
2034 fMultHit[i] =
int(cuts[i]);
2036 case eEventCut::kTrigger:
break;
2037 case eEventCut::kVertex:
break;
2046 case eEventCut::kMultTrk: ss <<
"kMultTrk : \"cut on track multiplicity";
break;
2047 case eEventCut::kMultHit: ss <<
"kMultHit : \"cut on hit multiplicity";
break;
2048 case eEventCut::kTrigger: ss <<
"kTrigger : \"cut on trigger conditions";
break;
2049 case eEventCut::kVertex: ss <<
"kVertex : \"cut on vertex definition";
break;
2056 LOG(info) <<
"CbmRecoQaTask::EventFilter : Usage";
2058 case eEventCut::kMultTrk:
2060 LOG(info) <<
"\tDepends one two values : min and max of the no of global "
2062 LOG(info) <<
"\tValue should follow the relation max >= min.";
2064 case eEventCut::kMultHit:
2066 LOG(info) <<
"\tDepends one three values : total hits in the following "
2067 "systems (in this order) : STS TRD TOF.";
2068 LOG(info) <<
"\tNegative values are interpreted as no-cut.";
2072 LOG(info) <<
"\tNo user info.";
2085 case eTrackCut::kSts:
2086 if (fNSts <= 0 && !fStsHits.size())
break;
2088 ss <<
"Sts trk index missing";
2093 ss <<
"Sts trk nullptr";
2099 ss <<
"Sts hits/trk [" << trk->
GetNofHits() <<
"] < min[" << fNSts <<
"].";
2104 for (
auto stsStation : fStsHits) {
2105 if (!stsStation)
continue;
2109 case eTrackCut::kTrd:
2110 if (fNTrd <= 0)
break;
2112 ss <<
"Trd trk index missing";
2117 ss <<
"Trd trk nullptr";
2123 ss <<
"Trd` hits/trk [" << trk->
GetNofHits() <<
"] < min[" << fNTrd <<
"].";
2128 case eTrackCut::kTof:
2129 if (fNTof <= 0)
break;
2131 ss <<
"Tof trk index missing";
2136 ss <<
"Tof trk nullptr";
2142 ss <<
"Tof` hits/trk [" << trk->
GetNofHits() <<
"] < min[" << fNTof <<
"].";
2150 if (!ret) LOG(debug2) <<
"Track reject for : " << ss.str();
2156 case eTrackCut::kSts:
2157 if (cuts.size() < 1) {
2158 LOG(warning) <<
"Improper definition for track filter :\n\t" <<
ToString() << endl;
2162 fNSts = int(cuts[0]);
2164 case eTrackCut::kTrd:
2165 if (cuts.size() < 1) {
2166 LOG(warning) <<
"Improper definition for track filter :\n\t" <<
ToString() << endl;
2170 fNTrd = int(cuts[0]);
2172 case eTrackCut::kTof:
2173 if (cuts.size() < 1) {
2174 LOG(warning) <<
"Improper definition for track filter :\n\t" <<
ToString() << endl;
2178 fNTof = int(cuts[0]);
2188 case eTrackCut::kSts: ss <<
"kSts : \"cut on no of STS hits / track\"";
break;
2189 case eTrackCut::kMuch: ss <<
"kMuch : \"cut on no of Much hits / track\"";
break;
2190 case eTrackCut::kRich: ss <<
"kRich : \"cut on no of Rich hits / track\"";
break;
2191 case eTrackCut::kTrd: ss <<
"kTrd : \"cut on no of TRD hits / track\"";
break;
2192 case eTrackCut::kTof: ss <<
"kTof : \"cut on no of Tof hits / track\"";
break;
ClassImp(CbmConverterManager)
@ kMvd
Micro-Vertex Detector.
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kPsd
Projectile spectator detector.
@ kSts
Silicon Tracking System.
@ kTrd2d
TRD-FASP Detector (FIXME)
@ kLastModule
For loops over all modules.
@ kMuch
Muon detection system.
@ kFsd
Forward spectator detector.
@ kRich
Ring-Imaging Cherenkov Detector.
Data class for a reconstructed hit in the STS.
Helper class to convert unique channel ID back and forth.
Class for hits in TRD detector.
friend fvec sqrt(const fvec &a)
friend fscal max(fscal x, fscal y)
static constexpr size_t size()
Generates beam ions for transport simulation.
Class characterising one event by a collection of links (indices) to data objects,...
size_t GetNofData() const
double GetStartTime() const
int32_t GetStsTrackIndex() const
int32_t GetTofTrackIndex() const
int32_t GetTrdTrackIndex() const
void SetSkipUnmeasuredCoordinates(bool skip=true)
skip unmeasured coordinates
bool CreateGlobalTrack(Trajectory &kfTrack, int globalTrackIndex)
void FixMomentumForMs(bool fix=true)
fix the inverse momentum for the Multiple Scattering calculation
void SetDefaultMomentumForMs(double p)
set the default inverse momentum for the Multiple Scattering calculation
bool FitTrajectory(CbmKfTrackFitter::Trajectory &t)
fit the track
Task class creating and managing CbmMCDataArray objects.
CbmMCDataArray * InitBranch(const char *name)
int32_t GetNofLinks() const
const CbmLink & GetMatchedLink() const
CbmMCDataManager * cbm_mc_manager
std::vector< TVector3 > fPrjPlanes
list of QA views
virtual bool FilterEvent(const CbmEvent *ptr)
Filter events for QA use (e.g. event multiplicity)
std::map< ECbmModuleId, TClonesArray * > fHitMatch
mc points
int GetNviews(eViewType type) const
count views types registered with the task
virtual EventFilter * AddEventFilter(EventFilter::eEventCut cut)
virtual Detector * GetDetector(ECbmModuleId did)
std::map< ECbmModuleId, CbmMCDataArray * > fPoints
reconstructed hits
TClonesArray * fEvents
MC info for the global tracks.
static std::bitset< kRecoQaNConfigs > fuRecoConfig
std::map< ECbmModuleId, Detector > fDetQa
virtual void Exec(Option_t *option)
Executed task.
std::map< ECbmModuleId, TClonesArray * > fHits
Time slice info.
std::vector< EventFilter > fFilterEv
reconstructed hits
std::vector< TrackFilter > fFilterTrk
@ kPVyz
x-z projection of the primary vertex:
@ kXYh
Time to EV residuals as function of coordinate in view.
@ kPVxy
Residual distribution T:
@ kResidualX
Pull distribution Y:
@ kDmult
X-Y hit coorelation in local view.
@ kXYt3
X-Y track projections on a random plane (value 2)
@ kXYt5
X-Y track projections on a random plane (value 4)
@ kXYhMC
local view MC point multiplicity
@ kYpY
X to TRK pulls as function of local X in view.
@ kXYt1
X-Y track projections on a random plane (value 0)
@ kYdYMC
Y to TRK residuals as function of local Y in view.
@ kResidualY
Residual distribution X: (x_RC - x_MC) in cm.
@ kPullX
X-Y MC point coorelation in local view (using HitMatch)
@ kResidualTX
Residual distribution Y:
@ kXYt0
y-z projection of the primary vertex:
@ kXYt2
X-Y track projections on a random plane (value 1)
@ kResidualTY
Residual distribution T:
@ kXdX
X-Y track projections on detection unit.
@ kPullY
Pull distribution X: (RC - MC) / dx_RC.
@ kXYp
X-Y hit coorelation in track filtered data.
@ kPVmult
y-z projection of the primary vertex:
@ kYdY
X to TRK residuals w.r.t MC points.
@ kXdXMC
X to TRK residuals as function of local X in view.
@ kWdT
Y to TRK residuals w.r.t MC points.
@ kPVxz
x-y projection of the primary vertex:
@ kXYt4
X-Y track projections on a random plane (value 3)
@ kDmultMC
local view hit multiplicity
@ kChdT
Y to TRK pulls as function of local Y in view.
virtual bool FilterTrack(const CbmGlobalTrack *ptr)
Filter tracks for further use (e.g. track projections)
@ kUseMC
has Much hits (MuchHit branch)
@ kRecoTracks
has events reconstructed (CbmEvent branch)
virtual InitStatus Init()
Perform initialization of data sources and projections.
std::map< ECbmModuleId, TClonesArray * > fTracks
reconstructed global tracks / event
TString GetGeoTagForDetector(const TString &detector)
std::vector< TString > GetPath(TGeoNode *node, TString, TString activeNodeName, int depth=0, const TString &path="")
@ kPV
set of track projection views
virtual const CbmTrack * GetTrack(ECbmModuleId did, int id) const
Retrieve detector specific track by index.
std::map< const char *, View > fViews
list of detector QA
TClonesArray * fTrackMatches
reconstructed global tracks / event
virtual TrackFilter * AddTrackFilter(TrackFilter::eTrackCut cut)
virtual Detector * AddDetector(ECbmModuleId did)
TDirectoryFile fOutFolder
void InitMcbm22()
build QA plots for particular setups
static uint16_t GetDirichId(int Address)
Bool_t IsActive(ECbmModuleId moduleId)
static CbmSetup * Instance()
data class for a reconstructed 3-d hit in the STS
Data class with information on a STS local track.
static int32_t GetSmId(uint32_t address)
static int32_t GetRpcId(uint32_t address)
static int32_t GetSmType(uint32_t address)
virtual int32_t GetNofHits() const
static uint32_t GetModuleId(uint32_t address)
Return module ID from address.
static uint32_t GetLayerId(uint32_t address)
Return layer ID from address.
static uint32_t GetModuleAddress(uint32_t address)
Return unique module ID from address.
data class for a reconstructed Energy-4D measurement in the TRD
void Position(TVector3 &pos) const
bool FindTrackByIndex(uint32_t iTrack) const
Accessors to the Global track array. Check if track with global index iTrack was actually used for ve...
double GetCovariance(int32_t i, int32_t j) const
int32_t GetNTracks() const
T X() const
Gets x position [cm].
T Y() const
Gets y position [cm].
T Time() const
Gets time [ns].
T GetCovariance(int i, int j) const
Get covariance matrix element.
uint32_t GetElementId(int32_t address, int32_t level)
Get the index of an element.
std::string_view ToString(T t)
cbm::algo::kf::TrackParamD fParamUp
fitted track parameters upstream the node
double fZ
Z coordinate of the node.
cbm::algo::kf::MeasurementXy< double > fMxy
== Hit information ( if present )
int fReference1
some reference can be set by the user
bool fIsXySet
== Flags etc
cbm::algo::kf::MeasurementTime< double > fMt
time measurement at fZ
A trajectory to be fitted.
std::vector< TrajectoryNode > fNodes
nodes on the trajectory
View * GetView(const char *n)
Detector(ECbmModuleId did=ECbmModuleId::kNotExist)
View * FindView(double x, double y, double z)
bool Init(TDirectoryFile *f, bool mc=false)
Check geometry and trigger Init() for all registered views. Build main directory outut for the curren...
View * AddView(const char *n, const char *p, std::vector< int > set)
void HelpMess() const
max no of hits/ev for the systems [STS TRD ToF]
std::string ToString() const
bool SetFilter(std::vector< float > cuts)
bool Accept(const CbmEvent *ptr, const CbmRecoQaTask *lnk)
bool Accept(const CbmGlobalTrack *ptr, const CbmRecoQaTask *lnk)
std::string ToString() const
bool SetFilter(std::vector< float > cuts)
bool AddProjection(eProjectionType prj, float range=-1, const char *unit="cm")
bool Init(const char *dname, bool mc=false)
Define all type of QA histo known to the class. In case of detector view type, convert geo address in...
std::string makeYrange(const int scale, float &range)
bool Load(const CbmHit *h, const FairMCPoint *point, const CbmEvent *ev)
void SetSetup(CbmRecoQaTask::eSetup setup)
uint Register(TDirectoryFile *f)
build directory structure for all projections of current view.
std::string makeTrange(const int scale, float &range)
helper functions to estimate the representation (y) axis
bool HasAddress(const CbmHit *h, double &x, double &y, double &dx, double &dy) const
Hit classification on system and view.
bool SetProjection(eProjectionType prj, float range, const char *unit)
std::string ToString() const