@@ -483,21 +483,33 @@ o2::base::MatBudget GeometryManager::meanMaterialBudget(float x0, float y0, floa
483483 return o2::base::MatBudget (budTotal);
484484}
485485
486+ // _________________________________
487+ void GeometryManager::applyMisalignent (bool applyMisalignment)
488+ {
489+ // /< load geometry from file
490+ if (!isGeometryLoaded ()) {
491+ LOG (FATAL) << " geometry is not loaded" ;
492+ }
493+ if (applyMisalignment) {
494+ auto & aligner = Aligner::Instance ();
495+ aligner.applyAlignment ();
496+ }
497+ }
498+
486499// _________________________________
487500void GeometryManager::loadGeometry (std::string_view geomFileName, bool applyMisalignment)
488501{
489502 // /< load geometry from file
490503 std::string fname = o2::base::NameConf::getGeomFileName (geomFileName);
491- LOG (INFO) << " Loading geometry " << o2::base::NameConf::GEOMOBJECTNAME << " from " << fname;
504+ LOG (INFO) << " Loading geometry from " << fname;
492505 TFile flGeom (fname.data ());
493506 if (flGeom.IsZombie ()) {
494507 LOG (FATAL) << " Failed to open file " << fname;
495508 }
496- if (!flGeom.Get (std::string (o2::base::NameConf::GEOMOBJECTNAME).c_str ())) {
497- LOG (FATAL) << " Did not find geometry named " << o2::base::NameConf::GEOMOBJECTNAME;
498- }
499- if (applyMisalignment) {
500- auto & aligner = Aligner::Instance ();
501- aligner.applyAlignment ();
509+ // try under the standard CCDB name
510+ if (!flGeom.Get (std::string (o2::base::NameConf::CCDBOBJECT).c_str ()) &&
511+ !flGeom.Get (std::string (o2::base::NameConf::GEOMOBJECTNAME_FAIR).c_str ())) {
512+ LOG (FATAL) << " Did not find geometry named " << o2::base::NameConf::CCDBOBJECT << " or " << o2::base::NameConf::GEOMOBJECTNAME_FAIR;
502513 }
514+ applyMisalignent (applyMisalignment);
503515}
0 commit comments