]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/macros/ConfigOCDB.C
store ntuple in same file as histos (Renu)
[u/mrichter/AliRoot.git] / TPC / macros / ConfigOCDB.C
CommitLineData
e100e17a 1//
c5b76244 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
e100e17a 12
13
78abca19 14
c5b76244 15void SetupCustom(Int_t run);
16
17void ConfigOCDB(Int_t crun=-1){
e100e17a 18 //
c5b76244 19 printf("SETUP OCBD for TPC\n");
e100e17a 20 //
c5b76244 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}
78abca19 34
c5b76244 35
36void SetupCustom(Int_t run){
37 //
38 //
39 // Custom part - to be empty once we are happy with the calibration
e100e17a 40 //
41 //
42 // Setup magnetic field
43 //
c5b76244 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;
3d5dfcdb 57 if (bzfac==0) { // force default magnetic field if 0 field used
58 bzfac=1;
59 bz=5;
60 }
4642ac4b 61 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", bzfac, 1., smag));
c5b76244 62
63 printf("\n\nSET EXB FIELD\t%f\n\n", -bz);
64 AliTPCcalibDB::Instance()->SetExBField(-bz);
e100e17a 65 //
66 //
c5b76244 67 // import geometry
e100e17a 68 //
c5b76244 69 //
70 TGeoManager::Import("/u/miranov/proof/geometry.root");
71 AliGeomManager::LoadGeometry("/u/miranov/proof/geometry.root");
e100e17a 72
78abca19 73 AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam();
74 AliTPCParam * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
c7568bc5 75 paramCl->SetInstance(paramCl);
c5b76244 76
e100e17a 77 //
c5b76244 78 // Setup reco param
e100e17a 79 //
c5b76244 80 AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
81 AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
82 transform->SetCurrentRecoParam(tpcRecoParam);
83 tpcRecoParam->SetUseRPHICorrection(kTRUE);
e100e17a 84 //
c5b76244 85 tpcRecoParam->SetUseRadialCorrection(kFALSE);
86 tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
78abca19 87 //
c5b76244 88 tpcRecoParam->SetUseSectorAlignment(kFALSE);
89 tpcRecoParam->SetUseDriftCorrectionTime(kFALSE);
90 tpcRecoParam->SetUseDriftCorrectionGY(kTRUE);
91 tpcRecoParam->SetUseGainCorrectionTime(kFALSE);
92 tpcRecoParam->SetUseFieldCorrection(kFALSE);
93 tpcRecoParam->SetUseExBCorrection(kTRUE);
78abca19 94 //
c5b76244 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");
e100e17a 104}
c5b76244 105
106