]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/macros/ConfigOCDB.C
THIS IS EXAMPLE MACRO:
[u/mrichter/AliRoot.git] / TPC / macros / ConfigOCDB.C
1 //
2 // Macro to Setup OCDB  
3 // This is just example macro
4 // Responsible: marian.ivanov@cern.ch
5 // To be used:
6 // 1. Before invocation of the calibration - in the calibration trains
7 // 2. To setup calibration viewer.
8 //  
9 // ConfigOCDB  - setup default and specific data storage
10 // SetupCustom - user sepcific configuration 
11 //             - Values in local cache of OCDB are overwritten
12
13
14
15 void SetupCustom(Int_t run);
16
17 void ConfigOCDB(Int_t crun=-1){
18   // 
19   printf("SETUP OCBD for TPC\n");
20   //
21   AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
22   AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Parameters","local://$ALICE_ROOT/OCDB");
23   AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/ClusterParam","local:///u/miranov/OCDB/TPCcosmic2/");
24   AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/PadTime0","local://$ALICE_ROOT/OCDB");
25   AliCDBManager::Instance()->SetSpecificStorage("GRP/GRP/Data","local:///lustre/alice/alien/alice/data/2009/OCDB/");
26   AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Temperature","local:///lustre/alice/alien/alice/data/2009/OCDB/");
27   AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Goofie","local:///lustre/alice/alien/alice/data/2009/OCDB/");
28   AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/HighVoltage","local:///lustre/alice/alien/alice/data/2009/OCDB/");
29   Int_t run =crun;
30   if (run<0) run =0;
31   AliCDBManager::Instance()->SetRun(run);
32   SetupCustom(run);
33 }
34
35
36 void SetupCustom(Int_t run){
37   //
38   //
39   // Custom part - to be empty once we are happy with the calibration
40   //
41   //
42   // Setup magnetic field
43   //
44   AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
45   Float_t current = 0;
46   Float_t bz      = 0;
47   if (grp){
48     current = grp->GetL3Current((AliGRPObject::Stats)0);
49     bz = 5*current/30000.;
50     printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
51   }
52   else{
53     printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
54   }
55   AliMagF::BMap_t smag = AliMagF::k5kG;
56   Double_t bzfac = bz/5;
57   TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, bzfac, 1., 10., smag));
58
59   printf("\n\nSET EXB FIELD\t%f\n\n", -bz);
60   AliTPCcalibDB::Instance()->SetExBField(-bz);
61   //
62   //
63   // import geometry
64   //
65   //
66   TGeoManager::Import("/u/miranov/proof/geometry.root");
67   AliGeomManager::LoadGeometry("/u/miranov/proof/geometry.root");
68
69   AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam(); 
70   AliTPCParam   * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
71   paramCl->SetInstance(paramCl);
72
73   //
74   // Setup reco param
75   //
76   AliTPCTransform *transform     = AliTPCcalibDB::Instance()->GetTransform() ;
77   AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
78   transform->SetCurrentRecoParam(tpcRecoParam);
79   tpcRecoParam->SetUseRPHICorrection(kTRUE);
80   //
81   tpcRecoParam->SetUseRadialCorrection(kFALSE);
82   tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
83   //
84   tpcRecoParam->SetUseSectorAlignment(kFALSE);
85   tpcRecoParam->SetUseDriftCorrectionTime(kFALSE);
86   tpcRecoParam->SetUseDriftCorrectionGY(kTRUE);
87   tpcRecoParam->SetUseGainCorrectionTime(kFALSE);
88   tpcRecoParam->SetUseFieldCorrection(kFALSE);
89   tpcRecoParam->SetUseExBCorrection(kTRUE);
90   //
91   //
92   //
93   TFile fposcor("~/OCDB/calibUnlin.root");
94   AliTPCPointCorrection *pcorr = fposcor.Get("correction");
95   if (pcorr) pcorr->SetInstance(pcorr); 
96   //
97   //
98   //
99   printf("END of SETUP OCBD for TPC\n");
100 }
101
102