Updated trigger configuration (A. Mastroserio)
[u/mrichter/AliRoot.git] / ZDC / ZDCPEDESTALda.cxx
CommitLineData
f3ca8792 1/*
2
039a08c3 3This program reads the DAQ data files passed as argument using the monitoring library.
4
039a08c3 5
6The program reports about its processing progress.
f3ca8792 7
8Messages on stdout are exported to DAQ log system.
9
b3b2b9dd 10DA for ZDC standalone pedestal runs
ea628de7 11
b3b2b9dd 12Contact: Chiara.Oppedisano@to.infn.it
442e1b18 13Link:
b3b2b9dd 14Run Type: STANDALONE_PEDESTAL_RUN
442e1b18 15DA Type: LDC
b3b2b9dd 16Number of events needed: no constraint (tipically ~10^3)
442e1b18 17Input Files:
18Output Files: ZDCPedestal.dat, ZDCChMapping.dat
b3b2b9dd 19Trigger Types Used: Standalone Trigger
f3ca8792 20
21*/
218f916a 22#define PEDDATA_FILE "ZDCPedestal.dat"
23#define MAPDATA_FILE "ZDCChMapping.dat"
f3ca8792 24
25#include <stdio.h>
039a08c3 26#include <stdlib.h>
f3ca8792 27#include <Riostream.h>
28
29// DATE
f3ca8792 30#include <event.h>
31#include <monitor.h>
039a08c3 32#include <daqDA.h>
f3ca8792 33
34//ROOT
35#include <TRandom.h>
36#include <TH1F.h>
37#include <TH2F.h>
38#include <TProfile.h>
39#include <TF1.h>
40#include <TFile.h>
442e1b18 41#include <TFitter.h>
f3ca8792 42
43//AliRoot
44#include <AliRawReaderDate.h>
442e1b18 45#include <AliRawEventHeaderBase.h>
f3ca8792 46#include <AliZDCRawStream.h>
47
48
49/* Main routine
039a08c3 50 Arguments: list of DATE raw data files
f3ca8792 51*/
52int main(int argc, char **argv) {
442e1b18 53
9d0b658a 54// TVirtualFitter::SetDefaultFitter("Minuit2");
f3ca8792 55
039a08c3 56 int status = 0;
9d0b658a 57 int const kNChannels = 24;
039a08c3 58
59 /* log start of process */
63604324 60 printf("\n ZDC PEDESTAL program started\n");
039a08c3 61
62 /* check that we got some arguments = list of files */
63 if (argc<2) {
64 printf("Wrong number of arguments\n");
65 return -1;
66 }
67
f3ca8792 68 // --- Histograms for ADC pedestals
b3b2b9dd 69 // [22 signal channels + 2 reference PTMs] x 2 gain chains
f3ca8792 70 //
039a08c3 71 TH1F::AddDirectory(0);
9d0b658a 72 //
b3b2b9dd 73 TH1F *hPedhg[kNChannels], *hPedOutOfTimehg[kNChannels];
74 TH2F *hPedCorrhg[kNChannels];
75 TH1F *hPedlg[kNChannels], *hPedOutOfTimelg[kNChannels];
76 TH2F *hPedCorrlg[kNChannels];
f3ca8792 77 //
b3b2b9dd 78 char namhist1hg[50], namhist2hg[50], namhist3hg[50];
79 char namhist1lg[50], namhist2lg[50], namhist3lg[50];
80 for(Int_t j=0; j<kNChannels; j++){
7f4bde92 81 if(j<=4){ // ZNC
82 sprintf(namhist1hg,"PedZNChg_%d",j);
83 sprintf(namhist2hg,"PedZNChgOutOfTime_%d",j);
84 sprintf(namhist3hg,"PedCorrZNChg_%d",j);
b3b2b9dd 85 //
7f4bde92 86 sprintf(namhist1lg,"PedZNClg_%d",j);
87 sprintf(namhist2lg,"PedZNClgOutOfTime_%d",j);
88 sprintf(namhist3lg,"PedCorrZNClg_%d",j);
b3b2b9dd 89 }
7f4bde92 90 else if(j>=5 && j<=9){ // ZPC
91 sprintf(namhist1hg,"PedZPChg_%d",j-5);
92 sprintf(namhist2hg,"PedZPChgOutOfTime_%d",j-5);
93 sprintf(namhist3hg,"PedCorrZPChg_%d",j-5);
b3b2b9dd 94 //
7f4bde92 95 sprintf(namhist1lg,"PedZPClg_%d",j-5);
96 sprintf(namhist2lg,"PedZPClgOutOfTime_%d",j-5);
97 sprintf(namhist3lg,"PedCorrZPClg_%d",j-5);
f3ca8792 98 }
7f4bde92 99 else if(j==10 || j==11){ // ZEM
b3b2b9dd 100 sprintf(namhist1hg,"PedZEMhg_%d",j-10);
101 sprintf(namhist2hg,"PedZEMhgOutOfTime_%d",j-10);
102 sprintf(namhist3hg,"PedCorrZEMhg_%d",j-10);
103 //
104 sprintf(namhist1lg,"PedZEMlg_%d",j-10);
105 sprintf(namhist2lg,"PedZEMlgOutOfTime_%d",j-10);
106 sprintf(namhist3lg,"PedCorrZEMlg_%d",j-10);
f3ca8792 107 }
7f4bde92 108 else if(j>=12 && j<=16){ // ZNA
109 sprintf(namhist1hg,"PedZNAhg_%d",j-12);
110 sprintf(namhist2hg,"PedZNAhgOutOfTime_%d",j-12);
111 sprintf(namhist3hg,"PedCorrZNAhg_%d",j-12);
b3b2b9dd 112 //
7f4bde92 113 sprintf(namhist1lg,"PedZNAlg_%d",j-12);
114 sprintf(namhist2lg,"PedZNAlgOutOfTime_%d",j-12);
115 sprintf(namhist3lg,"PedCorrZNAlg_%d",j-12);
f3ca8792 116 }
7f4bde92 117 else if(j>=17 && j<=21){ // ZPA
118 sprintf(namhist1hg,"PedZPAhg_%d",j-17);
119 sprintf(namhist2hg,"PedZPAhgOutOfTime_%d",j-17);
120 sprintf(namhist3hg,"PedCorrZPAhg_%d",j-17);
b3b2b9dd 121 //
7f4bde92 122 sprintf(namhist1lg,"PedZPAlg_%d",j-17);
123 sprintf(namhist2lg,"PedZPAlgOutOfTime_%d",j-17);
124 sprintf(namhist3lg,"PedCorrZPAlg_%d",j-17);
f3ca8792 125 }
7f4bde92 126 else if(j==22 || j==24){ //Reference PMs
b3b2b9dd 127 sprintf(namhist1hg,"PedRefhg_%d",j-22);
128 sprintf(namhist2hg,"PedRefhgOutOfTime_%d",j-22);
129 sprintf(namhist3hg,"PedCorrRefhg_%d",j-22);
130 //
131 sprintf(namhist1lg,"PedReflg_%d",j-22);
132 sprintf(namhist2lg,"PedReflgOutOfTime_%d",j-22);
133 sprintf(namhist3lg,"PedCorrReflg_%d",j-22);
f3ca8792 134 }
b3b2b9dd 135 // --- High gain chain histos
057ed567 136 hPedhg[j] = new TH1F(namhist1hg, namhist1hg, 200, 0., 200.);
137 hPedOutOfTimehg[j] = new TH1F(namhist2hg, namhist2hg, 200, 0., 200.);
b3b2b9dd 138 hPedCorrhg[j] = new TH2F(namhist3hg,namhist3hg,100,0.,200.,100,0.,200.);
139 // --- Low gain chain histos
057ed567 140 hPedlg[j] = new TH1F(namhist1lg, namhist1lg, 100, 0., 1000.);
141 hPedOutOfTimelg[j] = new TH1F(namhist2lg, namhist2lg, 100, 0., 1000.);
142 hPedCorrlg[j] = new TH2F(namhist3lg,namhist3lg,100,0.,1000.,100,0.,1000.);
f3ca8792 143 }
144
f3ca8792 145
146 /* open result file */
147 FILE *fp=NULL;
9d0b658a 148 fp=fopen("./result.txt","w");
f3ca8792 149 if (fp==NULL) {
150 printf("Failed to open file\n");
151 return -1;
152 }
153
442e1b18 154 FILE *mapFile4Shuttle;
f3ca8792 155
039a08c3 156 /* report progress */
157 daqDA_progressReport(10);
f3ca8792 158
f3ca8792 159
f3ca8792 160 /* init some counters */
161 int nevents_physics=0;
162 int nevents_total=0;
163
039a08c3 164 /* read the data files */
165 int n;
442e1b18 166 for(n=1;n<argc;n++){
039a08c3 167
168 status=monitorSetDataSource( argv[n] );
f3ca8792 169 if (status!=0) {
039a08c3 170 printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
171 return -1;
f3ca8792 172 }
173
039a08c3 174 /* report progress */
175 /* in this example, indexed on the number of files */
176 daqDA_progressReport(10+80*n/argc);
177
178 /* read the file */
179 for(;;) {
180 struct eventHeaderStruct *event;
181 eventTypeType eventT;
182
183 /* get next event */
184 status=monitorGetEventDynamic((void **)&event);
442e1b18 185 if(status==MON_ERR_EOF) break; /* end of monitoring file has been reached */
186 if(status!=0) {
039a08c3 187 printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
188 return -1;
189 }
190
191 /* retry if got no event */
442e1b18 192 if(event==NULL) {
039a08c3 193 break;
194 }
442e1b18 195
196 // Initalize raw-data reading and decoding
197 AliRawReader *reader = new AliRawReaderDate((void*)event);
198 reader->Select("ZDC");
199 // --- Reading event header
200 //UInt_t evtype = reader->GetType();
201 //printf("\n\t ZDCPEDESTALda -> ev. type %d\n",evtype);
202 //printf("\t ZDCPEDESTALda -> run # %d\n",reader->GetRunNumber());
203 //
204 AliZDCRawStream *rawStreamZDC = new AliZDCRawStream(reader);
205
f3ca8792 206
039a08c3 207 /* use event - here, just write event id to result file */
208 eventT=event->eventType;
442e1b18 209
9d0b658a 210 Int_t ich=0;
211 Int_t adcMod[2*kNChannels], adcCh[2*kNChannels], sigCode[2*kNChannels];
212 Int_t det[2*kNChannels], sec[2*kNChannels];
7f4bde92 213
442e1b18 214 if(eventT==START_OF_DATA){
215
7f4bde92 216 rawStreamZDC->SetSODReading(kTRUE);
217
9d0b658a 218 // --------------------------------------------------------
219 // --- Writing ascii data file for the Shuttle preprocessor
220 mapFile4Shuttle = fopen(MAPDATA_FILE,"w");
442e1b18 221 if(!rawStreamZDC->Next()) printf(" \t No raw data found!! \n");
222 else{
9d0b658a 223 while((rawStreamZDC->Next()) && (ich<2*kNChannels)){
442e1b18 224 if(rawStreamZDC->IsChMapping()){
225 adcMod[ich] = rawStreamZDC->GetADCModFromMap(ich);
226 adcCh[ich] = rawStreamZDC->GetADCChFromMap(ich);
227 sigCode[ich] = rawStreamZDC->GetADCSignFromMap(ich);
228 det[ich] = rawStreamZDC->GetDetectorFromMap(ich);
229 sec[ich] = rawStreamZDC->GetTowerFromMap(ich);
9d0b658a 230 //
231 fprintf(mapFile4Shuttle,"\t%d\t%d\t%d\t%d\t%d\t%d\n",
232 ich,adcMod[ich],adcCh[ich],sigCode[ich],det[ich],sec[ich]);
233 //
234 //printf("ZDCPEDESTALda.cxx -> %d mod %d ch %d, code %d det %d, sec %d\n",
235 // ich,adcMod[ich],adcCh[ich],sigCode[ich],det[ich],sec[ich]);
236 //
442e1b18 237 ich++;
238 }
239 }
240 }
442e1b18 241 fclose(mapFile4Shuttle);
9d0b658a 242 }// SOD event
442e1b18 243
039a08c3 244 if(eventT==PHYSICS_EVENT){
442e1b18 245 // --- Reading data header
246 reader->ReadHeader();
039a08c3 247 const AliRawDataHeader* header = reader->GetDataHeader();
442e1b18 248 if(header){
b3b2b9dd 249 UChar_t message = header->GetAttributes();
442e1b18 250 if(message & 0x20){ // PEDESTAL RUN
251 //printf("\t STANDALONE_PEDESTAL RUN raw data found\n");
252 }
253 else{
9d0b658a 254 printf("ZDCPEDESTALda.cxx -> NO STANDALONE_PEDESTAL RUN raw data found\n");
442e1b18 255 return -1;
256 }
257 }
258 else{
259 printf("\t ATTENTION! No Raw Data Header found!!!\n");
260 return -1;
261 }
7f4bde92 262
263 rawStreamZDC->SetSODReading(kTRUE);
442e1b18 264
265 if(!rawStreamZDC->Next()) printf(" \t No raw data found!! \n");
266 //
267 // ----- Setting ch. mapping -----
9d0b658a 268 for(Int_t jk=0; jk<2*kNChannels; jk++){
7f4bde92 269 //printf("ZDCPEDESTALDA.cxx -> ch.%d mod %d, ch %d, code %d det %d, sec %d\n",
270 // jk,adcMod[jk],adcCh[jk],sigCode[jk],det[jk],sec[jk]);
442e1b18 271 rawStreamZDC->SetMapADCMod(jk, adcMod[jk]);
272 rawStreamZDC->SetMapADCCh(jk, adcCh[jk]);
273 rawStreamZDC->SetMapADCSig(jk, sigCode[jk]);
274 rawStreamZDC->SetMapDet(jk, det[jk]);
275 rawStreamZDC->SetMapTow(jk, sec[jk]);
276 }
277 //
278 Int_t iraw=0;
039a08c3 279 Int_t RawADChg[kNChannels], RawADCoothg[kNChannels];
280 Int_t RawADClg[kNChannels], RawADCootlg[kNChannels];
281 for(Int_t j=0; j<kNChannels; j++){
282 RawADChg[j]=0; RawADCoothg[j]=0;
283 RawADClg[j]=0; RawADCootlg[j]=0;
284 }
442e1b18 285 //
039a08c3 286 while(rawStreamZDC->Next()){
442e1b18 287 Int_t index=-1;
7f4bde92 288 Int_t detector = rawStreamZDC->GetSector(0);
9d0b658a 289 Int_t sector = rawStreamZDC->GetSector(1);
290
7f4bde92 291 if(rawStreamZDC->IsADCDataWord() && (detector!=-1)){
9d0b658a 292 if(sector!=5){ // Physics signals
293 if(detector==1) index = sector; // *** ZNC
294 else if(detector==2) index = sector+5; // *** ZPC
295 else if(detector==3) index = sector+9; // *** ZEM
296 else if(detector==4) index = sector+12; // *** ZNA
297 else if(detector==5) index = sector+17; // *** ZPA
f3ca8792 298 }
b3b2b9dd 299 else{ // Reference PMs
7f4bde92 300 index = (detector-1)/3+22;
f3ca8792 301 }
b3b2b9dd 302 //
9d0b658a 303 if(index==-1) printf("ERROR in ZDCPEDESTALda.cxx -> det %d quad %d res %d index %d \n",
304 detector,sector,rawStreamZDC->GetADCGain(),index);
7f4bde92 305
442e1b18 306 //
307 if(iraw<2*kNChannels){ // --- In-time pedestals (1st 48 raw data)
b3b2b9dd 308 if(rawStreamZDC->GetADCGain()==0){
309 hPedhg[index]->Fill(rawStreamZDC->GetADCValue());
310 RawADChg[index] = rawStreamZDC->GetADCValue();
442e1b18 311 //
312 //printf("\t filling histo hPedhg[%d]\n",index);
b3b2b9dd 313 }
314 else{
315 hPedlg[index]->Fill(rawStreamZDC->GetADCValue());
316 RawADClg[index] = rawStreamZDC->GetADCValue();
442e1b18 317 //
318 //printf("\t filling histo hPedlg[%d]\n",index);
b3b2b9dd 319 }
442e1b18 320 }
321 else{ // --- Out-of-time pedestals
322 if(rawStreamZDC->GetADCGain()==0){
323 hPedOutOfTimehg[index]->Fill(rawStreamZDC->GetADCValue());
324 RawADCoothg[index] = rawStreamZDC->GetADCValue();
325 //
326 //printf("\t filling histo hPedOutOfTimehg[%d]\n",index);
039a08c3 327 }
442e1b18 328 else{
329 hPedOutOfTimelg[index]->Fill(rawStreamZDC->GetADCValue());
330 RawADCootlg[index] = rawStreamZDC->GetADCValue();
331 //
332 //printf("\t filling histo hPedOutOfTimelg[%d]\n",index);
039a08c3 333 }
442e1b18 334 }
335 iraw++;
336 }//IsADCDataWord()
337 //
338 if(iraw == 4*kNChannels){ // Last ADC channel -> Filling correlation histos
339 for(Int_t k=0; k<kNChannels; k++){
039a08c3 340 hPedCorrhg[k]->Fill(RawADCoothg[k], RawADChg[k]);
341 hPedCorrlg[k]->Fill(RawADCootlg[k], RawADClg[k]);
442e1b18 342 }
343 }
039a08c3 344 }
345 //
346 nevents_physics++;
347 //
348 delete reader;
349 delete rawStreamZDC;
350
351 }//(if PHYSICS_EVENT)
352 nevents_total++;
353
354 /* free resources */
355 free(event);
f3ca8792 356
f3ca8792 357 }
039a08c3 358 }
f3ca8792 359
360 /* Analysis of the histograms */
361 //
362 FILE *fileShuttle;
218f916a 363 fileShuttle = fopen(PEDDATA_FILE,"w");
f3ca8792 364 //
b3b2b9dd 365 Float_t MeanPed[2*kNChannels], MeanPedWidth[2*kNChannels],
63604324 366 MeanPedOOT[2*kNChannels], MeanPedWidthOOT[2*kNChannels];
b3b2b9dd 367 // --- In-time pedestals
368 TF1 *ADCfunchg[kNChannels];
369 for(Int_t i=0; i<kNChannels; i++){
370 hPedhg[i]->Fit("gaus","Q");
371 ADCfunchg[i] = hPedhg[i]->GetFunction("gaus");
442e1b18 372 MeanPed[i] = (Double_t) ADCfunchg[i]->GetParameter(1);
373 MeanPedWidth[i] = (Double_t) ADCfunchg[i]->GetParameter(2);
218f916a 374 fprintf(fileShuttle,"\t%f\t%f\n",MeanPed[i],MeanPedWidth[i]);
057ed567 375 //printf("\t MeanPedhg[%d] = %f\n",i, MeanPed[i]);
b3b2b9dd 376 }
377 TF1 *ADCfunclg[kNChannels];
378 for(Int_t i=0; i<kNChannels; i++){
379 hPedlg[i]->Fit("gaus","Q");
380 ADCfunclg[i] = hPedlg[i]->GetFunction("gaus");
442e1b18 381 MeanPed[i+kNChannels] = (Double_t) ADCfunclg[i]->GetParameter(1);
382 MeanPedWidth[i+kNChannels] = (Double_t) ADCfunclg[i]->GetParameter(2);
218f916a 383 fprintf(fileShuttle,"\t%f\t%f\n",MeanPed[i+kNChannels],MeanPedWidth[i+kNChannels]);
057ed567 384 //printf("\t MeanPedlg[%d] = %f\n",i+kNChannels, MeanPed[i+kNChannels]);
f3ca8792 385 }
386 // --- Out-of-time pedestals
b3b2b9dd 387 TF1 *ADCootfunchg[kNChannels];
388 for(Int_t i=0; i<kNChannels; i++){
389 hPedOutOfTimehg[i]->Fit("gaus","Q");
390 ADCootfunchg[i] = hPedOutOfTimehg[i]->GetFunction("gaus");
442e1b18 391 MeanPedOOT[i] = (Double_t) ADCootfunchg[i]->GetParameter(1);
392 MeanPedWidthOOT[i] = (Double_t) ADCootfunchg[i]->GetParameter(2);
218f916a 393 fprintf(fileShuttle,"\t%f\t%f\n",MeanPedOOT[i],MeanPedWidthOOT[i]);
057ed567 394 //printf("\t MeanPedOOThg[%d] = %f\n",i, MeanPedOOT[i]);
b3b2b9dd 395 }
396 TF1 *ADCootfunclg[kNChannels];
397 for(Int_t i=0; i<kNChannels; i++){
398 hPedOutOfTimelg[i]->Fit("gaus","Q");
399 ADCootfunclg[i] = hPedOutOfTimelg[i]->GetFunction("gaus");
442e1b18 400 MeanPedOOT[i+kNChannels] = (Double_t) ADCootfunclg[i]->GetParameter(1);
401 MeanPedWidthOOT[i+kNChannels] = (Double_t) ADCootfunclg[i]->GetParameter(2);
218f916a 402 fprintf(fileShuttle,"\t%f\t%f\n",MeanPedOOT[i+kNChannels],MeanPedWidthOOT[i+kNChannels]);
057ed567 403 //printf("\t MeanPedOOTlg[%d] = %f\n",i+kNChannels, MeanPedOOT[i+kNChannels]);
f3ca8792 404 }
63604324 405
b3b2b9dd 406 // --- Correlations
9d0b658a 407
63604324 408 Float_t CorrCoeff0[2*kNChannels], CorrCoeff1[2*kNChannels];
b3b2b9dd 409 TProfile *hPedCorrProfhg[kNChannels], *hPedCorrProflg[kNChannels];
410 TF1 *ffunchg[kNChannels], *ffunclg[kNChannels];
f3ca8792 411 char namhist4[50];
b3b2b9dd 412 for(int i=0;i<kNChannels;i++) {
413 sprintf(namhist4,"ADCHRvsOOT%d_Prof",i);
414 hPedCorrProfhg[i] = hPedCorrhg[i]->ProfileX(namhist4,-1,-1,"S");
415 hPedCorrProfhg[i]->SetName(namhist4);
416 hPedCorrProfhg[i]->Fit("pol1","Q");
417 ffunchg[i] = hPedCorrProfhg[i]->GetFunction("pol1");
442e1b18 418 CorrCoeff0[i] = (Double_t) ffunchg[i]->GetParameter(0);
419 CorrCoeff1[i] = (Double_t) ffunchg[i]->GetParameter(1);
9d0b658a 420 fprintf(fileShuttle,"\t%f\t%f\n",CorrCoeff0[i],CorrCoeff1[i]);
ea628de7 421 //printf("\t CorrCoeff0[%d] = %f, CorrCoeff1[%d] = %f\n",i, CorrCoeff0[i], i, CorrCoeff1[i]);
b3b2b9dd 422 }
423 for(int i=0;i<kNChannels;i++) {
424 sprintf(namhist4,"ADCLRvsOOT%d_Prof",i);
425 hPedCorrProflg[i] = hPedCorrlg[i]->ProfileX(namhist4,-1,-1,"S");
426 hPedCorrProflg[i]->SetName(namhist4);
427 hPedCorrProflg[i]->Fit("pol1","Q");
428 ffunclg[i] = hPedCorrProflg[i]->GetFunction("pol1");
442e1b18 429 CorrCoeff0[i+kNChannels] = (Double_t) ffunclg[i]->GetParameter(0);
430 CorrCoeff1[i+kNChannels] = (Double_t) ffunclg[i]->GetParameter(1);
9d0b658a 431 fprintf(fileShuttle,"\t%f\t%f\n",CorrCoeff0[i+kNChannels],CorrCoeff1[i+kNChannels]);
ea628de7 432 //printf("\t CorrCoeff0[%d] = %f, CorrCoeff1[%d] = %f\n",
433 // i+kNChannels, CorrCoeff0[i+kNChannels], i+kNChannels, CorrCoeff1[i+kNChannels]);
f3ca8792 434 }
9d0b658a 435
f3ca8792 436 //
437 fclose(fileShuttle);
b3b2b9dd 438 //
039a08c3 439 for(Int_t j=0; j<kNChannels; j++){
440 delete hPedhg[j];
441 delete hPedOutOfTimehg[j];
442 delete hPedCorrhg[j];
443 delete hPedlg[j];
444 delete hPedOutOfTimelg[j];
445 delete hPedCorrlg[j];
446 }
f3ca8792 447
448 /* write report */
449 fprintf(fp,"Run #%s, received %d physics events out of %d\n",getenv("DATE_RUN_NUMBER"),nevents_physics,nevents_total);
450
451 /* close result file */
452 fclose(fp);
039a08c3 453
454 /* report progress */
455 daqDA_progressReport(90);
456
442e1b18 457 /* store the result files on FES */
63604324 458 // [1] File with mapping
218f916a 459 status = daqDA_FES_storeFile(MAPDATA_FILE,MAPDATA_FILE);
442e1b18 460 if(status){
63604324 461 printf("Failed to export file %d to DAQ FES\n",status);
442e1b18 462 return -1;
463 }
63604324 464 // [2] File with pedestal data
218f916a 465 status = daqDA_FES_storeFile(PEDDATA_FILE,PEDDATA_FILE);
039a08c3 466 if(status){
63604324 467 printf("Failed to export file %d to DAQ FES\n",status);
468 return -1;
469 }
470
471 /* store the result files on DB */
218f916a 472 status = daqDA_DB_storeFile(PEDDATA_FILE,PEDDATA_FILE);
63604324 473 if(status){
474 printf("Failed to export file %d to DAQ DB\n",status);
039a08c3 475 return -1;
476 }
477
478 /* report progress */
479 daqDA_progressReport(100);
f3ca8792 480
f3ca8792 481 return status;
482}