Possibility to fix some of the parameters. New method to get the number of free param...
[u/mrichter/AliRoot.git] / FMD / MakeFMDResMisAlignment.C
CommitLineData
1895a097 1void MakeFMDResMisAlignment()
2{
3 // Create TClonesArray of residual misalignment objects for FMD
4 //
6fce62af 5 const char* macroname = "MakeFMDResMisAlignment.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);
ffa78f64 11
12 Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
13 TString storage = gSystem->Getenv("STORAGE");
6fce62af 14
ffa78f64 15 if(toCdb) {
16 if(!storage.BeginsWith("local://") &&
17 !storage.BeginsWith("alien://")) {
18 Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data());
6fce62af 19 return;
20 }
ffa78f64 21
22 AliCDBStorage* store = cdb->GetStorage(storage.Data());
23 if(!store){
24 Error(macroname,"Unable to open storage %s\n", storage.Data());
6fce62af 25 return;
26 }
ffa78f64 27
28 AliCDBPath path("GRP","Geometry","Data");
29 AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun());
6fce62af 30 if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
ffa78f64 31
6fce62af 32 entry->SetOwner(0);
ffa78f64 33 TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
6fce62af 34 AliGeomManager::SetGeometry(geom);
ffa78f64 35 }else
36 //load geom from default CDB storage
37 AliGeomManager::LoadGeometry();
1895a097 38
39 gSystem->Load("libFMDutil.so");
ffa78f64 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()));
1895a097 49
ffa78f64 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
57}
ffa78f64 58//
59// EOF
60//