Bool_t AliMC::MisalignGeometry()
{
// Call misalignment code if AliSimulation object was defined.
+
+ //Set alignable volumes for the whole geometry
+ SetAllAlignableVolumes();
+ // Misalign geometry via AliSimulation instance
if (!AliSimulation::GetInstance()) return kFALSE;
return AliSimulation::GetInstance()->MisalignGeometry(gAlice->GetRunLoader());
}
//=================Create Materials and geometry
gMC->Init();
- //Set alignable volumes for the whole geometry
- SetAllAlignableVolumes();
//Read the cuts for all materials
ReadTransPar();
//Build the special IMEDIA table
// then applied to the TGeo geometry.
// Finally an overlaps check is performed.
+ if (!gGeoManager || !gGeoManager->IsClosed()) {
+ AliError("Can't apply the misalignment! gGeoManager doesn't exist or it is still opened!");
+ return kFALSE;
+ }
Bool_t delRunLoader = kFALSE;
if (!runLoader) {
runLoader = LoadRun("READ");
}
// Export ideal geometry
- if (gGeoManager) gGeoManager->Export("geometry.root");
+ gGeoManager->Export("geometry.root");
// Load alignment data from CDB and apply to geometry through AliGeomManager
if(fLoadAlignFromCDB){
AliModule* det = (AliModule*) detArray->At(iDet);
if (!det || !det->IsActive()) continue;
if (IsSelected(det->GetName(), detStr)) {
- //add det to list of dets to be aligned from CDB
- loadAlObjsListOfDets += det->GetName();
- loadAlObjsListOfDets += " ";
+ //add det to list of dets to be aligned from CDB
+ loadAlObjsListOfDets += det->GetName();
+ loadAlObjsListOfDets += " ";
}
} // end loop over detectors
(AliGeomManager::Instance())->ApplyAlignObjsFromCDB(loadAlObjsListOfDets.Data());
// provided by the user. If yes, apply the objects
// to the present TGeo geometry
if (fAlignObjArray) {
- if (gGeoManager && gGeoManager->IsClosed()) {
- if ((AliGeomManager::Instance())->ApplyAlignObjsToGeom(fAlignObjArray) == kFALSE) {
- AliError("The misalignment of one or more volumes failed!"
- "Compare the list of simulated detectors and the list of detector alignment data!");
- if (delRunLoader) delete runLoader;
- return kFALSE;
- }
- }
- else {
- AliError("Can't apply the misalignment! gGeoManager doesn't exist or it is still opened!");
- if (delRunLoader) delete runLoader;
- return kFALSE;
+ if ((AliGeomManager::Instance())->ApplyAlignObjsToGeom(fAlignObjArray) == kFALSE) {
+ AliError("The misalignment of one or more volumes failed!"
+ "Compare the list of simulated detectors and the list of detector alignment data!");
+ if (delRunLoader) delete runLoader;
+ return kFALSE;
}
}
}
// Update the TGeoPhysicalNodes
gGeoManager->RefreshPhysicalNodes();
+ // Export (mis)aligned geometry
+ gGeoManager->Export("misaligned_geometry.root");
+
return kTRUE;
}
MisalignGeometry(runLoader);
#endif
- // Export (mis)aligned geometry
- if (gGeoManager) gGeoManager->Export("misaligned_geometry.root");
-
// AliRunLoader* runLoader = gAlice->GetRunLoader();
// if (!runLoader) {
// AliError(Form("gAlice has no run loader object. "