3 // This is just example macro
4 // Responsible: marian.ivanov@cern.ch
6 // 1. Before invocation of the calibration - in the calibration trains
7 // 2. To setup calibration viewer.
9 // ConfigOCDB - setup default and specific data storage
10 // SetupCustom - user sepcific configuration
11 // - Values in local cache of OCDB are overwritten
15 void SetupCustom(Int_t run);
17 void ConfigOCDB(Int_t crun=-1){
19 printf("SETUP OCBD for TPC\n");
23 AliCDBManager::Instance()->SetDefaultStorage("local:///lustre/alice/alien/alice/data/2009/OCDB/");
24 AliCDBManager::Instance()->SetRun(run);
27 // custom calibration to test before committing
29 TString ocdbStorage="local://";
30 ocdbStorage+=gSystem->Getenv("workdir");
31 ocdbStorage+="/calibNoDrift/OCDB";
32 printf("OCDB storage\t%s\n",ocdbStorage.Data());
33 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeGain",ocdbStorage.Data());
34 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeDrift",ocdbStorage.Data());
36 AliCDBManager::Instance()->Get("TPC/Calib/TimeDrift",run)->Dump();
38 AliTPCcalibDB::Instance()->SetRun(run);
42 void SetupCustom(Int_t run){
45 // Custom part - to be empty once we are happy with the calibration
48 // Setup magnetic field
50 AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
54 current = grp->GetL3Current((AliGRPObject::Stats)0);
55 bz = 5*current/30000.;
56 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
59 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
61 AliMagF::BMap_t smag = AliMagF::k5kG;
62 Double_t bzfac = bz/5;
63 Double_t bzfacOrig=bzfac;
64 if (TMath::Abs(bzfac)<0.01) { // force default magnetic field if 0 field used
68 AliMagF* magF= new AliMagF("Maps","Maps", bzfac, 1., smag);
69 TGeoGlobalMagField::Instance()->SetField(magF);
70 printf("\n\nSET EXB FIELD\t\n\n");
71 AliTPCcalibDB::Instance()->SetExBField(magF);
77 TGeoManager::Import("/u/miranov/proof/geometry.root");
78 AliGeomManager::LoadGeometry("/u/miranov/proof/geometry.root");
80 AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam();
81 AliTPCParam * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
82 paramCl->SetInstance(paramCl);
87 AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
88 AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
89 transform->SetCurrentRecoParam(tpcRecoParam);
90 tpcRecoParam->SetUseRPHICorrection(kTRUE);
91 tpcRecoParam->SetUseTOFCorrection(kFALSE);
93 tpcRecoParam->SetUseGainCorrectionTime(1);
94 tpcRecoParam->SetUseDriftCorrectionTime(1);
95 tpcRecoParam->SetUseDriftCorrectionGY(1);
97 tpcRecoParam->SetUseRadialCorrection(kFALSE);
98 tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
100 tpcRecoParam->SetUseSectorAlignment(kFALSE);
101 tpcRecoParam->SetUseFieldCorrection(kFALSE);
102 tpcRecoParam->SetUseExBCorrection(kTRUE);
103 if (TMath::Abs(bzfacOrig)<0.05){
104 tpcRecoParam->SetUseExBCorrection(kFALSE);
109 TFile fposcor("~/OCDB/calibUnlin.root");
110 AliTPCPointCorrection *pcorr = fposcor.Get("correction");
111 if (pcorr) pcorr->SetInstance(pcorr);
115 printf("END of SETUP OCBD for TPC\n");