Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions Detectors/MUON/MCH/Align/src/AlignmentSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class AlignmentTask
doReAlign = ic.options().get<bool>("do-realign");
Comment thread
pillot marked this conversation as resolved.
if (doReAlign) {
LOG(info) << "Re-alignment mode";
NewGeoFileName = ic.options().get<string>("geo-file-new");
}

if (mCCDBRequest) {
Expand All @@ -181,9 +182,9 @@ class AlignmentTask
LOG(fatal) << "No GRP file";
}

auto geoIdealFile = ic.options().get<string>("geo-file-ideal");
if (std::filesystem::exists(geoIdealFile)) {
base::GeometryManager::loadGeometry(geoIdealFile.c_str());
IdealGeoFileName = ic.options().get<string>("geo-file-ideal");
if (std::filesystem::exists(IdealGeoFileName)) {
base::GeometryManager::loadGeometry(IdealGeoFileName.c_str());
transformation = geo::transformationFromTGeoManager(*gGeoManager);
for (int i = 0; i < 156; i++) {
int iDEN = GetDetElemId(i);
Expand All @@ -193,9 +194,9 @@ class AlignmentTask
LOG(fatal) << "No ideal geometry";
}

auto geoRefFile = ic.options().get<string>("geo-file-ref");
if (std::filesystem::exists(geoRefFile)) {
base::GeometryManager::loadGeometry(geoRefFile.c_str());
RefGeoFileName = ic.options().get<string>("geo-file-ref");
if (std::filesystem::exists(RefGeoFileName)) {
base::GeometryManager::loadGeometry(RefGeoFileName.c_str());
transformation = geo::transformationFromTGeoManager(*gGeoManager);
for (int i = 0; i < 156; i++) {
int iDEN = GetDetElemId(i);
Expand Down Expand Up @@ -389,8 +390,8 @@ class AlignmentTask

// Load new geometry if we need to do re-align
if (doReAlign) {
if (NewGeoFileName != "") {
LOG(info) << "Loading re-alignment geometry";
LOG(info) << "Loading re-alignment geometry";
if (std::filesystem::exists(NewGeoFileName)) {
Comment thread
Elros60 marked this conversation as resolved.
Outdated
base::GeometryManager::loadGeometry(NewGeoFileName.c_str());
transformation = geo::transformationFromTGeoManager(*gGeoManager);
for (int i = 0; i < 156; i++) {
Expand Down Expand Up @@ -875,6 +876,7 @@ class AlignmentTask
const string mchFileName{"mchtracks.root"};
const string muonFileName{"muontracks.root"};
string outFileName{"Alignment"};
string IdealGeoFileName{""};
string RefGeoFileName{""};
string NewGeoFileName{""};
bool doAlign{false};
Expand Down Expand Up @@ -918,6 +920,7 @@ o2::framework::DataProcessorSpec getAlignmentSpec(bool disableCCDB)
outputSpecs,
AlgorithmSpec{o2::framework::adaptFromTask<AlignmentTask>(ccdbRequest)},
Options{{"geo-file-ref", VariantType::String, o2::base::NameConf::getAlignedGeomFileName(), {"Name of the reference geometry file"}},
{"geo-file-new", VariantType::String, "", {"Name of the new geometry file"}},
{"geo-file-ideal", VariantType::String, o2::base::NameConf::getGeomFileName(), {"Name of the ideal geometry file"}},
{"grp-file", VariantType::String, o2::base::NameConf::getGRPFileName(), {"Name of the grp file"}},
{"do-align", VariantType::Bool, false, {"Switch for alignment, otherwise only residuals will be stored"}},
Expand Down