1 void ApplyAlignment(const char* fileMA)
3 // apply ITSU alignment from the file
6 if (!gSystem->AccessPathName("geometry.root")) {
7 printf("Loading geometry.root from current directory\n");
8 AliGeomManager::LoadGeometry("geometry.root"); //load geom from default CDB storage
11 printf("No geometry in memory and not geometry.root in current directory\n");
16 if (gGeoManager->IsLocked()) {
17 printf("There is geometry in memory but it is locked");
22 TFile* fl = TFile::Open(fileMA);
24 printf("Failed to open misalignments file %s\n",fileMA);
26 TClonesArray* arr = (TClonesArray*)fl->Get("ITSUAlignObjs");
28 AliCDBEntry* cdbe = (AliCDBEntry*) fl->Get("AliCDBEntry");
30 printf("File %s does not contain recognizable misalignment\n",fileMA);
33 arr = (TClonesArray*)cdbe->GetObject();
36 if (!arr->IsA()==TClonesArray::Class()) {
37 printf("The object in %s is not TClonesArray\n",fileMA);
40 printf("Applying misalignment from %s geometry in memory\n",fileMA);
41 AliGeomManager::ApplyAlignObjsToGeom(*arr);
42 gGeoManager->LockGeometry();