2 Contact: henrik.tydesjo@cern.ch
3 Link: tydes.home.cern.ch/tydes/doc/CalibrationOverview/CalibrationAlgorithms/
4 Run Type: DAQ_MIN_TH_SCAN,DAQ_MEAN_TH_SCAN,DAQ_UNIFORMITY_SCAN,DAQ_NOISY_PIX_SCAN,DAQ_PIX_DELAY_SCAN,DAQ_FO_UNIF_SCAN
6 Number of events needed: Depending on scan type
7 Input Files: spd_standal_params,spd_perm_noisy , ./calibResults/ScanNoisy/* , raw data
8 Output Files: ./calibResults/ScanReference/* , ./calibResults/ScanDCSconfigToFXS/* , ./calibResults/ScanNoisyToFXS/* , ./calibResults/ScanNoisy/*
9 Trigger types used: PHYSICS
12 ////////////////////////////////////////////////////////////////////////////////
13 // This program can be compiled in two modes. //
15 // 1. With the DAQ DA framework on. This is the default operating mode. //
16 // Call this program with the name of the executable followed by the //
17 // data files to process. //
19 // 2. Without the DAQ DA framework on. Define the SPD_DA_OFF environment var. //
20 // Call this program with the name of the executable followed by the //
21 // runNr and the data files to process. //
23 ////////////////////////////////////////////////////////////////////////////////
32 #include "AliRawReaderDate.h"
33 #include "AliITSRawStreamSPD.h"
34 #include "AliITSOnlineSPDscan.h"
35 #include "AliITSOnlineSPDscanSingle.h"
36 #include "AliITSOnlineSPDscanMultiple.h"
37 #include "AliITSOnlineSPDscanMeanTh.h"
38 #include "AliITSOnlineSPDscanAnalyzer.h"
39 #include "AliITSOnlineCalibrationSPDhandler.h"
44 #include <TPluginManager.h>
45 #include <TObjArray.h>
49 int main(int argc, char **argv) {
51 printf("Wrong number of arguments\n");
55 // directory structure, hard coded
56 char *saveDirNoisy = "./calibResults/ScanNoisy"; // may NOT delete content
57 char *saveDirNoisyToFXS = "./calibResults/ScanNoisyToFXS"; // may delete content
58 char *saveDirDCSconfigToFXS= "./calibResults/ScanDCSconfigToFXS"; // may delete content
59 char *saveDirRef = "./calibResults/ScanReference"; // may delete content
60 char *saveDirIdsToFXS = "./calibResults/IdsToFXS"; // may delete content
61 char *configFilesDir = "./configFiles"; // may delete content
63 // make sure the directory structure is correct:
64 system("mkdir ./calibResults >& /dev/null");
65 system("mkdir ./calibResults/ScanNoisy >& /dev/null");
66 system("mkdir ./calibResults/ScanNoisyToFXS >& /dev/null");
67 system("mkdir ./calibResults/ScanDCSconfigToFXS >& /dev/null");
68 system("mkdir ./calibResults/ScanReference >& /dev/null");
69 system("mkdir ./calibResults/IdsToFXS >& /dev/null");
70 system("mkdir ./configFiles >& /dev/null");
71 // prameters config files
72 TString paramsFileName = Form("%s/standal_params.txt",configFilesDir);
73 TString permNoisyFileName = Form("%s/perm_noisy.txt",configFilesDir);
75 TFitter *fitter = new TFitter(3);
76 TVirtualFitter::SetFitter(fitter);
78 // This line is needed in case of a stand-alone application w/o
79 // $ROOTSYS/etc/system.rootrc file
80 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
86 // turn off annoying warning messages
88 AliLog::Instance()->SetGlobalDebugLevel(-20);
91 enum calib_types{MINTH,MEANTH,DAC,UNIMA,NOISE,DELAY};
94 // ********* STEP 0: Get configuration files from db (if there are any) , then read parameters*********
95 UInt_t nrTuningParams = 0;
96 TObjArray paramNames; paramNames.SetOwner(kTRUE);
97 TObjArray paramVals; paramVals.SetOwner(kTRUE);
102 TString idp = "spd_standal_params";
103 status=daqDA_DB_getFile(idp.Data(),paramsFileName.Data());
105 printf("Failed to get config file %s: status=%d. Using default tuning parameters.\n",idp.Data(),status);
110 paramsFile.open(paramsFileName.Data(), ifstream::in);
111 if (paramsFile.fail()) {
112 printf("No config file (%s) present. Using default tuning parameters.\n",paramsFileName.Data());
118 paramsFile >> paramN;
119 if (paramsFile.eof()) break;
120 paramsFile >> paramV;
121 TString* paramNS = new TString(paramN);
122 TString* paramVS = new TString(paramV);
123 paramNames.AddAtAndExpand((TObject*)paramNS,nrTuningParams);
124 paramVals.AddAtAndExpand((TObject*)paramVS,nrTuningParams);
126 if (paramsFile.eof()) break;
131 // for (UInt_t i=0; i<nrTuningParams; i++) {
132 // printf("Entry %d: N=%s , V=%s\n",i,((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
136 Int_t permstatus = 0;
138 TString idn = "spd_perm_noisy";
139 permstatus=daqDA_DB_getFile(idn.Data(),permNoisyFileName.Data());
141 printf("Failed to get config file %s: status=%d. No permanently noisy pixels will be added.\n",idn.Data(),permstatus);
148 // ********* STEP 1: Produce scan container files (Reference Data). ***********************************
152 if (getenv("DATE_RUN_NUMBER")==0) {
153 printf("DATE_RUN_NUMBER not properly set.\n");
156 int runNr = atoi(getenv("DATE_RUN_NUMBER"));
158 int runNr = atoi(argv[1]);
163 AliITSOnlineSPDscan *scanObj[20];
164 Bool_t bScanInit[20];
165 for (UInt_t eqId=0; eqId<20; eqId++) {
167 bScanInit[eqId]=kFALSE;
169 // header data variables
171 Bool_t halfStaveScanned[20][6];
173 Bool_t dataFormat[20];
175 Bool_t chipPresent[20][6][10];
184 UInt_t dacHigh[20][6];
185 UInt_t dacLow[20][6];
187 Bool_t minTHchipPresent[20][10];
188 // current scan step flag
189 Int_t currentStep[20];
190 for (UInt_t eqId=0; eqId<20; eqId++) currentStep[eqId] = 9999;
192 // loop over run segments
193 for (int segNr=startSeg; segNr<argc; segNr++) {
197 /* define data source : this is argument 1 */
198 status=monitorSetDataSource( argv[segNr] );
200 printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
203 /* declare monitoring program */
204 status=monitorDeclareMp("ITS_SPD_CAL");
206 printf("monitorDeclareMp() failed : %s\n",monitorDecodeError(status));
209 /* define wait event timeout - 1s max */
211 monitorSetNoWaitNetworkTimeout(1000);
216 /* main loop (infinite) */
219 struct eventHeaderStruct *event;
220 eventTypeType eventT;
222 /* check shutdown condition */
224 if (daqDA_checkShutdown()) {break;}
226 /* get next event (blocking call until timeout) */
227 status=monitorGetEventDynamic((void **)&event);
228 if (status==MON_ERR_EOF) {
229 printf ("End of File detected\n");
230 break; /* end of monitoring file has been reached */
233 printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
236 /* retry if got no event */
241 eventT=event->eventType;
242 if (eventT == PHYSICS_EVENT) {
245 // printf("eventNr %d\n",eventNr);
247 AliRawReader *reader = new AliRawReaderDate((void*)event);
248 AliITSRawStreamSPD *str = new AliITSRawStreamSPD(reader);
250 for (UInt_t eqId=0; eqId<20; eqId++) {
253 reader->Select("ITSSPD",eqId,eqId);
255 // Hit Event flags, specific for one event
256 Bool_t hitEventHSIncremented[6];
257 Bool_t hitEventChipIncremented[6][10];
258 for (UInt_t hs=0; hs<6; hs++) {
259 hitEventHSIncremented[hs] = kFALSE;
260 for (UInt_t chip=0; chip<10; chip++) {
261 hitEventChipIncremented[hs][chip] = kFALSE;
265 if (str->ReadCalibHeader()>0) {
266 // first check the type:
267 if (bScanInit[eqId] && type[eqId]!=str->GetHtype()) {
268 printf("Calib header problem. Type changed (%d -> %d)!\n",type[eqId],str->GetHtype());
272 routerNr[eqId] = str->GetHrouterNr();
273 type[eqId] = str->GetHtype();
274 dataFormat[eqId] = str->GetHdataFormat();
275 triggers[eqId] = str->GetHtriggers();
276 dacStart[eqId] = str->GetHdacStart();
277 dacEnd[eqId] = str->GetHdacEnd();
278 dacStep[eqId] = str->GetHdacStep();
279 dacId[eqId] = str->GetHdacId();
280 rowStart[eqId] = str->GetHrowStart();
281 rowEnd[eqId] = str->GetHrowEnd();
282 rowValue[eqId] = str->GetHrowValue();
283 dacValue[eqId] = str->GetHdacValue();
284 for (UInt_t hs=0; hs<6; hs++) {
285 halfStaveScanned[eqId][hs] = str->GetHhalfStaveScanned(hs);
286 dacHigh[eqId][hs] = str->GetHdacHigh(hs);
287 dacLow[eqId][hs] = str->GetHdacLow(hs);
288 TPAmp[eqId][hs] = str->GetHTPAmp(hs);
289 for (UInt_t chip=0; chip<10; chip++) {
290 chipPresent[eqId][hs][chip] = str->GetHchipPresent(hs,chip);
293 for (UInt_t chip=0; chip<10; chip++) {
294 minTHchipPresent[eqId][chip] = str->GetHminTHchipPresent(chip);
297 currentStep[eqId] = (dacValue[eqId]-dacStart[eqId])/dacStep[eqId];
298 if (type[eqId]==DELAY) {
299 currentStep[eqId]=currentStep[eqId]*2;
300 dacValue[eqId]=dacValue[eqId]*2;
301 if (dacHigh[eqId][0]==128) { // misc_ctrl value
302 currentStep[eqId]=currentStep[eqId]+1;
303 dacValue[eqId]=dacValue[eqId]+1;
308 if (routerNr[eqId]!=eqId) {
309 printf("Router nr problem? Router nr %d != EqID %d\n",routerNr[eqId],eqId);
312 if (!bScanInit[eqId]) {
313 // initialize container object
314 TString fileName = Form("%s/SPDcal_run_%d_eq_%d.root",saveDirRef,runNr,eqId);
315 switch (type[eqId]) {
318 scanObj[eqId] = new AliITSOnlineSPDscanSingle(fileName.Data());
319 ((AliITSOnlineSPDscanSingle*)scanObj[eqId])->ClearThis();
320 bScanInit[eqId]=kTRUE;
325 scanObj[eqId] = new AliITSOnlineSPDscanMultiple(fileName.Data());
326 scanObj[eqId]->ClearThis();
327 bScanInit[eqId]=kTRUE;
330 scanObj[eqId] = new AliITSOnlineSPDscanMeanTh(fileName.Data());
331 scanObj[eqId]->ClearThis();
332 bScanInit[eqId]=kTRUE;
335 printf("Unknown scan type: %d.\n",type[eqId]);
337 // some multiple scan data
338 if (type[eqId]==MINTH || type[eqId]==MEANTH || type[eqId]==DAC || type[eqId]==DELAY) {
339 ((AliITSOnlineSPDscanMultiple*)scanObj[eqId])->SetDacId(dacId[eqId]);
342 scanObj[eqId]->SetRunNr((UInt_t)runNr);
343 scanObj[eqId]->SetRouterNr(routerNr[eqId]);
344 for (UInt_t hs=0; hs<6; hs++) {
345 scanObj[eqId]->SetHalfStaveScanned(hs,halfStaveScanned[eqId][hs]);
347 scanObj[eqId]->SetType(type[eqId]);
348 scanObj[eqId]->SetDataFormat(dataFormat[eqId]);
349 for (Int_t hs=0; hs<6; hs++) {
351 // remove later when the chip present is set correctly !!!!!!!!!!!!!!!!!!!!!!!!!!!
352 Bool_t halfStavePresent = str->GetHalfStavePresent(hs);
353 // remove later when the chip present is set correctly !!!!!!!!!!!!!!!!!!!!!!!!!!!
355 for (UInt_t chip=0; chip<10; chip++) {
356 scanObj[eqId]->SetChipPresent(hs,chip,chipPresent[eqId][hs][chip]);
358 // remove later when the chip present is set correctly !!!!!!!!!!!!!!!!!!!!!!!!!!!
359 if (halfStavePresent) scanObj[eqId]->SetChipPresent(hs,chip,kTRUE);
360 // remove later when the chip present is set correctly !!!!!!!!!!!!!!!!!!!!!!!!!!!
364 scanObj[eqId]->SetRowStart(rowStart[eqId]);
365 scanObj[eqId]->SetRowEnd(rowEnd[eqId]);
366 scanObj[eqId]->SetDacStart(dacStart[eqId]);
367 scanObj[eqId]->SetDacEnd(dacEnd[eqId]);
368 scanObj[eqId]->SetDacStep(dacStep[eqId]);
371 if (type[eqId]==MINTH) {
372 scanObj[eqId]->SetTriggers(currentStep[eqId],triggers[eqId]);
374 if (type[eqId]==UNIMA || type[eqId]==NOISE) {
375 if (currentStep[eqId]==9999) printf("SPDcalibratorStep1 (eq %d): single step\n",eqId);
378 if (type[eqId]==MINTH || type[eqId]==MEANTH || type[eqId]==DAC || type[eqId]==DELAY) {
379 ((AliITSOnlineSPDscanMultiple*)scanObj[eqId])->SetDacValue(currentStep[eqId],dacValue[eqId]);
380 if (type[eqId]==DELAY) {
381 printf("SPDcalibratorStep1 (eq %d): DAC %d/%d , step %d\n",eqId,dacValue[eqId]/2,dacHigh[eqId][0],currentStep[eqId]);
384 printf("SPDcalibratorStep1 (eq %d): DAC %d , step %d\n",eqId,dacValue[eqId],currentStep[eqId]);
387 if (type[eqId]==MEANTH) {
388 for (Int_t hs=0; hs<6; hs++) {
389 ((AliITSOnlineSPDscanMeanTh*)scanObj[eqId])->SetDacLow(currentStep[eqId],hs,dacLow[eqId][hs]);
390 ((AliITSOnlineSPDscanMeanTh*)scanObj[eqId])->SetDacHigh(currentStep[eqId],hs,dacHigh[eqId][hs]);
391 ((AliITSOnlineSPDscanMeanTh*)scanObj[eqId])->SetTPAmp(currentStep[eqId],hs,TPAmp[eqId][hs]);
398 if (bScanInit[eqId]) {
399 while (str->Next()) {
400 UInt_t hs = str->GetHalfStaveNr();
401 UInt_t chip = str->GetChipAddr();
402 //***remove last condition when minthpresent put correctly in calib header?
404 if (type[eqId]!=MINTH || minTHchipPresent[eqId][chip] || runNr<=416900) {
406 if (type[eqId]!=MINTH || minTHchipPresent[eqId][chip] || runNr<=416900) {
408 //*************************************************************************
409 scanObj[eqId]->IncrementHits(currentStep[eqId],hs,chip,str->GetChipCol(),str->GetChipRow());
411 if (!hitEventHSIncremented[hs]) {
412 scanObj[eqId]->IncrementHitEventsTot(currentStep[eqId],hs);
413 hitEventHSIncremented[hs]=kTRUE;
416 if (!hitEventChipIncremented[hs][chip]) {
417 scanObj[eqId]->IncrementHitEvents(currentStep[eqId],hs,chip);
418 hitEventChipIncremented[hs][chip]=kTRUE;
424 if (type[eqId]!=MINTH) { // for minth, triggers are set from header info
425 scanObj[eqId]->IncrementTriggers(currentStep[eqId]);
443 daqDA_progressReport((unsigned int)( ((Float_t)(segNr-startSeg+1))/(argc-startSeg)*50 ));
445 printf("progress: %d\n",(unsigned int)( ((Float_t)(segNr-startSeg+1))/(argc-startSeg)*50 ));
451 // clean up scan objects (which also saves them) , check if something happened...
452 Bool_t somethingHappened = kFALSE;
453 for (UInt_t eqId=0; eqId<20; eqId++) {
454 if (scanObj[eqId]!=NULL) {
455 delete scanObj[eqId];
456 somethingHappened = kTRUE;
459 if (!somethingHappened) {
460 printf("WARNING: No data processed. Are the calibration headers missing?\n");
466 // ********* STEP 2: Analyze scan container files. ************************************************
468 // clear noisyToFXS and DCSconfigToFXS dirs:
469 TString command = Form("cd %s; rm -f *",saveDirNoisyToFXS);
470 system(command.Data());
471 TString command2 = Form("cd %s; rm -f *",saveDirDCSconfigToFXS);
472 system(command2.Data());
473 UInt_t nrNoisyFilesProduced=0;
474 UInt_t nrDCSconfigFilesProduced=0;
476 AliITSOnlineCalibrationSPDhandler* handler = new AliITSOnlineCalibrationSPDhandler();
477 AliITSOnlineSPDscanAnalyzer *analyzer = NULL;
478 AliITSOnlineCalibrationSPDhandler* handlerPermNoisy = NULL;
479 // fill permanent noisy list to add later...
481 handlerPermNoisy = new AliITSOnlineCalibrationSPDhandler();
482 UInt_t permNoisy = handlerPermNoisy->ReadNoisyFromText(permNoisyFileName.Data(),240); // 240 = read for all modules
484 printf("%d noisy pixels read from permanent list.\n",permNoisy);
488 Bool_t reset_made = kFALSE;
490 // *** *** *** start loop over equipments (eq_id)
491 for (int eqId=0; eqId<20; eqId++) {
493 // create analyzer for this eq
494 TString fileName = Form("%s/SPDcal_run_%d_eq_%d.root",saveDirRef,runNr,eqId);
495 analyzer = new AliITSOnlineSPDscanAnalyzer(fileName.Data(),handler);
497 // configure analyzer with tuning parameters etc:
498 for (UInt_t i=0; i<nrTuningParams; i++) {
499 analyzer->SetParam(((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
502 UInt_t type = analyzer->GetType();
503 UInt_t dacId = analyzer->GetDacId();
504 UInt_t routerNr = analyzer->GetRouterNr();
507 printf("SPD scan calibrator Step2: eqId %d, type %d, dacId %d\n",eqId,type,dacId);
509 else printf("SPD scan calibrator Step2: eqId %d type %d\n",eqId,type);
514 // algorithms for the different types of scans:
520 else if (type==NOISE) {
521 // read previous noisy list (clear if overwriting)
522 handler->SetFileLocation(saveDirNoisy);
523 if (analyzer->IsOverWriteSet() && !reset_made) {
524 handler->ResetNoisy();
525 handler->WriteToFilesAlways();
529 handler->ReadFromFiles();
531 if (analyzer->ProcessNoisyPixels(/*saveDirNoisy*/)) {
533 handler->AddNoisyFrom(handlerPermNoisy);
535 // init dcs config text file
536 TString dcsConfigFileName = Form("%s/dcsConfig_run_%d_eq_%d.txt",saveDirDCSconfigToFXS,runNr,eqId);
538 dcsfile.open(dcsConfigFileName.Data());
539 dcsfile << "[SPD SCAN]\n";
540 dcsfile << "RunNumber=" << runNr << "\n";
541 dcsfile << "Type=" << type << "\n";
542 dcsfile << "Router=" << routerNr << "\n";
543 dcsfile << "ActualDetConfiguration=" << "0,-1,-1\n"; // dummy values for now
544 dcsfile << "[NOISY]\n";
545 nrDCSconfigFilesProduced++;
547 for (UInt_t hs=0; hs<6; hs++) {
548 for (UInt_t chip=0; chip<10; chip++) {
549 if (analyzer->IsChipPresent(hs,chip) || analyzer->IsOverWriteSet()) {
550 dcsfile << "-" << eqId << "," << hs << "," << chip << "\n";
551 UInt_t nrNoisy = handler->GetNrNoisyC(eqId,hs,chip);
552 for (UInt_t ind=0; ind<nrNoisy; ind++) {
553 UInt_t col = handler->GetNoisyColAtC(eqId,hs,chip,ind);
554 UInt_t row = handler->GetNoisyRowAtC(eqId,hs,chip,ind);
555 dcsfile << col << "," << row << "\n";
560 handler->SetFileLocation(saveDirNoisy);
561 handler->WriteNoisyToFile(eqId);
562 handler->SetFileLocation(saveDirNoisyToFXS);
563 handler->WriteNoisyToFile(eqId);
564 nrNoisyFilesProduced++;
570 else if (type==MINTH || (type==DAC && dacId==39)) {
571 // init dcs config text file
572 TString dcsConfigFileName = Form("%s/dcsConfig_run_%d_eq_%d.txt",saveDirDCSconfigToFXS,runNr,eqId);
574 dcsfile.open(dcsConfigFileName.Data());
575 dcsfile << "[SPD SCAN]\n";
576 dcsfile << "RunNumber=" << runNr << "\n";
577 dcsfile << "Type=" << type << "\n";
578 dcsfile << "Router=" << routerNr << "\n";
579 dcsfile << "ActualDetConfiguration=" << "0,-1,-1\n"; // dummy values for now
580 dcsfile << "[DACvalues]\n";
581 nrDCSconfigFilesProduced++;
582 for (UInt_t hs=0; hs<6; hs++) {
583 for (UInt_t chipNr=0; chipNr<10; chipNr++) {
585 if (analyzer->GetOnlineScan()->GetChipPresent(hs,chipNr)) {
586 minTh = analyzer->GetMinTh(hs,chipNr);
588 dcsfile << "39," << eqId << "," << hs << "," << chipNr << "=" << minTh << "\n";
591 printf("MinTh failed for Eq %d , HS %d , Chip %d\n",eqId,hs,chipNr);
599 else if (type==DELAY) {
600 // init dcs config text file
601 TString dcsConfigFileName = Form("%s/dcsConfig_run_%d_eq_%d.txt",saveDirDCSconfigToFXS,runNr,eqId);
603 dcsfile.open(dcsConfigFileName.Data());
604 dcsfile << "[SPD SCAN]\n";
605 dcsfile << "RunNumber=" << runNr << "\n";
606 dcsfile << "Type=" << type << "\n";
607 dcsfile << "Router=" << routerNr << "\n";
608 dcsfile << "ActualDetCoonfiguration=" << "0,-1,-1\n"; // dummy values for now
609 dcsfile << "[DACvalues]\n";
610 nrDCSconfigFilesProduced++;
611 for (UInt_t hs=0; hs<6; hs++) {
612 for (UInt_t chipNr=0; chipNr<10; chipNr++) {
613 Int_t clockCycle = -1;
614 Int_t delayCtrl = -1;
616 if (analyzer->GetOnlineScan()->GetChipPresent(hs,chipNr)) {
617 clockCycle = analyzer->GetDelay(hs,chipNr);
618 delayCtrl = clockCycle/2;
620 if (clockCycle!=-1) {
621 if (clockCycle%2==1) miscCtrl = 128;
622 dcsfile << "42," << eqId << "," << hs << "," << chipNr << "=" << delayCtrl << "\n";
623 dcsfile << "43," << eqId << "," << hs << "," << chipNr << "=" << miscCtrl << "\n";
626 printf("Delay failed for Eq %d , HS %d , Chip %d\n",eqId,hs,chipNr);
637 daqDA_progressReport((unsigned int)(50+(eqId+1)*2.5));
639 printf("progress: %d\n",(unsigned int)(50+(eqId+1)*2.5));
643 // *** *** *** end loop over equipments (eq_id)
647 if (handlerPermNoisy!=NULL) {
648 delete handlerPermNoisy;
651 printf("Opening id list file\n");
652 TString idsFXSFileName = Form("%s/FXSids_run_%d.txt",saveDirIdsToFXS,runNr);
654 idsFXSfile.open(idsFXSFileName.Data());
658 // send noisy data to FXS
659 if (nrNoisyFilesProduced>0) {
660 printf("Preparing noisy files\n");
661 // send a tared file of all new noisy maps
662 TString command = Form("cd %s; tar -cf noisy_scan.tar *",saveDirNoisyToFXS);
663 // printf("\n\n%s\n\n",command.Data());
664 system(command.Data());
665 TString fileName = Form("%s/noisy_scan.tar",saveDirNoisyToFXS);
666 TString id = "SPD_scan_noisy";
668 Int_t status = daqDA_FES_storeFile(fileName.Data(),id.Data());
670 printf("Failed to export file %s , status %d\n",fileName.Data(),status);
674 idsFXSfile << Form("%s\n",id.Data());
677 // send dcs config files to FXS
678 if (nrDCSconfigFilesProduced>0) {
679 printf("Preparing DCS config files\n");
680 // send a tared file of all the dcsConfig text files
681 TString command = Form("cd %s; tar -cf dcsConfig.tar *",saveDirDCSconfigToFXS);
682 // printf("\n\n%s\n\n",command.Data());
683 system(command.Data());
684 TString fileName = Form("%s/dcsConfig.tar",saveDirDCSconfigToFXS);
685 TString id = "SPD_dcsConfig";
687 Int_t status = daqDA_FES_storeFile(fileName.Data(),id.Data());
689 printf("Failed to export file %s , status %d\n",fileName.Data(),status);
693 //idsFXSfile << Form("%s\n",id.Data()); // do NOT write this id (this is not for preprocessor)
696 // send reference data to FXS
697 for (UInt_t eqId=0; eqId<20; eqId++) {
698 if (bScanInit[eqId]) {
699 printf("Preparing reference data for eq %d\n",eqId);
700 TString fileName = Form("%s/SPDcal_run_%d_eq_%d.root",saveDirRef,runNr,eqId);
701 TString id = Form("SPD_ref_scan_%d",eqId);
703 Int_t status = daqDA_FES_storeFile(fileName.Data(),id.Data());
705 printf("Failed to export file %s , status %d\n",fileName.Data(),status);
709 idsFXSfile << Form("%s\n",id.Data());
714 printf("Preparing id list file\n");
716 TString id = "SPD_id_list";
718 status = daqDA_FES_storeFile(idsFXSFileName.Data(),id.Data());
720 printf("Failed to export file %s , status %d\n",idsFXSFileName.Data(),status);
726 printf("DA finished.\n");