corrected TRD/TOF MV position
[u/mrichter/AliRoot.git] / TOF / CreateOnlineCalibPars_CalibHisto.C
CommitLineData
48f18eab 1void CreateOnlineCalibPars_CalibHisto(){
2 // Create TOF Calibration Object from AliTOFcalibHisto class
3 // and write it on CDB
4
5 AliTOFcalib *tofcalib = new AliTOFcalib();
6 tofcalib->CreateCalArrays();
565fc5b5 7 AliTOFChannelOnlineArray *delayArray = (AliTOFChannelOnlineArray*) tofcalib->GetTOFOnlineDelay();
48f18eab 8
9 /* get calib histo andl and load params */
10 AliTOFcalibHisto calibHisto;
11 calibHisto.LoadCalibPar();
12
13 /* turn time-slewing correction off to only retrieve constants */
14 calibHisto.SetFullCorrectionFlag(AliTOFcalibHisto::kTimeSlewingCorr, kFALSE);
15
16 /* OCDB init */
17 AliCDBManager *man = AliCDBManager::Instance();
18 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
19 Int_t nChannels = AliTOFGeometry::NSectors()*(2*(AliTOFGeometry::NStripC()+AliTOFGeometry::NStripB())+AliTOFGeometry::NStripA())*AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();
20
21 /* channel-related params */
22 Double_t delay;
23 for (Int_t ipad = 0 ; ipad<nChannels; ipad++){
24 AliTOFChannelOnline *calChannelOnline = (AliTOFChannelOnline *)tofCalOnline->At(ipad);
25 delay = calibHisto.GetFullCorrection(ipad);
565fc5b5 26 delayArray->SetDelay(ipad, delay);
48f18eab 27 }
28
29 /* write */
30 tofcalib->WriteParOnlineDelayOnCDB("TOF/Calib",0,AliCDBRunRange::Infinity());
31}
32
33