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 // *****************************
191 // ** **
192 // ** GEOMETRY INITIALIZATION **
193 // ** **
194 // *****************************
195
196 // Read parameters object from a binary file
197 if (2 == fSTAPDataMode) {
198 this->ReadSTAPParamObject();
199 }
200 // Parameters initialization, based on the FairRunAna chain
201 else {
202 // ********************************************
203 // ** Base configuration file initialization **
204 // ********************************************
205 {
206 // The parameters module of CA algorithm (L1Parameters) contains two sets of data fields: the geometry configura-
207 // tion and the parameter configuration. The configuration both for geometry and parameters can be set using
208 // either the accessor functions of the L1InitManager class, or reading the beforehand prepared L1Parameters
209 // object. On top of that, the parameters configuration (including cuts, algorithm execution scenario etc.) can
210 // be initialized from the YAML configuration files in two levels (base and user). The base level of the initia-
211 // lization is required for CbmL1 mode, the user level of the initialization is optional.
212
213 std::string mainConfig = std::string(gSystem->Getenv("VMCWORKDIR")) + "/macro/L1/configs/";
214 switch (fTrackingMode) {
215 case ca::TrackingMode::kSts: mainConfig += "ca_params_sts.yaml"; break;
216 case ca::TrackingMode::kMcbm: mainConfig += "ca_params_mcbm.yaml"; break;
217 case ca::TrackingMode::kGlobal: mainConfig += "ca_params_global.yaml"; break;
218 }
219 fInitManager.SetConfigMain(mainConfig);
220 }
221
223
224 auto mvdInterface = CbmMvdTrackingInterface::Instance();
225 auto stsInterface = CbmStsTrackingInterface::Instance();
226 auto muchInterface = CbmMuchTrackingInterface::Instance();
227 auto trdInterface = CbmTrdTrackingInterface::Instance();
228 auto tofInterface = CbmTofTrackingInterface::Instance();
229
230 int nMvdStationsGeom = (bGeoMVD) ? mvdInterface->GetNtrackingStations() : 0;
231 int nStsStationsGeom = (bGeoSTS) ? stsInterface->GetNtrackingStations() : 0;
232 int nMuchStationsGeom = (bGeoMUCH) ? muchInterface->GetNtrackingStations() : 0;
233 int nTrdStationsGeom = (bGeoTRD) ? trdInterface->GetNtrackingStations() : 0;
234 int nTofStationsGeom = (bGeoTOF) ? tofInterface->GetNtrackingStations() : 0;
235
236 // **************************
237 // ** Field initialization **
238 // **************************
239
240 if (FairRunAna::Instance()->GetField()) {
241 fInitManager.SetFieldFunction([](const double(&inPos)[3], double(&outB)[3]) {
242 FairRunAna::Instance()->GetField()->GetFieldValue(inPos, outB);
243 });
244 }
245 else {
246 fInitManager.SetFieldFunction([](const double(&)[3], double(&outB)[3]) {
247 outB[0] = 0.;
248 outB[1] = 0.;
249 outB[2] = 0.;
250 });
251 }
252
253 // ***************************
254 // ** Target initialization **
255 // ***************************
256
257 {
258 const auto& pTarget = cbm::kf::Target::Instance();
259 fTargetX = pTarget->GetX();
260 fTargetY = pTarget->GetY();
261 fTargetZ = pTarget->GetZ();
262 }
264
265 // *********************************
266 // ** Target field initialization **
267 // *********************************
268
269 // FIXME: SZh 22.08.2023:
270 // Is there anyway to calculate a step between field slices?
271 fInitManager.InitTargetField(/*zStep = */ 2.5 /*cm*/); // Replace zStep -> sizeZfieldRegion = 2 * zStep (TODO)
272
273
274 // **************************************
275 // ** **
276 // ** STATIONS GEOMETRY INITIALIZATION **
277 // ** **
278 // **************************************
279
280
281 // ***************************************************
282 // ** Active tracking detector subsystems selection **
283 // ***************************************************
284
285
286 // Explicitly disable MVD, if it is not required from the STSFindTracks task
287 if (bUseMVD) {
288 auto* pTrackFinderTask = dynamic_cast<CbmStsFindTracks*>(FairRunAna::Instance()->GetTask("STSFindTracks"));
289 if (pTrackFinderTask) {
290 bUseMVD = pTrackFinderTask->MvdUsage();
291 }
292 }
293
294
295 // *************************************
296 // ** Stations layout initialization **
297 // *************************************
298
299 std::vector<ca::StationInitializer> vStations;
300 vStations.reserve(100);
301 bool bDisableTime = false;
302
303 // *** MVD stations info ***
304 if (bGeoMVD) {
305 for (int iSt = 0; iSt < nMvdStationsGeom; ++iSt) {
306 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kMvd, iSt);
307 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
308 stationInfo.SetStationType(1); // MVD
309 stationInfo.SetTimeInfo(!bDisableTime && mvdInterface->IsTimeInfoProvided(iSt));
310 stationInfo.SetFieldStatus(fTrackingMode == ca::TrackingMode::kMcbm ? 0 : 1);
311 stationInfo.SetZref(mvdInterface->GetZref(iSt));
312 stationInfo.SetZmin(mvdInterface->GetZmin(iSt));
313 stationInfo.SetZmax(mvdInterface->GetZmax(iSt));
314 stationInfo.SetXmax(std::max(fabs(mvdInterface->GetXmax(iSt)), fabs(mvdInterface->GetXmin(iSt))));
315 stationInfo.SetYmax(std::max(fabs(mvdInterface->GetYmax(iSt)), fabs(mvdInterface->GetYmin(iSt))));
316 stationInfo.SetTrackingStatus(true);
317 if (fvmDisabledStationIDs[ca::EDetectorID::kMvd].find(iSt)
318 != fvmDisabledStationIDs[ca::EDetectorID::kMvd].cend()) {
319 stationInfo.SetTrackingStatus(false);
320 }
321 if (!bUseMVD) {
322 stationInfo.SetTrackingStatus(false);
323 }
324 fInitManager.AddStation(stationInfo);
325 LOG(info) << "- MVD station " << iSt << " at z = " << stationInfo.GetZref() << " cm ";
326 }
327 }
328
329 // *** STS stations info ***
330 if (bGeoSTS) {
331 for (int iSt = 0; iSt < nStsStationsGeom; ++iSt) {
332 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kSts, iSt);
333 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
334 stationInfo.SetStationType(0); // STS
335 stationInfo.SetTimeInfo(!bDisableTime && stsInterface->IsTimeInfoProvided(iSt));
336 stationInfo.SetFieldStatus(ca::TrackingMode::kMcbm == fTrackingMode ? 0 : 1);
337 stationInfo.SetZref(stsInterface->GetZref(iSt));
338 stationInfo.SetZmin(stsInterface->GetZmin(iSt));
339 stationInfo.SetZmax(stsInterface->GetZmax(iSt));
340 stationInfo.SetXmax(std::max(fabs(stsInterface->GetXmax(iSt)), fabs(stsInterface->GetXmin(iSt))));
341 stationInfo.SetYmax(std::max(fabs(stsInterface->GetYmax(iSt)), fabs(stsInterface->GetYmin(iSt))));
342
343 stationInfo.SetTrackingStatus(true);
344 if (fvmDisabledStationIDs[ca::EDetectorID::kSts].find(iSt)
345 != fvmDisabledStationIDs[ca::EDetectorID::kSts].cend()) {
346 stationInfo.SetTrackingStatus(false);
347 }
348 if (!bUseSTS) {
349 stationInfo.SetTrackingStatus(false);
350 }
351 fInitManager.AddStation(stationInfo);
352 LOG(info) << "- STS station " << iSt << " at z = " << stationInfo.GetZref() << " cm ";
353 }
354 }
355
356 // *** MuCh stations info ***
357 if (bGeoMUCH) {
358 for (int iSt = 0; iSt < nMuchStationsGeom; ++iSt) {
359 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kMuch, iSt);
360 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
361 stationInfo.SetStationType(2); // MuCh
362 stationInfo.SetTimeInfo(!bDisableTime && muchInterface->IsTimeInfoProvided(iSt));
363 stationInfo.SetFieldStatus(0);
364 stationInfo.SetZref(muchInterface->GetZref(iSt));
365 stationInfo.SetZmin(muchInterface->GetZmin(iSt));
366 stationInfo.SetZmax(muchInterface->GetZmax(iSt));
367 stationInfo.SetXmax(std::max(fabs(muchInterface->GetXmax(iSt)), fabs(muchInterface->GetXmin(iSt))));
368 stationInfo.SetYmax(std::max(fabs(muchInterface->GetYmax(iSt)), fabs(muchInterface->GetYmin(iSt))));
369
370 stationInfo.SetTrackingStatus(true);
371 if (fvmDisabledStationIDs[ca::EDetectorID::kMuch].find(iSt)
372 != fvmDisabledStationIDs[ca::EDetectorID::kMuch].cend()) {
373 stationInfo.SetTrackingStatus(false);
374 }
375 if (!bUseMUCH) {
376 stationInfo.SetTrackingStatus(false);
377 }
378 fInitManager.AddStation(stationInfo);
379 LOG(info) << "- MuCh station " << iSt << " at z = " << stationInfo.GetZref() << " cm";
380 }
381 }
382
383 // *** TRD stations info ***
384 if (bGeoTRD) {
385 for (int iSt = 0; iSt < nTrdStationsGeom; ++iSt) {
386 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kTrd, iSt);
387 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
388 stationInfo.SetStationType(3);
389 stationInfo.SetTimeInfo(!bDisableTime && trdInterface->IsTimeInfoProvided(iSt));
390 stationInfo.SetFieldStatus(0);
391 stationInfo.SetZref(trdInterface->GetZref(iSt));
392 stationInfo.SetZmin(trdInterface->GetZmin(iSt));
393 stationInfo.SetZmax(trdInterface->GetZmax(iSt));
394 stationInfo.SetXmax(std::max(fabs(trdInterface->GetXmax(iSt)), fabs(trdInterface->GetXmin(iSt))));
395 stationInfo.SetYmax(std::max(fabs(trdInterface->GetYmax(iSt)), fabs(trdInterface->GetYmin(iSt))));
396
397 if (ca::TrackingMode::kGlobal == fTrackingMode) {
398 stationInfo.SetTimeInfo(false);
399 }
400 stationInfo.SetTrackingStatus(true);
401 if (fvmDisabledStationIDs[ca::EDetectorID::kTrd].find(iSt)
402 != fvmDisabledStationIDs[ca::EDetectorID::kTrd].cend()) {
403 stationInfo.SetTrackingStatus(false);
404 }
405 if (!bUseTRD) {
406 stationInfo.SetTrackingStatus(false);
407 }
408 fInitManager.AddStation(stationInfo);
409 LOG(info) << "- TRD station " << iSt << " at z = " << stationInfo.GetZref() << " cm";
410 }
411 }
412
413 // *** TOF stations info ***
414 if (bGeoTOF) {
415 for (int iSt = 0; iSt < nTofStationsGeom; ++iSt) {
416 auto stationInfo = ca::StationInitializer(ca::EDetectorID::kTof, iSt);
417 // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
418 stationInfo.SetStationType(4);
419 stationInfo.SetTimeInfo(!bDisableTime && tofInterface->IsTimeInfoProvided(iSt));
420 stationInfo.SetFieldStatus(0);
421 stationInfo.SetZref(tofInterface->GetZref(iSt));
422 stationInfo.SetZmin(tofInterface->GetZmin(iSt));
423 stationInfo.SetZmax(tofInterface->GetZmax(iSt));
424 stationInfo.SetXmax(std::max(fabs(tofInterface->GetXmax(iSt)), fabs(tofInterface->GetXmin(iSt))));
425 stationInfo.SetYmax(std::max(fabs(tofInterface->GetYmax(iSt)), fabs(tofInterface->GetYmin(iSt))));
426
427 stationInfo.SetTrackingStatus(true);
428 if (fvmDisabledStationIDs[ca::EDetectorID::kTof].find(iSt)
429 != fvmDisabledStationIDs[ca::EDetectorID::kTof].cend()) {
430 stationInfo.SetTrackingStatus(false);
431 }
432 if (!bUseTOF) {
433 stationInfo.SetTrackingStatus(false);
434 }
435 fInitManager.AddStation(stationInfo);
436 LOG(info) << "- TOF station " << iSt << " at z = " << stationInfo.GetZref() << " cm";
437 }
438 }
439
440 // Init station layout: sort stations in z-position and init maps of station local, geo and active indices
443
444 // *************************
445 // ** Initialize KF-setup **
446 // *************************
447 {
448 auto trackerSetup = pSetupBuilder->MakeSetup<float>(cbm::algo::kf::EFieldMode::Intrpl);
449 TString geoTag = "";
450 if (auto* pSetup = CbmSetup::Instance()) {
451 geoTag = pSetup->GetProvider()->GetSetup().GetTag();
452 }
453 if (geoTag.IsNull()) {
454 geoTag = fSTAPDataPrefix;
455 }
456 TString outputFile = fSTAPDataDir + "/" + geoTag + "." + TString(kSTAPSetupSuffix.data());
457 cbm::algo::kf::SetupBuilder::Store(trackerSetup, outputFile.Data());
458 fInitManager.SetGeometrySetup(trackerSetup);
459 }
460
461 // *******************************
462 // ** Initialize search windows **
463 // *******************************
464
465 if (fsInputSearchWindowsFilename.size()) {
468 }
469 else {
471 }
472
473 // Form parameters container
475 return kFATAL;
476 }
477
478 bUseMVD = fInitManager.IsActive(ca::EDetectorID::kMvd);
479 bUseSTS = fInitManager.IsActive(ca::EDetectorID::kSts);
480 bUseMUCH = fInitManager.IsActive(ca::EDetectorID::kMuch);
481 bUseTRD = fInitManager.IsActive(ca::EDetectorID::kTrd);
482 bUseTOF = fInitManager.IsActive(ca::EDetectorID::kTof);
483
484 // Write parameters object to file if needed
485 if (1 == fSTAPDataMode || 4 == fSTAPDataMode) {
486 this->WriteSTAPParamObject();
487 }
488 }
489
491 auto parameters = fInitManager.TakeParameters();
492 LOG(info) << '\n' << parameters.ToString(1);
493 return kSUCCESS;
494 }
495
496 // Init L1 algo core
497
498 // FIXME: SZh 22.08.2023:
499 // Re-organize the the relation between CbmL1 and ca::Framework. I believe, we don't need a global pointer to the ca::Framework
500 // instance.
501 fpAlgo = &gAlgo;
502
503 //
504 // ** Send formed parameters object to ca::Framework instance **
505 //
506 std::shared_ptr<ca::Parameters<float>> pParameters{nullptr};
507 {
508 auto parameters = fInitManager.TakeParameters();
509 pParameters = std::make_shared<ca::Parameters<float>>(parameters);
510 fpAlgo->ReceiveParameters(std::move(parameters));
511 }
513
514
515 // Initialize time-slice reader
516 fpTSReader = std::make_unique<TimeSliceReader>();
517 fpTSReader->SetDetector(ca::EDetectorID::kMvd, bUseMVD);
518 fpTSReader->SetDetector(ca::EDetectorID::kSts, bUseSTS);
519 fpTSReader->SetDetector(ca::EDetectorID::kMuch, bUseMUCH);
520 fpTSReader->SetDetector(ca::EDetectorID::kTrd, bUseTRD);
521 fpTSReader->SetDetector(ca::EDetectorID::kTof, bUseTOF);
522
523 fpTSReader->RegisterParameters(pParameters);
524 fpTSReader->RegisterHitIndexContainer(fvExternalHits);
525 fpTSReader->RegisterIODataManager(fpIODataManager);
526 fpTSReader->RegisterQaHitContainer(fvHitDebugInfo);
527 if (!fpTSReader->InitRun()) {
528 return kFATAL;
529 }
530
531 if (fPerformance) {
532 fpMCModule = std::make_unique<MCModule>(fVerbose, fPerformance);
533 fpMCModule->SetDetector(ca::EDetectorID::kMvd, bUseMVD);
534 fpMCModule->SetDetector(ca::EDetectorID::kSts, bUseSTS);
535 fpMCModule->SetDetector(ca::EDetectorID::kMuch, bUseMUCH);
536 fpMCModule->SetDetector(ca::EDetectorID::kTrd, bUseTRD);
537 fpMCModule->SetDetector(ca::EDetectorID::kTof, bUseTOF);
538
539 fpMCModule->RegisterMCData(fMCData);
540 fpMCModule->RegisterRecoTrackContainer(fvRecoTracks);
541 fpMCModule->RegisterHitIndexContainer(fvExternalHits);
542 fpMCModule->RegisterParameters(pParameters);
543 fpMCModule->RegisterQaHitContainer(fvHitDebugInfo);
544 fpMCModule->RegisterFirstHitIndexes(fpTSReader->GetHitFirstIndexDet());
545 if (!fpMCModule->InitRun()) {
546 return kFATAL;
547 }
548 }
549
550 LOG(info) << pParameters->ToString(1);
551 LOG(info) << "----- Numbers of stations active in tracking -----";
552 LOG(info) << " MVD: " << pParameters->GetNstationsActive(ca::EDetectorID::kMvd);
553 LOG(info) << " STS: " << pParameters->GetNstationsActive(ca::EDetectorID::kSts);
554 LOG(info) << " MuCh: " << pParameters->GetNstationsActive(ca::EDetectorID::kMuch);
555 LOG(info) << " TRD: " << pParameters->GetNstationsActive(ca::EDetectorID::kTrd);
556 LOG(info) << " TOF: " << pParameters->GetNstationsActive(ca::EDetectorID::kTof);
557 LOG(info) << " Total: " << pParameters->GetNstationsActive();
558
559 fNStations = pParameters->GetNstationsActive();
560
561 // TODO: Probably move from CbmL1 to a more proper place (e.g. kf::Setup)
562 {
563 //std::stringstream msg;
564 //msg << " ----- Material budget map monitoring: active setup -----\n";
565 const auto& activeSetup = pParameters->GetActiveSetup();
566 for (int iSt = 0; iSt < activeSetup.GetNofLayers(); ++iSt) {
567 fMaterialMonitor.emplace_back(&(activeSetup.GetMaterial(iSt)), Form("Station %d", iSt));
568 //msg << monitor.ToString() << '\n';
569 }
570 //msg << " --------------------------------------------------------";
571 //LOG(info) << '\n' << msg.str();
572 }
573
574 DumpMaterialToFile("L1material.root");
575
576 // Initialize monitor
577 fMonitor.Reset();
578
579 return kSUCCESS;
580}
581catch (const std::exception& err) {
582 LOG(error) << "CbmL1: initialization failed. Reason: " << err.what();
583 return kFATAL;
584}
585
586// ---------------------------------------------------------------------------------------------------------------------
587//
589{
590 ca::TrackingMonitorData monitorData;
591
592 fpTSReader->ReadEvent(event);
593 if (fPerformance) {
594 fpMCModule->InitEvent(event); // reads points and MC tracks
595 fpMCModule->MatchHits(); // matches points with hits
596 }
597 fpAlgo->ReceiveInputData(fpIODataManager->TakeInputData());
598
599 // Material monitoring: mark active areas
600 {
601 for (const auto& hit : fpAlgo->GetInputData().GetHits()) {
602 fMaterialMonitor[hit.Station()].MarkActiveBin(hit.X(), hit.Y());
603 }
604 }
605 //LOG(info) << "CHECK: hit ids = " << fvExternalHits.size() << ", hits = " << fpIODataManager->GetNofHits()
606 //<< ", dbg hits = " << fvHitDebugInfo.size();
607
608 fpAlgo->SetMonitorData(monitorData);
609
610 if (nullptr != event) {
611 LOG_IF(debug, fVerbose > 0) << "\n======= Ca Track finder: process event " << event->GetNumber() << " ...";
612 }
613 else {
614 LOG_IF(debug, fVerbose > 0) << "\n======= Ca Track finder: process timeslice ...";
615 }
616
618 // IdealTrackFinder();
619 fTrackingTime = fpAlgo->fCaRecoTime; // TODO: remove (not used)
620
621 LOG_IF(debug, fVerbose > 0) << "Ca Track Finder finished, found " << fpAlgo->fRecoTracks.size() << " tracks";
622
623 // Update monitor data after the actual tracking
624 monitorData = fpAlgo->GetMonitorData();
625
626 // save reconstructed tracks
627
628 fvRecoTracks.clear();
630
631 int trackFirstHit = 0;
632
633 // FIXME: Rewrite
634 for (const auto& caTrk : fpAlgo->fRecoTracks) {
635 CbmL1Track t;
636 t.Set(caTrk.fParFirst);
637 t.TLast.Set(caTrk.fParLast);
638 t.Tpv.Set(caTrk.fParPV);
639 t.Hits.clear();
640
641 for (int i = 0; i < caTrk.fNofHits; i++) {
642 int caHitId = fpAlgo->fRecoHits[trackFirstHit + i];
643 int cbmHitID = fpAlgo->GetInputData().GetHit(caHitId).Id();
644 t.Hits.push_back(cbmHitID);
645 }
647 trackFirstHit += caTrk.fNofHits;
648 //fMonitor.IncrementCounter(EMonitorKey::kRecoHit, it->fNofHits);
649 }
650
651 //fMonitor.IncrementCounter(EMonitorKey::kRecoTrack, fvRecoTracks.size());
652 LOG(debug) << "CA Track Finder: " << fpAlgo->fCaRecoTime << " s/sub-ts";
653
654 // output performance
655 if (fPerformance) {
656 LOG_IF(info, fVerbose) << "Performance...";
657
658 fpMCModule->MatchTracks(); // matches reco and MC tracks, fills the MC-truth fields of reco tracks
659
660 //
661 // tracker input performance is moved to external QA tasks.
662 // InputPerformance() method is not optimised to run with the event builder
663 // TODO: verify QA tasks and remove InputPerformance()
664 // InputPerformance();
665 //
666
667
671 if (fsMcTripletsOutputFilename.size()) {
673 }
674 // TimeHist();
676 LOG_IF(info, fVerbose > 1) << "Tracking performance... done";
677 }
678 LOG_IF(debug, fVerbose > 1) << "End of CA";
679
680 ++fEventNo;
681 fMonitor.AddMonitorData(monitorData);
682}
683
684// ----- Finish CbmStsFitPerformanceTask task -----------------------------
686{
687 if (fPerformance) {
688 // FieldApproxCheck();
689 // FieldIntegralCheck();
691 }
692
693 {
694 // monitor the material
695 std::stringstream msg;
696 msg << '\n';
697 msg << "\033[31;1m ***************************\033[0m\n";
698 msg << "\033[31;1m ** CA Tracking monitor **\033[0m\n";
699 msg << "\033[31;1m ***************************\033[0m\n";
700
701 // TODO: Probably move from CbmL1 to a more proper place (e.g. kf::Setup)
702 {
703 msg << '\n';
704 msg << " ----- Material budget map monitoring: active setup -----\n";
705 for (auto& monitor : fMaterialMonitor) {
706 msg << monitor.ToString() << '\n';
707 }
708 msg << " --------------------------------------------------------\n";
709 }
710
711 // monitor of the reconstructed tracks
712 msg << '\n' << fMonitor.ToString();
713 LOG(info) << msg.str();
714 }
715
716 TDirectory* curr = gDirectory;
717 TFile* currentFile = gFile;
718
719
720 // Open output file and write histograms
721 boost::filesystem::path p = (FairRunAna::Instance()->GetUserOutputFileName()).Data();
722 std::string dir = p.parent_path().string();
723 if (dir.empty()) dir = ".";
724 {
725 std::string histoOutName = dir + "/L1_histo_" + p.filename().string();
726 LOG(info) << "\033[31;1mL1 performance histograms will be saved to: \033[0m" << histoOutName;
727 TFile* outfile = new TFile(histoOutName.c_str(), "RECREATE");
728 outfile->cd();
730 outfile->Close();
731 outfile->Delete();
732 }
733 {
734 std::string tablesOutName = dir + "/L1_perftable_" + p.filename().string();
735 LOG(info) << "\033[31;1mL1 performance tables will be saved to: \033[0m" << tablesOutName;
736 TFile* outfile = new TFile(tablesOutName.c_str(), "RECREATE");
737 outfile->cd();
739 outfile->Close();
740 outfile->Delete();
741 }
742
745 fpMcTripletsTree->Write();
746 fpMcTripletsOutFile->Close();
747 fpMcTripletsOutFile->Delete();
748 }
749
750 gFile = currentFile;
751 gDirectory = curr;
752 fpAlgo->Finish();
754}
755
756
757// ---------------------------------------------------------------------------------------------------------------------
758//
759void CbmL1::writedir2current(TObject* obj)
760{
761 if (!obj->IsFolder())
762 obj->Write();
763 else {
764 TDirectory* cur = gDirectory;
765 TDirectory* sub = cur->mkdir(obj->GetName());
766 sub->cd();
767 TList* listSub = (dynamic_cast<TDirectory*>(obj))->GetList();
768 TIter it(listSub);
769 while (TObject* obj1 = it())
770 writedir2current(obj1);
771 cur->cd();
772 }
773}
774
775// ---------------------------------------------------------------------------------------------------------------------
776//
778{
779 fpAlgo->fRecoTracks.clear();
780 fpAlgo->fRecoHits.clear();
781
782 for (auto& MC : fMCData.GetTrackContainer()) {
783 if (!MC.IsReconstructable()) continue;
784 if (!(MC.GetId() >= 0)) continue;
785
786 if (MC.GetNofHits() < 4) continue;
787
788 CaTrack algoTr;
789 algoTr.fNofHits = 0;
790
791 ca::Vector<int> hitIndices("CbmL1::hitIndices", fpAlgo->GetParameters().GetNstationsActive(), -1);
792
793 for (unsigned int iH : MC.GetHitIndexes()) {
794 const CbmL1HitDebugInfo& hit = fvHitDebugInfo[iH];
795 const int iStation = hit.GetStationId();
796 if (iStation >= 0) hitIndices[iStation] = iH;
797 }
798
799
800 for (int iH = 0; iH < fpAlgo->GetParameters().GetNstationsActive(); iH++) {
801 const int hitI = hitIndices[iH];
802 if (hitI < 0) continue;
803
804 // fpAlgo->fRecoHits.push_back(hitI);
805 algoTr.fNofHits++;
806 }
807
808
809 if (algoTr.fNofHits < 3) continue;
810
811 for (int iH = 0; iH < fpAlgo->GetParameters().GetNstationsActive(); iH++) {
812 const int hitI = hitIndices[iH];
813 if (hitI < 0) continue;
815 }
816
817 algoTr.fParFirst.X() = MC.GetStartX();
818 algoTr.fParFirst.Y() = MC.GetStartY();
819 algoTr.fParFirst.Z() = MC.GetStartZ();
820 algoTr.fParFirst.Tx() = MC.GetTx();
821 algoTr.fParFirst.Ty() = MC.GetTy();
822 algoTr.fParFirst.Qp() = MC.GetCharge() / MC.GetP();
823 algoTr.fParFirst.Time() = MC.GetStartT();
824 fpAlgo->fRecoTracks.push_back(algoTr);
825 }
826} // void CbmL1::IdealTrackFinder()
827
828
830
831// ---------------------------------------------------------------------------------------------------------------------
832//
833void CbmL1::DefineSTAPNames(const char* dirName)
834{
835 // FIXME: SZh 01.03.2023: Clean STAP names
836 namespace bfs = boost::filesystem;
837
838 if (fSTAPDataMode == 0) {
839 return;
840 }
841
842 // Define file prefix (/path/to/data/setup.reco.root -> "setup.reco")
843 bfs::path pathToRecoOutput = FairRunAna::Instance()->GetUserOutputFileName().Data();
844 fSTAPDataPrefix = pathToRecoOutput.filename().string();
845 fSTAPDataPrefix.ReplaceAll(".root", "");
846 fSTAPDataPrefix = fSTAPDataPrefix.Strip(TString::EStripType::kBoth, '.');
847
848 TString sDirName = TString(dirName);
849 if (sDirName.Length() == 0) {
850 fSTAPDataDir = pathToRecoOutput.parent_path().string();
851 }
852 else if (bfs::exists(sDirName.Data()) && bfs::is_directory(sDirName.Data())) {
853 fSTAPDataDir = sDirName;
854 }
855 else {
856 fSTAPDataDir = ".";
857 }
858
859 // TODO: Clean-up the names and pathes
860 if (fSTAPDataDir.Length() == 0) {
861 fSTAPDataDir = ".";
862 }
863
864 LOG(info) << "CbmL1: STAP data root directory is \033[1;32m" << bfs::system_complete(fSTAPDataDir.Data())
865 << "\033[0m";
866
867 if (fSTAPDataMode == 4) {
868 return;
869 }
870
871 // Directory for handling L1InputData objects
872 TString sInputDataDir = fSTAPDataDir + "/" + fSTAPDataPrefix + "_cainputdata";
873 if (!bfs::exists(sInputDataDir.Data())) {
874 LOG(warn) << "CbmL1: directory for tracking input data does not exist. It will be created";
875 bfs::create_directories(sInputDataDir.Data());
876 }
877 LOG(info) << "CbmL1: STAP tracking input jobs directory is \033[1;32m" << bfs::system_complete(sInputDataDir.Data())
878 << "\033[0m";
879}
880
881// ---------------------------------------------------------------------------------------------------------------------
882//
884{
885 TString filename = fSTAPParamFile.IsNull()
886 ? fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPParamSuffix.data())
888 fInitManager.WriteParametersObject(filename.Data());
889}
890
891// ---------------------------------------------------------------------------------------------------------------------
892//
893void CbmL1::WriteSTAPAlgoInputData(int iJob) // must be called after ReadEvent
894{
895 TString filename =
896 fSTAPDataDir + "/" + fSTAPDataPrefix + "_cainputdata/" + +TString::Format(kSTAPAlgoIDataSuffix.data(), iJob);
897
898 // Write file
899 fpIODataManager->WriteInputData(filename.Data());
900}
901
902// ---------------------------------------------------------------------------------------------------------------------
903//
904void CbmL1::WriteSTAPPerfInputData() // must be called after ReadEvent
905{
906 LOG(fatal) << "CbmL1: Running in standalone mode is not available at the moment. It will be updated soon...";
907}
908
909// ---------------------------------------------------------------------------------------------------------------------
910//
912{
913 TString filename = fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPParamSuffix.data());
914 fInitManager.ReadParametersObject(filename.Data());
915}
916
917// ---------------------------------------------------------------------------------------------------------------------
918//
920{
921 TString filename = fSTAPDataDir + "/" + TString(kSTAPAlgoIDataDir) + "/" + fSTAPDataPrefix + "."
922 + TString::Format(kSTAPAlgoIDataSuffix.data(), iJob);
923
924 // Read file
925 fpIODataManager->ReadInputData(filename.Data());
926}
927
928// ---------------------------------------------------------------------------------------------------------------------
929//
931{
932 LOG(fatal) << "CbmL1: Running in standalone mode is not available at the moment. It will be updated soon...";
933}
934
935// ---------------------------------------------------------------------------------------------------------------------
936//
937void CbmL1::DumpMaterialToFile(TString fileName)
938{
939 auto* currentFile = gFile;
940 TFile f = TFile{fileName, "RECREATE"};
941 f.cd();
942 // TODO: (!) replace CbmL1::Instance()->fpAlgo->GetParameters() with the cbm::ca::ParametersHandler::Instance()->Get()
943 // everywhere outside cbm::algo
944 const auto& activeTrackingSetup = CbmL1::Instance()->fpAlgo->GetParameters().GetActiveSetup();
945 for (int iSt = 0; iSt < activeTrackingSetup.GetNofLayers(); ++iSt) {
946 const auto& material = activeTrackingSetup.GetMaterial(iSt);
947 TString name = Form("tracking_station%d", iSt);
948 TString title = Form("Tracking station %d: Rad. thickness in %%. Z region [%.2f, %.2f] cm.", iSt,
949 material.GetZmin(), material.GetZmax());
951 title += " Horizontal projection.";
952 }
953 else {
954 title += " Radial projection.";
955 }
956 auto* h = ::kf::tools::RootUtils::ToHistogram(material, name, title);
957 h->SetStats(kFALSE);
958 h->SetDirectory(&f);
959 }
960 f.Write();
961 currentFile->cd();
962}
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)
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:588
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:937
cbm::ca::tools::MCData fMCData
MC Data object.
Definition CbmL1.h:417
void WriteSTAPParamObject()
Writes initialized L1Parameters object to file "".
Definition CbmL1.cxx:883
void ReadSTAPPerfInputData()
Definition CbmL1.cxx:930
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:893
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:919
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:904
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:777
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:685
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:833
~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:911
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:759
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.
cbm::algo::kf::TrackParamS fParFirst
Track parameters on the first station.
Definition CaTrack.h:46
int fNofHits
Number of hits in track.
Definition CaTrack.h:44
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.