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