Adding new entry in OCDB for configuration of TOF online calibration.
[u/mrichter/AliRoot.git] / TOF / CreateOnlineCalibPars.C
CommitLineData
be2ca2e7 1void CreateOnlineCalibPars(){
2 // Create TOF Online Calibration Object for reconstruction
3f2237b1 3 // and write it on CDB;
4 // NB: only delay set, status still ok
be2ca2e7 5 AliTOFcalib *tofcalib = new AliTOFcalib();
6 tofcalib->CreateCalArrays();
7 TObjArray *tofCalOnline = (TObjArray*) tofcalib->GetTOFCalArrayOnline();
3f2237b1 8 TObjArray *tofCalOnlinePulser = (TObjArray*) tofcalib->GetTOFCalArrayOnlinePulser();
9 TObjArray *tofCalOnlineNoise = (TObjArray*) tofcalib->GetTOFCalArrayOnlineNoise();
10 TObjArray *tofCalOnlineHW = (TObjArray*) tofcalib->GetTOFCalArrayOnlineHW();
be2ca2e7 11 // Write the offline calibration object on CDB
12
13 AliCDBManager *man = AliCDBManager::Instance();
14 man->SetDefaultStorage("local://$ALICE");
15 Int_t nChannels = AliTOFGeometry::NSectors()*(2*(AliTOFGeometry::NStripC()+AliTOFGeometry::NStripB())+AliTOFGeometry::NStripA())*AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();
16 Float_t delay=0.;
17 Float_t meanDelay=0.3;
18 Float_t sigmaDelay=0.08;
19 TRandom *rnd = new TRandom(4357);
20 for (Int_t ipad = 0 ; ipad<nChannels; ipad++){
21 AliTOFChannelOnline *calChannelOnline = (AliTOFChannelOnline*)tofCalOnline->At(ipad);
3f2237b1 22 AliTOFChannelOnlineStatus *calChannelOnlinePulser = (AliTOFChannelOnlineStatus*)tofCalOnlinePulser->At(ipad);
23 AliTOFChannelOnlineStatus *calChannelOnlineNoise = (AliTOFChannelOnlineStatus*)tofCalOnlineNoise->At(ipad);
24 AliTOFChannelOnlineStatus *calChannelOnlineHW = (AliTOFChannelOnlineStatus*)tofCalOnlineHW->At(ipad);
be2ca2e7 25 delay = rnd->Gaus(meanDelay,sigmaDelay);
26 calChannelOnline->SetDelay(delay);
3f2237b1 27 calChannelOnlinePulser->SetStatus(AliTOFChannelOnlineStatus::kTOFPulserOk);
28 calChannelOnlineNoise->SetStatus(AliTOFChannelOnlineStatus::kTOFNoiseOk);
29 calChannelOnlineHW->SetStatus(AliTOFChannelOnlineStatus::kTOFHWOk);
be2ca2e7 30 }
31 tofcalib->WriteParOnlineOnCDB("TOF/Calib");
3f2237b1 32 tofcalib->WriteParOnlinePulserOnCDB("TOF/Calib");
33 tofcalib->WriteParOnlineNoiseOnCDB("TOF/Calib");
34 tofcalib->WriteParOnlineHWOnCDB("TOF/Calib");
be2ca2e7 35 return;
36}