1 /// \file ConfigOCDBAlien.C
3 /// Macro to Setup OCDB
4 /// This is just example macro - using the alien OCDB
5 /// \author marian.ivanov@cern.ch
7 /// 1. Before invocation of the calibration - in the calibration trains
8 /// 2. To setup calibration viewer.
10 /// ConfigOCDB - setup default and specific data storage
11 /// SetupCustom - user sepcific configuration
12 /// - Values in local cache of OCDB are overwritten
16 void SetupCustom(Int_t run);
18 void ConfigOCDBAlien(Int_t crun=-1){
21 TGrid * alien = TGrid::Connect("alien://",0,0,"t");
22 printf("SETUP OCBD for TPC\n");
24 AliCDBManager::Instance()->SetDefaultStorage("raw://");
28 AliCDBManager::Instance()->SetRun(run);
29 AliTPCcalibDB::Instance()->SetRun(run);
34 void SetupCustom(Int_t run){
35 /// Custom part - to be empty once we are happy with the calibration
37 /// Setup magnetic field - In future this should be part of GRP functionality
39 AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
43 current = grp->GetL3Current((AliGRPObject::Stats)0);
44 bz = 5*current/30000.;
45 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
48 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
50 AliMagF::BMap_t smag = AliMagF::k5kG;
51 Double_t bzfac = bz/5;
52 Double_t bzfacOrig=bzfac;
53 if (TMath::Abs(bzfac)<0.01) { // force default magnetic field if 0 field used
57 AliMagF * magF = new AliMagF("Maps","Maps", 2, bzfac, 1., smag);
58 TGeoGlobalMagField::Instance()->SetField(magF);
59 printf("\n\nSET EXB FIELD\t\n\n");
60 AliTPCcalibDB::Instance()->SetExBField(magF);
62 AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam();
63 AliTPCParam * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
64 paramCl->SetInstance(paramCl);
66 if (TMath::Abs(bzfacOrig)<0.05){
67 tpcRecoParam->SetUseExBCorrection(kFALSE);
72 printf("END of SETUP OCBD for TPC\n");