]>
Commit | Line | Data |
---|---|---|
c2fc1258 | 1 | //____________________________________________________________________ |
2 | // | |
3 | // $Id$ | |
4 | // | |
5 | // Read in the geometry, and get alignment data from CDB, and apply | |
6 | // that to the geometry. | |
7 | // | |
8 | /** Print alignment to a geometry | |
9 | @ingroup simple_script | |
10 | */ | |
11 | #include <iomanip> | |
12 | void | |
13 | PrintAlignment() | |
14 | { | |
15 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
162637e4 | 16 | cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
c2fc1258 | 17 | AliCDBEntry* align = cdb->Get("FMD/Align/Data"); |
18 | if (!align) { | |
19 | Error("PrintAlignment","didn't alignment data from CDB"); | |
20 | return; | |
21 | } | |
22 | ||
23 | TClonesArray* array = dynamic_cast<TClonesArray*>(align->GetObject()); | |
24 | if (!array) { | |
25 | Warning("PrintAlignement", "Invalid align data from CDB"); | |
26 | return; | |
27 | } | |
28 | Int_t nAlign = array->GetEntries(); | |
29 | for (Int_t i = 0; i < nAlign; i++) { | |
90dbf5fb | 30 | AliAlignObjParams* a = static_cast<AliAlignObjParams*>(array->At(i)); |
c2fc1258 | 31 | Double_t ang[3]; |
32 | Double_t trans[3]; | |
33 | a->GetAngles(ang); | |
34 | a->GetTranslation(trans); | |
35 | std::cout << a->GetVolPath() << "\n" | |
36 | << " translation: " | |
37 | << "(" << std::setw(12) << trans[0] | |
38 | << "," << std::setw(12) << trans[1] | |
39 | << "," << std::setw(12) << trans[2] << ")\n" | |
40 | << " rotation: " | |
41 | << "(" << std::setw(12) << ang[0] | |
42 | << "," << std::setw(12) << ang[1] | |
43 | << "," << std::setw(12) << ang[2] << ")" << std::endl; | |
44 | // a->Print(); | |
45 | } | |
46 | } | |
47 | //____________________________________________________________________ | |
48 | // | |
49 | // EOF | |
50 | // |