]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/macros/ConfigOCDB.C
- Adding initialisation of detector variable - Adding functions to get hadronic contr...
[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   if (bzfac==0) {  // force default magnetic field if 0 field used
58     bzfac=1;
59     bz=5;
60   }
61   TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", bzfac, 1., smag));
62
63   printf("\n\nSET EXB FIELD\t%f\n\n", -bz);
64   AliTPCcalibDB::Instance()->SetExBField(-bz);
65   //
66   //
67   // import geometry
68   //
69   //
70   TGeoManager::Import("/u/miranov/proof/geometry.root");
71   AliGeomManager::LoadGeometry("/u/miranov/proof/geometry.root");
72
73   AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam(); 
74   AliTPCParam   * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
75   paramCl->SetInstance(paramCl);
76
77   //
78   // Setup reco param
79   //
80   AliTPCTransform *transform     = AliTPCcalibDB::Instance()->GetTransform() ;
81   AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
82   transform->SetCurrentRecoParam(tpcRecoParam);
83   tpcRecoParam->SetUseRPHICorrection(kTRUE);
84   //
85   tpcRecoParam->SetUseRadialCorrection(kFALSE);
86   tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
87   //
88   tpcRecoParam->SetUseSectorAlignment(kFALSE);
89   tpcRecoParam->SetUseDriftCorrectionTime(kFALSE);
90   tpcRecoParam->SetUseDriftCorrectionGY(kTRUE);
91   tpcRecoParam->SetUseGainCorrectionTime(kFALSE);
92   tpcRecoParam->SetUseFieldCorrection(kFALSE);
93   tpcRecoParam->SetUseExBCorrection(kTRUE);
94   //
95   //
96   //
97   TFile fposcor("~/OCDB/calibUnlin.root");
98   AliTPCPointCorrection *pcorr = fposcor.Get("correction");
99   if (pcorr) pcorr->SetInstance(pcorr); 
100   //
101   //
102   //
103   printf("END of SETUP OCBD for TPC\n");
104 }
105
106