1 /**************************************************************************
2 - Contact: Oleksandr_Borysov aborysov@ts.infnf.it
3 - Link: /afs/infn.it/ts/user/efragiac/public/testCosm3125.001
6 - Number of events needed: >=500
7 - Input Files: ssdpeddaconfig, raw_data_file_on_LDC
8 - Output Files: $DA_TEST_DIR/ssddaldc_<LDCID>_<RunID>.root, FXS_name=ITSSSDda_<LDCID>_<RunID>.root
9 local files are persistent over runs: data source
11 **************************************************************************/
18 #include "AliITSHandleDaSSD.h"
20 #include "TPluginManager.h"
25 int main( int argc, char** argv )
27 AliITSHandleDaSSD *ssddaldc;
28 TString feefname, cmddbsave;
30 Char_t *dafname = NULL, *dadaqdir = NULL;
33 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
41 /* check that we got some arguments = list of files */
43 fprintf(stderr, "Wrong number of arguments\n");
47 char *datafilename = argv[1];
49 ssddaldc = new AliITSHandleDaSSD(datafilename);
50 if (ssddaldc->IsZombie()) return -1;
51 if (!ssddaldc->ProcessRawData())
53 cerr << "Error !ssddaldc->ProcessRawData()" << endl;
57 daqDA_progressReport(90);
60 cerr << "Error: the call system(NULL) in main() returned NULL!" << endl;
63 dadaqdir = getenv ("DA_TEST_DIR");
65 cerr << "Error: DA_TEST_DIR is not defined, DA data are not saved!" << endl;
67 daqDA_progressReport(100);
71 if (ssddaldc->SaveCalibrationSSDLDC(dafname)) {
72 cout << "SSDDA data are saved in " << dafname << endl;
73 status = daqDA_FES_storeFile(dafname, "DASSD_DB_results");
74 if (status) fprintf(stderr, "Failed to export file : %d\n", status);
75 } else cerr << "Error saving DA data to the file! Probably $DA_TEST_DIR defined incorrectly!" << endl;
76 feefname.Form("%s/ssddaldc_%i_%i.root", dadaqdir, ssddaldc->GetLdcId(), ssddaldc->GetRunId());
77 cout << "Saving feessdda data in " << feefname << endl;
78 TFile *fileRun = new TFile (feefname.Data(),"RECREATE");
79 if (fileRun->IsZombie()) {
80 cerr << "Error open file " << feefname << endl;
89 if (getenv("DATE_DB_DIR")) {
90 cmddbsave.Form("$DATE_DB_DIR/daqDetDB_store ssddaldc_%i.root %s", ssddaldc->GetLdcId(), feefname.Data());
91 status = system(cmddbsave.Data());
92 if (status) fprintf(stderr, "Failed to export file to the detector db: %d, %s \n",status, cmddbsave.Data());
93 cmddbsave.Form("$DATE_DB_DIR/daqDetDB_store ssddaldc_%i_%i.root %s",
94 ssddaldc->GetLdcId(), ssddaldc->GetRunId(), feefname.Data());
95 status = system(cmddbsave.Data());
96 if (status) fprintf(stderr, "Failed to export file to the detector db: %d, %s \n",status, cmddbsave.Data());
97 } else cerr << "Error main(): $DATE_DB_DIR is not defined!" << endl;
100 daqDA_progressReport(100);