Skip to content
Snippets Groups Projects
Commit c6054144 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

Add macro to print/dump alignment matrices in human readable text form

parent 8a605400
No related branches found
No related tags found
1 merge request!239Add macro to print/dump alignment matrices in human readable text form
Pipeline #33698 passed
Bool_t print_alignment( std::string geoSetupTag )
{
TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory
TString alignmentMatrixFileName = srcDir + "/parameters/mcbm/AlignmentMatrices_" + geoSetupTag + ".root";
if (alignmentMatrixFileName.Length() != 0) {
std::cout << "Reading alignment for file " << alignmentMatrixFileName << std::endl;
// Define the basic structure which needs to be filled with information
// This structure is stored in the output file and later passed to the
// FairRoot framework to do the (miss)alignment
std::map<std::string, TGeoHMatrix>* matrices{nullptr};
// read matrices from disk
std::cout << "Filename: " << alignmentMatrixFileName << std::endl;
TFile* misalignmentMatrixRootfile = new TFile(alignmentMatrixFileName, "READ");
if (misalignmentMatrixRootfile->IsOpen()) {
gDirectory->GetObject("MisalignMatrices", matrices);
misalignmentMatrixRootfile->Close();
for( auto it = matrices->begin(); it != matrices->end(); ++it) {
std::cout << "===========================" << std::endl;
std::cout << it->first << std::endl;
it->second.Print();
std::cout << "===========================" << std::endl;
}
}
else {
std::cout << "Could not open file " << alignmentMatrixFileName << "\n Exiting" << std::endl;
return kFALSE;
}
}
return kTRUE;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment