]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/MakeFMDZeroMisAlignment.C
Updated Detector Algorithm base class to write the conditions data to file. The class...
[u/mrichter/AliRoot.git] / FMD / MakeFMDZeroMisAlignment.C
CommitLineData
d3a9c52a 1void MakeFMDZeroMisAlignment()
2{
3 // Create TClonesArray of zero-misalignment objects for FMD
4 //
6fce62af 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);
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();
d3a9c52a 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()));
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;
d3a9c52a 57
58
59}