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);
190 LOG(info) <<
"!!!!!!! " << bUseSTS;
215 std::string mainConfig = std::string(gSystem->Getenv(
"VMCWORKDIR")) +
"/macro/L1/configs/";
217 case ca::TrackingMode::kSts: mainConfig +=
"ca_params_sts.yaml";
break;
218 case ca::TrackingMode::kMcbm: mainConfig +=
"ca_params_mcbm.yaml";
break;
219 case ca::TrackingMode::kGlobal: mainConfig +=
"ca_params_global.yaml";
break;
232 int nMvdStationsGeom = (bGeoMVD) ? mvdInterface->GetNtrackingStations() : 0;
233 int nStsStationsGeom = (bGeoSTS) ? stsInterface->GetNtrackingStations() : 0;
234 int nMuchStationsGeom = (bGeoMUCH) ? muchInterface->GetNtrackingStations() : 0;
235 int nTrdStationsGeom = (bGeoTRD) ? trdInterface->GetNtrackingStations() : 0;
236 int nTofStationsGeom = (bGeoTOF) ? tofInterface->GetNtrackingStations() : 0;
242 if (FairRunAna::Instance()->GetField()) {
244 FairRunAna::Instance()->GetField()->GetFieldValue(inPos, outB);
290 auto* pTrackFinderTask =
dynamic_cast<CbmStsFindTracks*
>(FairRunAna::Instance()->GetTask(
"STSFindTracks"));
291 if (pTrackFinderTask) {
292 bUseMVD = pTrackFinderTask->MvdUsage();
301 std::vector<ca::StationInitializer> vStations;
302 vStations.reserve(100);
303 bool bDisableTime =
false;
307 for (
int iSt = 0; iSt < nMvdStationsGeom; ++iSt) {
310 stationInfo.SetStationType(1);
311 stationInfo.SetTimeInfo(!bDisableTime && mvdInterface->IsTimeInfoProvided(iSt));
312 stationInfo.SetFieldStatus(
fTrackingMode == ca::TrackingMode::kMcbm ? 0 : 1);
313 stationInfo.SetZref(mvdInterface->GetZref(iSt));
314 stationInfo.SetZmin(mvdInterface->GetZmin(iSt));
315 stationInfo.SetZmax(mvdInterface->GetZmax(iSt));
316 stationInfo.SetXmax(std::max(fabs(mvdInterface->GetXmax(iSt)), fabs(mvdInterface->GetXmin(iSt))));
317 stationInfo.SetYmax(std::max(fabs(mvdInterface->GetYmax(iSt)), fabs(mvdInterface->GetYmin(iSt))));
318 stationInfo.SetTrackingStatus(
true);
321 stationInfo.SetTrackingStatus(
false);
324 stationInfo.SetTrackingStatus(
false);
327 LOG(info) <<
"- MVD station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm ";
333 for (
int iSt = 0; iSt < nStsStationsGeom; ++iSt) {
336 stationInfo.SetStationType(0);
337 stationInfo.SetTimeInfo(!bDisableTime && stsInterface->IsTimeInfoProvided(iSt));
338 stationInfo.SetFieldStatus(ca::TrackingMode::kMcbm ==
fTrackingMode ? 0 : 1);
339 stationInfo.SetZref(stsInterface->GetZref(iSt));
340 stationInfo.SetZmin(stsInterface->GetZmin(iSt));
341 stationInfo.SetZmax(stsInterface->GetZmax(iSt));
342 stationInfo.SetXmax(std::max(fabs(stsInterface->GetXmax(iSt)), fabs(stsInterface->GetXmin(iSt))));
343 stationInfo.SetYmax(std::max(fabs(stsInterface->GetYmax(iSt)), fabs(stsInterface->GetYmin(iSt))));
345 stationInfo.SetTrackingStatus(
true);
348 stationInfo.SetTrackingStatus(
false);
351 stationInfo.SetTrackingStatus(
false);
354 LOG(info) <<
"- STS station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm ";
360 for (
int iSt = 0; iSt < nMuchStationsGeom; ++iSt) {
363 stationInfo.SetStationType(2);
364 stationInfo.SetTimeInfo(!bDisableTime && muchInterface->IsTimeInfoProvided(iSt));
365 stationInfo.SetFieldStatus(0);
366 stationInfo.SetZref(muchInterface->GetZref(iSt));
367 stationInfo.SetZmin(muchInterface->GetZmin(iSt));
368 stationInfo.SetZmax(muchInterface->GetZmax(iSt));
369 stationInfo.SetXmax(std::max(fabs(muchInterface->GetXmax(iSt)), fabs(muchInterface->GetXmin(iSt))));
370 stationInfo.SetYmax(std::max(fabs(muchInterface->GetYmax(iSt)), fabs(muchInterface->GetYmin(iSt))));
372 stationInfo.SetTrackingStatus(
true);
375 stationInfo.SetTrackingStatus(
false);
378 stationInfo.SetTrackingStatus(
false);
381 LOG(info) <<
"- MuCh station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm";
387 for (
int iSt = 0; iSt < nTrdStationsGeom; ++iSt) {
390 stationInfo.SetStationType(3);
391 stationInfo.SetTimeInfo(!bDisableTime && trdInterface->IsTimeInfoProvided(iSt));
392 stationInfo.SetFieldStatus(0);
393 stationInfo.SetZref(trdInterface->GetZref(iSt));
394 stationInfo.SetZmin(trdInterface->GetZmin(iSt));
395 stationInfo.SetZmax(trdInterface->GetZmax(iSt));
396 stationInfo.SetXmax(std::max(fabs(trdInterface->GetXmax(iSt)), fabs(trdInterface->GetXmin(iSt))));
397 stationInfo.SetYmax(std::max(fabs(trdInterface->GetYmax(iSt)), fabs(trdInterface->GetYmin(iSt))));
400 stationInfo.SetTimeInfo(
false);
402 stationInfo.SetTrackingStatus(
true);
405 stationInfo.SetTrackingStatus(
false);
408 stationInfo.SetTrackingStatus(
false);
411 LOG(info) <<
"- TRD station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm";
417 for (
int iSt = 0; iSt < nTofStationsGeom; ++iSt) {
420 stationInfo.SetStationType(4);
421 stationInfo.SetTimeInfo(!bDisableTime && tofInterface->IsTimeInfoProvided(iSt));
422 stationInfo.SetFieldStatus(0);
423 stationInfo.SetZref(tofInterface->GetZref(iSt));
424 stationInfo.SetZmin(tofInterface->GetZmin(iSt));
425 stationInfo.SetZmax(tofInterface->GetZmax(iSt));
426 stationInfo.SetXmax(std::max(fabs(tofInterface->GetXmax(iSt)), fabs(tofInterface->GetXmin(iSt))));
427 stationInfo.SetYmax(std::max(fabs(tofInterface->GetYmax(iSt)), fabs(tofInterface->GetYmin(iSt))));
429 stationInfo.SetTrackingStatus(
true);
432 stationInfo.SetTrackingStatus(
false);
435 stationInfo.SetTrackingStatus(
false);
438 LOG(info) <<
"- TOF station " << iSt <<
" at z = " << stationInfo.GetZref() <<
" cm";
453 geoTag = pSetup->GetProvider()->GetSetup().GetTag();
455 if (geoTag.IsNull()) {
494 LOG(info) <<
'\n' << parameters.ToString(1);
508 std::shared_ptr<ca::Parameters<float>> pParameters{
nullptr};
511 pParameters = std::make_shared<ca::Parameters<float>>(parameters);
518 fpTSReader = std::make_unique<TimeSliceReader>();
519 fpTSReader->SetDetector(ca::EDetectorID::kMvd, bUseMVD);
520 fpTSReader->SetDetector(ca::EDetectorID::kSts, bUseSTS);
521 fpTSReader->SetDetector(ca::EDetectorID::kMuch, bUseMUCH);
522 fpTSReader->SetDetector(ca::EDetectorID::kTrd, bUseTRD);
523 fpTSReader->SetDetector(ca::EDetectorID::kTof, bUseTOF);
535 fpMCModule->SetDetector(ca::EDetectorID::kMvd, bUseMVD);
536 fpMCModule->SetDetector(ca::EDetectorID::kSts, bUseSTS);
537 fpMCModule->SetDetector(ca::EDetectorID::kMuch, bUseMUCH);
538 fpMCModule->SetDetector(ca::EDetectorID::kTrd, bUseTRD);
539 fpMCModule->SetDetector(ca::EDetectorID::kTof, bUseTOF);
552 LOG(info) << pParameters->ToString(1);
553 LOG(info) <<
"----- Numbers of stations active in tracking -----";
554 LOG(info) <<
" MVD: " << pParameters->GetNstationsActive(ca::EDetectorID::kMvd);
555 LOG(info) <<
" STS: " << pParameters->GetNstationsActive(ca::EDetectorID::kSts);
556 LOG(info) <<
" MuCh: " << pParameters->GetNstationsActive(ca::EDetectorID::kMuch);
557 LOG(info) <<
" TRD: " << pParameters->GetNstationsActive(ca::EDetectorID::kTrd);
558 LOG(info) <<
" TOF: " << pParameters->GetNstationsActive(ca::EDetectorID::kTof);
559 LOG(info) <<
" Total: " << pParameters->GetNstationsActive();
561 fNStations = pParameters->GetNstationsActive();
567 const auto& activeSetup = pParameters->GetActiveSetup();
568 for (
int iSt = 0; iSt < activeSetup.GetNofLayers(); ++iSt) {
569 fMaterialMonitor.emplace_back(&(activeSetup.GetMaterial(iSt)), Form(
"Station %d", iSt));
583catch (
const std::exception& err) {
584 LOG(error) <<
"CbmL1: initialization failed. Reason: " << err.what();