scripts/ApplyAlignment.C

Go to the documentation of this file.
00001 //____________________________________________________________________
00002 //
00003 // $Id: ApplyAlignment.C,v 1.1 2006/03/21 12:58:10 cholm Exp $
00004 //
00005 // Read in the geometry, and get alignment data from CDB, and  apply
00006 // that to the geometry. 
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 // EOF
00044 // 

Generated on Fri Mar 24 17:11:21 2006 for ALICE FMD Off-line by  doxygen 1.4.6