46 LOG(info) <<
"cbm::kf::TrackingGeoSetupFactory: initializing ...";
52 throw std::runtime_error(
"cbm::RecoSetupManager not initialized");
58 fBuilder.SetFieldFunction(GlobalField::fgOriginalField, GlobalField::fgOriginalFieldType);
62 auto GuessFieldType = [&](
double z) -> EFieldType {
63 auto [Bx, By, Bz] = GlobalField::fgOriginalField(0., 0., z);
64 double absBsq = Bx * Bx + By * By + Bz * Bz;
65 return absBsq < MinField<double> * MinField<double> ? EFieldType::Null : EFieldType::Normal;
69 auto CollectStations = [&](
const auto* pIfs,
EDetectorID detID) ->
void {
73 for (
int iSt = 0; iSt < pIfs->GetNofTrackingStations(); ++iSt) {
74 const auto& actVol = pIfs->GetActiveVolume(iSt);
75 const auto& fullVol = pIfs->GetFullVolume(iSt);
77 .detId =
static_cast<int>(detID),
79 .zRef = actVol.GetCenterZ(),
80 .zMin = fullVol.GetMinZ(),
81 .zMax = fullVol.GetMaxZ(),
82 .xMinFull = fullVol.GetMinX(),
83 .xMaxFull = fullVol.GetMaxX(),
84 .yMinFull = fullVol.GetMinY(),
85 .yMaxFull = fullVol.GetMaxY(),
86 .xMinAct = actVol.GetMinX(),
87 .xMaxAct = actVol.GetMaxX(),
88 .yMinAct = actVol.GetMinY(),
89 .yMaxAct = actVol.GetMaxY(),
90 .fieldType = GuessFieldType(actVol.GetCenterZ()),
91 .timeInfo = pIfs->IsTimeInfoProvided(iSt)
97 CollectStations(recoSetup.GetMvd(), EDetectorID::kMvd);
98 CollectStations(recoSetup.GetSts(), EDetectorID::kSts);
99 CollectStations(recoSetup.GetMuch(), EDetectorID::kMuch);
100 CollectStations(recoSetup.GetTrd(), EDetectorID::kTrd);
101 CollectStations(recoSetup.GetTof(), EDetectorID::kTof);
105 fBuilder.SetTargetProperty(pTarget->GetX(), pTarget->GetY(), pTarget->GetZ(), pTarget->GetDz(), pTarget->GetRmax());
108 auto pMaterialFactory = std::make_shared<MaterialMapFactory>();
110 pMaterialFactory->SetDoRadialProjection(pTarget->GetZ());
112 fBuilder.SetMaterialMapFactory(pMaterialFactory);
115 LOG(info) <<
"cbm::kf::TrackingGeoSetupFactory: initializing ... done";
117catch (
const std::exception& err) {
118 LOG(fatal) <<
"cbm::kf::TrackingGeoSetupFactory: initializing ... failed. Reason: " << err.what();
126 LOG(info) <<
"TrackingGeoSetupFactory: detector subsystems in geometry: ";
130 if (requireHitPresence) {
132 LOG(info) << fmt::format(
"\t{:6} in geometry: {:5}, has hits: {:5}", std::string(
cbm::util::ToString(modId)),
137 LOG(info) << fmt::format(
"\t{:6} in geometry: {:5}", std::string(
cbm::util::ToString(modId)),
142 Check(EDetectorID::kMvd);
143 Check(EDetectorID::kSts);
144 Check(EDetectorID::kMuch);
145 Check(EDetectorID::kTrd);
146 Check(EDetectorID::kTof);