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 outputFile = fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPSetupSuffix.data());
450 cbm::algo::kf::SetupBuilder::Store(trackerSetup, outputFile.Data());
451 fInitManager.SetGeometrySetup(trackerSetup);
452 }
453
454 // *******************************
455 // ** Initialize search windows **
456 // *******************************
457
458 if (fsInputSearchWindowsFilename.size()) {
461 }
462 else {
464 }
465
466 // Form parameters container
468 return kFATAL;
469 }
470
471 bUseMVD = fInitManager.IsActive(ca::EDetectorID::kMvd);
472 bUseSTS = fInitManager.IsActive(ca::EDetectorID::kSts);
473 bUseMUCH = fInitManager.IsActive(ca::EDetectorID::kMuch);
474 bUseTRD = fInitManager.IsActive(ca::EDetectorID::kTrd);
475 bUseTOF = fInitManager.IsActive(ca::EDetectorID::kTof);
476
477 // Write parameters object to file if needed
478 if (1 == fSTAPDataMode || 4 == fSTAPDataMode) {
479 this->WriteSTAPParamObject();
480 }
481 }
482
484 auto parameters = fInitManager.TakeParameters();
485 LOG(info) << '\n' << parameters.ToString(1);
486 return kSUCCESS;
487 }
488
489 // Init L1 algo core
490
491 // FIXME: SZh 22.08.2023:
492 // Re-organize the the relation between CbmL1 and ca::Framework. I believe, we don't need a global pointer to the ca::Framework
493 // instance.
494 fpAlgo = &gAlgo;
495
496 //
497 // ** Send formed parameters object to ca::Framework instance **
498 //
499 std::shared_ptr<ca::Parameters<float>> pParameters{nullptr};
500 {
501 auto parameters = fInitManager.TakeParameters();
502 pParameters = std::make_shared<ca::Parameters<float>>(parameters);
503 fpAlgo->ReceiveParameters(std::move(parameters));
504 }
506
507
508 // Initialize time-slice reader
509 fpTSReader = std::make_unique<TimeSliceReader>();
510 fpTSReader->SetDetector(ca::EDetectorID::kMvd, bUseMVD);
511 fpTSReader->SetDetector(ca::EDetectorID::kSts, bUseSTS);
512 fpTSReader->SetDetector(ca::EDetectorID::kMuch, bUseMUCH);
513 fpTSReader->SetDetector(ca::EDetectorID::kTrd, bUseTRD);
514 fpTSReader->SetDetector(ca::EDetectorID::kTof, bUseTOF);
515
516 fpTSReader->RegisterParameters(pParameters);
517 fpTSReader->RegisterHitIndexContainer(fvExternalHits);
518 fpTSReader->RegisterIODataManager(fpIODataManager);
519 fpTSReader->RegisterQaHitContainer(fvHitDebugInfo);
520 if (!fpTSReader->InitRun()) {
521 return kFATAL;
522 }
523
524 if (fPerformance) {
525 fpMCModule = std::make_unique<MCModule>(fVerbose, fPerformance);
526 fpMCModule->SetDetector(ca::EDetectorID::kMvd, bUseMVD);
527 fpMCModule->SetDetector(ca::EDetectorID::kSts, bUseSTS);
528 fpMCModule->SetDetector(ca::EDetectorID::kMuch, bUseMUCH);
529 fpMCModule->SetDetector(ca::EDetectorID::kTrd, bUseTRD);
530 fpMCModule->SetDetector(ca::EDetectorID::kTof, bUseTOF);
531
532 fpMCModule->RegisterMCData(fMCData);
533 fpMCModule->RegisterRecoTrackContainer(fvRecoTracks);
534 fpMCModule->RegisterHitIndexContainer(fvExternalHits);
535 fpMCModule->RegisterParameters(pParameters);
536 fpMCModule->RegisterQaHitContainer(fvHitDebugInfo);
537 fpMCModule->RegisterFirstHitIndexes(fpTSReader->GetHitFirstIndexDet());
538 if (!fpMCModule->InitRun()) {
539 return kFATAL;
540 }
541 }
542
543 LOG(info) << pParameters->ToString(1);
544 LOG(info) << "----- Numbers of stations active in tracking -----";
545 LOG(info) << " MVD: " << pParameters->GetNstationsActive(ca::EDetectorID::kMvd);
546 LOG(info) << " STS: " << pParameters->GetNstationsActive(ca::EDetectorID::kSts);
547 LOG(info) << " MuCh: " << pParameters->GetNstationsActive(ca::EDetectorID::kMuch);
548 LOG(info) << " TRD: " << pParameters->GetNstationsActive(ca::EDetectorID::kTrd);
549 LOG(info) << " TOF: " << pParameters->GetNstationsActive(ca::EDetectorID::kTof);
550 LOG(info) << " Total: " << pParameters->GetNstationsActive();
551
552 fNStations = pParameters->GetNstationsActive();
553
554 // TODO: Probably move from CbmL1 to a more proper place (e.g. kf::Setup)
555 {
556 //std::stringstream msg;
557 //msg << " ----- Material budget map monitoring: active setup -----\n";
558 const auto& activeSetup = pParameters->GetActiveSetup();
559 for (int iSt = 0; iSt < activeSetup.GetNofLayers(); ++iSt) {
560 fMaterialMonitor.emplace_back(&(activeSetup.GetMaterial(iSt)), Form("Station %d", iSt));
561 //msg << monitor.ToString() << '\n';
562 }
563 //msg << " --------------------------------------------------------";
564 //LOG(info) << '\n' << msg.str();
565 }
566
567 DumpMaterialToFile("L1material.root");
568
569 // Initialize monitor
570 fMonitor.Reset();
571
572 return kSUCCESS;
573}
574catch (const std::exception& err) {
575 LOG(error) << "CbmL1: initialization failed. Reason: " << err.what();
576 return kFATAL;
577}
578
579// ---------------------------------------------------------------------------------------------------------------------
580//
582{
583 ca::TrackingMonitorData monitorData;
584
585 fpTSReader->ReadEvent(event);
586 if (fPerformance) {
587 fpMCModule->InitEvent(event); // reads points and MC tracks
588 fpMCModule->MatchHits(); // matches points with hits
589 }
590 fpAlgo->ReceiveInputData(fpIODataManager->TakeInputData());
591
592 // Material monitoring: mark active areas
593 {
594 for (const auto& hit : fpAlgo->GetInputData().GetHits()) {
595 fMaterialMonitor[hit.Station()].MarkActiveBin(hit.X(), hit.Y());
596 }
597 }
598 //LOG(info) << "CHECK: hit ids = " << fvExternalHits.size() << ", hits = " << fpIODataManager->GetNofHits()
599 //<< ", dbg hits = " << fvHitDebugInfo.size();
600
601 fpAlgo->SetMonitorData(monitorData);
602
603 if (nullptr != event) {
604 LOG_IF(debug, fVerbose > 0) << "\n======= Ca Track finder: process event " << event->GetNumber() << " ...";
605 }
606 else {
607 LOG_IF(debug, fVerbose > 0) << "\n======= Ca Track finder: process timeslice ...";
608 }
609
611 // IdealTrackFinder();
612 fTrackingTime = fpAlgo->fCaRecoTime; // TODO: remove (not used)
613
614 LOG_IF(debug, fVerbose > 0) << "Ca Track Finder finished, found " << fpAlgo->fRecoTracks.size() << " tracks";
615
616 // Update monitor data after the actual tracking
617 monitorData = fpAlgo->GetMonitorData();
618
619 // save reconstructed tracks
620
621 fvRecoTracks.clear();
623
624 int trackFirstHit = 0;
625
626 // FIXME: Rewrite
627 for (const auto& caTrk : fpAlgo->fRecoTracks) {
628 CbmL1Track t;
629 t.Set(caTrk.fParFirst);
630 t.TLast.Set(caTrk.fParLast);
631 t.Tpv.Set(caTrk.fParPV);
632 t.Hits.clear();
633
634 for (int i = 0; i < caTrk.fNofHits; i++) {
635 int caHitId = fpAlgo->fRecoHits[trackFirstHit + i];
636 int cbmHitID = fpAlgo->GetInputData().GetHit(caHitId).Id();
637 t.Hits.push_back(cbmHitID);
638 }
640 trackFirstHit += caTrk.fNofHits;
641 //fMonitor.IncrementCounter(EMonitorKey::kRecoHit, it->fNofHits);
642 }
643
644 //fMonitor.IncrementCounter(EMonitorKey::kRecoTrack, fvRecoTracks.size());
645 LOG(debug) << "CA Track Finder: " << fpAlgo->fCaRecoTime << " s/sub-ts";
646
647 // output performance
648 if (fPerformance) {
649 LOG_IF(info, fVerbose) << "Performance...";
650
651 fpMCModule->MatchTracks(); // matches reco and MC tracks, fills the MC-truth fields of reco tracks
652
653 //
654 // tracker input performance is moved to external QA tasks.
655 // InputPerformance() method is not optimised to run with the event builder
656 // TODO: verify QA tasks and remove InputPerformance()
657 // InputPerformance();
658 //
659
660
664 if (fsMcTripletsOutputFilename.size()) {
666 }
667 // TimeHist();
669 LOG_IF(info, fVerbose > 1) << "Tracking performance... done";
670 }
671 LOG_IF(debug, fVerbose > 1) << "End of CA";
672
673 ++fEventNo;
674 fMonitor.AddMonitorData(monitorData);
675}
676
677// ----- Finish CbmStsFitPerformanceTask task -----------------------------
679{
680 if (fPerformance) {
681 // FieldApproxCheck();
682 // FieldIntegralCheck();
684 }
685
686 {
687 // monitor the material
688 std::stringstream msg;
689 msg << '\n';
690 msg << "\033[31;1m ***************************\033[0m\n";
691 msg << "\033[31;1m ** CA Tracking monitor **\033[0m\n";
692 msg << "\033[31;1m ***************************\033[0m\n";
693
694 // TODO: Probably move from CbmL1 to a more proper place (e.g. kf::Setup)
695 {
696 msg << '\n';
697 msg << " ----- Material budget map monitoring: active setup -----\n";
698 for (auto& monitor : fMaterialMonitor) {
699 msg << monitor.ToString() << '\n';
700 }
701 msg << " --------------------------------------------------------\n";
702 }
703
704 // monitor of the reconstructed tracks
705 msg << '\n' << fMonitor.ToString();
706 LOG(info) << msg.str();
707 }
708
709 TDirectory* curr = gDirectory;
710 TFile* currentFile = gFile;
711
712
713 // Open output file and write histograms
714 boost::filesystem::path p = (FairRunAna::Instance()->GetUserOutputFileName()).Data();
715 std::string dir = p.parent_path().string();
716 if (dir.empty()) dir = ".";
717 {
718 std::string histoOutName = dir + "/L1_histo_" + p.filename().string();
719 LOG(info) << "\033[31;1mL1 performance histograms will be saved to: \033[0m" << histoOutName;
720 TFile* outfile = new TFile(histoOutName.c_str(), "RECREATE");
721 outfile->cd();
723 outfile->Close();
724 outfile->Delete();
725 }
726 {
727 std::string tablesOutName = dir + "/L1_perftable_" + p.filename().string();
728 LOG(info) << "\033[31;1mL1 performance tables will be saved to: \033[0m" << tablesOutName;
729 TFile* outfile = new TFile(tablesOutName.c_str(), "RECREATE");
730 outfile->cd();
732 outfile->Close();
733 outfile->Delete();
734 }
735
738 fpMcTripletsTree->Write();
739 fpMcTripletsOutFile->Close();
740 fpMcTripletsOutFile->Delete();
741 }
742
743 gFile = currentFile;
744 gDirectory = curr;
745 fpAlgo->Finish();
747}
748
749
750// ---------------------------------------------------------------------------------------------------------------------
751//
752void CbmL1::writedir2current(TObject* obj)
753{
754 if (!obj->IsFolder())
755 obj->Write();
756 else {
757 TDirectory* cur = gDirectory;
758 TDirectory* sub = cur->mkdir(obj->GetName());
759 sub->cd();
760 TList* listSub = (dynamic_cast<TDirectory*>(obj))->GetList();
761 TIter it(listSub);
762 while (TObject* obj1 = it())
763 writedir2current(obj1);
764 cur->cd();
765 }
766}
767
768// ---------------------------------------------------------------------------------------------------------------------
769//
771{
772 fpAlgo->fRecoTracks.clear();
773 fpAlgo->fRecoHits.clear();
774
775 for (auto& MC : fMCData.GetTrackContainer()) {
776 if (!MC.IsReconstructable()) continue;
777 if (!(MC.GetId() >= 0)) continue;
778
779 if (MC.GetNofHits() < 4) continue;
780
781 CaTrack algoTr;
782 algoTr.fNofHits = 0;
783
784 ca::Vector<int> hitIndices("CbmL1::hitIndices", fpAlgo->GetParameters().GetNstationsActive(), -1);
785
786 for (unsigned int iH : MC.GetHitIndexes()) {
787 const CbmL1HitDebugInfo& hit = fvHitDebugInfo[iH];
788 const int iStation = hit.GetStationId();
789 if (iStation >= 0) hitIndices[iStation] = iH;
790 }
791
792
793 for (int iH = 0; iH < fpAlgo->GetParameters().GetNstationsActive(); iH++) {
794 const int hitI = hitIndices[iH];
795 if (hitI < 0) continue;
796
797 // fpAlgo->fRecoHits.push_back(hitI);
798 algoTr.fNofHits++;
799 }
800
801
802 if (algoTr.fNofHits < 3) continue;
803
804 for (int iH = 0; iH < fpAlgo->GetParameters().GetNstationsActive(); iH++) {
805 const int hitI = hitIndices[iH];
806 if (hitI < 0) continue;
808 }
809
810 algoTr.fParFirst.X() = MC.GetStartX();
811 algoTr.fParFirst.Y() = MC.GetStartY();
812 algoTr.fParFirst.Z() = MC.GetStartZ();
813 algoTr.fParFirst.Tx() = MC.GetTx();
814 algoTr.fParFirst.Ty() = MC.GetTy();
815 algoTr.fParFirst.Qp() = MC.GetCharge() / MC.GetP();
816 algoTr.fParFirst.Time() = MC.GetStartT();
817 fpAlgo->fRecoTracks.push_back(algoTr);
818 }
819} // void CbmL1::IdealTrackFinder()
820
821
823
824// ---------------------------------------------------------------------------------------------------------------------
825//
826void CbmL1::DefineSTAPNames(const char* dirName)
827{
828 // FIXME: SZh 01.03.2023: Clean STAP names
829 namespace bfs = boost::filesystem;
830
831 if (fSTAPDataMode == 0) {
832 return;
833 }
834
835 // Define file prefix (/path/to/data/setup.reco.root -> "setup.reco")
836 bfs::path pathToRecoOutput = FairRunAna::Instance()->GetUserOutputFileName().Data();
837 fSTAPDataPrefix = pathToRecoOutput.filename().string();
838 fSTAPDataPrefix.ReplaceAll(".root", "");
839 fSTAPDataPrefix = fSTAPDataPrefix.Strip(TString::EStripType::kBoth, '.');
840
841 TString sDirName = TString(dirName);
842 if (sDirName.Length() == 0) {
843 fSTAPDataDir = pathToRecoOutput.parent_path().string();
844 }
845 else if (bfs::exists(sDirName.Data()) && bfs::is_directory(sDirName.Data())) {
846 fSTAPDataDir = sDirName;
847 }
848 else {
849 fSTAPDataDir = ".";
850 }
851
852 // TODO: Clean-up the names and pathes
853 if (fSTAPDataDir.Length() == 0) {
854 fSTAPDataDir = ".";
855 }
856
857 LOG(info) << "CbmL1: STAP data root directory is \033[1;32m" << bfs::system_complete(fSTAPDataDir.Data())
858 << "\033[0m";
859
860 if (fSTAPDataMode == 4) {
861 return;
862 }
863
864 // Directory for handling L1InputData objects
865 TString sInputDataDir = fSTAPDataDir + "/" + fSTAPDataPrefix + "_cainputdata";
866 if (!bfs::exists(sInputDataDir.Data())) {
867 LOG(warn) << "CbmL1: directory for tracking input data does not exist. It will be created";
868 bfs::create_directories(sInputDataDir.Data());
869 }
870 LOG(info) << "CbmL1: STAP tracking input jobs directory is \033[1;32m" << bfs::system_complete(sInputDataDir.Data())
871 << "\033[0m";
872}
873
874// ---------------------------------------------------------------------------------------------------------------------
875//
877{
878 TString filename = fSTAPParamFile.IsNull()
879 ? fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPParamSuffix.data())
881 fInitManager.WriteParametersObject(filename.Data());
882}
883
884// ---------------------------------------------------------------------------------------------------------------------
885//
886void CbmL1::WriteSTAPAlgoInputData(int iJob) // must be called after ReadEvent
887{
888 TString filename =
889 fSTAPDataDir + "/" + fSTAPDataPrefix + "_cainputdata/" + +TString::Format(kSTAPAlgoIDataSuffix.data(), iJob);
890
891 // Write file
892 fpIODataManager->WriteInputData(filename.Data());
893}
894
895// ---------------------------------------------------------------------------------------------------------------------
896//
897void CbmL1::WriteSTAPPerfInputData() // must be called after ReadEvent
898{
899 LOG(fatal) << "CbmL1: Running in standalone mode is not available at the moment. It will be updated soon...";
900}
901
902// ---------------------------------------------------------------------------------------------------------------------
903//
905{
906 TString filename = fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPParamSuffix.data());
907 fInitManager.ReadParametersObject(filename.Data());
908}
909
910// ---------------------------------------------------------------------------------------------------------------------
911//
913{
914 TString filename = fSTAPDataDir + "/" + TString(kSTAPAlgoIDataDir) + "/" + fSTAPDataPrefix + "."
915 + TString::Format(kSTAPAlgoIDataSuffix.data(), iJob);
916
917 // Read file
918 fpIODataManager->ReadInputData(filename.Data());
919}
920
921// ---------------------------------------------------------------------------------------------------------------------
922//
924{
925 LOG(fatal) << "CbmL1: Running in standalone mode is not available at the moment. It will be updated soon...";
926}
927
928// ---------------------------------------------------------------------------------------------------------------------
929//
930void CbmL1::DumpMaterialToFile(TString fileName)
931{
932 auto* currentFile = gFile;
933 TFile f = TFile{fileName, "RECREATE"};
934 f.cd();
935 // TODO: (!) replace CbmL1::Instance()->fpAlgo->GetParameters() with the cbm::ca::ParametersHandler::Instance()->Get()
936 // everywhere outside cbm::algo
937 const auto& activeTrackingSetup = CbmL1::Instance()->fpAlgo->GetParameters().GetActiveSetup();
938 for (int iSt = 0; iSt < activeTrackingSetup.GetNofLayers(); ++iSt) {
939 const auto& material = activeTrackingSetup.GetMaterial(iSt);
940 TString name = Form("tracking_station%d", iSt);
941 TString title = Form("Tracking station %d: Rad. thickness in %%. Z region [%.2f, %.2f] cm.", iSt,
942 material.GetZmin(), material.GetZmax());
944 title += " Horizontal projection.";
945 }
946 else {
947 title += " Radial projection.";
948 }
949 auto* h = ::kf::tools::RootUtils::ToHistogram(material, name, title);
950 h->SetStats(kFALSE);
951 h->SetDirectory(&f);
952 }
953 f.Write();
954 currentFile->cd();
955}
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:581
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:930
cbm::ca::tools::MCData fMCData
MC Data object.
Definition CbmL1.h:417
void WriteSTAPParamObject()
Writes initialized L1Parameters object to file "".
Definition CbmL1.cxx:876
void ReadSTAPPerfInputData()
Definition CbmL1.cxx:923
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:886
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:912
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:897
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:770
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:678
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:826
~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:904
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:752
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 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.