]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/scripts/OCDBscan/ConfigOCDB.C
Moving the OCDBscan scripts to the subdirectory
[u/mrichter/AliRoot.git] / TPC / scripts / OCDBscan / 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:///lustre/alice/alien/alice/data/2009/OCDB/");
22   
23   //
24   // custom calibration to test before committing
25   //
26
27  AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/GainFactorDedx","local:///lustre/alice/akalweit/OCDB"); 
28  AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/ClusterParam","local:///lustre/alice/akalweit/OCDB");
29  
30  AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeGainKrypton","local:///lustre/alice/miranov/OCDB");
31  
32  AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeDrift","local:///lustre/alice/miranov/rec/LHC09c/calibAlienNoDrift/mergerunMagAll.list/OCDB");
33  // AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeGain","local:///lustre/alice/akalweit/OCDB");  
34  AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeGain","local:///lustre/alice/miranov/rec/LHC09c/calibAlienNoDrift/mergerunMagN0.list");
35 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Ref","local://$ALICE_ROOT/OCDB");
36
37   Int_t run =crun;
38   if (run<0) run =0;
39   AliCDBManager::Instance()->SetRun(run);
40   SetupCustom(run);
41 }
42
43
44 void SetupCustom(Int_t run){
45   //
46   //
47   // Custom part - to be empty once we are happy with the calibration
48   //
49   //
50   // Setup magnetic field
51   //
52   AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
53   Float_t current = 0;
54   Float_t bz      = 0;
55   if (grp){
56     current = grp->GetL3Current((AliGRPObject::Stats)0);
57     bz = 5*current/30000.;
58     printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
59   }
60   else{
61     printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
62   }
63   AliMagF::BMap_t smag = AliMagF::k5kG;
64   Double_t bzfac = bz/5;
65   if (bzfac==0) {  // force default magnetic field if 0 field used
66     bzfac=1;
67     bz=5;
68   }
69   AliMagF * magF = new AliMagF("Maps","Maps", 2, bzfac, 1., 10., smag);
70   TGeoGlobalMagField::Instance()->SetField(magF);
71   printf("\n\nSET EXB FIELD\t%f\n\n", );
72   AliTPCcalibDB::Instance()->SetExBField(magF);
73   //
74   //
75   // import geometry
76   //
77   //
78   TGeoManager::Import("/u/miranov/proof/geometry.root");
79   AliGeomManager::LoadGeometry("/u/miranov/proof/geometry.root");
80
81   AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam(); 
82   AliTPCParam   * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
83   paramCl->SetInstance(paramCl);
84
85   //
86   // Setup reco param
87   //
88   AliTPCTransform *transform     = AliTPCcalibDB::Instance()->GetTransform() ;
89   AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
90   transform->SetCurrentRecoParam(tpcRecoParam);
91   tpcRecoParam->SetUseRPHICorrection(kTRUE);
92   //
93   tpcRecoParam->SetUseRadialCorrection(kFALSE);
94   tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
95   //
96   tpcRecoParam->SetUseSectorAlignment(kFALSE);
97   tpcRecoParam->SetUseDriftCorrectionTime(kFALSE);
98   tpcRecoParam->SetUseDriftCorrectionGY(kTRUE);
99   tpcRecoParam->SetUseGainCorrectionTime(kFALSE);
100   tpcRecoParam->SetUseFieldCorrection(kFALSE);
101   tpcRecoParam->SetUseExBCorrection(kTRUE);
102   //
103   //
104   //
105   TFile fposcor("~/OCDB/calibUnlin.root");
106   AliTPCPointCorrection *pcorr = fposcor.Get("correction");
107   if (pcorr) pcorr->SetInstance(pcorr); 
108   //
109   //
110   //
111   printf("END of SETUP OCBD for TPC\n");
112 }
113
114