]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/macros/ConfigOCDBAlien.C
doxy: TPC/macros root converted
[u/mrichter/AliRoot.git] / TPC / macros / ConfigOCDBAlien.C
CommitLineData
457c0713 1/// \file ConfigOCDBAlien.C
2///
3/// Macro to Setup OCDB
4/// This is just example macro - using the alien OCDB
5/// \author marian.ivanov@cern.ch
6/// To be used:
7/// 1. Before invocation of the calibration - in the calibration trains
8/// 2. To setup calibration viewer.
9///
10/// ConfigOCDB - setup default and specific data storage
11/// SetupCustom - user sepcific configuration
12/// - Values in local cache of OCDB are overwritten
0a6c54a1 13
14
15
16void SetupCustom(Int_t run);
17
18void ConfigOCDBAlien(Int_t crun=-1){
457c0713 19 ///
20
0a6c54a1 21 TGrid * alien = TGrid::Connect("alien://",0,0,"t");
22 printf("SETUP OCBD for TPC\n");
23 //
24 AliCDBManager::Instance()->SetDefaultStorage("raw://");
25
26 Int_t run =crun;
27 if (run<0) run =0;
28 AliCDBManager::Instance()->SetRun(run);
29 AliTPCcalibDB::Instance()->SetRun(run);
30 SetupCustom(run);
31}
32
33
34void SetupCustom(Int_t run){
457c0713 35 /// Custom part - to be empty once we are happy with the calibration
36 ///
37 /// Setup magnetic field - In future this should be part of GRP functionality
38
0a6c54a1 39 AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
40 Float_t current = 0;
41 Float_t bz = 0;
42 if (grp){
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);
46 }
47 else{
48 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
49 }
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
54 bzfac=1;
55 bz=5;
56 }
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);
61
62 AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam();
63 AliTPCParam * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
64 paramCl->SetInstance(paramCl);
65
66 if (TMath::Abs(bzfacOrig)<0.05){
67 tpcRecoParam->SetUseExBCorrection(kFALSE);
68 }
69 //
70 //
71 //
72 printf("END of SETUP OCBD for TPC\n");
73}
74
75