]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/MakeFMDResMisAlignment.C
Process codes corrected/completed.
[u/mrichter/AliRoot.git] / FMD / MakeFMDResMisAlignment.C
1 void MakeFMDResMisAlignment()
2 {
3   // Create TClonesArray of residual misalignment objects for FMD
4   //
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);
11   
12   TString Storage;
13   
14   if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
15     Storage = gSystem->Getenv("STORAGE");
16     if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
17       Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
18       return;
19     }
20     AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
21     if(!storage){
22       Error(macroname,"Unable to open storage %s\n",Storage.Data());
23       return;
24     }
25     AliCDBPath path("GRP","Geometry","Data");
26     AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
27     if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
28     entry->SetOwner(0);
29     TGeoManager* geom = (TGeoManager*) entry->GetObject();
30     AliGeomManager::SetGeometry(geom);
31   }else{
32     AliGeomManager::LoadGeometry(); //load geom from default CDB storage
33   }    
34   
35   gSystem->Load("libFMDutil.so");
36   if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
37     // save on file
38     AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDresidualMisalignment.root");
39   }else{
40     // save in CDB storage
41     AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage.Data());
42   }
43
44   // fRunMax should be changed in the constructor
45
46   faker.SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
47   faker.SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
48   faker.SetHalfDisplacement(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25);
49   faker.SetHalfRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
50   faker.Exec();
51
52
53 }