Default OCDB setup (Jens)
authormivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Jun 2013 16:20:20 +0000 (16:20 +0000)
committermivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Jun 2013 16:20:20 +0000 (16:20 +0000)
TPC/Upgrade/macros/ConfigOCDB.C [new file with mode: 0644]

diff --git a/TPC/Upgrade/macros/ConfigOCDB.C b/TPC/Upgrade/macros/ConfigOCDB.C
new file mode 100644 (file)
index 0000000..b0b67d2
--- /dev/null
@@ -0,0 +1,27 @@
+void SetupOCDB(Int_t run=0) {
+  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  AliCDBManager::Instance()->SetRun(run);
+  // magnetic field
+  if ( !TGeoGlobalMagField::Instance()->GetField() ) {
+    printf("Loading field map...\n");
+    AliGRPManager grpMan;
+    if( !grpMan.ReadGRPEntry() ) {
+      printf("Cannot get GRP entry\n");
+    }
+    if( !grpMan.SetMagField() ) {
+      printf("Problem with magnetic field setup\n");
+    }
+  }
+  if ( !TGeoGlobalMagField::Instance()->GetField()){
+    AliMagF::BMap_t smag = AliMagF::k5kG;
+    Double_t bzfac = 1;
+    AliMagF* magF= new AliMagF("Maps","Maps", bzfac, 1., smag);
+    TGeoGlobalMagField::Instance()->SetField(magF);
+  }
+  //TPC calib
+  AliTPCcalibDB::Instance()->SetRun(run);
+  //geometry
+  AliGeomManager::LoadGeometry();
+}
+
+