]>
Commit | Line | Data |
---|---|---|
1e8f773e | 1 | //____________________________________________________________________ |
2 | // | |
3 | // $Id$ | |
4 | // | |
5 | // Read in the geometry, and get alignment data from CDB, and apply | |
6 | // that to the geometry. | |
7 | // | |
9b48326f | 8 | /** Apply alignment to a geometry |
9 | @ingroup simple_script | |
10 | */ | |
1e8f773e | 11 | void |
12 | ApplyAlignment() | |
13 | { | |
14 | gSystem->Load("libFMDutil.so"); | |
15 | TGeoManager::Import("geometry.root"); | |
16 | ||
17 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
18 | cdb->SetDefaultStorage("local://cdb"); | |
19 | AliCDBEntry* align = cdb->Get("FMD/Align/Data"); | |
20 | if (align) { | |
21 | Info("ApplyAlignment","Got alignment data from CDB"); | |
22 | TClonesArray* array = dynamic_cast<TClonesArray*>(align->GetObject()); | |
23 | if (!array) { | |
24 | Warning("ApplyAlignement", "Invalid align data from CDB"); | |
25 | } | |
26 | else { | |
27 | Int_t nAlign = array->GetEntries(); | |
28 | for (Int_t i = 0; i < nAlign; i++) { | |
90dbf5fb | 29 | AliAlignObjParams* a = static_cast<AliAlignObjParams*>(array->At(i)); |
1e8f773e | 30 | if (!a->ApplyToGeometry()) { |
31 | Warning("ApplyAlignement", "Failed to apply alignment to %s", | |
32 | a->GetVolPath()); | |
33 | } | |
34 | } | |
35 | } | |
36 | } | |
37 | TCanvas* c = new TCanvas("Geometry", "Geometry"); | |
38 | c->SetFillColor(1); | |
39 | gGeoManager->GetTopVolume()->Draw(); | |
40 | } | |
41 | //____________________________________________________________________ | |
42 | // | |
43 | // EOF | |
44 | // |