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");
21 AliCDBManager::Instance()->SetDefaultStorage("local:///lustre/alice/alien/alice/data/2009/OCDB/");
24 // custom calibration to test before committing
26 TString ocdbStorage="local://";
27 ocdbStorage+=gSystem->Getenv("workdir");
28 ocdbStorage+="../calibNoDrift/OCDB";
29 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeGain",ocdbStorage.Data());
30 AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeDrift",ocdbStorage.Data());
35 AliCDBManager::Instance()->SetRun(run);
37 AliTPCcalibDB::Instance()->SetRun(run);
41 void SetupCustom(Int_t run){
44 // Custom part - to be empty once we are happy with the calibration
47 // Setup magnetic field
49 AliGRPObject *grp = AliTPCcalibDB::GetGRP(run);
53 current = grp->GetL3Current((AliGRPObject::Stats)0);
54 bz = 5*current/30000.;
55 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
58 printf("Run%d\tL3 current%f\tBz\t%f\n",run,current,bz);
60 AliMagF::BMap_t smag = AliMagF::k5kG;
61 Double_t bzfac = bz/5;
62 Double_t bzfacOrig=bzfac;
63 if (TMath::Abs(bzfac)<0.01) { // force default magnetic field if 0 field used
67 AliMagF* magF= new AliMagF("Maps","Maps", bzfac, 1., smag);
68 TGeoGlobalMagField::Instance()->SetField(magF);
69 printf("\n\nSET EXB FIELD\t\n\n");
70 AliTPCcalibDB::Instance()->SetExBField(magF);
76 TGeoManager::Import("/u/miranov/proof/geometry.root");
77 AliGeomManager::LoadGeometry("/u/miranov/proof/geometry.root");
79 AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam();
80 AliTPCParam * paramTPC = AliTPCcalibDB::Instance()->GetParameters();
81 paramCl->SetInstance(paramCl);
86 AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
87 AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
88 transform->SetCurrentRecoParam(tpcRecoParam);
89 tpcRecoParam->SetUseRPHICorrection(kTRUE);
90 tpcRecoParam->SetUseTOFCorrection(kFALSE);
92 tpcRecoParam->SetUseGainCorrectionTime(1);
93 tpcRecoParam->SetUseDriftCorrectionTime(1);
94 tpcRecoParam->SetUseDriftCorrectionGY(1);
96 tpcRecoParam->SetUseRadialCorrection(kFALSE);
97 tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
99 tpcRecoParam->SetUseSectorAlignment(kFALSE);
100 tpcRecoParam->SetUseFieldCorrection(kFALSE);
101 tpcRecoParam->SetUseExBCorrection(kTRUE);
102 if (TMath::Abs(bzfacOrig)<0.05){
103 tpcRecoParam->SetUseExBCorrection(kFALSE);
108 TFile fposcor("~/OCDB/calibUnlin.root");
109 AliTPCPointCorrection *pcorr = fposcor.Get("correction");
110 if (pcorr) pcorr->SetInstance(pcorr);
114 printf("END of SETUP OCBD for TPC\n");