Skip to content
Snippets Groups Projects

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

1 file
+ 35
0
Compare changes
  • Side-by-side
  • Inline
+ 35
0
 
 
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;
 
}
Loading