141 char y[20] =
" [0;33;44m";
142 char Y[20] =
" [1;33;44m";
143 char W[20] =
" [1;37;44m";
144 char o[20] =
" [0m\n";
145 Y[0] =
y[0] = W[0] = o[0] = 0x1B;
146 std::stringstream ss;
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;
164 LOG(info) << ss.str();
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);
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);
213 std::string mainConfig = std::string(gSystem->Getenv(
"VMCWORKDIR")) +
"/macro/L1/configs/";
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;
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;
240 if (FairRunAna::Instance()->GetField()) {
242 FairRunAna::Instance()->GetField()->GetFieldValue(inPos, outB);
288 auto* pTrackFinderTask =
dynamic_cast<CbmStsFindTracks*
>(FairRunAna::Instance()->GetTask(
"STSFindTracks"));
289 if (pTrackFinderTask) {
290 bUseMVD = pTrackFinderTask->MvdUsage();
299 std::vector<ca::StationInitializer> vStations;
300 vStations.reserve(100);
301 bool bDisableTime =
false;
305 for (
int iSt = 0; iSt < nMvdStationsGeom; ++iSt) {
308 stationInfo.SetStationType(1);
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);
319 stationInfo.SetTrackingStatus(
false);
322 stationInfo.SetTrackingStatus(
false);
325 LOG(info) <<
"- MVD station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm ";
331 for (
int iSt = 0; iSt < nStsStationsGeom; ++iSt) {
334 stationInfo.SetStationType(0);
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))));
343 stationInfo.SetTrackingStatus(
true);
346 stationInfo.SetTrackingStatus(
false);
349 stationInfo.SetTrackingStatus(
false);
352 LOG(info) <<
"- STS station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm ";
358 for (
int iSt = 0; iSt < nMuchStationsGeom; ++iSt) {
361 stationInfo.SetStationType(2);
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))));
370 stationInfo.SetTrackingStatus(
true);
373 stationInfo.SetTrackingStatus(
false);
376 stationInfo.SetTrackingStatus(
false);
379 LOG(info) <<
"- MuCh station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm";
385 for (
int iSt = 0; iSt < nTrdStationsGeom; ++iSt) {
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))));
398 stationInfo.SetTimeInfo(
false);
400 stationInfo.SetTrackingStatus(
true);
403 stationInfo.SetTrackingStatus(
false);
406 stationInfo.SetTrackingStatus(
false);
409 LOG(info) <<
"- TRD station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm";
415 for (
int iSt = 0; iSt < nTofStationsGeom; ++iSt) {
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))));
427 stationInfo.SetTrackingStatus(
true);
430 stationInfo.SetTrackingStatus(
false);
433 stationInfo.SetTrackingStatus(
false);
436 LOG(info) <<
"- TOF station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm";
485 LOG(info) <<
'\n' << parameters.ToString(1);
499 std::shared_ptr<ca::Parameters<float>> pParameters{
nullptr};
502 pParameters = std::make_shared<ca::Parameters<float>>(parameters);
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);
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);
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();
552 fNStations = pParameters->GetNstationsActive();
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));
574catch (
const std::exception& err) {
575 LOG(error) <<
"CbmL1: initialization failed. Reason: " << err.what();