]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/MakeFMDFullMisAlignment.C
effc++ warnings
[u/mrichter/AliRoot.git] / FMD / MakeFMDFullMisAlignment.C
1 void MakeFMDFullMisAlignment()
2 {
3   // Create TClonesArray of full misalignment objects for FMD
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);
10
11   Bool_t  toCdb   = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
12   TString storage = gSystem->Getenv("STORAGE");
13   
14   if(toCdb) {
15     if(!storage.BeginsWith("local://") && 
16        !storage.BeginsWith("alien://")) {
17       Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data());
18       return;
19     }
20
21     AliCDBStorage* store = cdb->GetStorage(storage.Data());
22     if(!store){
23       Error(macroname,"Unable to open storage %s\n", storage.Data());
24       return;
25     }
26
27     AliCDBPath   path("GRP","Geometry","Data");
28     AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun());
29     if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
30
31     entry->SetOwner(0);
32     TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
33     AliGeomManager::SetGeometry(geom);
34   }else
35     //load geom from default CDB storage
36     AliGeomManager::LoadGeometry(); 
37   
38   gSystem->Load("libFMDutil.so");
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()));
48
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;
56 }