]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/scripts/OCDBscan/jdl/ConfigOCDB.C
macro to run on alien
[u/mrichter/AliRoot.git] / TPC / scripts / OCDBscan / jdl / ConfigOCDB.C
1 //
2 //
3 // Macro to Setup OCDB for calibration scan
4 // By default - all entries taken from the AliEn OCDB storage 
5 // This is just example macro
6 // Responsible: marian.ivanov@cern.ch
7
8  
9
10 void ConfigOCDB(Int_t run=-1){
11   // 
12   printf("SETUP OCBD for TPC\n");
13   //
14   AliCDBManager::Instance()->SetDefaultStorage("raw://");  
15
16   printf("setting run to %d\n",run);
17   if (run<0) run =0;
18   AliCDBManager::Instance()->SetRun(run);
19
20   // magnetic field
21   if ( !TGeoGlobalMagField::Instance()->GetField() ) {
22     printf("Loading field map...\n");
23     AliGRPManager grpMan;
24     if( !grpMan.ReadGRPEntry() ) {
25       printf("Cannot get GRP entry\n");
26     }
27     if( !grpMan.SetMagField() ) {
28       printf("Problem with magnetic field setup\n");
29     }
30   }
31   if ( !TGeoGlobalMagField::Instance()->GetField()){
32     AliMagF::BMap_t smag = AliMagF::k5kG;
33     Double_t bzfac = 1;
34     AliMagF* magF= new AliMagF("Maps","Maps", bzfac, 1., smag);
35     TGeoGlobalMagField::Instance()->SetField(magF);
36   }
37
38   AliTPCcalibDB::Instance()->SetRun(run); 
39 }
40
41
42