CbmRoot
Loading...
Searching...
No Matches
CbmL1.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Ivan Kisel, Sergey Gorbunov [committer], Valentina Akishina, Igor Kulakov, Maksym Zyzak, Sergei Zharko */
4
5/*
6 *====================================================================
7 *
8 * CBM Level 1 Reconstruction
9 *
10 * Authors: I.Kisel, S.Gorbunov
11 *
12 * e-mail : ikisel@kip.uni-heidelberg.de
13 *
14 *====================================================================
15 *
16 * L1 main program
17 *
18 *====================================================================
19 */
20
21#include "CbmL1.h"
22
23#include "CbmKfTarget.h"
24#include "CbmMCDataManager.h"
27#include "CbmSetup.h"
31#include "KfDefs.h"
32
33#include <boost/filesystem.hpp>
34// TODO: include of CbmSetup.h creates problems on Mac
35// #include "CbmSetup.h"
36#include "CaFramework.h"
37#include "CaHit.h"
38#include "CaToolsDebugger.h"
39#include "CaToolsField.h"
40#include "CbmEvent.h"
42#include "CbmMCDataObject.h"
43#include "CbmStsFindTracks.h"
44#include "CbmStsHit.h"
46#include "FairField.h"
47#include "FairRunAna.h"
48#include "KfRootUtils.h"
49#include "TGeoArb8.h"
50#include "TGeoBoolNode.h"
51#include "TGeoCompositeShape.h"
52#include "TGeoManager.h"
53#include "TGeoNode.h"
54#include "TMatrixD.h"
55#include "TNtuple.h"
56#include "TProfile2D.h"
57#include "TROOT.h"
58#include "TRandom3.h"
59#include "TSystem.h"
60#include "TVector3.h"
61#include "TVectorD.h"
62
63#include <TFile.h>
64
65#include <chrono>
66#include <fstream>
67#include <iomanip>
68#include <list>
69#include <sstream>
70
71using namespace cbm::algo; // TODO: remove this line
72
77
79
80static ca::Framework gAlgo _fvecalignment; // TODO: Change coupling logic between ca::Framework and CbmL1
81
82CbmL1* CbmL1::fpInstance = nullptr;
83
84
85// ---------------------------------------------------------------------------------------------------------------------
86//
87CbmL1::CbmL1() : CbmL1("L1") {}
88
89// ---------------------------------------------------------------------------------------------------------------------
90//
91CbmL1::CbmL1(const char* name, Int_t verbose, Int_t performance) : FairTask(name, verbose), fPerformance(performance)
92{
93 if (!fpInstance) fpInstance = this;
94
95 switch (fSTAPDataMode) {
96 case 1: LOG(info) << "CbmL1: input data will be written for a standalone usage"; break;
97 case 2: LOG(info) << "CbmL1: input data will be read from external files"; break;
98 default: LOG(info) << "CbmL1: tracking will be run without external data R/W"; break;
99 }
100
101 fpIODataManager = std::make_shared<ca::DataManager>();
102
103 this->DefineSTAPNames("");
104
106 LOG(fatal) << "CbmL1: CbmTrackingDetectorInterfaceInit instance was not found. Please, add it as a task to your "
107 "reco macro right before the KF and L1 tasks:\n"
108 << "\033[1;30mrun->AddTask(new CbmTrackingDetectorInterfaceInit());\033[0m";
109 }
110}
111
112// ---------------------------------------------------------------------------------------------------------------------
113//
115{
116 if (fpInstance == this) fpInstance = nullptr;
117}
118
119// ---------------------------------------------------------------------------------------------------------------------
120//
122{
123 if (ca::EDetectorID::END != detID) {
124 fvmDisabledStationIDs[detID].insert(iSt);
125 }
126}
127
128// ---------------------------------------------------------------------------------------------------------------------
129//
130InitStatus CbmL1::ReInit()
131{
132 SetParContainers();
133 return Init();
134}
135
136// ---------------------------------------------------------------------------------------------------------------------
137//
138InitStatus CbmL1::Init()
139try {
140 if (fVerbose > 1) {
141 char y[20] = " [0;33;44m"; // yellow
142 char Y[20] = " [1;33;44m"; // yellow bold
143 char W[20] = " [1;37;44m"; // white bold
144 char o[20] = " [0m\n"; // color off
145 Y[0] = y[0] = W[0] = o[0] = 0x1B; // escape character
146 std::stringstream ss;
147
148 ss << "\n\n";
149 ss << " " << W << " " << o;
150 ss << " " << W << " ===////====================================================== " << o;
151 ss << " " << W << " = = " << o;
152 ss << " " << W << " = " << Y << "L1 on-line finder" << W << " = " << o;
153 ss << " " << W << " = = " << o;
154 ss << " " << W << " = " << W << "Cellular Automaton 3.1 Vector" << y << " with " << W << "KF Quadro" << y
155 << " technology" << W << " = " << o;
156 ss << " " << W << " = = " << o;
157 ss << " " << W << " = " << y << "Designed for CBM collaboration" << W << " = " << o;
158 ss << " " << W << " = " << y << "All rights reserved" << W << " = " << o;
159 ss << " " << W << " = = " << o;
160 ss << " " << W << " ========================================================////= " << o;
161 ss << " " << W << " " << o;
162 ss << "\n\n";
163
164 LOG(info) << ss.str();
165 }
166
168
169 fHistoDir = gROOT->mkdir("L1");
170 fHistoDir->mkdir("Input");
171 fHistoDir->mkdir("Fit");
172
173 fTableDir = gROOT->mkdir("L1Tables");
174
175 // turn on reconstruction in sub-detectors
176
177 auto* pSetupBuilder{cbm::kf::TrackingSetupBuilder::Instance()};
178 bool bGeoMVD = pSetupBuilder->IsInGeometry(ca::EDetectorID::kMvd);
179 bool bGeoSTS = pSetupBuilder->IsInGeometry(ca::EDetectorID::kSts);
180 bool bGeoMUCH = pSetupBuilder->IsInGeometry(ca::EDetectorID::kMuch);
181 bool bGeoTRD = pSetupBuilder->IsInGeometry(ca::EDetectorID::kTrd);
182 bool bGeoTOF = pSetupBuilder->IsInGeometry(ca::EDetectorID::kTof);
183
184 bool bUseMVD = pSetupBuilder->HasHits(ca::EDetectorID::kMvd);
185 bool bUseSTS = pSetupBuilder->HasHits(ca::EDetectorID::kSts);
186 bool bUseMUCH = pSetupBuilder->HasHits(ca::EDetectorID::kMuch);
187 bool bUseTRD = pSetupBuilder->HasHits(ca::EDetectorID::kTrd);
188 bool bUseTOF = pSetupBuilder->HasHits(ca::EDetectorID::kTof);
189
190 LOG(info) << "!!!!!!! " << bUseSTS;
191
192 // *****************************
193 // ** **
194 // ** GEOMETRY INITIALIZATION **
195 // ** **
196 // *****************************
197
198 // Read parameters object from a binary file
199 if (2 == fSTAPDataMode) {
200 this->ReadSTAPParamObject();
201 }
202 // Parameters initialization, based on the FairRunAna chain
203 else {
204 // ********************************************
205 // ** Base configuration file initialization **
206 // ********************************************
207 {
208 // The parameters module of CA algorithm (L1Parameters) contains two sets of data fields: the geometry configura-
209 // tion and the parameter configuration. The configuration both for geometry and parameters can be set using
210 // either the accessor functions of the L1InitManager class, or reading the beforehand prepared L1Parameters
211 // object. On top of that, the parameters configuration (including cuts, algorithm execution scenario etc.) can
212 // be initialized from the YAML configuration files in two levels (base and user). The base level of the initia-
213 // lization is required for CbmL1 mode, the user level of the initialization is optional.
214
215 std::string mainConfig = std::string(gSystem->Getenv("VMCWORKDIR")) + "/macro/L1/configs/";
216 switch (fTrackingMode) {
217 case ca::TrackingMode::kSts: mainConfig += "ca_params_sts.yaml"; break;
218 case ca::TrackingMode::kMcbm: mainConfig += "ca_params_mcbm.yaml"; break;
219 case ca::TrackingMode::kGlobal: mainConfig += "ca_params_global.yaml"; break;
220 }
221 fInitManager.SetConfigMain(mainConfig);
222 }
223
225
226 auto mvdInterface = CbmMvdTrackingInterface::Instance();
227 auto stsInterface = CbmStsTrackingInterface::Instance();
228 auto muchInterface = CbmMuchTrackingInterface::Instance();
229 auto trdInterface = CbmTrdTrackingInterface::Instance();
230 auto tofInterface = CbmTofTrackingInterface::Instance();
231
232 int nMvdStationsGeom = (bGeoMVD) ? mvdInterface->GetNtrackingStations() : 0;
233 int nStsStationsGeom = (bGeoSTS) ? stsInterface->GetNtrackingStations() : 0;
234 int nMuchStationsGeom = (bGeoMUCH) ? muchInterface->GetNtrackingStations() : 0;
235 int nTrdStationsGeom = (bGeoTRD) ? trdInterface->GetNtrackingStations() : 0;
236 int nTofStationsGeom = (bGeoTOF) ? tofInterface->GetNtrackingStations() : 0;
237
238 // **************************
239 // ** Field initialization **
240 // **************************
241
242 if (FairRunAna::Instance()->GetField()) {
243 fInitManager.SetFieldFunction([](const double(&inPos)[3], double(&outB)[3]) {
244 FairRunAna::Instance()->GetField()->GetFieldValue(inPos, outB);
245 });
246 }
247 else {
248 fInitManager.SetFieldFunction([](const double(&)[3], double(&outB)[3]) {
249 outB[0] = 0.;
250 outB[1] = 0.;
251 outB[2] = 0.;
252 });
253 }
254
255 // ***************************
256 // ** Target initialization **
257 // ***************************
258
259 {
260 const auto& pTarget = cbm::kf::Target::Instance();
261 fTargetX = pTarget->GetX();
262 fTargetY = pTarget->GetY();
263 fTargetZ = pTarget->GetZ();
264 }
266
267 // *********************************
268 // ** Target field initialization **
269 // *********************************
270
271 // FIXME: SZh 22.08.2023:
272 // Is there anyway to calculate a step between field slices?
273 fInitManager.InitTargetField(/*zStep = */ 2.5 /*cm*/); // Replace zStep -> sizeZfieldRegion = 2 * zStep (TODO)
274
275
276 // **************************************
277 // ** **
278 // ** STATIONS GEOMETRY INITIALIZATION **
279 // ** **
280 // **************************************
281
282
283 // ***************************************************
284 // ** Active tracking detector subsystems selection **
285 // ***************************************************
286
287
288 // Explicitly disable MVD, if it is not required from the STSFindTracks task
289 if (bUseMVD) {
290 auto* pTrackFinderTask = dynamic_cast<CbmStsFindTracks*>(FairRunAna::Instance()->GetTask("STSFindTracks"));
291 if (pTrackFinderTask) {
292 bUseMVD = pTrackFinderTask->MvdUsage();
293 }
294 }
295
296
297 // *************************************
298 // ** Stations layout initialization **
299 // *************************************
300
301 std::vector<ca::StationInitializer> vStations;
302 vStations.reserve(100);
303 bool bDisableTime = false;
304
305 // *** MVD stations info ***
306 if (bGeoMVD) {
307 for (int iSt = 0; iSt < nMvdStationsGeom; ++iSt) {
308 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kMvd, iSt);
309 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
310 stationInfo.SetStationType(1); // MVD
311 stationInfo.SetTimeInfo(!bDisableTime && mvdInterface->IsTimeInfoProvided(iSt));
312 stationInfo.SetFieldStatus(fTrackingMode == ca::TrackingMode::kMcbm ? 0 : 1);
313 stationInfo.SetZref(mvdInterface->GetZref(iSt));
314 stationInfo.SetZmin(mvdInterface->GetZmin(iSt));
315 stationInfo.SetZmax(mvdInterface->GetZmax(iSt));
316 stationInfo.SetXmax(std::max(fabs(mvdInterface->GetXmax(iSt)), fabs(mvdInterface->GetXmin(iSt))));
317 stationInfo.SetYmax(std::max(fabs(mvdInterface->GetYmax(iSt)), fabs(mvdInterface->GetYmin(iSt))));
318 stationInfo.SetTrackingStatus(true);
319 if (fvmDisabledStationIDs[ca::EDetectorID::kMvd].find(iSt)
320 != fvmDisabledStationIDs[ca::EDetectorID::kMvd].cend()) {
321 stationInfo.SetTrackingStatus(false);
322 }
323 if (!bUseMVD) {
324 stationInfo.SetTrackingStatus(false);
325 }
326 fInitManager.AddStation(stationInfo);
327 LOG(info) << "- MVD station " << iSt << " at z = " << stationInfo.GetZref() << " cm ";
328 }
329 }
330
331 // *** STS stations info ***
332 if (bGeoSTS) {
333 for (int iSt = 0; iSt < nStsStationsGeom; ++iSt) {
334 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kSts, iSt);
335 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
336 stationInfo.SetStationType(0); // STS
337 stationInfo.SetTimeInfo(!bDisableTime && stsInterface->IsTimeInfoProvided(iSt));
338 stationInfo.SetFieldStatus(ca::TrackingMode::kMcbm == fTrackingMode ? 0 : 1);
339 stationInfo.SetZref(stsInterface->GetZref(iSt));
340 stationInfo.SetZmin(stsInterface->GetZmin(iSt));
341 stationInfo.SetZmax(stsInterface->GetZmax(iSt));
342 stationInfo.SetXmax(std::max(fabs(stsInterface->GetXmax(iSt)), fabs(stsInterface->GetXmin(iSt))));
343 stationInfo.SetYmax(std::max(fabs(stsInterface->GetYmax(iSt)), fabs(stsInterface->GetYmin(iSt))));
344
345 stationInfo.SetTrackingStatus(true);
346 if (fvmDisabledStationIDs[ca::EDetectorID::kSts].find(iSt)
347 != fvmDisabledStationIDs[ca::EDetectorID::kSts].cend()) {
348 stationInfo.SetTrackingStatus(false);
349 }
350 if (!bUseSTS) {
351 stationInfo.SetTrackingStatus(false);
352 }
353 fInitManager.AddStation(stationInfo);
354 LOG(info) << "- STS station " << iSt << " at z = " << stationInfo.GetZref() << " cm ";
355 }
356 }
357
358 // *** MuCh stations info ***
359 if (bGeoMUCH) {
360 for (int iSt = 0; iSt < nMuchStationsGeom; ++iSt) {
361 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kMuch, iSt);
362 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
363 stationInfo.SetStationType(2); // MuCh
364 stationInfo.SetTimeInfo(!bDisableTime && muchInterface->IsTimeInfoProvided(iSt));
365 stationInfo.SetFieldStatus(0);
366 stationInfo.SetZref(muchInterface->GetZref(iSt));
367 stationInfo.SetZmin(muchInterface->GetZmin(iSt));
368 stationInfo.SetZmax(muchInterface->GetZmax(iSt));
369 stationInfo.SetXmax(std::max(fabs(muchInterface->GetXmax(iSt)), fabs(muchInterface->GetXmin(iSt))));
370 stationInfo.SetYmax(std::max(fabs(muchInterface->GetYmax(iSt)), fabs(muchInterface->GetYmin(iSt))));
371
372 stationInfo.SetTrackingStatus(true);
373 if (fvmDisabledStationIDs[ca::EDetectorID::kMuch].find(iSt)
374 != fvmDisabledStationIDs[ca::EDetectorID::kMuch].cend()) {
375 stationInfo.SetTrackingStatus(false);
376 }
377 if (!bUseMUCH) {
378 stationInfo.SetTrackingStatus(false);
379 }
380 fInitManager.AddStation(stationInfo);
381 LOG(info) << "- MuCh station " << iSt << " at z = " << stationInfo.GetZref() << " cm";
382 }
383 }
384
385 // *** TRD stations info ***
386 if (bGeoTRD) {
387 for (int iSt = 0; iSt < nTrdStationsGeom; ++iSt) {
388 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kTrd, iSt);
389 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
390 stationInfo.SetStationType(3);
391 stationInfo.SetTimeInfo(!bDisableTime && trdInterface->IsTimeInfoProvided(iSt));
392 stationInfo.SetFieldStatus(0);
393 stationInfo.SetZref(trdInterface->GetZref(iSt));
394 stationInfo.SetZmin(trdInterface->GetZmin(iSt));
395 stationInfo.SetZmax(trdInterface->GetZmax(iSt));
396 stationInfo.SetXmax(std::max(fabs(trdInterface->GetXmax(iSt)), fabs(trdInterface->GetXmin(iSt))));
397 stationInfo.SetYmax(std::max(fabs(trdInterface->GetYmax(iSt)), fabs(trdInterface->GetYmin(iSt))));
398
399 if (ca::TrackingMode::kGlobal == fTrackingMode) {
400 stationInfo.SetTimeInfo(false);
401 }
402 stationInfo.SetTrackingStatus(true);
403 if (fvmDisabledStationIDs[ca::EDetectorID::kTrd].find(iSt)
404 != fvmDisabledStationIDs[ca::EDetectorID::kTrd].cend()) {
405 stationInfo.SetTrackingStatus(false);
406 }
407 if (!bUseTRD) {
408 stationInfo.SetTrackingStatus(false);
409 }
410 fInitManager.AddStation(stationInfo);
411 LOG(info) << "- TRD station " << iSt << " at z = " << stationInfo.GetZref() << " cm";
412 }
413 }
414
415 // *** TOF stations info ***
416 if (bGeoTOF) {
417 for (int iSt = 0; iSt < nTofStationsGeom; ++iSt) {
418 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kTof, iSt);
419 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
420 stationInfo.SetStationType(4);
421 stationInfo.SetTimeInfo(!bDisableTime && tofInterface->IsTimeInfoProvided(iSt));
422 stationInfo.SetFieldStatus(0);
423 stationInfo.SetZref(tofInterface->GetZref(iSt));
424 stationInfo.SetZmin(tofInterface->GetZmin(iSt));
425 stationInfo.SetZmax(tofInterface->GetZmax(iSt));
426 stationInfo.SetXmax(std::max(fabs(tofInterface->GetXmax(iSt)), fabs(tofInterface->GetXmin(iSt))));
427 stationInfo.SetYmax(std::max(fabs(tofInterface->GetYmax(iSt)), fabs(tofInterface->GetYmin(iSt))));
428
429 stationInfo.SetTrackingStatus(true);
430 if (fvmDisabledStationIDs[ca::EDetectorID::kTof].find(iSt)
431 != fvmDisabledStationIDs[ca::EDetectorID::kTof].cend()) {
432 stationInfo.SetTrackingStatus(false);
433 }
434 if (!bUseTOF) {
435 stationInfo.SetTrackingStatus(false);
436 }
437 fInitManager.AddStation(stationInfo);
438 LOG(info) << "- TOF station " << iSt << " at z = " << stationInfo.GetZref() << " cm";
439 }
440 }
441
442 // Init station layout: sort stations in z-position and init maps of station local, geo and active indices
445
446 // *************************
447 // ** Initialize KF-setup **
448 // *************************
449 {
450 auto trackerSetup = pSetupBuilder->MakeSetup<float>(cbm::algo::kf::EFieldMode::Intrpl);
451 TString geoTag = "";
452 if (auto* pSetup = CbmSetup::Instance()) {
453 geoTag = pSetup->GetProvider()->GetSetup().GetTag();
454 }
455 if (geoTag.IsNull()) {
456 geoTag = fSTAPDataPrefix;
457 }
458 TString outputFile = fSTAPDataDir + "/" + geoTag + "." + TString(kSTAPSetupSuffix.data());
459 cbm::algo::kf::SetupBuilder::Store(trackerSetup, outputFile.Data());
460 fInitManager.SetGeometrySetup(trackerSetup);
461 }
462
463 // *******************************
464 // ** Initialize search windows **
465 // *******************************
466
467 if (fsInputSearchWindowsFilename.size()) {
470 }
471 else {
473 }
474
475 // Form parameters container
477 return kFATAL;
478 }
479
480 bUseMVD = fInitManager.IsActive(ca::EDetectorID::kMvd);
481 bUseSTS = fInitManager.IsActive(ca::EDetectorID::kSts);
482 bUseMUCH = fInitManager.IsActive(ca::EDetectorID::kMuch);
483 bUseTRD = fInitManager.IsActive(ca::EDetectorID::kTrd);
484 bUseTOF = fInitManager.IsActive(ca::EDetectorID::kTof);
485
486 // Write parameters object to file if needed
487 if (1 == fSTAPDataMode || 4 == fSTAPDataMode) {
488 this->WriteSTAPParamObject();
489 }
490 }
491
493 auto parameters = fInitManager.TakeParameters();
494 LOG(info) << '\n' << parameters.ToString(1);
495 return kSUCCESS;
496 }
497
498 // Init L1 algo core
499
500 // FIXME: SZh 22.08.2023:
501 // Re-organize the the relation between CbmL1 and ca::Framework. I believe, we don't need a global pointer to the ca::Framework
502 // instance.
503 fpAlgo = &gAlgo;
504
505 //
506 // ** Send formed parameters object to ca::Framework instance **
507 //
508 std::shared_ptr<ca::Parameters<float>> pParameters{nullptr};
509 {
510 auto parameters = fInitManager.TakeParameters();
511 pParameters = std::make_shared<ca::Parameters<float>>(parameters);
512 fpAlgo->ReceiveParameters(std::move(parameters));
513 }
515
516
517 // Initialize time-slice reader
518 fpTSReader = std::make_unique<TimeSliceReader>();
519 fpTSReader->SetDetector(ca::EDetectorID::kMvd, bUseMVD);
520 fpTSReader->SetDetector(ca::EDetectorID::kSts, bUseSTS);
521 fpTSReader->SetDetector(ca::EDetectorID::kMuch, bUseMUCH);
522 fpTSReader->SetDetector(ca::EDetectorID::kTrd, bUseTRD);
523 fpTSReader->SetDetector(ca::EDetectorID::kTof, bUseTOF);
524
525 fpTSReader->RegisterParameters(pParameters);
526 fpTSReader->RegisterHitIndexContainer(fvExternalHits);
527 fpTSReader->RegisterIODataManager(fpIODataManager);
528 fpTSReader->RegisterQaHitContainer(fvHitDebugInfo);
529 if (!fpTSReader->InitRun()) {
530 return kFATAL;
531 }
532
533 if (fPerformance) {
534 fpMCModule = std::make_unique<MCModule>(fVerbose, fPerformance);
535 fpMCModule->SetDetector(ca::EDetectorID::kMvd, bUseMVD);
536 fpMCModule->SetDetector(ca::EDetectorID::kSts, bUseSTS);
537 fpMCModule->SetDetector(ca::EDetectorID::kMuch, bUseMUCH);
538 fpMCModule->SetDetector(ca::EDetectorID::kTrd, bUseTRD);
539 fpMCModule->SetDetector(ca::EDetectorID::kTof, bUseTOF);
540
541 fpMCModule->RegisterMCData(fMCData);
542 fpMCModule->RegisterRecoTrackContainer(fvRecoTracks);
543 fpMCModule->RegisterHitIndexContainer(fvExternalHits);
544 fpMCModule->RegisterParameters(pParameters);
545 fpMCModule->RegisterQaHitContainer(fvHitDebugInfo);
546 fpMCModule->RegisterFirstHitIndexes(fpTSReader->GetHitFirstIndexDet());
547 if (!fpMCModule->InitRun()) {
548 return kFATAL;
549 }
550 }
551
552 LOG(info) << pParameters->ToString(1);
553 LOG(info) << "----- Numbers of stations active in tracking -----";
554 LOG(info) << " MVD: " << pParameters->GetNstationsActive(ca::EDetectorID::kMvd);
555 LOG(info) << " STS: " << pParameters->GetNstationsActive(ca::EDetectorID::kSts);
556 LOG(info) << " MuCh: " << pParameters->GetNstationsActive(ca::EDetectorID::kMuch);
557 LOG(info) << " TRD: " << pParameters->GetNstationsActive(ca::EDetectorID::kTrd);
558 LOG(info) << " TOF: " << pParameters->GetNstationsActive(ca::EDetectorID::kTof);
559 LOG(info) << " Total: " << pParameters->GetNstationsActive();
560
561 fNStations = pParameters->GetNstationsActive();
562
563 // TODO: Probably move from CbmL1 to a more proper place (e.g. kf::Setup)
564 {
565 //std::stringstream msg;
566 //msg << " ----- Material budget map monitoring: active setup -----\n";
567 const auto& activeSetup = pParameters->GetActiveSetup();
568 for (int iSt = 0; iSt < activeSetup.GetNofLayers(); ++iSt) {
569 fMaterialMonitor.emplace_back(&(activeSetup.GetMaterial(iSt)), Form("Station %d", iSt));
570 //msg << monitor.ToString() << '\n';
571 }
572 //msg << " --------------------------------------------------------";
573 //LOG(info) << '\n' << msg.str();
574 }
575
576 DumpMaterialToFile("L1material.root");
577
578 // Initialize monitor
579 fMonitor.Reset();
580
581 return kSUCCESS;
582}
583catch (const std::exception& err) {
584 LOG(error) << "CbmL1: initialization failed. Reason: " << err.what();
585 return kFATAL;
586}
587
588// ---------------------------------------------------------------------------------------------------------------------
589//
591{
592 ca::TrackingMonitorData monitorData;
593
594 fpTSReader->ReadEvent(event);
595 if (fPerformance) {
596 fpMCModule->InitEvent(event); // reads points and MC tracks
597 fpMCModule->MatchHits(); // matches points with hits
598 }
599 fpAlgo->ReceiveInputData(fpIODataManager->TakeInputData());
600
601 // Material monitoring: mark active areas
602 {
603 for (const auto& hit : fpAlgo->GetInputData().GetHits()) {
604 fMaterialMonitor[hit.Station()].MarkActiveBin(hit.X(), hit.Y());
605 }
606 }
607 //LOG(info) << "CHECK: hit ids = " << fvExternalHits.size() << ", hits = " << fpIODataManager->GetNofHits()
608 //<< ", dbg hits = " << fvHitDebugInfo.size();
609
610 fpAlgo->SetMonitorData(monitorData);
611
612 if (nullptr != event) {
613 LOG_IF(debug, fVerbose > 0) << "\n======= Ca Track finder: process event " << event->GetNumber() << " ...";
614 }
615 else {
616 LOG_IF(debug, fVerbose > 0) << "\n======= Ca Track finder: process timeslice ...";
617 }
618
620 // IdealTrackFinder();
621 fTrackingTime = fpAlgo->fCaRecoTime; // TODO: remove (not used)
622
623 LOG_IF(debug, fVerbose > 0) << "Ca Track Finder finished, found " << fpAlgo->fRecoTracks.size() << " tracks";
624
625 // Update monitor data after the actual tracking
626 monitorData = fpAlgo->GetMonitorData();
627
628 // save reconstructed tracks
629
630 fvRecoTracks.clear();
632
633 int trackFirstHit = 0;
634
635 // FIXME: Rewrite
636 for (const auto& caTrk : fpAlgo->fRecoTracks) {
637 CbmL1Track t;
638 t.Set(caTrk.fParFirst);
639 t.TLast.Set(caTrk.fParLast);
640 t.Tpv.Set(caTrk.fParPV);
641 t.Hits.clear();
642
643 for (int i = 0; i < caTrk.fNofHits; i++) {
644 int caHitId = fpAlgo->fRecoHits[trackFirstHit + i];
645 int cbmHitID = fpAlgo->GetInputData().GetHit(caHitId).Id();
646 t.Hits.push_back(cbmHitID);
647 }
649 trackFirstHit += caTrk.fNofHits;
650 //fMonitor.IncrementCounter(EMonitorKey::kRecoHit, it->fNofHits);
651 }
652
653 //fMonitor.IncrementCounter(EMonitorKey::kRecoTrack, fvRecoTracks.size());
654 LOG(debug) << "CA Track Finder: " << fpAlgo->fCaRecoTime << " s/sub-ts";
655
656 // output performance
657 if (fPerformance) {
658 LOG_IF(info, fVerbose) << "Performance...";
659
660 fpMCModule->MatchTracks(); // matches reco and MC tracks, fills the MC-truth fields of reco tracks
661
662 //
663 // tracker input performance is moved to external QA tasks.
664 // InputPerformance() method is not optimised to run with the event builder
665 // TODO: verify QA tasks and remove InputPerformance()
666 // InputPerformance();
667 //
668
669
673 if (fsMcTripletsOutputFilename.size()) {
675 }
676 // TimeHist();
678 LOG_IF(info, fVerbose > 1) << "Tracking performance... done";
679 }
680 LOG_IF(debug, fVerbose > 1) << "End of CA";
681
682 ++fEventNo;
683 fMonitor.AddMonitorData(monitorData);
684}
685
686// ----- Finish CbmStsFitPerformanceTask task -----------------------------
688{
689 if (fPerformance) {
690 // FieldApproxCheck();
691 // FieldIntegralCheck();
693 }
694
695 {
696 // monitor the material
697 std::stringstream msg;
698 msg << '\n';
699 msg << "\033[31;1m ***************************\033[0m\n";
700 msg << "\033[31;1m ** CA Tracking monitor **\033[0m\n";
701 msg << "\033[31;1m ***************************\033[0m\n";
702
703 // TODO: Probably move from CbmL1 to a more proper place (e.g. kf::Setup)
704 {
705 msg << '\n';
706 msg << " ----- Material budget map monitoring: active setup -----\n";
707 for (auto& monitor : fMaterialMonitor) {
708 msg << monitor.ToString() << '\n';
709 }
710 msg << " --------------------------------------------------------\n";
711 }
712
713 // monitor of the reconstructed tracks
714 msg << '\n' << fMonitor.ToString();
715 LOG(info) << msg.str();
716 }
717
718 TDirectory* curr = gDirectory;
719 TFile* currentFile = gFile;
720
721
722 // Open output file and write histograms
723 boost::filesystem::path p = (FairRunAna::Instance()->GetUserOutputFileName()).Data();
724 std::string dir = p.parent_path().string();
725 if (dir.empty()) dir = ".";
726 {
727 std::string histoOutName = dir + "/L1_histo_" + p.filename().string();
728 LOG(info) << "\033[31;1mL1 performance histograms will be saved to: \033[0m" << histoOutName;
729 TFile* outfile = new TFile(histoOutName.c_str(), "RECREATE");
730 outfile->cd();
732 outfile->Close();
733 outfile->Delete();
734 }
735 {
736 std::string tablesOutName = dir + "/L1_perftable_" + p.filename().string();
737 LOG(info) << "\033[31;1mL1 performance tables will be saved to: \033[0m" << tablesOutName;
738 TFile* outfile = new TFile(tablesOutName.c_str(), "RECREATE");
739 outfile->cd();
741 outfile->Close();
742 outfile->Delete();
743 }
744
747 fpMcTripletsTree->Write();
748 fpMcTripletsOutFile->Close();
749 fpMcTripletsOutFile->Delete();
750 }
751
752 gFile = currentFile;
753 gDirectory = curr;
754 fpAlgo->Finish();
756}
757
758
759// ---------------------------------------------------------------------------------------------------------------------
760//
761void CbmL1::writedir2current(TObject* obj)
762{
763 if (!obj->IsFolder())
764 obj->Write();
765 else {
766 TDirectory* cur = gDirectory;
767 TDirectory* sub = cur->mkdir(obj->GetName());
768 sub->cd();
769 TList* listSub = (dynamic_cast<TDirectory*>(obj))->GetList();
770 TIter it(listSub);
771 while (TObject* obj1 = it())
772 writedir2current(obj1);
773 cur->cd();
774 }
775}
776
777// ---------------------------------------------------------------------------------------------------------------------
778//
780{
781 fpAlgo->fRecoTracks.clear();
782 fpAlgo->fRecoHits.clear();
783
784 for (auto& MC : fMCData.GetTrackContainer()) {
785 if (!MC.IsReconstructable()) continue;
786 if (!(MC.GetId() >= 0)) continue;
787
788 if (MC.GetNofHits() < 4) continue;
789
790 CaTrack algoTr;
791 algoTr.fNofHits = 0;
792
793 ca::Vector<int> hitIndices("CbmL1::hitIndices", fpAlgo->GetParameters().GetNstationsActive(), -1);
794
795 for (unsigned int iH : MC.GetHitIndexes()) {
796 const CbmL1HitDebugInfo& hit = fvHitDebugInfo[iH];
797 const int iStation = hit.GetStationId();
798 if (iStation >= 0) hitIndices[iStation] = iH;
799 }
800
801
802 for (int iH = 0; iH < fpAlgo->GetParameters().GetNstationsActive(); iH++) {
803 const int hitI = hitIndices[iH];
804 if (hitI < 0) continue;
805
806 // fpAlgo->fRecoHits.push_back(hitI);
807 algoTr.fNofHits++;
808 }
809
810
811 if (algoTr.fNofHits < 3) continue;
812
813 for (int iH = 0; iH < fpAlgo->GetParameters().GetNstationsActive(); iH++) {
814 const int hitI = hitIndices[iH];
815 if (hitI < 0) continue;
817 }
818
819 algoTr.fParFirst.X() = MC.GetStartX();
820 algoTr.fParFirst.Y() = MC.GetStartY();
821 algoTr.fParFirst.Z() = MC.GetStartZ();
822 algoTr.fParFirst.Tx() = MC.GetTx();
823 algoTr.fParFirst.Ty() = MC.GetTy();
824 algoTr.fParFirst.Qp() = MC.GetCharge() / MC.GetP();
825 algoTr.fParFirst.Time() = MC.GetStartT();
826 fpAlgo->fRecoTracks.push_back(algoTr);
827 }
828} // void CbmL1::IdealTrackFinder()
829
830
832
833// ---------------------------------------------------------------------------------------------------------------------
834//
835void CbmL1::DefineSTAPNames(const char* dirName)
836{
837 // FIXME: SZh 01.03.2023: Clean STAP names
838 namespace bfs = boost::filesystem;
839
840 if (fSTAPDataMode == 0) {
841 return;
842 }
843
844 // Define file prefix (/path/to/data/setup.reco.root -> "setup.reco")
845 bfs::path pathToRecoOutput = FairRunAna::Instance()->GetUserOutputFileName().Data();
846 fSTAPDataPrefix = pathToRecoOutput.filename().string();
847 fSTAPDataPrefix.ReplaceAll(".root", "");
848 fSTAPDataPrefix = fSTAPDataPrefix.Strip(TString::EStripType::kBoth, '.');
849
850 TString sDirName = TString(dirName);
851 if (sDirName.Length() == 0) {
852 fSTAPDataDir = pathToRecoOutput.parent_path().string();
853 }
854 else if (bfs::exists(sDirName.Data()) && bfs::is_directory(sDirName.Data())) {
855 fSTAPDataDir = sDirName;
856 }
857 else {
858 fSTAPDataDir = ".";
859 }
860
861 // TODO: Clean-up the names and pathes
862 if (fSTAPDataDir.Length() == 0) {
863 fSTAPDataDir = ".";
864 }
865
866 LOG(info) << "CbmL1: STAP data root directory is \033[1;32m" << bfs::system_complete(fSTAPDataDir.Data())
867 << "\033[0m";
868
869 if (fSTAPDataMode == 4) {
870 return;
871 }
872
873 // Directory for handling L1InputData objects
874 TString sInputDataDir = fSTAPDataDir + "/" + fSTAPDataPrefix + "_cainputdata";
875 if (!bfs::exists(sInputDataDir.Data())) {
876 LOG(warn) << "CbmL1: directory for tracking input data does not exist. It will be created";
877 bfs::create_directories(sInputDataDir.Data());
878 }
879 LOG(info) << "CbmL1: STAP tracking input jobs directory is \033[1;32m" << bfs::system_complete(sInputDataDir.Data())
880 << "\033[0m";
881}
882
883// ---------------------------------------------------------------------------------------------------------------------
884//
886{
887 TString filename = fSTAPParamFile.IsNull()
888 ? fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPParamSuffix.data())
890 fInitManager.WriteParametersObject(filename.Data());
891}
892
893// ---------------------------------------------------------------------------------------------------------------------
894//
895void CbmL1::WriteSTAPAlgoInputData(int iJob) // must be called after ReadEvent
896{
897 TString filename =
898 fSTAPDataDir + "/" + fSTAPDataPrefix + "_cainputdata/" + +TString::Format(kSTAPAlgoIDataSuffix.data(), iJob);
899
900 // Write file
901 fpIODataManager->WriteInputData(filename.Data());
902}
903
904// ---------------------------------------------------------------------------------------------------------------------
905//
906void CbmL1::WriteSTAPPerfInputData() // must be called after ReadEvent
907{
908 LOG(fatal) << "CbmL1: Running in standalone mode is not available at the moment. It will be updated soon...";
909}
910
911// ---------------------------------------------------------------------------------------------------------------------
912//
914{
915 TString filename = fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPParamSuffix.data());
916 fInitManager.ReadParametersObject(filename.Data());
917}
918
919// ---------------------------------------------------------------------------------------------------------------------
920//
922{
923 TString filename = fSTAPDataDir + "/" + TString(kSTAPAlgoIDataDir) + "/" + fSTAPDataPrefix + "."
924 + TString::Format(kSTAPAlgoIDataSuffix.data(), iJob);
925
926 // Read file
927 fpIODataManager->ReadInputData(filename.Data());
928}
929
930// ---------------------------------------------------------------------------------------------------------------------
931//
933{
934 LOG(fatal) << "CbmL1: Running in standalone mode is not available at the moment. It will be updated soon...";
935}
936
937// ---------------------------------------------------------------------------------------------------------------------
938//
939void CbmL1::DumpMaterialToFile(TString fileName)
940{
941 auto* currentFile = gFile;
942 TFile f = TFile{fileName, "RECREATE"};
943 f.cd();
944 // TODO: (!) replace CbmL1::Instance()->fpAlgo->GetParameters() with the cbm::ca::ParametersHandler::Instance()->Get()
945 // everywhere outside cbm::algo
946 const auto& activeTrackingSetup = CbmL1::Instance()->fpAlgo->GetParameters().GetActiveSetup();
947 for (int iSt = 0; iSt < activeTrackingSetup.GetNofLayers(); ++iSt) {
948 const auto& material = activeTrackingSetup.GetMaterial(iSt);
949 TString name = Form("tracking_station%d", iSt);
950 TString title = Form("Tracking station %d: Rad. thickness in %%. Z region [%.2f, %.2f] cm.", iSt,
951 material.GetZmin(), material.GetZmax());
953 title += " Horizontal projection.";
954 }
955 else {
956 title += " Radial projection.";
957 }
958 auto* h = ::kf::tools::RootUtils::ToHistogram(material, name, title);
959 h->SetStats(kFALSE);
960 h->SetDirectory(&f);
961 }
962 f.Write();
963 currentFile->cd();
964}
A generic hit for the CA tracker (header)
Tracking Debugger class (implementation)
Tracking Field class (header)
Target property initialization and access in CBM (source)
ClassImp(CbmL1)
Data class for a reconstructed hit in the STS.
Common constant definitions for the Kalman Filter library.
Different ROOT utility functions for the KF-framework (header)
int Int_t
Generates beam ions for transport simulation.
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
int GetStationId() const
Gets global index of active tracking station.
Definition CbmL1Hit.h:73
cbm::algo::kf::TrackParamD TLast
Track parameters in the end of the track.
Definition CbmL1Track.h:102
std::vector< int > Hits
Indexes of hits of this track.
Definition CbmL1Track.h:104
cbm::algo::kf::TrackParamD Tpv
Track parameters at primary vertex.
Definition CbmL1Track.h:101
Definition CbmL1.h:109
@ Param
Parameter initialization (when algorithm execution is not required)
std::shared_ptr< ca::DataManager > fpIODataManager
Input-output data manager.
Definition CbmL1.h:420
bool fMatBudgetParallelProjection
Definition CbmL1.h:519
int fNStations
number of total active detector stations
Definition CbmL1.h:441
static CbmL1 * Instance()
Pointer to CbmL1 instance.
Definition CbmL1.h:171
TDirectory * fHistoDir
Definition CbmL1.h:500
void Reconstruct(CbmEvent *event=nullptr)
Definition CbmL1.cxx:590
double fTrackingTime
time of track finding procedure
Definition CbmL1.h:444
std::vector< cbm::algo::kf::MaterialMonitor > fMaterialMonitor
Material monitors for each material budget map.
Definition CbmL1.h:524
void EfficienciesPerformance(bool doFinish=kFALSE)
Calculates tracking efficiencies (counters)
double fTargetX
target position X
Definition CbmL1.h:437
TTree * fpMcTripletsTree
Tree to save MC-triplets.
Definition CbmL1.h:510
std::string fsMcTripletsOutputFilename
Name of file to save MC-triplets tree.
Definition CbmL1.h:511
void DumpMaterialToFile(TString fileName)
Definition CbmL1.cxx:939
cbm::ca::tools::MCData fMCData
MC Data object.
Definition CbmL1.h:417
void WriteSTAPParamObject()
Writes initialized L1Parameters object to file "".
Definition CbmL1.cxx:885
void ReadSTAPPerfInputData()
Definition CbmL1.cxx:932
static CbmL1 * fpInstance
Instance of CbmL1.
Definition CbmL1.h:432
virtual InitStatus Init()
Defines action in the beginning of the run (initialization)
Definition CbmL1.cxx:138
cbm::ca::DetIdArr_t< std::set< int > > fvmDisabledStationIDs
Definition CbmL1.h:493
CbmL1()
Default constructor.
Definition CbmL1.cxx:87
void WriteSTAPAlgoInputData(int iJob=0)
Definition CbmL1.cxx:895
void DisableTrackingStation(ca::EDetectorID detID, int iSt)
Disables tracking station for a given detector subsystem.
Definition CbmL1.cxx:121
std::unique_ptr< cbm::ca::MCModule > fpMCModule
MC module.
Definition CbmL1.h:416
void ReadSTAPAlgoInputData(int iJob=0)
Definition CbmL1.cxx:921
int fSTAPDataMode
Option to work with files for the standalone mode.
Definition CbmL1.h:453
ca::Vector< CbmL1HitId > fvExternalHits
Array of hits.
Definition CbmL1.h:484
ca::InitManager fInitManager
Tracking parameters data manager.
Definition CbmL1.h:419
double fTargetZ
target position Z
Definition CbmL1.h:439
Int_t fPerformance
performance mode: 0 - w\o perf. 1 - L1-Efficiency definition. 2 - QA-Eff.definition
Definition CbmL1.h:443
int fEventNo
Current number of event/TS.
Definition CbmL1.h:478
ca::Framework * fpAlgo
Pointer to the L1 track finder algorithm.
Definition CbmL1.h:425
std::string fsInputSearchWindowsFilename
File name to read search windows.
Definition CbmL1.h:413
TDirectory * fTableDir
Definition CbmL1.h:501
ca::TrackingMonitor fMonitor
Tracking monitor.
Definition CbmL1.h:263
void WriteSTAPPerfInputData()
Definition CbmL1.cxx:906
static constexpr std::string_view kSTAPParamSuffix
Extension for IO of the L1Parameters object.
Definition CbmL1.h:460
EInitMode fInitMode
Initialization mode.
Definition CbmL1.h:517
ca::Vector< CbmL1Track > fvRecoTracks
Reconstructed tracks container.
Definition CbmL1.h:429
static constexpr std::string_view kSTAPAlgoIDataDir
Name of subdirectory for handling ca::InputData objects.
Definition CbmL1.h:472
void IdealTrackFinder()
Runs ideal track finder: copies all MC-tracks into reconstructed tracks.
Definition CbmL1.cxx:779
void TrackFitPerformance()
double fTargetY
target position Y
Definition CbmL1.h:438
TString fSTAPParamFile
Name of the parameter file (generated automatically, if not provided manually)
Definition CbmL1.h:457
void Finish()
Defines action in the end of the run (saves results)
Definition CbmL1.cxx:687
TString fSTAPDataPrefix
Name of input/output file prefix. The prefix is defined by output TTree file.
Definition CbmL1.h:456
ca::Vector< CbmL1HitDebugInfo > fvHitDebugInfo
Container of hits with extended information.
Definition CbmL1.h:487
ca::TrackingMode fTrackingMode
Tracking mode.
Definition CbmL1.h:427
void DumpMCTripletsToTree()
std::unique_ptr< cbm::ca::TimeSliceReader > fpTSReader
event/TS reader
Definition CbmL1.h:415
void DefineSTAPNames(const char *dirName)
Defines names for output in STAP mode.
Definition CbmL1.cxx:835
~CbmL1()
Destructor.
Definition CbmL1.cxx:114
static constexpr std::string_view kSTAPSetupSuffix
Definition CbmL1.h:461
void HistoPerformance()
Fills performance histograms.
void ReadSTAPParamObject()
Definition CbmL1.cxx:913
TString fSTAPDataDir
Name of input/output directory for running in a STAP mode.
Definition CbmL1.h:455
static void writedir2current(TObject *obj)
Definition CbmL1.cxx:761
static constexpr std::string_view kSTAPAlgoIDataSuffix
Definition CbmL1.h:469
virtual InitStatus ReInit()
Reruns the initialization.
Definition CbmL1.cxx:130
TFile * fpMcTripletsOutFile
File to save MC-triplets tree.
Definition CbmL1.h:509
static CbmMuchTrackingInterface * Instance()
Gets pointer to the instance of the CbmMuchTrackingInterface.
static CbmMvdTrackingInterface * Instance()
Gets pointer to the instance of the CbmMvdTrackingInterface.
static CbmSetup * Instance()
Definition CbmSetup.cxx:160
static CbmStsTrackingInterface * Instance()
Gets pointer to the instance of the CbmStsTrackingInterface class.
static CbmTofTrackingInterface * Instance()
Gets pointer to the instance of the CbmTofTrackingInterface.
static CbmTrackingDetectorInterfaceInit * Instance()
Returns a pointer to the class instance.
static CbmTrdTrackingInterface * Instance()
Gets pointer to the instance of the CbmTrdTrackingInterface.
const TrackingMonitorData & GetMonitorData() const
Gets monitor data.
const InputData & GetInputData() const
Gets pointer to input data object for external access.
Definition CaFramework.h:96
Vector< Track > fRecoTracks
reconstructed tracks
void ReceiveParameters(Parameters< fvec > &&parameters)
Receives tracking parameters.
Vector< ca::HitIndex_t > fRecoHits
packed hits of reconstructed tracks
void ReceiveInputData(InputData &&inputData)
Receives input data.
void SetMonitorData(const TrackingMonitorData &monitorData)
Sets monitor data.
void Init(const TrackingMode mode)
const Parameters< fvec > & GetParameters() const
Gets a pointer to the Framework parameters object.
Definition CaFramework.h:87
HitIndex_t Id() const
Get the hit id.
Definition CaHit.h:135
void SetTargetPosition(double x, double y, double z)
Sets target position.
void SetFieldFunction(const FieldFunction_t &fieldFcn)
Sets a magnetic field function, which will be applied for all the stations.
void ReadSearchWindows(const std::string &fileName)
Reads search windows from file.
void InitTargetField(double zStep)
Calculates kf::FieldValue and L1FieldReference values for a selected step in z-axis from the target p...
void SetConfigMain(const std::string &mainConfig)
Sets base configuration file.
void InitStationLayout()
Initializes station layout.
Parameters< fvec > && TakeParameters()
Takes parameters object from the init-manager instance.
void SetGeometrySetup(const cbm::algo::kf::Setup< DataT > &setup)
Sets setup.
void ReadParametersObject(const std::string &fileName)
Reads parameters object from boost-serialized binary file.
void WriteParametersObject(const std::string &fileName) const
Writes parameters object from boost-serialized binary file.
void ReadInputConfigs()
Reads main and user parameters configs.
bool IsActive(EDetectorID detectorID) const
Checks, if the detector is active.
void SetDetectorNames(const std::array< const char *, Size > &container)
Sets detector names.
void DevSetIsParSearchWUsed(bool value=true)
Flag to use estimated hit search windows.
void AddStation(const StationInitializer &station)
Adds a tracking station to the geometry.
bool FormParametersContainer()
Forms parameters container.
const Hit & GetHit(HitIndex_t index) const
Gets reference to hit by its index.
Definition CaInputData.h:55
const Vector< Hit > & GetHits() const
Gets reference to hits vector.
Definition CaInputData.h:58
std::string ToString() const
Prints counters summary to string.
Definition CaMonitor.h:167
void Reset()
Resets the counters.
Definition CaMonitor.h:107
void AddMonitorData(const MonitorData< ECounterKey, ETimerKey > &data, bool parallel=false)
Adds the other monitor data to this.
Definition CaMonitor.h:70
A container for all external parameters of the CA tracking algorithm.
A base class which provides interface to L1Algo station geometry.
Class representing an output track in the CA tracking algorithm.
TrackParam_t fParFirst
Track parameters on the first station.
Definition CaTrack.h:48
int fNofHits
Number of hits in track.
Definition CaTrack.h:46
void push_back(Tinput value)
Pushes back a value to the vector.
Definition CaVector.h:176
void reserve(std::size_t count)
Reserves a new size for the vector.
Definition CaVector.h:162
static void Store(const Setup< double > &setup, const std::string &fileName)
Stores a serialized setup to a file.
T Tx() const
Gets slope along x-axis.
T X() const
Gets x position [cm].
T Y() const
Gets y position [cm].
T Qp() const
Gets charge over momentum [ec/GeV].
T Z() const
Gets z position [cm].
T Time() const
Gets time [ns].
void Set(const TrackParamBase< T1 > &Tb)
T Ty() const
Gets slope along y-axis.
Class CbmCaPerformance is an interface to communicate between.
A reader of time slice for CA tracker.
static Debugger & Instance()
Instance.
void Write()
Write ntuples to the file.
const auto & GetTrackContainer() const
Gets a reference to the vector of tracks.
static Target * Instance()
Instance access.
static TrackingSetupBuilder * Instance()
Instance access.
class cbm::algo::ca::WindowData _fvecalignment
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.
Definition CbmDefs.h:176
@ Intrpl
Interpolated magnetic field.
void SetOriginalCbmField()
pass the original magnetic field to L1Algo
constexpr DetIdArr_t< const char * > kDetName
Names of detector subsystems.
static TH2F * ToHistogram(const cbm::algo::kf::MaterialMap &material, const TString &name, const TString &title)
Converts a material budget map into a TH2D histogram.