]>
Commit | Line | Data |
---|---|---|
1 | void MakeFMDZeroMisAlignment() | |
2 | { | |
3 | // Create TClonesArray of zero-misalignment objects for FMD | |
4 | // | |
5 | const char* macroname = "MakeFMDZeroMisAlignment.C"; | |
6 | ||
7 | // Activate CDB storage and load geometry from CDB | |
8 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
9 | if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT"); | |
10 | cdb->SetRun(0); | |
11 | ||
12 | Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE"); | |
13 | TString storage = gSystem->Getenv("STORAGE"); | |
14 | ||
15 | if(toCdb) { | |
16 | if(!storage.BeginsWith("local://") && | |
17 | !storage.BeginsWith("alien://")) { | |
18 | Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data()); | |
19 | return; | |
20 | } | |
21 | ||
22 | AliCDBStorage* store = cdb->GetStorage(storage.Data()); | |
23 | if(!store){ | |
24 | Error(macroname,"Unable to open storage %s\n", storage.Data()); | |
25 | return; | |
26 | } | |
27 | ||
28 | AliCDBPath path("GRP","Geometry","Data"); | |
29 | AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun()); | |
30 | if(!entry) Fatal(macroname,"Could not get the specified CDB entry!"); | |
31 | ||
32 | entry->SetOwner(0); | |
33 | TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject()); | |
34 | AliGeomManager::SetGeometry(geom); | |
35 | }else | |
36 | //load geom from default CDB storage | |
37 | AliGeomManager::LoadGeometry(); | |
38 | ||
39 | gSystem->Load("libFMDutil.so"); | |
40 | AliFMDAlignFaker* faker = (toCdb ? | |
41 | // save on file | |
42 | new AliFMDAlignFaker(AliFMDAlignFaker::kAll, | |
43 | "geometry.root", | |
44 | "FMDfullMisalignment.root") : | |
45 | // save in CDB storage | |
46 | new AliFMDAlignFaker(AliFMDAlignFaker::kAll, | |
47 | "geometry.root", | |
48 | storage.Data())); | |
49 | ||
50 | ||
51 | faker->SetSensorDisplacement(0., 0., 0., 0., 0., 0.); | |
52 | faker->SetSensorRotation(0., 0., 0., 0., 0., 0.); | |
53 | faker->SetHalfDisplacement(0., 0., 0., 0., 0., 0.); | |
54 | faker->SetHalfRotation(0., 0., 0., 0., 0., 0.); | |
55 | faker->Exec(); | |
56 | delete faker; | |
57 | ||
58 | ||
59 | } |