3 // This is just example macro - using the alien OCDB
4 // Responsible: marian.ivanov@cern.ch
6 // 1. Before invocation of the calibration - in the calibration trains
7 // 2. To setup calibration viewer.
9 // ConfigOCDB - setup default and specific data storage
10 // SetupCustom - user sepcific configuration
11 // - Values in local cache of OCDB are overwritten
15 void SetupCustom(Int_t run);
17 void ConfigOCDBAlien(Int_t crun=-1){
19 TGrid * alien = TGrid::Connect("alien://",0,0,"t");
20 printf("SETUP OCBD for TPC\n");
22 AliCDBManager::Instance()->SetDefaultStorage("raw://");
26 AliCDBManager::Instance()->SetRun(run);
27 AliTPCcalibDB::Instance()->SetRun(run);
32 void SetupCustom(Int_t run){
35 // Custom part - to be empty once we are happy with the calibration
38 // Setup magnetic field - In future this should be part of GRP functionality
40 AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
44 current = grp->GetL3Current((AliGRPObject::Stats)0);
45 bz = 5*current/30000.;
46 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
49 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
51 AliMagF::BMap_t smag = AliMagF::k5kG;
52 Double_t bzfac = bz/5;
53 Double_t bzfacOrig=bzfac;
54 if (TMath::Abs(bzfac)<0.01) { // force default magnetic field if 0 field used
58 AliMagF * magF = new AliMagF("Maps","Maps", 2, bzfac, 1., smag);
59 TGeoGlobalMagField::Instance()->SetField(magF);
60 printf("\n\nSET EXB FIELD\t\n\n");
61 AliTPCcalibDB::Instance()->SetExBField(magF);
63 AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam();
64 AliTPCParam * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
65 paramCl->SetInstance(paramCl);
67 if (TMath::Abs(bzfacOrig)<0.05){
68 tpcRecoParam->SetUseExBCorrection(kFALSE);
73 printf("END of SETUP OCBD for TPC\n");