-
- for(Int_t ddl=0; ddl < 14; ddl++) {
- if (!isDDLOn[ddl]) continue;
-
- ofstream out;
- out.open(Form("./HmpidPedDdl%02i.txt",ddl));
-
- for(Int_t row=1; row < 25; row++)
- for(Int_t dil=1; dil < 11; dil++)
- for(Int_t adr=0; adr < 48; adr++) {
-
- Int_t n = nEntries[ddl][adr][dil][row];
- if (!n) {
- printf("No data for channel: %d %d %d %d\n",ddl,adr,dil,row);
- continue;
- }
- Double_t mean = SummQ[ddl][adr][dil][row]/n;
- if ((SummQ2[ddl][adr][dil][row]/n - (SummQ[ddl][adr][dil][row]/n)*(SummQ[ddl][adr][dil][row]/n)) < 0) {
- printf("Invalid sums: %d %d %d %d %f %f\n",row,dil,adr,n,SummQ[ddl][adr][dil][row],SummQ2[ddl][adr][dil][row]);
- return -1;
- }
- Float_t sigma = TMath::Sqrt(SummQ2[ddl][adr][dil][row]/n - (mean*mean));
- Int_t inhard=((Int_t(mean))<<9)+Int_t(mean+3*sigma);
-
- out << Form("%2i %2i %2i %5.2f %5.2f %x\n",row,dil,adr,mean,sigma,inhard);
- }
-
- /* store the result file on FES */
- status=daqDA_FES_storeFile(Form("./HmpidPedDdl%02i.txt",ddl),Form("HMPID_DA_Pedestals_ddl=%02i",ddl));
- if (status) {
- printf("Failed to export file : %d\n",status);
- return -1;
- }
+ /* send pedestal and error files to DAQ FXS */
+ for(Int_t nDDL=0; nDDL < AliHMPIDRawStream::kNDDL; nDDL++) {
+ feeIn=Form("thr%d.dat",ddlOffset+nDDL);
+ /* Calculate pedestal for the given ddl, if there is no ddl go t next */
+ if(pCal->CalcPedestal(nDDL,Form("HmpidPedDdl%02i.txt",nDDL),Form("%s",feeIn.Data()),iEvtNcal)) {
+ status=daqDA_DB_storeFile(feeIn.Data(),feeIn.Data()); //store a single threshold file for a DDL in DAQ DB
+ if (status) { printf("Failed to store file %s in DAQ DB, status: %d\n",feeIn.Data(),status); }
+ status=daqDA_FES_storeFile(Form("HmpidPedDdl%02i.txt",nDDL),Form("HmpidPedDdl%02i.txt",nDDL)); //store a single pedestal file for a DDL
+ if (status) { printf("Failed to export file on FES: %d\n",status); }
+ }//pedestals and thresholds
+ if(pCal->WriteErrors(nDDL,Form("HmpidErrorsDdl%02i.txt",nDDL),iEvtNcal)) {
+ status=daqDA_FES_storeFile(Form("HmpidErrorsDdl%02i.txt",nDDL),Form("HmpidErrorsDdl%02i.txt",nDDL));
+ if (status) { printf("Failed to export file : %d\n",status); }
+ }//errors
+ }//nDDL
+
+ /* send files to AMORE DB */
+ daqDA_progressReport(95);
+ Int_t statusAmoreDA=0;
+ amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
+ for(Int_t iCh=0; iCh < AliHMPIDParam::kMaxCh; iCh++) {
+ statusAmoreDA+=amoreDA.Send(Form("fPedMeanMap%d",iCh), pCal->GetPedMeanMap(iCh));
+ statusAmoreDA+=amoreDA.Send(Form("fPedSigMap%d",iCh), pCal->GetPedSigMap(iCh));