]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/macros/ConfigOCDBNoDrift.C
Removing obsolete macros
[u/mrichter/AliRoot.git] / TPC / macros / ConfigOCDBNoDrift.C
CommitLineData
3f086283 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
15void SetupCustom(Int_t run);
16
17void 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 Int_t run =crun;
27 if (run<0) run =0;
28 AliCDBManager::Instance()->SetRun(run);
29 SetupCustom(run);
30 AliTPCcalibDB::Instance()->SetRun(run);
31}
32
33
34void SetupCustom(Int_t run){
35 //
36 //
37 // Custom part - to be empty once we are happy with the calibration
38 //
39 //
40 // Setup magnetic field
41 //
42 AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
43 Float_t current = 0;
44 Float_t bz = 0;
45 if (grp){
46 current = grp->GetL3Current((AliGRPObject::Stats)0);
47 bz = 5*current/30000.;
48 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
49 }
50 else{
51 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
52 }
53 AliMagF::BMap_t smag = AliMagF::k5kG;
54 Double_t bzfac = bz/5;
55 Double_t bzfacOrig=bzfac;
56 if (TMath::Abs(bzfac)<0.01) { // force default magnetic field if 0 field used
57 bzfac=1;
58 bz=5;
59 }
60 AliMagF* magF= new AliMagF("Maps","Maps", bzfac, 1., smag);
61 TGeoGlobalMagField::Instance()->SetField(magF);
62 printf("\n\nSET EXB FIELD\t\n\n");
63 AliTPCcalibDB::Instance()->SetExBField(magF);
64 //
65 //
66 // import geometry
67 //
68 //
69 TGeoManager::Import("/u/miranov/proof/geometry.root");
70 AliGeomManager::LoadGeometry("/u/miranov/proof/geometry.root");
71
72 AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam();
73 AliTPCParam * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
74 paramCl->SetInstance(paramCl);
75
76 //
77 // Setup reco param
78 //
79 AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
80 AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
81 transform->SetCurrentRecoParam(tpcRecoParam);
82 tpcRecoParam->SetUseGainCorrectionTime(0);
83 tpcRecoParam->SetUseRPHICorrection(kTRUE);
84 tpcRecoParam->SetUseTOFCorrection(kFALSE);
85 //
86 tpcRecoParam->SetUseDriftCorrectionTime(0);
87 tpcRecoParam->SetUseDriftCorrectionGY(0);
88 //
89 tpcRecoParam->SetUseRadialCorrection(kFALSE);
90 tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
91 //
92 tpcRecoParam->SetUseSectorAlignment(kFALSE);
93 tpcRecoParam->SetUseGainCorrectionTime(kFALSE);
94 tpcRecoParam->SetUseFieldCorrection(kFALSE);
95 tpcRecoParam->SetUseExBCorrection(kTRUE);
96 if (TMath::Abs(bzfacOrig)<0.05){
97 tpcRecoParam->SetUseExBCorrection(kFALSE);
98 }
99 //
100 //
101 //
102 TFile fposcor("~/OCDB/calibUnlin.root");
103 AliTPCPointCorrection *pcorr = fposcor.Get("correction");
104 if (pcorr) pcorr->SetInstance(pcorr);
105 //
106 //
107 //
108 printf("END of SETUP OCBD for TPC\n");
109}
110
111