3 /// Macro to Setup OCDB
4 /// This is just example macro
5 /// \author marian.ivanov@cern.ch
7 /// 1. Before invocation of the calibration - in the calibration trains
8 /// 2. To setup calibration viewer.
10 /// ConfigOCDB - setup default and specific data storage
11 /// SetupCustom - user sepcific configuration
12 /// - Values in local cache of OCDB are overwritten
16 void SetupCustom(Int_t run);
18 void ConfigOCDB(Int_t crun=-1){
21 printf("SETUP OCBD for TPC\n");
23 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
24 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Parameters","local://$ALICE_ROOT/OCDB");
25 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/ClusterParam","local:///u/miranov/OCDB/TPCcosmic2/");
26 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/PadTime0","local://$ALICE_ROOT/OCDB");
27 AliCDBManager::Instance()->SetSpecificStorage("GRP/GRP/Data","local:///lustre/alice/alien/alice/data/2009/OCDB/");
28 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Temperature","local:///lustre/alice/alien/alice/data/2009/OCDB/");
29 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Goofie","local:///lustre/alice/alien/alice/data/2009/OCDB/");
30 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/HighVoltage","local:///lustre/alice/alien/alice/data/2009/OCDB/");
33 AliCDBManager::Instance()->SetRun(run);
38 void SetupCustom(Int_t run){
39 /// Custom part - to be empty once we are happy with the calibration
41 /// Setup magnetic field
43 AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
47 current = grp->GetL3Current((AliGRPObject::Stats)0);
48 bz = 5*current/30000.;
49 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
52 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
54 AliMagF::BMap_t smag = AliMagF::k5kG;
55 Double_t bzfac = bz/5;
56 if (bzfac==0) { // force default magnetic field if 0 field used
60 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", bzfac, 1., smag));
62 printf("\n\nSET EXB FIELD\t%f\n\n", -bz);
63 AliTPCcalibDB::Instance()->SetExBField(-bz);
69 TGeoManager::Import("/u/miranov/proof/geometry.root");
70 AliGeomManager::LoadGeometry("/u/miranov/proof/geometry.root");
72 AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam();
73 AliTPCParam * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
74 paramCl->SetInstance(paramCl);
79 AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
80 AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
81 transform->SetCurrentRecoParam(tpcRecoParam);
82 tpcRecoParam->SetUseRPHICorrection(kTRUE);
84 tpcRecoParam->SetUseRadialCorrection(kFALSE);
85 tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
87 tpcRecoParam->SetUseSectorAlignment(kFALSE);
88 tpcRecoParam->SetUseDriftCorrectionTime(kFALSE);
89 tpcRecoParam->SetUseDriftCorrectionGY(kTRUE);
90 tpcRecoParam->SetUseGainCorrectionTime(kFALSE);
91 tpcRecoParam->SetUseFieldCorrection(kFALSE);
92 tpcRecoParam->SetUseExBCorrection(kTRUE);
96 TFile fposcor("~/OCDB/calibUnlin.root");
97 AliTPCPointCorrection *pcorr = fposcor.Get("correction");
98 if (pcorr) pcorr->SetInstance(pcorr);
102 printf("END of SETUP OCBD for TPC\n");