1 void CreateOnlineCalibPars(){
3 // Create TOF Online Calibration Object for reconstruction
4 // and write it on CDB;
5 // NB: only delay set, status still ok
6 // Both old type objects (using TObjArrays) and new type objects (using AliTOFChannelOnlineArray/
7 // AliTOFChannelOnlineStatusArray are written
9 AliTOFcalib *tofcalib = new AliTOFcalib();
10 tofcalib->CreateCalArrays();
11 TObjArray *tofCalOnline = (TObjArray*) tofcalib->GetTOFCalArrayOnline();
12 TObjArray *tofCalOnlinePulser = (TObjArray*) tofcalib->GetTOFCalArrayOnlinePulser();
13 TObjArray *tofCalOnlineNoise = (TObjArray*) tofcalib->GetTOFCalArrayOnlineNoise();
14 TObjArray *tofCalOnlineHW = (TObjArray*) tofcalib->GetTOFCalArrayOnlineHW();
15 AliTOFChannelOnlineArray *delayObj = (AliTOFChannelOnlineArray*) tofcalib->GetTOFOnlineDelay();
16 AliTOFChannelOnlineStatusArray *status = (AliTOFChannelOnlineStatusArray*) tofcalib->GetTOFOnlineStatus();
17 // Write the online calibration object on CDB
19 AliCDBManager *man = AliCDBManager::Instance();
20 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
21 Int_t nChannels = AliTOFGeometry::NSectors()*(2*(AliTOFGeometry::NStripC()+AliTOFGeometry::NStripB())+AliTOFGeometry::NStripA())*AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();
23 Float_t meanDelay=0.3;
24 Float_t sigmaDelay=0.08;
25 TRandom *rnd = new TRandom(4357);
26 for (Int_t ipad = 0 ; ipad<nChannels; ipad++){
27 AliTOFChannelOnline *calChannelOnline = (AliTOFChannelOnline*)tofCalOnline->At(ipad);
28 AliTOFChannelOnlineStatus *calChannelOnlinePulser = (AliTOFChannelOnlineStatus*)tofCalOnlinePulser->At(ipad);
29 AliTOFChannelOnlineStatus *calChannelOnlineNoise = (AliTOFChannelOnlineStatus*)tofCalOnlineNoise->At(ipad);
30 AliTOFChannelOnlineStatus *calChannelOnlineHW = (AliTOFChannelOnlineStatus*)tofCalOnlineHW->At(ipad);
31 delay = rnd->Gaus(meanDelay,sigmaDelay);
32 delayObj->SetDelay(ipad,delay);
33 calChannelOnline->SetDelay(delay);
34 calChannelOnlinePulser->SetStatus(AliTOFChannelOnlineStatus::kTOFPulserOk);
35 calChannelOnlineNoise->SetStatus(AliTOFChannelOnlineStatus::kTOFNoiseOk);
36 calChannelOnlineHW->SetStatus(AliTOFChannelOnlineStatus::kTOFHWOk);
37 status->SetHWStatus(ipad,AliTOFChannelOnlineStatusArray::kTOFHWOk);
38 status->SetPulserStatus(ipad,AliTOFChannelOnlineStatusArray::kTOFPulserOk);
39 status->SetNoiseStatus(ipad,AliTOFChannelOnlineStatusArray::kTOFNoiseOk);
41 tofcalib->WriteParOnlineDelayOnCDB("TOF/Calib"); // new obj
42 tofcalib->WriteParOnlineStatusOnCDB("TOF/Calib"); // new obj
43 tofcalib->WriteParOnlineOnCDB("TOF/Calib"); // old object
44 tofcalib->WriteParOnlinePulserOnCDB("TOF/Calib"); // old obj
45 tofcalib->WriteParOnlineNoiseOnCDB("TOF/Calib"); // old obj
46 tofcalib->WriteParOnlineHWOnCDB("TOF/Calib"); // old obj