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>
46 #include <TObjString.h>
50 int main(int argc, char **argv) {
52 printf("Wrong number of arguments\n");
56 // directory structure, hard coded
57 char *saveDirNoisy = "./calibResults/ScanNoisy"; // may NOT delete content
58 char *saveDirNoisyToFXS = "./calibResults/ScanNoisyToFXS"; // may delete content
59 char *saveDirDCSconfigToFXS= "./calibResults/ScanDCSconfigToFXS"; // may delete content
60 char *saveDirRef = "./calibResults/ScanReference"; // may delete content
61 char *saveDirIdsToFXS = "./calibResults/IdsToFXS"; // may delete content
62 char *configFilesDir = "./configFiles"; // may delete content
64 // make sure the directory structure is correct:
65 system("mkdir ./calibResults >& /dev/null");
66 system("mkdir ./calibResults/ScanNoisy >& /dev/null");
67 system("mkdir ./calibResults/ScanNoisyToFXS >& /dev/null");
68 system("mkdir ./calibResults/ScanDCSconfigToFXS >& /dev/null");
69 system("mkdir ./calibResults/ScanReference >& /dev/null");
70 system("mkdir ./calibResults/IdsToFXS >& /dev/null");
71 system("mkdir ./configFiles >& /dev/null");
72 // prameters config files
73 TString paramsFileName = Form("%s/standal_params.txt",configFilesDir);
74 TString permNoisyFileName = Form("%s/perm_noisy.txt",configFilesDir);
76 TFitter *fitter = new TFitter(3);
77 TVirtualFitter::SetFitter(fitter);
79 // This line is needed in case of a stand-alone application w/o
80 // $ROOTSYS/etc/system.rootrc file
81 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
87 // turn off annoying warning messages
89 AliLog::Instance()->SetGlobalDebugLevel(-20);
92 enum calib_types{MINTH,MEANTH,DAC,UNIMA,NOISE,DELAY};
95 // ********* STEP 0: Get configuration files from db (if there are any) , then read parameters*********
96 UInt_t nrTuningParams = 0;
97 TObjArray paramNames; paramNames.SetOwner(kTRUE);
98 TObjArray paramVals; paramVals.SetOwner(kTRUE);
100 // tuning parameters:
103 TString idp = "spd_standal_params";
104 status=daqDA_DB_getFile(idp.Data(),paramsFileName.Data());
106 printf("Failed to get config file %s: status=%d. Using default tuning parameters.\n",idp.Data(),status);
107 TString rmCmd = Form("rm -f %s",paramsFileName.Data());
108 system(rmCmd.Data());
113 paramsFile.open(paramsFileName.Data(), ifstream::in);
114 if (paramsFile.fail()) {
115 printf("No config file (%s) present. Using default tuning parameters.\n",paramsFileName.Data());
121 paramsFile >> paramN;
122 if (paramsFile.eof()) break;
123 paramsFile >> paramV;
124 paramNames.AddAtAndExpand(new TObjString(paramN),nrTuningParams);
125 paramVals.AddAtAndExpand(new TObjString(paramV),nrTuningParams);
127 if (paramsFile.eof()) break;
132 // for (UInt_t i=0; i<nrTuningParams; i++) {
133 // // printf("Entry %d: N=%s , V=%s\n",i,((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
134 // printf("Entry %d: N=%s , V=%s\n",i,((TObjString*)paramNames.At(i))->GetString().Data(),((TObjString*)paramVals.At(i))->GetString().Data());
138 Int_t permstatus = 0;
140 TString idn = "spd_perm_noisy";
141 permstatus=daqDA_DB_getFile(idn.Data(),permNoisyFileName.Data());
143 printf("Failed to get config file %s: status=%d. No permanently noisy pixels will be added.\n",idn.Data(),permstatus);
144 TString rmCmd = Form("rm -f %s",permNoisyFileName.Data());
145 system(rmCmd.Data());
152 // ********* STEP 1: Produce scan container files (Reference Data). ***********************************
156 if (getenv("DATE_RUN_NUMBER")==0) {
157 printf("DATE_RUN_NUMBER not properly set.\n");
160 int runNr = atoi(getenv("DATE_RUN_NUMBER"));
162 int runNr = atoi(argv[1]);
167 AliITSOnlineSPDscan *scanObj[20];
168 Bool_t bScanInit[20];
169 for (UInt_t eqId=0; eqId<20; eqId++) {
171 bScanInit[eqId]=kFALSE;
173 // header data variables
175 Bool_t halfStaveScanned[20][6];
177 Bool_t dataFormat[20];
179 Bool_t chipPresent[20][6][10];
188 UInt_t dacHigh[20][6];
189 UInt_t dacLow[20][6];
191 Bool_t minTHchipPresent[20][10];
192 // current scan step flag
193 Int_t currentStep[20];
194 for (UInt_t eqId=0; eqId<20; eqId++) currentStep[eqId] = 9999;
196 // loop over run segments
197 for (int segNr=startSeg; segNr<argc; segNr++) {
201 /* define data source : this is argument 1 */
202 status=monitorSetDataSource( argv[segNr] );
204 printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
207 /* declare monitoring program */
208 status=monitorDeclareMp("ITS_SPD_CAL");
210 printf("monitorDeclareMp() failed : %s\n",monitorDecodeError(status));
213 /* define wait event timeout - 1s max */
215 monitorSetNoWaitNetworkTimeout(1000);
220 /* main loop (infinite) */
223 struct eventHeaderStruct *event;
224 eventTypeType eventT;
226 /* check shutdown condition */
228 if (daqDA_checkShutdown()) {break;}
230 /* get next event (blocking call until timeout) */
231 status=monitorGetEventDynamic((void **)&event);
232 if (status==MON_ERR_EOF) {
233 printf ("End of File detected\n");
234 break; /* end of monitoring file has been reached */
237 printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
240 /* retry if got no event */
245 eventT=event->eventType;
246 if (eventT == PHYSICS_EVENT) {
249 // printf("eventNr %d\n",eventNr);
251 AliRawReader *reader = new AliRawReaderDate((void*)event);
252 AliITSRawStreamSPD *str = new AliITSRawStreamSPD(reader);
254 for (UInt_t eqId=0; eqId<20; eqId++) {
257 reader->Select("ITSSPD",eqId,eqId);
259 // Hit Event flags, specific for one event
260 Bool_t hitEventHSIncremented[6];
261 Bool_t hitEventChipIncremented[6][10];
262 for (UInt_t hs=0; hs<6; hs++) {
263 hitEventHSIncremented[hs] = kFALSE;
264 for (UInt_t chip=0; chip<10; chip++) {
265 hitEventChipIncremented[hs][chip] = kFALSE;
269 if (str->ReadCalibHeader()>0) {
270 // first check the type:
271 if (bScanInit[eqId] && type[eqId]!=str->GetHtype()) {
272 printf("Calib header problem. Type changed (%d -> %d)!\n",type[eqId],str->GetHtype());
276 routerNr[eqId] = str->GetHrouterNr();
277 type[eqId] = str->GetHtype();
278 dataFormat[eqId] = str->GetHdataFormat();
279 triggers[eqId] = str->GetHtriggers();
280 dacStart[eqId] = str->GetHdacStart();
281 dacEnd[eqId] = str->GetHdacEnd();
282 dacStep[eqId] = str->GetHdacStep();
283 dacId[eqId] = str->GetHdacId();
284 rowStart[eqId] = str->GetHrowStart();
285 rowEnd[eqId] = str->GetHrowEnd();
286 rowValue[eqId] = str->GetHrowValue();
287 dacValue[eqId] = str->GetHdacValue();
288 for (UInt_t hs=0; hs<6; hs++) {
289 halfStaveScanned[eqId][hs] = str->GetHhalfStaveScanned(hs);
290 dacHigh[eqId][hs] = str->GetHdacHigh(hs);
291 dacLow[eqId][hs] = str->GetHdacLow(hs);
292 TPAmp[eqId][hs] = str->GetHTPAmp(hs);
293 for (UInt_t chip=0; chip<10; chip++) {
294 chipPresent[eqId][hs][chip] = str->GetHchipPresent(hs,chip);
297 for (UInt_t chip=0; chip<10; chip++) {
298 minTHchipPresent[eqId][chip] = str->GetHminTHchipPresent(chip);
301 currentStep[eqId] = (dacValue[eqId]-dacStart[eqId])/dacStep[eqId];
302 if (type[eqId]==DELAY) {
303 currentStep[eqId]=currentStep[eqId]*2;
304 dacValue[eqId]=dacValue[eqId]*2;
305 if (dacHigh[eqId][0]==128) { // misc_ctrl value
306 currentStep[eqId]=currentStep[eqId]+1;
307 dacValue[eqId]=dacValue[eqId]+1;
312 if (routerNr[eqId]!=eqId) {
313 printf("Router nr problem? Router nr %d != EqID %d\n",routerNr[eqId],eqId);
316 if (!bScanInit[eqId]) {
317 // initialize container object
318 TString fileName = Form("%s/SPDcal_run_%d_eq_%d.root",saveDirRef,runNr,eqId);
319 switch (type[eqId]) {
322 scanObj[eqId] = new AliITSOnlineSPDscanSingle(fileName.Data());
323 ((AliITSOnlineSPDscanSingle*)scanObj[eqId])->ClearThis();
324 bScanInit[eqId]=kTRUE;
329 scanObj[eqId] = new AliITSOnlineSPDscanMultiple(fileName.Data());
330 scanObj[eqId]->ClearThis();
331 bScanInit[eqId]=kTRUE;
334 scanObj[eqId] = new AliITSOnlineSPDscanMeanTh(fileName.Data());
335 scanObj[eqId]->ClearThis();
336 bScanInit[eqId]=kTRUE;
339 printf("Unknown scan type: %d.\n",type[eqId]);
341 // some multiple scan data
342 if (type[eqId]==MINTH || type[eqId]==MEANTH || type[eqId]==DAC || type[eqId]==DELAY) {
343 ((AliITSOnlineSPDscanMultiple*)scanObj[eqId])->SetDacId(dacId[eqId]);
346 scanObj[eqId]->SetRunNr((UInt_t)runNr);
347 scanObj[eqId]->SetRouterNr(routerNr[eqId]);
348 for (UInt_t hs=0; hs<6; hs++) {
349 scanObj[eqId]->SetHalfStaveScanned(hs,halfStaveScanned[eqId][hs]);
351 scanObj[eqId]->SetType(type[eqId]);
352 scanObj[eqId]->SetDataFormat(dataFormat[eqId]);
353 for (Int_t hs=0; hs<6; hs++) {
355 // remove later when the chip present is set correctly !!!!!!!!!!!!!!!!!!!!!!!!!!!
356 Bool_t halfStavePresent = str->GetHalfStavePresent(hs);
357 // remove later when the chip present is set correctly !!!!!!!!!!!!!!!!!!!!!!!!!!!
359 for (UInt_t chip=0; chip<10; chip++) {
360 scanObj[eqId]->SetChipPresent(hs,chip,chipPresent[eqId][hs][chip]);
362 // remove later when the chip present is set correctly !!!!!!!!!!!!!!!!!!!!!!!!!!!
363 if (halfStavePresent) scanObj[eqId]->SetChipPresent(hs,chip,kTRUE);
364 // remove later when the chip present is set correctly !!!!!!!!!!!!!!!!!!!!!!!!!!!
368 scanObj[eqId]->SetRowStart(rowStart[eqId]);
369 scanObj[eqId]->SetRowEnd(rowEnd[eqId]);
370 scanObj[eqId]->SetDacStart(dacStart[eqId]);
371 scanObj[eqId]->SetDacEnd(dacEnd[eqId]);
372 scanObj[eqId]->SetDacStep(dacStep[eqId]);
375 if (type[eqId]==MINTH) {
376 scanObj[eqId]->SetTriggers(currentStep[eqId],triggers[eqId]);
378 if (type[eqId]==UNIMA || type[eqId]==NOISE) {
379 if (currentStep[eqId]==9999) printf("SPDcalibratorStep1 (eq %d): single step\n",eqId);
382 if (type[eqId]==MINTH || type[eqId]==MEANTH || type[eqId]==DAC || type[eqId]==DELAY) {
383 ((AliITSOnlineSPDscanMultiple*)scanObj[eqId])->SetDacValue(currentStep[eqId],dacValue[eqId]);
384 if (type[eqId]==DELAY) {
385 printf("SPDcalibratorStep1 (eq %d): DAC %d/%d , step %d\n",eqId,dacValue[eqId]/2,dacHigh[eqId][0],currentStep[eqId]);
388 printf("SPDcalibratorStep1 (eq %d): DAC %d , step %d\n",eqId,dacValue[eqId],currentStep[eqId]);
391 if (type[eqId]==MEANTH) {
392 for (Int_t hs=0; hs<6; hs++) {
393 ((AliITSOnlineSPDscanMeanTh*)scanObj[eqId])->SetDacLow(currentStep[eqId],hs,dacLow[eqId][hs]);
394 ((AliITSOnlineSPDscanMeanTh*)scanObj[eqId])->SetDacHigh(currentStep[eqId],hs,dacHigh[eqId][hs]);
395 ((AliITSOnlineSPDscanMeanTh*)scanObj[eqId])->SetTPAmp(currentStep[eqId],hs,TPAmp[eqId][hs]);
402 if (bScanInit[eqId]) {
403 while (str->Next()) {
404 UInt_t hs = str->GetHalfStaveNr();
405 UInt_t chip = str->GetChipAddr();
406 //***remove last condition when minthpresent put correctly in calib header?
408 if (type[eqId]!=MINTH || minTHchipPresent[eqId][chip] || runNr<=416900) {
410 if (type[eqId]!=MINTH || minTHchipPresent[eqId][chip] || runNr<=416900) {
412 //*************************************************************************
413 scanObj[eqId]->IncrementHits(currentStep[eqId],hs,chip,str->GetChipCol(),str->GetChipRow());
415 if (!hitEventHSIncremented[hs]) {
416 scanObj[eqId]->IncrementHitEventsTot(currentStep[eqId],hs);
417 hitEventHSIncremented[hs]=kTRUE;
420 if (!hitEventChipIncremented[hs][chip]) {
421 scanObj[eqId]->IncrementHitEvents(currentStep[eqId],hs,chip);
422 hitEventChipIncremented[hs][chip]=kTRUE;
428 if (type[eqId]!=MINTH) { // for minth, triggers are set from header info
429 scanObj[eqId]->IncrementTriggers(currentStep[eqId]);
447 daqDA_progressReport((unsigned int)( ((Float_t)(segNr-startSeg+1))/(argc-startSeg)*50 ));
449 printf("progress: %d\n",(unsigned int)( ((Float_t)(segNr-startSeg+1))/(argc-startSeg)*50 ));
455 // clean up scan objects (which also saves them) , check if something happened...
456 Bool_t somethingHappened = kFALSE;
457 for (UInt_t eqId=0; eqId<20; eqId++) {
458 if (scanObj[eqId]!=NULL) {
459 delete scanObj[eqId];
460 somethingHappened = kTRUE;
463 if (!somethingHappened) {
464 printf("WARNING: No data processed. Are the calibration headers missing?\n");
470 // ********* STEP 2: Analyze scan container files. ************************************************
472 // clear noisyToFXS and DCSconfigToFXS dirs:
473 TString command = Form("cd %s; rm -f *",saveDirNoisyToFXS);
474 system(command.Data());
475 TString command2 = Form("cd %s; rm -f *",saveDirDCSconfigToFXS);
476 system(command2.Data());
477 UInt_t nrNoisyFilesProduced=0;
478 UInt_t nrDCSconfigFilesProduced=0;
480 AliITSOnlineCalibrationSPDhandler* handler = new AliITSOnlineCalibrationSPDhandler();
481 AliITSOnlineSPDscanAnalyzer *analyzer = NULL;
482 AliITSOnlineCalibrationSPDhandler* handlerPermNoisy = NULL;
483 // fill permanent noisy list to add later...
485 handlerPermNoisy = new AliITSOnlineCalibrationSPDhandler();
486 UInt_t permNoisy = handlerPermNoisy->ReadNoisyFromText(permNoisyFileName.Data(),240); // 240 = read for all modules
488 printf("%d noisy pixels read from permanent list.\n",permNoisy);
492 Bool_t reset_made = kFALSE;
494 // *** *** *** start loop over equipments (eq_id)
495 for (int eqId=0; eqId<20; eqId++) {
497 // create analyzer for this eq
498 TString fileName = Form("%s/SPDcal_run_%d_eq_%d.root",saveDirRef,runNr,eqId);
499 analyzer = new AliITSOnlineSPDscanAnalyzer(fileName.Data(),handler);
501 // configure analyzer with tuning parameters etc:
502 for (UInt_t i=0; i<nrTuningParams; i++) {
503 analyzer->SetParam(((TObjString*)paramNames.At(i))->GetString().Data(),((TObjString*)paramVals.At(i))->GetString().Data());
506 UInt_t type = analyzer->GetType();
507 UInt_t dacId = analyzer->GetDacId();
508 UInt_t routerNr = analyzer->GetRouterNr();
511 printf("SPD scan calibrator Step2: eqId %d, type %d, dacId %d\n",eqId,type,dacId);
513 else printf("SPD scan calibrator Step2: eqId %d type %d\n",eqId,type);
518 // algorithms for the different types of scans:
524 else if (type==NOISE) {
525 // read previous noisy list (clear if overwriting)
526 handler->SetFileLocation(saveDirNoisy);
527 if (analyzer->IsOverWriteSet() && !reset_made) {
528 handler->ResetNoisy();
529 handler->WriteToFilesAlways();
533 handler->ReadFromFiles();
535 if (analyzer->ProcessNoisyPixels(/*saveDirNoisy*/)) {
537 handler->AddNoisyFrom(handlerPermNoisy);
539 // init dcs config text file
540 TString dcsConfigFileName = Form("%s/dcsConfig_run_%d_eq_%d.txt",saveDirDCSconfigToFXS,runNr,eqId);
542 dcsfile.open(dcsConfigFileName.Data());
543 dcsfile << "[SPD SCAN]\n";
544 dcsfile << "RunNumber=" << runNr << "\n";
545 dcsfile << "Type=" << type << "\n";
546 dcsfile << "Router=" << routerNr << "\n";
547 dcsfile << "ActualDetConfiguration=" << "0,-1,-1\n"; // dummy values for now
548 dcsfile << "[NOISY]\n";
549 nrDCSconfigFilesProduced++;
551 for (UInt_t hs=0; hs<6; hs++) {
552 for (UInt_t chip=0; chip<10; chip++) {
553 if (analyzer->IsChipPresent(hs,chip) || analyzer->IsOverWriteSet()) {
554 dcsfile << "-" << eqId << "," << hs << "," << chip << "\n";
555 UInt_t nrNoisy = handler->GetNrNoisyC(eqId,hs,chip);
556 for (UInt_t ind=0; ind<nrNoisy; ind++) {
557 UInt_t col = handler->GetNoisyColAtC(eqId,hs,chip,ind);
558 UInt_t row = handler->GetNoisyRowAtC(eqId,hs,chip,ind);
559 dcsfile << col << "," << row << "\n";
564 handler->SetFileLocation(saveDirNoisy);
565 handler->WriteNoisyToFile(eqId);
566 handler->SetFileLocation(saveDirNoisyToFXS);
567 handler->WriteNoisyToFile(eqId);
568 nrNoisyFilesProduced++;
574 else if (type==MINTH || (type==DAC && dacId==39)) {
575 // init dcs config text file
576 TString dcsConfigFileName = Form("%s/dcsConfig_run_%d_eq_%d.txt",saveDirDCSconfigToFXS,runNr,eqId);
578 dcsfile.open(dcsConfigFileName.Data());
579 dcsfile << "[SPD SCAN]\n";
580 dcsfile << "RunNumber=" << runNr << "\n";
581 dcsfile << "Type=" << type << "\n";
582 dcsfile << "Router=" << routerNr << "\n";
583 dcsfile << "ActualDetConfiguration=" << "0,-1,-1\n"; // dummy values for now
584 dcsfile << "[DACvalues]\n";
585 nrDCSconfigFilesProduced++;
586 for (UInt_t hs=0; hs<6; hs++) {
587 for (UInt_t chipNr=0; chipNr<10; chipNr++) {
589 if (analyzer->GetOnlineScan()->GetChipPresent(hs,chipNr)) {
590 minTh = analyzer->GetMinTh(hs,chipNr);
592 dcsfile << "39," << eqId << "," << hs << "," << chipNr << "=" << minTh << "\n";
595 printf("MinTh failed for Eq %d , HS %d , Chip %d\n",eqId,hs,chipNr);
603 else if (type==DELAY) {
604 // init dcs config text file
605 TString dcsConfigFileName = Form("%s/dcsConfig_run_%d_eq_%d.txt",saveDirDCSconfigToFXS,runNr,eqId);
607 dcsfile.open(dcsConfigFileName.Data());
608 dcsfile << "[SPD SCAN]\n";
609 dcsfile << "RunNumber=" << runNr << "\n";
610 dcsfile << "Type=" << type << "\n";
611 dcsfile << "Router=" << routerNr << "\n";
612 dcsfile << "ActualDetCoonfiguration=" << "0,-1,-1\n"; // dummy values for now
613 dcsfile << "[DACvalues]\n";
614 nrDCSconfigFilesProduced++;
615 for (UInt_t hs=0; hs<6; hs++) {
616 for (UInt_t chipNr=0; chipNr<10; chipNr++) {
617 Int_t clockCycle = -1;
618 Int_t delayCtrl = -1;
620 if (analyzer->GetOnlineScan()->GetChipPresent(hs,chipNr)) {
621 clockCycle = analyzer->GetDelay(hs,chipNr);
622 delayCtrl = clockCycle/2;
624 if (clockCycle!=-1) {
625 if (clockCycle%2==1) miscCtrl = 128;
626 dcsfile << "42," << eqId << "," << hs << "," << chipNr << "=" << delayCtrl << "\n";
627 dcsfile << "43," << eqId << "," << hs << "," << chipNr << "=" << miscCtrl << "\n";
630 printf("Delay failed for Eq %d , HS %d , Chip %d\n",eqId,hs,chipNr);
641 daqDA_progressReport((unsigned int)(50+(eqId+1)*2.5));
643 printf("progress: %d\n",(unsigned int)(50+(eqId+1)*2.5));
647 // *** *** *** end loop over equipments (eq_id)
651 if (handlerPermNoisy!=NULL) {
652 delete handlerPermNoisy;
655 printf("Opening id list file\n");
656 TString idsFXSFileName = Form("%s/FXSids_run_%d.txt",saveDirIdsToFXS,runNr);
658 idsFXSfile.open(idsFXSFileName.Data());
662 // send noisy data to FXS
663 if (nrNoisyFilesProduced>0) {
664 printf("Preparing noisy files\n");
665 // send a tared file of all new noisy maps
666 TString command = Form("cd %s; tar -cf noisy_scan.tar *",saveDirNoisyToFXS);
667 // printf("\n\n%s\n\n",command.Data());
668 system(command.Data());
669 TString fileName = Form("%s/noisy_scan.tar",saveDirNoisyToFXS);
670 TString id = "SPD_scan_noisy";
672 Int_t status = daqDA_FES_storeFile(fileName.Data(),id.Data());
674 printf("Failed to export file %s , status %d\n",fileName.Data(),status);
678 idsFXSfile << Form("%s\n",id.Data());
681 // send dcs config files to FXS
682 if (nrDCSconfigFilesProduced>0) {
683 printf("Preparing DCS config files\n");
684 // send a tared file of all the dcsConfig text files
685 TString command = Form("cd %s; tar -cf dcsConfig.tar *",saveDirDCSconfigToFXS);
686 // printf("\n\n%s\n\n",command.Data());
687 system(command.Data());
688 TString fileName = Form("%s/dcsConfig.tar",saveDirDCSconfigToFXS);
689 TString id = "SPD_dcsConfig";
691 Int_t status = daqDA_FES_storeFile(fileName.Data(),id.Data());
693 printf("Failed to export file %s , status %d\n",fileName.Data(),status);
697 //idsFXSfile << Form("%s\n",id.Data()); // do NOT write this id (this is not for preprocessor)
700 // send reference data to FXS
701 for (UInt_t eqId=0; eqId<20; eqId++) {
702 if (bScanInit[eqId]) {
703 printf("Preparing reference data for eq %d\n",eqId);
704 TString fileName = Form("%s/SPDcal_run_%d_eq_%d.root",saveDirRef,runNr,eqId);
705 TString id = Form("SPD_ref_scan_%d",eqId);
707 Int_t status = daqDA_FES_storeFile(fileName.Data(),id.Data());
709 printf("Failed to export file %s , status %d\n",fileName.Data(),status);
713 idsFXSfile << Form("%s\n",id.Data());
718 printf("Preparing id list file\n");
720 TString id = "SPD_id_list";
722 status = daqDA_FES_storeFile(idsFXSFileName.Data(),id.Data());
724 printf("Failed to export file %s , status %d\n",idsFXSFileName.Data(),status);
730 printf("DA finished.\n");