]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/MakeFMDResMisAlignment.C
.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / FMD / MakeFMDResMisAlignment.C
index db465efd89f024b8624c87de290df14a4a1a179c..e8953b64f4bd7a75172afb40241aaa69fc3b7109 100644 (file)
@@ -2,25 +2,33 @@ void MakeFMDResMisAlignment()
 {
   // Create TClonesArray of residual misalignment objects for FMD
   //
-  if(!gGeoManager) TGeoManager::Import("geometry.root");
-  
-  gSystem->Load("libFMDutil.so");
-  if(!gSystem->Getenv("$TOCDB")){
-    // save on file
-    AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","");
-  }else{
-    // save in CDB storage
-    const char* Storage = gSystem->Getenv("$STORAGE");
-    AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage);
-  }
+  const char* macroname = "MakeFMDResMisAlignment.C";
 
-  // fRunMax should be changed in the constructor
+  // Activate CDB storage and load geometry from CDB
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  cdb->SetRun(0);
 
-  faker.SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
-  faker.SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
-  faker.SetHalfDisplacement(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25);
-  faker.SetHalfRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
-  faker.Exec();
+  Bool_t    toCdb   = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
+  TString   storage = gSystem->Getenv("STORAGE");
+  TString   output  = "FMDfullMisalignment.root";
+  if(toCdb) output  = storage;
+  
+  gSystem->Load("libFMDutil");
+  AliFMDAlignFaker::GetGeometry(toCdb, storage);
+  AliFMDAlignFaker* faker = new AliFMDAlignFaker(AliFMDAlignFaker::kAll, 
+                                                "geometry.root", 
+                                                output.Data());
+  
 
+  faker->SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
+  faker->SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
+  faker->SetHalfDisplacement(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25);
+  faker->SetHalfRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
+  faker->Exec();
+  delete faker;
 
 }
+//
+// EOF
+//