00001
00002
00003
00004
00005
00006
00007
00011 void
00012 ApplyAlignment()
00013 {
00014 gSystem->Load("libFMDutil.so");
00015 TGeoManager::Import("geometry.root");
00016
00017 AliCDBManager* cdb = AliCDBManager::Instance();
00018 cdb->SetDefaultStorage("local://cdb");
00019 AliCDBEntry* align = cdb->Get("FMD/Align/Data");
00020 if (align) {
00021 Info("ApplyAlignment","Got alignment data from CDB");
00022 TClonesArray* array = dynamic_cast<TClonesArray*>(align->GetObject());
00023 if (!array) {
00024 Warning("ApplyAlignement", "Invalid align data from CDB");
00025 }
00026 else {
00027 Int_t nAlign = array->GetEntries();
00028 for (Int_t i = 0; i < nAlign; i++) {
00029 AliAlignObjAngles* a = static_cast<AliAlignObjAngles*>(array->At(i));
00030 if (!a->ApplyToGeometry()) {
00031 Warning("ApplyAlignement", "Failed to apply alignment to %s",
00032 a->GetVolPath());
00033 }
00034 }
00035 }
00036 }
00037 TCanvas* c = new TCanvas("Geometry", "Geometry");
00038 c->SetFillColor(1);
00039 gGeoManager->GetTopVolume()->Draw();
00040 }
00041
00042
00043
00044